/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #8B4513;
    --secondary-color: #D2691E;
    --success-color: #4CAF50;
    --warning-color: #FF9800;
    --danger-color: #F44336;
    --light-bg: #FFF8DC;
    --border-color: #DDD;
    --text-primary: #333;
    --text-secondary: #666;
    --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, #FFE4B5 0%, #FFF8DC 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* ==================== 头部样式 ==================== */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 14px;
    opacity: 0.9;
}

/* ==================== 页面切换 ==================== */
.page {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s ease-in;
}

.page.active {
    display: block;
}

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

/* ==================== 开始页面 ==================== */
.intro-card h2 {
    color: var(--primary-color);
    margin-bottom: 16px;
    font-size: 24px;
}

.intro-card > p {
    margin-bottom: 24px;
    color: var(--text-secondary);
}

.info-box {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    border-left: 4px solid var(--primary-color);
}

.info-box h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
}

.info-box ul {
    list-style: none;
    padding-left: 0;
}

.info-box li {
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
}

.info-box li:before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.constitution-preview {
    margin-bottom: 24px;
}

.constitution-preview h3 {
    margin-bottom: 12px;
    color: var(--primary-color);
}

.constitution-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.tag-peaceful { background: #E8F5E9; color: #2E7D32; }
.tag-qi { background: #FFF3E0; color: #E65100; }
.tag-yang { background: #E3F2FD; color: #1565C0; }
.tag-yin { background: #F3E5F5; color: #7B1FA2; }
.tag-phlegm { background: #FFF8E1; color: #F57F17; }
.tag-dampness { background: #E8F5E9; color: #1B5E20; }
.tag-stasis { background: #FFEBEE; color: #C62828; }
.tag-depression { background: #E1F5FE; color: #0277BD; }
.tag-special { background: #F3E5F5; color: #6A1B9A; }

/* ==================== 表单元素 ==================== */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ==================== 按钮样式 ==================== */
.btn {
    padding: 12px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

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

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

.btn-secondary {
    background: #f5f5f5;
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #e0e0e0;
}

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

.btn-outline:hover {
    background: var(--light-bg);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== 进度条 ==================== */
.progress-bar {
    margin-bottom: 24px;
}

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

.progress-text {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    display: block;
}

/* ==================== 问题卡片 ==================== */
.question-card {
    background: var(--light-bg);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    min-height: 200px;
}

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

.question-type-badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
}

.question-text {
    font-size: 20px;
    color: var(--text-primary);
    line-height: 1.5;
}

.answer-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.answer-option {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.answer-option:hover {
    border-color: var(--secondary-color);
    background: var(--light-bg);
}

.answer-option.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.1) 0%, rgba(210, 105, 30, 0.1) 100%);
}

.answer-option input[type="radio"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.option-label {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.option-value {
    font-weight: 500;
    margin-right: 16px;
}

.option-desc {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ==================== 导航按钮 ==================== */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.navigation-buttons button {
    flex: 1;
}

/* ==================== 结果页面 ==================== */
.result-header {
    text-align: center;
    margin-bottom: 24px;
}

.result-header h2 {
    color: var(--primary-color);
    margin-bottom: 8px;
}

.result-date {
    color: var(--text-secondary);
    font-size: 14px;
}

.primary-result {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 32px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 24px;
}

.primary-result h3 {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 12px;
}

.primary-result .constitution-name {
    font-size: 36px;
    font-weight: bold;
}

.tendency-result {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.tendency-result h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 18px;
}

#tendencyTags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tendency-tag {
    background: var(--secondary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
}

.constitution-interpretation {
    background: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 2px solid #e3f2fd;
    background: linear-gradient(135deg, #f8fbff 0%, #ffffff 100%);
}

.constitution-interpretation h3 {
    color: #1976d2;
    margin-bottom: 20px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.constitution-interpretation h3::before {
    content: "📋";
    font-size: 20px;
}

.interpretation-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.interpretation-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    border-left: 3px solid #1976d2;
    transition: all 0.3s ease;
}

.interpretation-item:hover {
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.1);
    transform: translateX(4px);
}

.interpretation-icon {
    font-size: 24px;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.interpretation-text {
    flex: 1;
}

.interpretation-text strong {
    color: #1976d2;
    font-size: 16px;
    display: block;
    margin-bottom: 8px;
}

.interpretation-text p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.interpretation-reminder {
    margin-top: 8px;
    padding: 12px;
    background: #fff3e0;
    border-radius: 6px;
    border-left: 3px solid #ff9800;
}

.interpretation-reminder p {
    margin: 0;
    color: #e65100;
    font-size: 13px;
    line-height: 1.5;
}

.constitution-details {
    background: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 2px solid var(--border-color);
}

.constitution-details h3 {
    color: var(--primary-color);
    margin-bottom: 16px;
    font-size: 18px;
}

.detail-item {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.detail-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.detail-text {
    color: var(--text-secondary);
    line-height: 1.6;
}

.all-results {
    margin-bottom: 24px;
}

.all-results h3 {
    color: var(--primary-color);
    margin-bottom: 16px;
    font-size: 18px;
}

.scores-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

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

.score-row.highlight {
    background: var(--light-bg);
}

.score-name {
    flex: 1;
    font-weight: 500;
}

.score-bar {
    width: 150px;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 0 16px;
}

.score-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    transition: width 0.5s;
}

.score-value {
    width: 80px;
    text-align: right;
    font-weight: 600;
    color: var(--primary-color);
}

.result-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 8px;
}

.result-badge-yes {
    background: #E8F5E9;
    color: #2E7D32;
}

.result-badge-tendency {
    background: #FFF3E0;
    color: #E65100;
}

.result-badge-no {
    background: #F5F5F5;
    color: #9E9E9E;
}

.action-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ==================== 底部 ==================== */
.footer {
    background: #f5f5f5;
    padding: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

.footer p {
    margin: 4px 0;
}

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

    .header {
        padding: 20px;
    }

    .header h1 {
        font-size: 22px;
    }

    .page {
        padding: 20px;
    }

    .question-text {
        font-size: 18px;
    }

    .primary-result .constitution-name {
        font-size: 28px;
    }

    .navigation-buttons {
        flex-direction: column-reverse;
    }

    .score-row {
        flex-wrap: wrap;
    }

    .score-bar {
        order: 3;
        width: 100%;
        margin: 8px 0 0 0;
    }
}

/* ==================== 打印样式 ==================== */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
    }

    .action-buttons,
    .footer {
        display: none;
    }

    .page {
        display: block !important;
    }
}

/* ==================== 免责声明 ==================== */

/* 简单免责声明文字 */
.simple-disclaimer {
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.6;
}

.simple-disclaimer .link {
    color: var(--primary-color);
    text-decoration: underline;
}

.simple-disclaimer .link:hover {
    color: var(--secondary-color);
}

/* 结果页提示 */
.result-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* ==================== 弹窗样式 ==================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    overflow-y: auto;
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: white;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: white;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.3s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    background: #f5f5f5;
    border-radius: 0 0 12px 12px;
}

/* 免责声明内容样式 */
.disclaimer-content h3 {
    color: #d32f2f;
    margin: 16px 0 8px 0;
    font-size: 16px;
}

.disclaimer-content h3:first-child {
    margin-top: 0;
}

.disclaimer-content h4 {
    color: var(--primary-color);
    margin: 12px 0 6px 0;
    font-size: 14px;
}

.disclaimer-content p {
    margin: 8px 0;
    line-height: 1.6;
}

.disclaimer-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.disclaimer-content li {
    margin: 6px 0;
    line-height: 1.5;
    font-size: 14px;
}

.agreement-notice {
    background: #FFF3CD;
    border: 2px solid #FFC107;
    border-radius: 8px;
    padding: 12px;
    margin-top: 16px;
}

.agreement-notice p {
    margin: 6px 0;
    font-size: 13px;
}

.agreement-notice p strong {
    color: #FF6F00;
}

/* 弹窗响应式 */
@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .modal-header {
        padding: 16px;
    }

    .modal-header h2 {
        font-size: 18px;
    }

    .modal-body {
        padding: 16px;
        max-height: 50vh;
    }

    .modal-footer {
        padding: 12px 16px;
    }
}
