/* ========== 全局变量 ========== */
:root {
    /* 浅色主题 */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    
    --bg-color: #f8fafc;
    --bg-secondary: #ffffff;
    --text-color: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    --transition: all 0.3s ease;
}

/* 深色主题 */
body.dark-theme {
    --bg-color: #0f172a;
    --bg-secondary: #1e293b;
    --text-color: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
}

/* ========== 顶部导航栏 ========== */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    transition: var(--transition);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.nav-brand i {
    font-size: 1.5rem;
}

.nav-progress {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}

.progress-text {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 999px;
    overflow: hidden;
}

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

.nav-actions {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-color);
    color: var(--text-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1.125rem;
}

.nav-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* ========== 快速导航 ========== */
.quick-nav {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    z-index: 999;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.quick-nav-item {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.quick-nav-item:hover {
    background: var(--primary-color);
    color: white;
}

/* ========== 主容器 ========== */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 160px 1.5rem 3rem;
}

/* ========== 介绍部分 ========== */
.intro-section {
    margin-bottom: 3rem;
}

.hero {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-xl);
    color: white;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.hero i {
    font-size: 2rem;
    margin-right: 0.5rem;
}

.subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
}

.info-card, .warning-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.info-card h2, .warning-card h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.info-list {
    list-style: none;
}

.info-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.info-list li:last-child {
    border-bottom: none;
}

.info-list i {
    color: var(--primary-color);
    margin-top: 0.25rem;
}

.warning-card {
    border-left: 4px solid var(--warning-color);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(251, 191, 36, 0.1));
}

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

/* ========== 工作手册部分 ========== */
.workbook-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.part1 { border-top: 4px solid #f59e0b; }
.part2 { border-top: 4px solid #3b82f6; }
.part3 { border-top: 4px solid #8b5cf6; }
.part4 { border-top: 4px solid #ec4899; }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.75rem;
}

.collapse-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-color);
    color: var(--text-color);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.collapse-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: rotate(180deg);
}

.collapse-btn.collapsed i {
    transform: rotate(180deg);
}

.section-content {
    transition: var(--transition);
}

.section-content.collapsed {
    display: none;
}

/* ========== 子部分 ========== */
.subsection {
    margin-bottom: 2.5rem;
}

.subsection-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.subsection-desc {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
}

/* ========== 问题卡片 ========== */
.question-card {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.question-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.question-card.highlight {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-color: var(--primary-color);
}

.question-card.goal-card {
    border-left: 4px solid var(--success-color);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.question-number {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.question-check {
    color: var(--border-color);
    font-size: 1.25rem;
    transition: var(--transition);
}

.question-card.completed .question-check {
    color: var(--success-color);
}

.question-label {
    display: block;
    font-weight: 500;
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text-color);
}

.question-input {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    background: var(--bg-secondary);
    color: var(--text-color);
    resize: vertical;
    transition: var(--transition);
}

.question-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.question-input.small {
    font-size: 0.875rem;
}

/* ========== 提醒网格 ========== */
.reminder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.reminder-card {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.reminder-card:hover {
    border-color: var(--info-color);
    box-shadow: var(--shadow-md);
}

.reminder-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--info-color);
    margin-bottom: 0.75rem;
}

.reminder-question {
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--text-color);
    line-height: 1.5;
}

.bonus-questions {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-top: 2rem;
}

.bonus-questions h4 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--info-color);
}

/* ========== 游戏化框架 ========== */
.game-framework {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.game-card {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.game-card.anti-vision {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
    border-color: var(--danger-color);
}

.game-card.vision {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
    border-color: var(--success-color);
}

.game-card.year-goal {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.1));
    border-color: var(--info-color);
}

.game-card.month-project {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.1));
    border-color: var(--warning-color);
}

.game-card.daily-levers {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(124, 58, 237, 0.1));
    border-color: var(--secondary-color);
}

.game-card.constraints {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(79, 70, 229, 0.1));
    border-color: var(--primary-color);
}

.game-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.game-card.anti-vision .game-icon { color: var(--danger-color); }
.game-card.vision .game-icon { color: var(--success-color); }
.game-card.year-goal .game-icon { color: var(--info-color); }
.game-card.month-project .game-icon { color: var(--warning-color); }
.game-card.daily-levers .game-icon { color: var(--secondary-color); }
.game-card.constraints .game-icon { color: var(--primary-color); }

.game-card h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.game-mapping {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-style: italic;
}

.game-explanation {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary-color);
}

.game-explanation h4 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.game-explanation ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.game-explanation li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.highlight-text {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
    font-weight: 500;
}

/* ========== 完成部分 ========== */
.completion-section {
    margin-top: 3rem;
}

.completion-card {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    padding: 3rem;
    border-radius: var(--radius-xl);
    text-align: center;
    box-shadow: var(--shadow-xl);
}

.completion-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.completion-card h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.completion-card p {
    margin-bottom: 1rem;
    font-size: 1.125rem;
    opacity: 0.95;
}

.completion-card ul {
    text-align: left;
    max-width: 600px;
    margin: 1.5rem auto;
    padding-left: 1.5rem;
}

.completion-card li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* ========== 按钮样式 ========== */
.btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

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

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
}

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

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* ========== 页脚 ========== */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 3rem;
}

.footer p {
    margin-bottom: 0.5rem;
}

/* ========== 自动保存提示 ========== */
.save-indicator {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--success-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: none;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.save-indicator.show {
    display: flex;
}

/* ========== 模态框 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header.warning {
    background: rgba(245, 158, 11, 0.1);
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

.modal-body {
    padding: 1.5rem;
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.export-btn {
    padding: 1rem;
    border: 2px solid var(--border-color);
    background: var(--bg-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1rem;
    color: var(--text-color);
}

.export-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

.export-btn i {
    font-size: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-progress {
        width: 100%;
        max-width: none;
    }
    
    .quick-nav {
        top: auto;
        position: relative;
        margin-top: 80px;
    }
    
    .container {
        padding-top: 100px;
    }
    
    .section-header h2 {
        font-size: 1.25rem;
    }
    
    .reminder-grid {
        grid-template-columns: 1fr;
    }
    
    .game-framework {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========== 打印样式 ========== */
@media print {
    .top-nav,
    .quick-nav,
    .nav-actions,
    .collapse-btn,
    .save-indicator,
    .action-buttons,
    .modal {
        display: none !important;
    }
    
    .container {
        padding-top: 0;
        max-width: 100%;
    }
    
    .workbook-section {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .question-card {
        page-break-inside: avoid;
    }
}

/* ========== 平滑滚动 ========== */
html {
    scroll-behavior: smooth;
}

/* ========== 选中文本样式 ========== */
::selection {
    background: var(--primary-color);
    color: white;
}

/* ========== 滚动条样式 ========== */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}
