* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    color: #333;
}

.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: flex;
    flex-direction: column;
}

/* ========== 首页样式 ========== */
#home-page {
    background: linear-gradient(180deg, #e8f5e9 0%, #c8e6c9 30%, #a5d6a7 100%);
    position: relative;
}

.home-scroll-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 100px;
}

.home-header {
    padding: 40px 20px 30px;
    text-align: center;
    position: relative;
}

.header-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(135deg, #4db6ac 0%, #26a69a 100%);
    border-radius: 0 0 50% 50% / 0 0 30px 30px;
}

.header-content {
    position: relative;
    z-index: 1;
    color: white;
}

.header-subtitle {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.header-content h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-decoration {
    font-size: 14px;
    opacity: 0.7;
}

.intro-card {
    background: white;
    margin: 20px 15px;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.card-title-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.card-icon-dot {
    width: 8px;
    height: 8px;
    background: #26a69a;
    border-radius: 50%;
}

.card-title-bar h3 {
    font-size: 16px;
    color: #333;
}

.intro-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.intro-stat {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-size: 24px;
    font-weight: 700;
    color: #26a69a;
}

.stat-text {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

.concern-section {
    padding: 20px 15px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.title-icon {
    font-size: 20px;
}

.section-title h3 {
    font-size: 16px;
    color: #333;
}

.concern-list {
    background: white;
    border-radius: 16px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.concern-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #555;
}

.concern-item:last-child {
    border-bottom: none;
}

.concern-icon {
    font-size: 20px;
}

.assessment-section {
    padding: 20px 15px;
}

.assessment-card {
    background: linear-gradient(135deg, #26a69a 0%, #4db6ac 100%);
    border-radius: 16px;
    padding: 25px 20px;
    text-align: center;
    color: white;
}

.assessment-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.assessment-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.assessment-card p {
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.6;
}

.dimensions-section {
    padding: 20px 15px;
}

.dimension-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dim-tag {
    background: white;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 13px;
    color: #26a69a;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.report-preview-section {
    padding: 20px 15px;
}

.report-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.report-feature {
    background: white;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.feature-icon {
    font-size: 30px;
    width: 50px;
    height: 50px;
    background: #e8f5e9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-text h4 {
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
}

.feature-text p {
    font-size: 12px;
    color: #888;
}

.home-tips {
    padding: 20px 15px;
    text-align: center;
}

.home-tips p {
    font-size: 12px;
    color: #888;
    line-height: 1.8;
}

.bottom-placeholder {
    height: 20px;
}

.fixed-bottom-btn {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 15px 20px;
    padding-bottom: calc(15px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 100;
}

.btn-primary {
    width: 100%;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #26a69a 0%, #4db6ac 100%);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(38, 166, 154, 0.4);
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    touch-action: manipulation;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(38, 166, 154, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
    opacity: 0.9;
}

/* 测评页样式 */
#test-page {
    background: linear-gradient(180deg, #e0f2f1 0%, #b2dfdb 100%);
    min-height: 100vh;
}

.test-page-header {
    display: flex;
    align-items: center;
    padding: 15px;
    padding-top: calc(15px + env(safe-area-inset-top));
}

.back-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 28px;
    color: #26a69a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.test-page-header h1 {
    flex: 1;
    font-size: 18px;
    color: #26a69a;
    text-align: center;
    margin-right: 36px;
}

.test-badge {
    display: flex;
    justify-content: flex-start;
    padding: 0 15px;
    margin-bottom: 15px;
}

.test-badge span {
    background: linear-gradient(135deg, #26a69a 0%, #4db6ac 100%);
    color: white;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.test-main-content {
    padding: 0 15px 30px;
}

.question-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.06);
    margin-bottom: 15px;
}

.progress-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.progress-label {
    font-size: 14px;
    color: #666;
}

.progress-percent {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.progress-bar {
    display: none;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #26a69a 0%, #4db6ac 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.question-text {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 20px 0;
    line-height: 1.4;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    padding: 16px 20px;
    font-size: 16px;
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    color: #333;
    -webkit-tap-highlight-color: transparent;
}

.option-btn:hover {
    background: #f0f0f0;
}

.option-btn:active {
    background: rgba(38, 166, 154, 0.1);
    border-color: #26a69a;
}

.option-btn.selected {
    background: rgba(38, 166, 154, 0.1);
    border-color: #26a69a;
    color: #26a69a;
    font-weight: 600;
}

.prev-btn-container {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 20px;
}

.prev-btn-new {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 16px;
    background: white;
    border: 1px solid #26a69a;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s;
    color: #26a69a;
    -webkit-tap-highlight-color: transparent;
}

.prev-btn-new:hover:not(:disabled) {
    background: rgba(38, 166, 154, 0.05);
}

.prev-btn-new:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.prev-icon {
    font-size: 18px;
}

.test-notice {
    background: transparent;
    padding: 0;
}

.test-notice h4 {
    font-size: 15px;
    color: #333;
    margin-bottom: 12px;
    font-weight: 600;
}

.test-notice p {
    font-size: 13px;
    color: #888;
    line-height: 1.8;
    margin-bottom: 4px;
}

.test-notice p:last-child {
    margin-bottom: 0;
}

/* ========== 新版结果页样式 ========== */
#result-page {
    background: #f8fafc;
    min-height: 100vh;
}

/* 报告头部 */
.report-header {
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    color: white;
    padding: 50px 20px 40px;
    text-align: center;
}

.heart-icon {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.report-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

.report-time {
    font-size: 14px;
    opacity: 0.85;
}

/* 报告区块 */
.report-section {
    background: white;
    margin: 20px 15px;
    border-radius: 16px;
    padding: 24px 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
    text-align: center;
}

/* 总体评估结果 */
.overall-result {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 20px;
}

.score-box, .level-box {
    text-align: center;
}

.score-label, .level-label {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 10px;
}

.score-value {
    font-size: 48px;
    font-weight: 700;
    color: #f43f5e;
    line-height: 1;
}

.score-max {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 8px;
}

.level-badge {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.level-badge.level-normal { background: #22c55e; }
.level-badge.level-mild { background: #f59e0b; }
.level-badge.level-moderate { background: #f97316; }
.level-badge.level-severe { background: #ef4444; }

.overall-summary {
    background: linear-gradient(135deg, #fef2f2 0%, #fff1f2 100%);
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 14px;
    line-height: 1.8;
    color: #475569;
    text-align: center;
}

/* 因子图例 */
.factor-legend {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.factor-legend strong {
    display: block;
    font-size: 14px;
    color: #334155;
    margin-bottom: 12px;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
}

.legend-item .dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.dot.normal { background: #22c55e; }
.dot.mild { background: #f59e0b; }
.dot.moderate { background: #f97316; }
.dot.severe { background: #ef4444; }

/* 因子网格 */
.factor-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (max-width: 480px) {
    .factor-grid {
        grid-template-columns: 1fr;
    }
}

.factor-grid-item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.factor-grid-name {
    font-size: 15px;
    color: #334155;
    font-weight: 500;
}

.factor-grid-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.factor-grid-score {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.factor-grid-level {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
    color: white;
}

.factor-grid-level.normal { background: #22c55e; }
.factor-grid-level.mild { background: #f59e0b; }
.factor-grid-level.moderate { background: #f97316; }
.factor-grid-level.severe { background: #ef4444; }

/* 因子详情卡片 */
.factor-details {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.factor-detail-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
}

.factor-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.factor-detail-info {
    flex: 1;
}

.factor-detail-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.factor-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.factor-dot.normal { background: #22c55e; }
.factor-dot.mild { background: #f59e0b; }
.factor-dot.moderate { background: #f97316; }
.factor-dot.severe { background: #ef4444; }

.factor-detail-title h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.factor-detail-desc {
    font-size: 13px;
    color: #64748b;
}

.factor-detail-score {
    text-align: right;
}

.factor-detail-score .score-num {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
}

.factor-detail-score .score-label {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.factor-detail-score .level-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: white;
    margin-top: 6px;
}

.level-tag.normal { background: #22c55e; }
.level-tag.mild { background: #f59e0b; }
.level-tag.moderate { background: #f97316; }
.level-tag.severe { background: #ef4444; }

.factor-detail-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

@media (max-width: 640px) {
    .factor-detail-body {
        grid-template-columns: 1fr;
    }
}

.detail-section {
    padding: 20px;
}

.detail-section:first-child {
    border-right: 1px solid #f1f5f9;
}

@media (max-width: 640px) {
    .detail-section:first-child {
        border-right: none;
        border-bottom: 1px solid #f1f5f9;
    }
}

.detail-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.detail-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
}

.detail-icon.feature { background: #6366f1; }
.detail-icon.advice { background: #22c55e; }

.detail-section-title strong {
    font-size: 15px;
    color: #334155;
}

.detail-section p {
    font-size: 14px;
    line-height: 1.8;
    color: #475569;
    margin: 0;
}

.factor-detail-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}

.stat-item {
    text-align: center;
    padding: 16px 8px;
    border-right: 1px solid #e2e8f0;
}

.stat-item:last-child {
    border-right: none;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

.stat-value.highlight {
    color: #ef4444;
}

.stat-label {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

/* 因子备注 */
.factor-note {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    margin-top: 24px;
    font-size: 13px;
    line-height: 1.8;
    color: #64748b;
}

.factor-note strong {
    color: #334155;
}

/* 健康综述 */
.health-summary {
    background: linear-gradient(135deg, #fef7ff 0%, #fdf4ff 100%);
}

.summary-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.summary-icon {
    font-size: 24px;
}

.summary-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.summary-content {
    font-size: 14px;
    line-height: 1.8;
    color: #475569;
}

.summary-content p {
    margin: 0 0 12px;
}

.summary-content p:last-child {
    margin-bottom: 0;
}

.hotline-box {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
}

.hotline-box .hotline-title {
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.hotline-box p {
    margin: 4px 0;
    font-size: 13px;
}

/* 报告页脚 */
.report-footer {
    text-align: center;
    padding: 30px 20px;
    color: #94a3b8;
    font-size: 13px;
}

.report-footer p {
    margin: 0 0 8px;
}

.disclaimer {
    font-size: 12px;
    line-height: 1.8;
}

/* 操作按钮 */
.result-actions {
    padding: 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    position: sticky;
    bottom: 0;
}

/* 加载页样式 */
#loading-page {
    background: linear-gradient(180deg, #26a69a 0%, #4db6ac 100%);
    min-height: 100vh;
}

.loading-header {
    padding: 60px 20px 40px;
    text-align: center;
    color: white;
}

.loading-icon {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.icon-doc {
    font-size: 60px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.icon-check {
    position: absolute;
    bottom: -5px;
    right: -15px;
    width: 30px;
    height: 30px;
    background: #ffb74d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
}

.loading-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.loading-content {
    padding: 0 15px;
}

.loading-card {
    background: white;
    border-radius: 20px 20px 0 0;
    min-height: calc(100vh - 200px);
    padding: 0;
    overflow: hidden;
}

.loading-tabs {
    display: flex;
    border-bottom: 1px solid #f0f0f0;
}

.loading-tab {
    flex: 1;
    padding: 18px 10px;
    text-align: center;
    font-size: 15px;
    color: #999;
    position: relative;
    transition: all 0.3s;
}

.loading-tab.active {
    color: #26a69a;
    font-weight: 600;
}

.loading-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: #26a69a;
    border-radius: 2px;
}

.loading-tab.completed {
    color: #333;
}

.loading-steps {
    padding: 30px 20px;
}

.step-group {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-item {
    margin-bottom: 30px;
}

.step-item:last-child {
    margin-bottom: 0;
}

.step-item p {
    font-size: 14px;
    color: #333;
    margin-bottom: 12px;
}

.step-bar {
    height: 8px;
    background: #e8f5e9;
    border-radius: 4px;
    overflow: hidden;
}

.step-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(135deg, #26a69a 0%, #4db6ac 100%);
    border-radius: 4px;
    transition: width 0.1s linear;
}

.step-fill.completed {
    width: 100%;
}

@media (min-width: 768px) {
    .hero-content h1 {
        font-size: 64px;
    }
    .stats {
        gap: 60px;
    }
    .stat-number {
        font-size: 36px;
    }
}
