/* =====================================================
   加法翻翻乐详细玩法 - 样式表
   设计理念：靛蓝紫+金橙色，魔法卡牌主题，神秘温馨
   ===================================================== */

/* CSS 变量 */
:root {
    /* 主色调 - 靛蓝紫（魔法感） */
    --primary: #5C6BC0;
    --primary-light: #7986CB;
    --primary-dark: #3F51B5;

    /* 金橙色 - 成功/收集 */
    --gold: #FFA726;
    --gold-light: #FFB74D;
    --gold-dark: #FF9800;

    /* 辅助色 - 翠绿（答对） */
    --positive: #66BB6A;
    --positive-light: #81C784;

    /* 思考色 - 琥珀（想了一下） */
    --thinking: #FFB74D;
    --thinking-light: #FFCC80;

    /* 错误/警示 */
    --negative: #EF5350;
    --negative-light: #E57373;

    /* 中性色 */
    --bg: #FFFBF5;
    --bg-warm: #F5F3FF;
    --bg-section: #EDE7F6;
    --text: #37474F;
    --text-light: #546E7A;
    --text-muted: #78909C;
    --border: #D1C4E9;

    /* 间距 */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
    --space-2xl: 6rem;

    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 32px;

    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(92, 107, 192, 0.1);
    --shadow-md: 0 4px 20px rgba(92, 107, 192, 0.15);
    --shadow-lg: 0 8px 40px rgba(92, 107, 192, 0.2);
    --shadow-gold: 0 4px 20px rgba(255, 167, 38, 0.4);

    /* 过渡 */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* 基础重置 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
}

/* 容器 */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* =====================================================
   导航栏
   ===================================================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 251, 245, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    padding: var(--space-sm) 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: var(--space-md);
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.nav-links a:hover {
    color: var(--primary);
}

/* =====================================================
   进度条
   ===================================================== */
.progress-bar {
    position: fixed;
    top: 57px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border);
    z-index: 999;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--gold));
    width: 0%;
    transition: width 0.1s ease-out;
}

/* =====================================================
   章节导航点
   ===================================================== */
.chapter-nav {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 100;
}

.chapter-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
}

.chapter-dot:hover {
    background: var(--primary-light);
    transform: scale(1.2);
}

.chapter-dot.active {
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(92, 107, 192, 0.2);
}

.chapter-dot::before {
    content: attr(title);
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--text);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.chapter-dot:hover::before {
    opacity: 1;
}

/* =====================================================
   英雄区 - 魔法卡牌主题
   ===================================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg) 0%, #E8EAF6 50%, #D1C4E9 100%);
    padding: var(--space-2xl) var(--space-md);
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* 装饰性卡牌背景 */
.hero::before {
    content: '🃏';
    position: absolute;
    font-size: 120px;
    opacity: 0.08;
    top: 10%;
    left: 5%;
    transform: rotate(-15deg);
}

.hero::after {
    content: '✨';
    position: absolute;
    font-size: 80px;
    opacity: 0.1;
    bottom: 15%;
    right: 8%;
    transform: rotate(20deg);
}

.hero-content {
    max-width: 700px;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 8px 20px;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-md);
}

.badge-icon {
    width: 18px;
    height: 18px;
}

.hero-title {
    font-family: 'Noto Serif SC', serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: var(--space-lg);
}

.title-line {
    display: block;
    color: var(--text);
}

.title-highlight {
    display: block;
    color: var(--primary);
    font-size: 0.7em;
    margin-top: 0.3em;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: var(--space-lg);
}

.hero-subtitle strong {
    color: var(--gold-dark);
}

.meta-info {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
    margin-bottom: var(--space-xl);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.meta-item svg {
    width: 18px;
    height: 18px;
}

.hero-cta {
    margin-top: var(--space-lg);
}

.scroll-hint {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: var(--space-sm);
}

.scroll-arrow {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    color: var(--primary);
    animation: bounce 2s infinite;
}

.scroll-arrow svg {
    width: 100%;
    height: 100%;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(10px); }
    60% { transform: translateY(5px); }
}

/* =====================================================
   通用章节样式
   ===================================================== */
.section {
    padding: var(--space-2xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.section-number {
    display: inline-block;
    font-family: 'Noto Serif SC', serif;
    font-size: 0.9rem;
    color: var(--primary);
    background: rgba(92, 107, 192, 0.1);
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: var(--space-sm);
}

.section-title {
    font-family: 'Noto Serif SC', serif;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-sm);
}

.section-desc {
    font-size: 1.1rem;
    color: var(--text-light);
}

.subsection-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
    color: var(--text);
}

/* =====================================================
   效果对比区
   ===================================================== */
.section-contrast {
    background: var(--bg-section);
}

.contrast-container {
    display: flex;
    align-items: stretch;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
}

.contrast-card {
    flex: 1;
    min-width: 280px;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.contrast-header {
    padding: var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contrast-card.before .contrast-header {
    background: linear-gradient(135deg, #FFCDD2, var(--negative));
    color: white;
}

.contrast-card.after .contrast-header {
    background: linear-gradient(135deg, #A5D6A7, var(--positive));
    color: white;
}

.contrast-label {
    font-weight: 600;
}

.contrast-icon {
    font-size: 1.5rem;
}

.contrast-content {
    padding: var(--space-lg);
}

.contrast-content ul {
    list-style: none;
}

.contrast-content li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--text-light);
}

.contrast-card.before li::before {
    content: '\2717';
    position: absolute;
    left: 0;
    color: var(--negative);
    font-weight: bold;
}

.contrast-card.after li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--positive);
    font-weight: bold;
}

.contrast-arrow {
    display: flex;
    align-items: center;
    color: var(--gold-dark);
}

.contrast-arrow svg {
    width: 40px;
    height: 40px;
}

.why-important {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    background: white;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--gold);
}

.why-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    color: var(--gold-dark);
}

.why-icon svg {
    width: 100%;
    height: 100%;
}

.why-title {
    font-weight: 600;
    color: var(--gold-dark);
    margin-bottom: var(--space-xs);
}

.why-content p {
    margin: 0;
    color: var(--text-light);
}

.why-content strong {
    color: var(--primary);
}

/* =====================================================
   材料准备区
   ===================================================== */
.section-materials {
    background: var(--bg);
}

.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.material-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-lg);
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-align: center;
    position: relative;
}

.material-item.required {
    border: 2px solid var(--primary);
}

.material-item.optional {
    border: 2px dashed var(--border);
}

.material-icon {
    font-size: 2.5rem;
}

.material-name {
    font-weight: 600;
    color: var(--text);
}

.material-tag {
    position: absolute;
    top: -10px;
    right: 10px;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
}

.material-item.optional .material-tag {
    background: var(--gold);
    color: var(--text);
}

.material-note {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* 卡片制作指南 */
.card-making-guide {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-xl);
}

.guide-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.guide-step {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.guide-step .step-num {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.guide-step .step-desc {
    font-size: 0.95rem;
    color: var(--text-light);
    padding-top: 4px;
}

.guide-step .step-desc strong {
    color: var(--text);
}

.guide-tip {
    background: var(--gold-light);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    text-align: center;
    color: var(--text-light);
}

/* 三区域系统 */
.zones-intro {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-xl);
}

.zones-desc {
    text-align: center;
    color: var(--text-light);
    margin-bottom: var(--space-lg);
}

.zones-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}

.zone-card {
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    text-align: center;
}

.zone-card.zone-master {
    background: linear-gradient(135deg, #E8EAF6, #C5CAE9);
    border: 2px solid var(--primary);
}

.zone-card.zone-practice {
    background: linear-gradient(135deg, #FFF8E1, #FFE0B2);
    border: 2px solid var(--thinking);
}

.zone-card.zone-waiting {
    background: linear-gradient(135deg, #ECEFF1, #CFD8DC);
    border: 2px solid #90A4AE;
}

.zone-icon {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.zone-card h4 {
    font-size: 1.1rem;
    margin-bottom: var(--space-xs);
    color: var(--text);
}

.zone-rule {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: var(--space-xs);
}

.zone-effect {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* 角色介绍 */
.roles-intro {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.roles-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.role-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-section);
    border-radius: var(--radius-md);
    min-width: 200px;
}

.role-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.mom-role .role-avatar {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
}

.kid-role .role-avatar {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
}

.kid-role .role-avatar svg {
    width: 28px;
    height: 28px;
    fill: var(--text);
}

.role-info h4 {
    font-size: 1rem;
    margin-bottom: 2px;
}

.role-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.mom-role .role-name {
    color: var(--primary);
}

.kid-role .role-name {
    color: var(--gold-dark);
}

.role-desc {
    font-size: 0.8rem;
    color: var(--text-light);
    line-height: 1.4;
}

.role-vs {
    font-size: 2rem;
}

/* =====================================================
   对话脚本区
   ===================================================== */
.section-script {
    background: var(--bg-section);
}

/* 开场Tab */
.opening-section {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-xl);
}

.opening-tabs, .branch-tabs {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.opening-tab, .branch-tab {
    padding: 8px 16px;
    border: 2px solid var(--border);
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.opening-tab:hover, .branch-tab:hover {
    border-color: var(--primary-light);
}

.opening-tab.active, .branch-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.opening-content, .branch-content {
    display: none;
}

.opening-content.active, .branch-content.active {
    display: block;
}

/* 步骤区 */
.steps-section {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-xl);
}

.script-step {
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--border);
}

.script-step:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.script-step.highlight-step {
    background: linear-gradient(135deg, rgba(92, 107, 192, 0.05), rgba(255, 167, 38, 0.08));
    margin: 0 calc(-1 * var(--space-xl));
    padding: var(--space-lg) var(--space-xl);
    border-radius: var(--radius-md);
}

.script-step.highlight-step.learn {
    background: linear-gradient(135deg, rgba(92, 107, 192, 0.1), rgba(102, 187, 106, 0.1));
}

.step-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.step-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.step-header h4 {
    font-size: 1.1rem;
    color: var(--text);
}

.step-tag {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.step-tag.key {
    background: var(--primary);
    color: white;
}

.step-tag.fun {
    background: var(--gold);
    color: var(--text);
}

.step-tag.learn {
    background: var(--positive);
    color: white;
}

.step-tag.speed {
    background: #FF5722;
    color: white;
}

.step-content {
    padding-left: 52px;
}

.action-note {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--bg-section);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
    font-size: 0.9rem;
    color: var(--text-light);
}

.action-note svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--primary);
}

.action-note.warning {
    background: #FFF8E6;
    color: var(--gold-dark);
}

.action-note.warning svg {
    color: var(--gold-dark);
}

/* =====================================================
   对话框
   ===================================================== */
.dialogue-box {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.dialogue {
    display: flex;
    gap: var(--space-sm);
    max-width: 85%;
}

/* 孩子对话 - 左边 */
.dialogue.child {
    align-self: flex-start;
    flex-direction: row;
}

/* 妈妈对话 - 右边 */
.dialogue.mom {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.dialogue .speaker {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.dialogue.mom .speaker {
    color: var(--primary);
    text-align: right;
}

.dialogue.child .speaker {
    color: var(--gold-dark);
}

.dialogue .bubble {
    background: var(--bg-warm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    position: relative;
}

/* 妈妈气泡 */
.dialogue.mom .bubble {
    background: #E8EAF6;
    border-bottom-right-radius: 4px;
}

/* 孩子气泡 */
.dialogue.child .bubble {
    background: #FFF8E1;
    border-bottom-left-radius: 4px;
}

.dialogue .bubble.error {
    background: #FFEBEE;
    border: 1px solid var(--negative-light);
}

.dialogue .bubble.success {
    background: #E8F5E9;
    border: 1px solid var(--positive-light);
}

.dialogue .bubble.shout {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    font-weight: 700;
    font-size: 1.1rem;
}

.face-note {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 算式卡片展示 */
.card-display {
    display: flex;
    gap: var(--space-md);
    margin: var(--space-md) 0;
    justify-content: center;
    flex-wrap: wrap;
}

.formula-card {
    min-width: 80px;
    padding: var(--space-md) var(--space-lg);
    background: white;
    border: 3px solid var(--primary);
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-md);
    position: relative;
}

.formula-card .formula {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.formula-card .card-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.formula-card.flipped {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    border-color: var(--gold-dark);
}

.formula-card.flipped .formula {
    color: var(--text);
}

/* 区域指示器 */
.zone-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    margin: var(--space-md) 0;
}

.zone-indicator.master {
    background: linear-gradient(135deg, #E8EAF6, #C5CAE9);
}

.zone-indicator.practice {
    background: linear-gradient(135deg, #FFF8E1, #FFE0B2);
}

.zone-tag {
    font-weight: 600;
    font-size: 0.9rem;
}

.zone-reason {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* 提示框 */
.tip-box {
    background: var(--bg-section);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary);
    margin: var(--space-md) 0;
}

.tip-box.green {
    border-left-color: var(--positive);
    background: #E8F5E9;
}

.tip-box.gold {
    border-left-color: var(--gold);
    background: var(--gold-light);
}

.tip-box strong {
    display: block;
    margin-bottom: var(--space-xs);
    color: var(--text);
}

.tip-box p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
}

/* 速度指示器 */
.speed-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin: var(--space-md) 0;
}

.speed-indicator .icon {
    font-size: 2rem;
}

.speed-indicator .text {
    font-weight: 600;
}

/* 学习要点 */
.learning-point {
    display: flex;
    gap: var(--space-md);
    background: linear-gradient(135deg, rgba(92, 107, 192, 0.1), rgba(102, 187, 106, 0.1));
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-top: var(--space-md);
}

.learning-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.learning-text strong {
    display: block;
    color: var(--primary);
    margin-bottom: 4px;
}

.learning-text p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
}

/* 收尾区 */
.ending-section {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.ending-tips {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.ending-tip {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm);
    background: var(--bg-section);
    border-radius: var(--radius-md);
}

.ending-tip .tip-icon {
    font-size: 1.5rem;
}

.ending-tip span:last-child {
    font-size: 0.95rem;
    color: var(--text);
}

/* =====================================================
   锦囊区
   ===================================================== */
.section-tips {
    background: linear-gradient(135deg, var(--gold-light), #FFF8E1);
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.tip-card {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: relative;
}

.tip-number {
    position: absolute;
    top: -15px;
    left: 20px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: var(--shadow-md);
}

.tip-card h4 {
    margin-top: var(--space-sm);
    margin-bottom: var(--space-sm);
    color: var(--text);
    font-size: 1.1rem;
}

.tip-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: var(--space-md);
}

.tip-example {
    background: var(--bg-warm);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.tip-example .example-label {
    font-weight: 600;
    color: var(--text-muted);
    margin-right: var(--space-xs);
}

/* =====================================================
   常见问题区
   ===================================================== */
.section-problems {
    background: var(--bg);
}

.problems-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.problem-flip-card {
    perspective: 1000px;
    height: 280px;
    cursor: pointer;
}

.flip-front, .flip-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: transform 0.6s ease;
    display: flex;
    flex-direction: column;
}

.flip-front {
    background: white;
    box-shadow: var(--shadow-md);
    text-align: center;
    justify-content: center;
    align-items: center;
}

.flip-back {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    transform: rotateY(180deg);
    overflow-y: auto;
}

.problem-flip-card.flipped .flip-front {
    transform: rotateY(-180deg);
}

.problem-flip-card.flipped .flip-back {
    transform: rotateY(0);
}

.flip-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.flip-front h3 {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: var(--space-sm);
}

.flip-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.flip-back h3 {
    font-size: 1rem;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.solution {
    flex: 1;
}

.solution .symptom,
.solution .cause,
.solution .action {
    font-size: 0.9rem;
    margin-bottom: var(--space-sm);
    opacity: 0.95;
}

.solution strong {
    opacity: 0.8;
}

.speech-example {
    background: rgba(255,255,255,0.15);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.speech-example .label {
    display: block;
    font-size: 0.75rem;
    opacity: 0.7;
    margin-bottom: 4px;
}

/* =====================================================
   进阶玩法区
   ===================================================== */
.section-advanced {
    background: var(--bg-section);
}

.difficulty-ladder {
    max-width: 600px;
    margin: 0 auto var(--space-xl);
}

.ladder-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    background: white;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.ladder-item.current {
    border: 2px solid var(--gold);
    box-shadow: var(--shadow-gold);
}

.ladder-level {
    min-width: 60px;
    padding: 6px 12px;
    background: var(--bg-section);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    text-align: center;
}

.ladder-item.current .ladder-level {
    background: var(--gold);
    color: var(--text);
}

.ladder-content h4 {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 4px;
}

.ladder-content p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
}

.ladder-badge {
    position: absolute;
    top: -10px;
    right: var(--space-md);
    background: var(--gold);
    color: var(--text);
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 10px;
    font-weight: 500;
}

.ladder-connector {
    width: 2px;
    height: 24px;
    background: var(--border);
    margin-left: 30px;
}

/* 变体玩法 */
.variants-section {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-xl);
}

.variants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-md);
}

.variant-card {
    padding: var(--space-lg);
    background: var(--bg-warm);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
}

.variant-card h4 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    color: var(--text);
}

.variant-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
}

/* 相关玩法 */
.related-plays {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-xl);
}

.related-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-md);
}

.related-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-section);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.related-card:hover {
    background: var(--primary);
    transform: translateX(4px);
}

.related-card:hover * {
    color: white !important;
}

.related-icon {
    font-size: 2rem;
}

.related-info h4 {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 2px;
}

.related-info p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0;
}

/* 总结卡片 */
.summary-card {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-xl);
}

.summary-card h3 {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: var(--space-lg);
}

.summary-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.summary-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm);
}

.summary-item.success {
    color: var(--positive);
}

.summary-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

/* 最终信息 */
.final-message {
    text-align: center;
    padding: var(--space-xl);
}

.message-lead {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.message-main {
    font-family: 'Noto Serif SC', serif;
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    line-height: 1.8;
    color: var(--text);
}

.message-main strong {
    color: var(--primary);
}

.highlight-word {
    color: var(--gold-dark);
    font-weight: 700;
}

/* =====================================================
   页脚
   ===================================================== */
.footer {
    background: var(--text);
    color: white;
    padding: var(--space-xl) 0;
    text-align: center;
}

.footer p {
    font-size: 1.1rem;
    margin-bottom: var(--space-md);
    opacity: 0.9;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.footer-links a {
    color: white;
    opacity: 0.7;
    text-decoration: none;
    font-size: 0.9rem;
    transition: opacity var(--transition-fast);
}

.footer-links a:hover {
    opacity: 1;
}

/* =====================================================
   响应式设计
   ===================================================== */
@media (max-width: 768px) {
    :root {
        --space-xl: 3rem;
        --space-2xl: 4rem;
    }

    .chapter-nav {
        display: none;
    }

    .contrast-container {
        flex-direction: column;
    }

    .contrast-arrow {
        transform: rotate(90deg);
        align-self: center;
    }

    .roles-container {
        flex-direction: column;
    }

    .role-vs {
        transform: rotate(90deg);
    }

    .step-content {
        padding-left: 0;
    }

    .script-step.highlight-step {
        margin: 0;
        padding: var(--space-lg);
    }

    .dialogue {
        max-width: 95%;
    }

    .problem-flip-card {
        height: auto;
        min-height: 260px;
    }

    .flip-front, .flip-back {
        position: relative;
        transform: none !important;
        backface-visibility: visible;
    }

    .flip-back {
        display: none;
    }

    .problem-flip-card.flipped .flip-front {
        display: none;
    }

    .problem-flip-card.flipped .flip-back {
        display: flex;
    }

    .zones-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .opening-tabs, .branch-tabs {
        flex-direction: column;
    }
}
