/* =====================================================
   算术飞行棋详细玩法 - 样式表
   设计理念：靛蓝紫+星际金，太空探险主题
   ===================================================== */

/* CSS 变量 */
:root {
    /* 主色调 - 太空靛蓝紫 */
    --primary: #6366F1;
    --primary-light: #818CF8;
    --primary-dark: #4F46E5;

    /* 星际金 - 成功/冠军 */
    --gold: #F59E0B;
    --gold-light: #FBBF24;
    --gold-dark: #D97706;

    /* 能量色 - 充电成功 */
    --energy: #10B981;
    --energy-light: #34D399;

    /* 失败色 - 充电失败 */
    --fail: #EF4444;
    --fail-light: #F87171;

    /* 中性色 */
    --bg: #F5F3FF;
    --bg-warm: #EEF2FF;
    --bg-section: #E0E7FF;
    --text: #1E1B4B;
    --text-light: #4338CA;
    --text-muted: #6366F1;
    --border: #C7D2FE;

    /* 间距 */
    --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(99, 102, 241, 0.1);
    --shadow-md: 0 4px 20px rgba(99, 102, 241, 0.15);
    --shadow-lg: 0 8px 40px rgba(99, 102, 241, 0.2);
    --shadow-gold: 0 4px 20px rgba(245, 158, 11, 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(245, 243, 255, 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(99, 102, 241, 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, #1E1B4B 0%, #312E81 50%, #4338CA 100%);
    padding: var(--space-2xl) var(--space-md);
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* 星星装饰 */
.hero::before {
    content: '🚀';
    position: absolute;
    font-size: 100px;
    opacity: 0.15;
    top: 15%;
    left: 8%;
    transform: rotate(-20deg);
    animation: float 6s ease-in-out infinite;
}

.hero::after {
    content: '⭐';
    position: absolute;
    font-size: 60px;
    opacity: 0.2;
    bottom: 20%;
    right: 10%;
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(-20deg); }
    50% { transform: translateY(-20px) rotate(-15deg); }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.1); }
}

.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(--gold), var(--gold-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-gold);
}

.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);
    color: white;
}

.title-line {
    display: block;
}

.title-highlight {
    display: block;
    background: linear-gradient(90deg, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 0.7em;
    margin-top: 0.3em;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.8;
    margin-bottom: var(--space-lg);
}

.hero-subtitle strong {
    color: var(--gold-light);
}

.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: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.meta-item svg {
    width: 18px;
    height: 18px;
}

.hero-cta {
    margin-top: var(--space-lg);
}

.scroll-hint {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-bottom: var(--space-sm);
}

.scroll-arrow {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    color: var(--gold-light);
    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(99, 102, 241, 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, #FECACA, var(--fail));
    color: white;
}

.contrast-card.after .contrast-header {
    background: linear-gradient(135deg, #A7F3D0, var(--energy));
    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(--fail);
    font-weight: bold;
}

.contrast-card.after li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--energy);
    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;
    border: 2px solid var(--primary);
}

.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-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);
}

/* 棋盘示意图 */
.board-demo {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-xl);
}

.board-path-demo {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: var(--space-md);
}

.board-cell {
    width: 60px;
    height: 60px;
    background: var(--bg-section);
    border: 2px solid var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
    text-align: center;
}

.board-cell.start {
    background: linear-gradient(135deg, #60A5FA, #3B82F6);
    color: white;
    border-color: #2563EB;
    font-size: 0.75rem;
}

.board-cell.end {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    color: white;
    border-color: var(--gold-dark);
    font-size: 0.75rem;
}

.ships-demo {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-top: var(--space-md);
}

.ship {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.ship.flash {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.ship.snail {
    background: rgba(245, 158, 11, 0.1);
    color: var(--gold-dark);
}

/* 角色介绍 */
.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: 2rem;
    flex-shrink: 0;
}

.kid-role .role-avatar {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.mom-role .role-avatar {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
}

.role-info h4 {
    font-size: 1rem;
    margin-bottom: 2px;
}

.role-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.kid-role .role-name {
    color: var(--primary);
}

.mom-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: 1.5rem;
    font-weight: 700;
    color: var(--text-muted);
}

/* =====================================================
   对话脚本区
   ===================================================== */
.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(99, 102, 241, 0.05), rgba(245, 158, 11, 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(99, 102, 241, 0.1), rgba(16, 185, 129, 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(--energy);
    color: white;
}

.step-tag.speed {
    background: #F97316;
    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: #FEF3C7;
    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(--gold-dark);
    text-align: right;
}

.dialogue.child .speaker {
    color: var(--primary);
}

.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: #FEF3C7;
    border-bottom-right-radius: 4px;
}

/* 孩子气泡 */
.dialogue.child .bubble {
    background: #EEF2FF;
    border-bottom-left-radius: 4px;
}

.dialogue .bubble.error {
    background: #FEE2E2;
    border: 1px solid var(--fail-light);
}

.dialogue .bubble.success {
    background: #D1FAE5;
    border: 1px solid var(--energy-light);
}

.dialogue .bubble.shout {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
}

.face-note {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 区域指示器 */
.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, #D1FAE5, #A7F3D0);
}

.zone-indicator.practice {
    background: linear-gradient(135deg, #FEE2E2, #FECACA);
}

.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(--energy);
    background: #D1FAE5;
}

.tip-box.gold {
    border-left-color: var(--gold);
    background: #FEF3C7;
}

.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, #F97316, #EA580C);
    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(99, 102, 241, 0.1), rgba(16, 185, 129, 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), #FEF3C7);
}

.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(--energy);
}

.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;
    }

    .board-path-demo {
        gap: 4px;
    }

    .board-cell {
        width: 50px;
        height: 50px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .opening-tabs, .branch-tabs {
        flex-direction: column;
    }
}
