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

:root {
    --primary-color: #4a90e2;
    --secondary-color: #7b68ee;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --danger-color: #f5222d;
    --text-color: #333;
    --text-secondary: #666;
    --border-color: #e0e0e0;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
        'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

.section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow);
    animation: fadeIn 0.5s ease-in;
}

.section.hidden {
    display: none;
}

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

/* 介绍页面 */
.intro-card {
    text-align: center;
}

.intro-card h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.intro-card ul {
    list-style: none;
    margin: 20px 0;
    text-align: left;
}

.intro-card li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.intro-card li:last-child {
    border-bottom: none;
}

.note {
    background: #fff7e6;
    border-left: 4px solid var(--warning-color);
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    text-align: left;
}

#start-btn {
    max-width: 400px;
    width: 100%;
    display: block;
    margin: 30px auto 0;
    padding: 16px 50px;
    font-size: 1.2rem;
}

/* 按钮 */
.btn-primary,
.btn-secondary {
    padding: 14px 40px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    margin-top: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-submit {
    width: 100%;
    margin-top: 30px;
}

/* 进度容器 */
.progress-container {
    margin-bottom: 30px;
}

/* 进度条 */
.progress-bar {
    background: #f0f0f0;
    border-radius: 20px;
    height: 40px;
    position: relative;
    margin-bottom: 15px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    height: 100%;
    width: 0;
    transition: width 0.3s ease;
    border-radius: 20px;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    color: var(--text-color);
    z-index: 1;
}

/* 页面指示器 */
.page-indicator {
    text-align: center;
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* 页面导航 */
.page-nav {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.page-nav-btn {
    width: 45px;
    height: 45px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.page-nav-btn:hover {
    border-color: var(--primary-color);
    background: #f0f7ff;
    transform: translateY(-2px);
}

.page-nav-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.page-nav-btn.completed {
    background: #f6ffed;
    border-color: #52c41a;
    color: #52c41a;
}

.page-nav-btn.completed::after {
    content: '✓';
    margin-left: 3px;
}

.page-nav-btn.completed.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.page-nav-btn.completed.active::after {
    content: '';
}

/* 题目列表 */
#questions-container {
    margin-bottom: 20px;
}

.question-item {
    background: #fafafa;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.question-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 12px rgba(74, 144, 226, 0.1);
}

.question-item.focused {
    border-color: var(--secondary-color);
    background: #f9f0ff;
    box-shadow: 0 4px 16px rgba(123, 104, 238, 0.2);
    transform: scale(1.01);
}

.question-item.highlight {
    border-color: var(--danger-color);
    background: #fff1f0;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.question-header {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
}

.question-number {
    color: var(--primary-color);
    font-weight: 600;
    min-width: 35px;
}

.question-text {
    font-size: 1.05rem;
    color: var(--text-color);
}

.options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.option-label {
    flex: 1;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.option-label:hover {
    border-color: var(--primary-color);
    background: #f0f7ff;
}

.option-label input[type="radio"] {
    margin-right: 8px;
}

.option-label input[type="radio"]:checked + .option-text {
    color: var(--primary-color);
    font-weight: 600;
}

.option-label:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background: #e6f4ff;
}

/* 结果页面 */
.result-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.result-card h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.result-overall {
    text-align: center;
    padding: 30px;
    border-radius: 12px;
}

.result-overall.normal {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
}

.result-overall.mild {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
}

.result-overall.moderate {
    background: linear-gradient(135deg, #ffe0b2, #ffcc80);
}

.result-overall.severe {
    background: linear-gradient(135deg, #ffcdd2, #ef9a9a);
}

.result-level {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.result-desc {
    font-size: 1.1rem;
    line-height: 1.8;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa, #e8eef5);
    border-radius: 12px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 5px;
    line-height: 1.4;
}

/* 因子分析 */
.factors-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.factor-item {
    padding: 20px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.factor-item.normal {
    background: #f6ffed;
    border-color: #b7eb8f;
}

.factor-item.abnormal {
    background: #fff1f0;
    border-color: #ffa39e;
}

.factor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.factor-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
}

.factor-score {
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.score-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
}

.score-status.normal {
    background: var(--success-color);
    color: white;
}

.score-status.abnormal {
    background: var(--danger-color);
    color: white;
}

.factor-bar {
    background: #f0f0f0;
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}

.factor-bar-fill {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.factor-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 8px;
}

.factor-norm {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 8px;
}

.factor-advice {
    margin-top: 12px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #fff9e6, #fffbf0);
    border-left: 3px solid #faad14;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #ad6800;
}

.factor-item.abnormal .factor-advice {
    background: linear-gradient(135deg, #fff1f0, #fff7f7);
    border-left-color: #f5222d;
    color: #a8071a;
}

.disclaimer {
    background: #fff7e6;
    border-color: var(--warning-color);
}

.disclaimer h3 {
    color: var(--warning-color);
}

.disclaimer p {
    color: var(--text-color);
    line-height: 1.8;
}

/* 导航按钮 */
.navigation-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn-nav {
    min-width: 120px;
    padding: 12px 30px;
}

/* 键盘提示 */
.keyboard-hint {
    text-align: center;
    margin-top: 20px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #fff9e6, #fffbf0);
    border: 1px solid #ffe58f;
    border-radius: 8px;
    color: #ad6800;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .section {
        padding: 20px;
    }

    /* 页面导航 */
    .page-nav {
        gap: 6px;
    }

    .page-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    /* 题目 */
    .question-item {
        padding: 15px;
    }

    .question-header {
        flex-direction: column;
        gap: 8px;
    }

    .question-number {
        min-width: auto;
    }

    .options {
        flex-direction: column;
    }

    .option-label {
        min-width: 100%;
        padding: 12px 15px;
        font-size: 1rem;
    }

    /* 导航按钮 */
    .navigation-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .btn-nav {
        width: 100%;
        min-width: auto;
    }

    .btn-submit {
        width: 100%;
    }

    /* 键盘提示在移动端隐藏 */
    .keyboard-hint {
        display: none;
    }

    /* 统计指标 */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .stat-item {
        padding: 15px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-hint {
        font-size: 0.8rem;
    }

    /* 因子分析 */
    .factor-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* 进度条 */
    .progress-bar {
        height: 35px;
    }

    .page-indicator {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .section {
        padding: 15px;
    }

    .page-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }

    .question-item {
        padding: 12px;
    }

    .question-text {
        font-size: 0.95rem;
    }

    .option-label {
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    /* 统计指标 */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .stat-hint {
        font-size: 0.75rem;
    }

    /* 因子建议 */
    .factor-advice {
        font-size: 0.85rem;
        padding: 10px 12px;
    }
}

@media print {
    body {
        background: white;
    }

    .btn-primary,
    .btn-secondary {
        display: none;
    }

    #intro-section,
    #test-section {
        display: none;
    }

    #result-section {
        display: block !important;
    }
}
