/* ============================================
   设备质保查询系统 - 前台样式
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1a6fff;
    --primary-light: #4096ff;
    --primary-dark: #0e4ed6;
    --success: #00b42c;
    --success-bg: #e8ffea;
    --danger: #f53f3f;
    --danger-bg: #ffece8;
    --text-main: #1d2129;
    --text-secondary: #4e5969;
    --text-light: #86909c;
    --border: #e5e6eb;
    --bg-card: #ffffff;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.12);
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f0f5ff;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

/* 背景装饰 */
.page-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #e8f3ff 0%, #f0f5ff 50%, #e8fffb 100%);
}

.bg-decoration {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
}

.bg-deco-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(26, 111, 255, 0.3), transparent);
    top: -100px;
    right: -100px;
}

.bg-deco-2 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(0, 180, 44, 0.15), transparent);
    bottom: -80px;
    left: -80px;
}

.bg-deco-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(64, 150, 255, 0.2), transparent);
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 主容器 */
.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 720px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 顶部Logo */
.header {
    margin-bottom: 30px;
    text-align: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(26, 111, 255, 0.3);
}

.logo-text h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 1px;
}

.logo-text p {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 2px;
    letter-spacing: 0.5px;
}

/* 查询卡片 */
.query-card {
    width: 100%;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px 36px;
    transition: box-shadow 0.3s ease;
}

.query-card:hover {
    box-shadow: var(--shadow-hover);
}

.card-header {
    text-align: center;
    margin-bottom: 28px;
}

.card-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.card-header p {
    font-size: 14px;
    color: var(--text-light);
}

/* 搜索框 */
.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

#keyword {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 44px;
    font-size: 15px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: #f7f8fa;
    color: var(--text-main);
    transition: all 0.25s ease;
    outline: none;
}

#keyword:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26, 111, 255, 0.12);
}

#keyword::placeholder {
    color: var(--text-light);
}

/* 查询按钮 */
.btn-query {
    height: 48px;
    padding: 0 28px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(26, 111, 255, 0.3);
    white-space: nowrap;
}

.btn-query:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(26, 111, 255, 0.4);
}

.btn-query:active {
    transform: translateY(0);
}

.btn-query:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 查询结果 */
.result-area {
    margin-top: 8px;
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 查询结果 */
.result-card {
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 12px;
}

.result-card.success {
    background: var(--success-bg);
    border: 1px solid #b7eb8f;
}

.result-card.danger {
    background: var(--danger-bg);
    border: 1px solid #ffccc7;
}

.result-card.notfound {
    background: #fff7e8;
    border: 1px solid #ffd591;
}

.result-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.result-status-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.result-card.success .result-status-icon {
    background: var(--success);
    color: #fff;
}

.result-card.danger .result-status-icon {
    background: var(--danger);
    color: #fff;
}

.result-card.notfound .result-status-icon {
    background: #ff9a2e;
    color: #fff;
}

.result-status-text h3 {
    font-size: 20px;
    font-weight: 700;
}

.result-card.success .result-status-text h3 {
    color: var(--success);
}

.result-card.danger .result-status-text h3 {
    color: var(--danger);
}

.result-card.notfound .result-status-text h3 {
    color: #ff7a00;
}

.result-status-text p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* 结果详情表格 */
.result-detail {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
}

.detail-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    width: 130px;
    flex-shrink: 0;
    font-size: 14px;
    color: var(--text-light);
}

.detail-value {
    flex: 1;
    font-size: 14px;
    color: var(--text-main);
    font-weight: 500;
}

.detail-value.highlight {
    color: var(--primary);
}

/* 提示信息 */
.tips {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px dashed var(--border);
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.tip-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary-light);
    flex-shrink: 0;
}

/* 底部 */
.footer {
    margin-top: 30px;
    text-align: center;
}

.footer p {
    font-size: 12px;
    color: var(--text-light);
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式 */
@media (max-width: 600px) {
    .container {
        padding: 16px;
    }

    .query-card {
        padding: 28px 20px;
    }

    .logo-area {
        flex-direction: column;
        gap: 10px;
    }

    .logo-text h1 {
        font-size: 22px;
    }

    .search-box {
        flex-direction: column;
    }

    .btn-query {
        width: 100%;
    }

    .detail-label {
        width: 100px;
    }
}
