/* 全局重置 & 字体 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #f5f7fb;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 480px;
    width: 100%;
    background: white;
    border-radius: 32px;
    padding: 36px 28px 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

/* 大标题 */
.main-title {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
    color: #0b1e33;
    margin-bottom: 28px;
    background: linear-gradient(135deg, #1a2a4a, #2d4b7a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    user-select: none;
}

/* 输入区域 */
.input-area {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;  /* 留出间距给错误提示 */
}

.input-area input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-size: 1rem;
    background: #fafbfc;
    transition: border 0.2s, box-shadow 0.2s;
    outline: none;
}

.input-area input:focus {
    border-color: #3b6cb0;
    box-shadow: 0 0 0 4px rgba(59, 108, 176, 0.15);
    background: white;
}

.input-area input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.input-area button {
    padding: 14px 24px;
    background: #1a2a4a;
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}

.input-area button:hover:not(:disabled) {
    background: #2d4b7a;
}

.input-area button:active:not(:disabled) {
    transform: scale(0.96);
}

.input-area button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 红字错误提示 */
.domain-error {
    color: #e53e3e;
    font-size: 0.9rem;
    margin-top: 6px;
    margin-bottom: 16px;
    padding: 6px 10px;
    background: #fff5f5;
    border-radius: 8px;
    border-left: 4px solid #e53e3e;
    line-height: 1.4;
    display: none;  /* 默认隐藏 */
}

/* 测试卡片 - 竖向排列 */
.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 8px;
}

.test-card {
    background: #fafbfc;
    border-radius: 18px;
    padding: 16px 18px;
    border: 2px solid #edf2f7;
    transition: border-color 0.3s, background 0.2s;
}

.test-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.test-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.test-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: #2d3748;
}

/* 状态样式 */
.test-status {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 4px 0;
}

.status-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    background: #cbd5e0;
    transition: background 0.3s, box-shadow 0.3s;
}

.status-text {
    color: #2d3748;
}

/* 加载中状态 */
.status-loading .status-dot {
    background: #a0aec0;
    box-shadow: 0 0 0 2px #e2e8f0;
}
.status-loading .status-dot.spinning {
    animation: spin 1s linear infinite;
    background: #718096;
    border: 2px solid transparent;
    border-top: 2px solid #2b6cb0;
    width: 20px;
    height: 20px;
    box-shadow: none;
}

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

/* 阳性 (1) */
.status-positive .status-dot {
    background: #e53e3e;
    box-shadow: 0 0 0 4px rgba(229, 62, 62, 0.2);
}
.status-positive .status-text {
    color: #c53030;
}

/* 阴性 (0) */
.status-negative .status-dot {
    background: #38a169;
    box-shadow: 0 0 0 4px rgba(56, 161, 105, 0.2);
}
.status-negative .status-text {
    color: #2f855a;
}

/* 无效 (-1) */
.status-invalid .status-dot {
    background: #a0aec0;
    box-shadow: 0 0 0 2px #e2e8f0;
}
.status-invalid .status-text {
    color: #718096;
}

/* 响应式 */
@media (max-width: 500px) {
    .container {
        padding: 24px 16px;
    }
    .main-title {
        font-size: 2.4rem;
    }
    .input-area {
        flex-direction: column;
        gap: 10px;
    }
    .input-area button {
        width: 100%;
        justify-content: center;
    }
}