/* Claude Code 教程网站 - 主样式 */

/* ==================== CSS 变量 ==================== */
:root {
    /* 基础颜色 */
    --primary-color: #7c3aed;
    --primary-light: #a78bfa;
    --primary-dark: #5b21b6;
    --secondary-color: #06b6d4;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;

    /* 背景色 */
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #0f172a;
    --bg-code: #1e1e1e;
    --bg-hover: #334155;

    /* 文字颜色 */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* 边框颜色 */
    --border-color: #334155;

    /* 渐变色 */
    --gradient-primary: linear-gradient(135deg, #7c3aed 0%, #a78bfa 50%, #06b6d4 100%);
    --gradient-purple: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    --gradient-cyan: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-card: linear-gradient(145deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
    --gradient-hero: radial-gradient(ellipse at top, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
                    radial-gradient(ellipse at bottom right, rgba(6, 182, 212, 0.1) 0%, transparent 50%);

    /* 阴影系统 */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 6px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.4), 0 10px 20px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.4), 0 4px 12px rgba(124, 58, 237, 0.3);
    --shadow-glow-cyan: 0 0 20px rgba(6, 182, 212, 0.4), 0 4px 12px rgba(6, 182, 212, 0.3);
    --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.05);

    /* 玻璃态效果 */
    --glass-bg: rgba(30, 41, 59, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(12px);

    /* 动画缓动函数 */
    --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* 字体 */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', sans-serif;
    --font-mono: 'Consolas', 'Monaco', 'Courier New', monospace;

    /* 尺寸 */
    --sidebar-width: 280px;
    --header-height: 60px;
}

/* ==================== 全局重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 16px;
    position: relative;
    overflow-x: hidden;
}

/* 动态背景效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-hero);
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

/* 背景网格 */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(124, 58, 237, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 58, 237, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

.app-container {
    position: relative;
    z-index: 1;
}

body.no-scroll {
    overflow: hidden;
}

:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.2s;
    position: relative;
}

a:hover {
    color: var(--primary-color);
}

/* 链接下划线动画 */
.article-content a {
    color: var(--primary-light);
    text-decoration: none;
    background: linear-gradient(to right, var(--primary-color), var(--primary-color));
    background-size: 0 2px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size 0.3s var(--ease-out);
}

.article-content a:hover {
    background-size: 100% 2px;
}

/* ==================== 图标与无障碍 ==================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.icon {
    width: 1em;
    height: 1em;
    fill: currentColor;
    flex: 0 0 auto;
}

.icon-sm {
    width: 16px;
    height: 16px;
}

.icon-xs {
    width: 14px;
    height: 14px;
}

/* ==================== 布局容器 ==================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ==================== 侧边栏 ==================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.sidebar-header .logo-text {
    font-size: 16px;
    font-weight: 600;
}

.sidebar-search {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-box .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.nav-section {
    padding: 12px 0;
}

.nav-section-title {
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    border-left: 3px solid transparent;
    position: relative;
}

/* 悬停背景渐变效果 */
.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gradient-primary);
    transform: scaleY(0);
    transition: transform 0.3s var(--ease-out);
}

.nav-item:focus-visible {
    background: rgba(124, 58, 237, 0.08);
    color: var(--text-primary);
}

.nav-item:hover {
    background: rgba(124, 58, 237, 0.08);
    color: var(--text-primary);
    padding-left: 24px;
}

.nav-item:hover::before {
    transform: scaleY(1);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.15), transparent);
    color: var(--primary-light);
}

.nav-item.active::before {
    transform: scaleY(1);
}

/* 完成状态动画 */
.nav-item.completed .nav-icon {
    color: var(--success-color);
}

.nav-item.completed .nav-icon svg {
    animation: checkPop 0.4s var(--ease-spring);
}

@keyframes checkPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.nav-item .nav-icon {
    margin-right: 10px;
    width: 18px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-item .nav-text {
    flex: 1;
}

.nav-item .nav-badge {
    font-size: 11px;
    padding: 2px 6px;
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
}

.sub-nav {
    margin-left: 20px;
    border-left: 1px solid var(--border-color);
}

.sub-nav .nav-item {
    padding-left: 16px;
    font-size: 14px;
}

/* ==================== 主内容区 ==================== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
}

/* ==================== 顶部导航 ==================== */
.top-nav {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.menu-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.breadcrumb {
    font-size: 14px;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb a:hover {
    color: var(--primary-light);
}

.breadcrumb .separator {
    margin: 0 8px;
    color: var(--text-muted);
}

.breadcrumb .current {
    color: var(--text-primary);
}

.top-nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.progress-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.progress-bar {
    width: 120px;
    height: 8px;
    background: var(--bg-hover);
    border-radius: var(--radius-full);
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.6s var(--ease-smooth);
    position: relative;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
}

/* 进度条动画光效 */
.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ==================== 内容区域 ==================== */
.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

/* ==================== 本页目录（TOC） ==================== */
.toc-panel {
    position: fixed;
    top: calc(var(--header-height) + 16px);
    right: 18px;
    width: 260px;
    max-height: calc(100vh - var(--header-height) - 32px);
    padding: 14px 12px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-lg);
    overflow: auto;
    z-index: 60;
    display: none;
}

.toc-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 4px 6px 10px;
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toc-item {
    display: block;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.35;
    transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out), transform 0.15s var(--ease-out);
    border-left: 2px solid transparent;
}

.toc-item:hover {
    background: rgba(148, 163, 184, 0.10);
    color: var(--text-primary);
}

.toc-item.active {
    background: rgba(124, 58, 237, 0.14);
    color: var(--primary-light);
    border-left-color: var(--primary-color);
}

.toc-item.level-3 {
    padding-left: 20px;
    font-size: 12px;
    color: var(--text-muted);
}

/* 仅在超宽屏显示 TOC，避免遮挡正文 */
@media (min-width: 1280px) {
    .has-toc .toc-panel {
        display: block;
    }
}

/* ==================== 本页阅读进度 ==================== */
.reading-indicator {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    min-width: 220px;
}

.reading-meta {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.reading-bar {
    width: 220px;
    height: 6px;
    background: var(--bg-hover);
    border-radius: var(--radius-full);
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.reading-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-cyan);
    border-radius: var(--radius-full);
    transition: width 0.15s linear;
}

@media (max-width: 768px) {
    .reading-indicator {
        display: none;
    }
}

/* ==================== 首页 ==================== */
.hero-section {
    text-align: center;
    padding: 80px 20px 60px;
    position: relative;
}

/* Hero 背景动画 */
.hero-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse 8s ease-in-out infinite;
    pointer-events: none;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 30%;
    right: 10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 12s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.3; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-30px); }
}

.hero-title {
    font-size: 52px;
    font-weight: 800;
    margin-bottom: 24px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    letter-spacing: -1px;
    animation: slideUp 0.8s var(--ease-out);
}

/* 标题文字阴影效果 */
.hero-title::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    z-index: -1;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: blur(20px);
    opacity: 0.4;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    animation: slideUp 0.8s var(--ease-out) 0.2s both;
}

.hero-badges {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    animation: slideUp 0.8s var(--ease-out) 0.4s both;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    transition: all 0.3s var(--ease-out);
}

.badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
    border-color: rgba(16, 185, 129, 0.4);
}

.badge-success:hover {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 60px;
    animation: slideUp 0.8s var(--ease-out) 0.6s both;
}

/* 主要按钮呼吸效果 */
.btn-primary {
    animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { box-shadow: var(--shadow-md), 0 0 0 1px rgba(124, 58, 237, 0.3) inset; }
    50% { box-shadow: var(--shadow-glow), 0 0 0 1px rgba(124, 58, 237, 0.5) inset; }
}

.btn-primary:hover {
    animation: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gradient-purple);
    color: white;
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(124, 58, 237, 0.3) inset;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm), var(--shadow-inset);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    background: rgba(124, 58, 237, 0.15);
    transform: translateY(-1px);
    box-shadow: var(--shadow), 0 0 0 1px rgba(124, 58, 237, 0.2) inset;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fecaca;
    border: 1px solid rgba(239, 68, 68, 0.4);
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
    border-color: rgba(239, 68, 68, 0.6);
    background: rgba(239, 68, 68, 0.2);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

/* 按钮图标悬停旋转 */
.btn:hover .icon {
    transform: scale(1.1);
}

.btn .icon {
    transition: transform 0.3s var(--ease-spring);
}

/* ==================== 学习路径 ==================== */
.path-section {
    margin-bottom: 60px;
}

.section-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title .section-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.chapter-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: all 0.4s var(--ease-out);
    position: relative;
    overflow: hidden;
}

/* 渐变边框效果 */
.chapter-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: var(--gradient-primary);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s;
}

/* 左侧高亮条 */
.chapter-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.4s;
}

/* 发光背景效果 */
.chapter-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-xl), 0 0 30px rgba(124, 58, 237, 0.2);
    border-color: transparent;
}

.chapter-card:hover::before {
    opacity: 1;
}

.chapter-card:hover::after {
    opacity: 1;
}

.chapter-card:focus-visible {
    outline: none;
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
}

/* 卡片内部发光 */
.chapter-card .chapter-number {
    position: relative;
    z-index: 1;
}

.chapter-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.chapter-number {
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    background: var(--gradient-purple);
    color: white;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.chapter-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.chapter-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.chapter-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.chapter-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==================== 文章页面 ==================== */
.article-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.article-breadcrumb {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.article-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
}

.article-meta {
    display: flex;
    gap: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

.article-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ==================== 文章内容 ==================== */
.article-content {
    font-size: 17px;
    line-height: 1.8;
}

.article-content h2 {
    font-size: 28px;
    font-weight: 600;
    margin: 48px 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
}

.article-content h3 {
    font-size: 22px;
    font-weight: 600;
    margin: 36px 0 16px;
    color: var(--text-primary);
}

.article-content h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 28px 0 12px;
    color: var(--text-secondary);
}

.article-content p {
    margin-bottom: 16px;
}

/* ==================== 小测/自检 ==================== */
.quiz {
    margin: 40px 0;
    padding: 24px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.quiz-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.quiz-hint {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.quiz details {
    padding: 14px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
}

.quiz details:first-of-type {
    border-top: none;
}

.quiz details:hover {
    background: rgba(124, 58, 237, 0.05);
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
    border-radius: var(--radius-md);
}

.quiz summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
    outline: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color 0.2s;
}

.quiz summary:hover {
    color: var(--primary-light);
}

.quiz summary::-webkit-details-marker {
    display: none;
}

.quiz summary::before {
    content: 'Q';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gradient-purple);
    color: white;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.quiz .quiz-answer {
    margin-top: 12px;
    padding-left: 34px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.quiz .quiz-answer code {
    font-family: var(--font-mono);
    background: rgba(124, 58, 237, 0.15);
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(124, 58, 237, 0.3);
    color: var(--primary-light);
}

.article-content a {
    color: var(--primary-light);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-content ul,
.article-content ol {
    margin-bottom: 20px;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content code {
    background: var(--bg-hover);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: #e2e8f0;
}

.article-content pre {
    background: var(--bg-code);
    padding: 20px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.article-content pre code {
    background: none;
    padding: 0;
    color: #d4d4d4;
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 20px;
    margin: 24px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.article-content th,
.article-content td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.article-content th {
    background: var(--bg-hover);
    font-weight: 600;
    color: var(--text-primary);
}

.article-content tr:last-child td {
    border-bottom: none;
}

.article-content img {
    max-width: 100%;
    border-radius: var(--radius-md);
    margin: 24px 0;
}

/* ==================== 提示框 ==================== */
.alert {
    padding: 18px 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    border-left: 4px solid;
    backdrop-filter: var(--glass-blur);
    transition: all 0.3s var(--ease-out);
    position: relative;
    overflow: hidden;
}

/* 提示框内部发光效果 */
.alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    opacity: 0.8;
}

.alert-info {
    background: rgba(6, 182, 212, 0.12);
    border-color: var(--secondary-color);
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.15);
}

.alert-info::before { background: var(--secondary-color); }

.alert-success {
    background: rgba(16, 185, 129, 0.12);
    border-color: var(--success-color);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15);
}

.alert-success::before { background: var(--success-color); }

.alert-warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: var(--warning-color);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15);
}

.alert-warning::before { background: var(--warning-color); }

.alert-danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: var(--danger-color);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.15);
}

.alert-danger::before { background: var(--danger-color); }

.alert:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-lg);
}

.alert-title {
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-info .alert-title { color: var(--secondary-color); }
.alert-success .alert-title { color: var(--success-color); }
.alert-warning .alert-title { color: var(--warning-color); }
.alert-danger .alert-title { color: var(--danger-color); }

/* ==================== 代码块语法高亮 ==================== */
/* 代码块容器 */
.code-block-wrapper {
    position: relative;
    margin-bottom: 24px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(180deg, #2d2d2d 0%, #252525 100%);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

/* Mac 风格窗口按钮 */
.code-header::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 8px;
}

.code-header-mac {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 8px;
}

.code-header-mac span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.code-header-mac span:nth-child(1) {
    background: #ff5f57;
}

.code-header-mac span:nth-child(2) {
    background: #febc2e;
}

.code-header-mac span:nth-child(3) {
    background: #28c840;
}

.code-header + pre {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-top: 0;
    border: none;
}

/* 有 Mac 按钮时调整语言标签位置 */
.code-header:has(.code-header-mac) .code-lang {
    margin-left: 60px;
}

.code-header + pre {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-top: 0;
}

.code-lang {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.code-copy {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.3s var(--ease-out);
    display: flex;
    align-items: center;
    gap: 6px;
}

.code-copy:hover {
    color: var(--text-primary);
    background: rgba(124, 58, 237, 0.2);
    border-color: rgba(124, 58, 237, 0.4);
    transform: scale(1.05);
}

.code-copy:active {
    transform: scale(0.95);
}

/* ==================== 任务清单 ==================== */
.checklist {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

.checklist-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.checklist-item:hover {
    background: rgba(124, 58, 237, 0.05);
}

.checklist-item:last-child {
    border-bottom: none;
}

.checklist-item input[type="checkbox"] {
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.3s var(--ease-spring);
    flex-shrink: 0;
    margin-top: 2px;
}

.checklist-item input[type="checkbox"]:hover {
    border-color: var(--primary-color);
}

.checklist-item input[type="checkbox"]:checked {
    background: var(--gradient-purple);
    border-color: var(--primary-color);
}

.checklist-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ==================== 下一章导航 ==================== */
.chapter-nav {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.chapter-nav-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.chapter-nav-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.chapter-nav-card .icon {
    color: var(--primary-light);
    width: 24px;
    height: 24px;
}

.chapter-nav-card .content {
    flex: 1;
}

.chapter-nav-card .label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.chapter-nav-card .title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.chapter-nav-card.next {
    text-align: right;
}

.chapter-nav-card.next {
    flex-direction: row-reverse;
}

/* ==================== 页脚 ==================== */
.footer {
    margin-top: 80px;
    padding: 40px 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 20px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 14px;
}

.footer-links a:hover {
    color: var(--primary-light);
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 13px;
}

/* ==================== 响应式 ==================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .chapter-grid {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 36px;
    }

    .chapter-nav {
        flex-direction: column;
    }

    .chapter-nav-card.next {
        flex-direction: row;
    }
}

@media (max-width: 640px) {
    .content-wrapper {
        padding: 24px 16px 60px;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .article-title {
        font-size: 24px;
    }

    .article-content {
        font-size: 16px;
    }

    .article-content h2 {
        font-size: 22px;
    }

    .article-content h3 {
        font-size: 18px;
    }

    .top-nav {
        padding: 0 16px;
    }

    .progress-indicator {
        display: none;
    }
}

/* ==================== 滚动条样式 ==================== */
.sidebar::-webkit-scrollbar,
.article-content pre::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track,
.article-content pre::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==================== 遮罩层 ==================== */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
}

.overlay.show {
    display: block;
}

/* ==================== 操作系统切换（隐藏不相关步骤） ==================== */
.os-hidden {
    display: none !important;
}

.os-switcher {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    margin: 16px 0;
    flex-wrap: wrap;
}

.os-switcher .os-switcher-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.os-switcher .os-switcher-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.os-btn {
    appearance: none;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.os-btn:hover {
    border-color: var(--primary-color);
}

.os-btn.active {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ==================== 动画 ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 滚动淡入动画 */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 交错延迟 */
.fade-in.stagger-1 { transition-delay: 0.1s; }
.fade-in.stagger-2 { transition-delay: 0.2s; }
.fade-in.stagger-3 { transition-delay: 0.3s; }
.fade-in.stagger-4 { transition-delay: 0.4s; }

.article-content > * {
    animation: fadeIn 0.5s ease;
}

/* ==================== 返回顶部按钮 ==================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s var(--ease-out);
    z-index: 90;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.back-to-top:active {
    transform: translateY(-2px);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
    color: white;
    transition: transform 0.3s var(--ease-spring);
}

.back-to-top:hover svg {
    transform: translateY(-3px);
}

/* ==================== 图片样式 ==================== */
/* Hero横幅图 */
.hero-banner {
    width: 100%;
    height: 320px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 40px;
    position: relative;
    box-shadow: var(--shadow-xl);
}

.hero-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out);
}

.hero-banner:hover img {
    transform: scale(1.05);
}

/* 章节配图 */
.section-image {
    width: 100%;
    max-width: 800px;
    border-radius: var(--radius-lg);
    margin: 32px auto;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.section-image img {
    width: 100%;
    height: auto;
    display: block;
}

.section-image-caption {
    padding: 12px 16px;
    background: var(--bg-card);
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    border-top: 1px solid var(--border-color);
}

/* 卡片装饰图 */
.card-decoration {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    opacity: 0.15;
    transition: opacity 0.3s;
}

.chapter-card:hover .card-decoration {
    opacity: 0.25;
}

.card-decoration img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 行内插图 */
.inline-image {
    display: inline-block;
    vertical-align: middle;
    margin: 0 8px;
    border-radius: var(--radius-sm);
}

/* 提示框图标插图 */
.alert-icon-img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    margin-right: 12px;
    vertical-align: middle;
    object-fit: cover;
}

/* 准备工作插图 */
.prep-image {
    width: 100%;
    max-width: 400px;
    border-radius: var(--radius-md);
    margin: 16px auto;
    display: block;
    box-shadow: var(--shadow);
}

/* 响应式图片 */
@media (max-width: 768px) {
    .hero-banner {
        height: 200px;
    }

    .section-image {
        margin: 24px -16px;
        border-radius: 0;
    }

    .card-decoration {
        width: 36px;
        height: 36px;
    }
}

/* ==================== 打印样式 ==================== */
@media print {
    .sidebar,
    .top-nav,
    .chapter-nav,
    .footer,
    .demo-container,
    .floating-help-btn {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .article-content {
        color: #000;
    }

    .article-content pre {
        background: #f5f5f5;
        border: 1px solid #ddd;
    }

    .article-content code {
        background: #f5f5f5;
        color: #333;
    }
}

/* ==================== 演示区域（视频/GIF） ==================== */
.demo-container {
    margin: 32px 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
}

.demo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15) 0%, rgba(6, 182, 212, 0.15) 100%);
    border-bottom: 1px solid var(--border-color);
}

.demo-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-light);
}

.demo-title .demo-badge {
    font-size: 11px;
    padding: 4px 10px;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-full);
    font-weight: 500;
}

.demo-duration {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.demo-content {
    position: relative;
    background: #000;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.demo-content img,
.demo-content video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.demo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
}

.demo-placeholder-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(124, 58, 237, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.demo-placeholder-icon svg {
    width: 40px;
    height: 40px;
    color: var(--primary-light);
}

.demo-placeholder-text {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.demo-placeholder-hint {
    font-size: 13px;
    color: var(--text-muted);
}

.demo-caption {
    padding: 14px 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.demo-caption strong {
    color: var(--text-primary);
}

/* 内联演示（较小的版本） */
.demo-inline {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin: 0 8px;
    vertical-align: middle;
}

.demo-inline-thumbnail {
    width: 60px;
    height: 34px;
    background: #000;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.demo-inline-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.demo-inline-text {
    font-size: 13px;
    color: var(--primary-light);
    text-decoration: underline;
    cursor: pointer;
}

/* ==================== 浮动帮助按钮 ==================== */
.floating-help-btn {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-xl), 0 0 30px rgba(124, 58, 237, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s var(--ease-out);
    z-index: 95;
}

.floating-help-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.floating-help-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: var(--shadow-glow);
}

.floating-help-btn:active {
    transform: translateY(-2px);
}

.floating-help-btn svg {
    width: 28px;
    height: 28px;
    color: white;
}

.floating-help-btn .help-tooltip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    white-space: nowrap;
    font-size: 14px;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.floating-help-btn:hover .help-tooltip {
    opacity: 1;
    visibility: visible;
}

.floating-help-btn .help-tooltip::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-left-color: var(--border-color);
}

.floating-help-btn .help-tooltip::before {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-left-color: var(--bg-card);
}

/* ==================== 下载引导图（带标注） ==================== */
.download-guide {
    margin: 32px 0;
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.download-guide-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.download-guide-content {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.download-guide-content img {
    width: 100%;
    height: auto;
    display: block;
}

.download-guide-annotation {
    position: absolute;
    background: rgba(239, 68, 68, 0.95);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: bounce 2s infinite;
}

.download-guide-annotation::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 10px solid transparent;
}

.download-guide-annotation.arrow-top::after {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: rgba(239, 68, 68, 0.95);
}

.download-guide-annotation.arrow-bottom::after {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: rgba(239, 68, 68, 0.95);
}

.download-guide-annotation.arrow-left::after {
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-left-color: rgba(239, 68, 68, 0.95);
}

.download-guide-annotation.arrow-right::after {
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-right-color: rgba(239, 68, 68, 0.95);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.download-guide-steps {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.download-guide-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(124, 58, 237, 0.08);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary-color);
}

.download-guide-step-number {
    width: 24px;
    height: 24px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.download-guide-step-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==================== 术语卡片 ==================== */
.term-card {
    position: relative;
    display: inline;
    cursor: help;
    border-bottom: 1px dashed var(--primary-light);
    color: var(--primary-light);
    transition: all 0.2s;
}

.term-card:hover {
    background: rgba(124, 58, 237, 0.15);
    color: var(--primary-color);
}

.term-card-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-secondary);
    box-shadow: var(--shadow-xl);
    min-width: 200px;
    max-width: 300px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 100;
    line-height: 1.6;
}

.term-card:hover .term-card-tooltip {
    opacity: 1;
    visibility: visible;
}

.term-card-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--bg-card);
}

.term-card-tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--border-color);
}

/* ==================== 自测题（改进版） ==================== */
.self-quiz {
    margin: 40px 0;
    padding: 28px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(6, 182, 212, 0.08) 100%);
    border: 2px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.self-quiz-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
}

.self-quiz-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--success-color);
}

.self-quiz-hint {
    margin-left: auto;
    font-size: 13px;
    color: var(--text-muted);
}

.self-quiz-question {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.self-quiz-question-text {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.self-quiz-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.self-quiz-option {
    padding: 12px 16px;
    background: var(--bg-hover);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.self-quiz-option:hover {
    background: rgba(124, 58, 237, 0.1);
    border-color: rgba(124, 58, 237, 0.3);
}

.self-quiz-option.correct {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--success-color);
    color: var(--success-color);
}

.self-quiz-option.wrong {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.self-quiz-option-letter {
    width: 24px;
    height: 24px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.self-quiz-option.correct .self-quiz-option-letter {
    background: var(--success-color);
    color: white;
}

.self-quiz-option.wrong .self-quiz-option-letter {
    background: var(--danger-color);
    color: white;
}

.self-quiz-feedback {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    display: none;
}

.self-quiz-feedback.show {
    display: block;
}

.self-quiz-feedback.correct {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.self-quiz-feedback.wrong {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
}

.self-quiz-result {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    text-align: center;
    display: none;
}

.self-quiz-result.show {
    display: block;
}

.self-quiz-result-score {
    font-size: 32px;
    font-weight: 700;
    background: var(--gradient-success);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.self-quiz-result-text {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ==================== 学习路线图 ==================== */
.roadmap-container {
    margin: 40px 0;
    padding: 32px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.roadmap-header {
    text-align: center;
    margin-bottom: 32px;
}

.roadmap-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.roadmap-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

.roadmap-timeline {
    position: relative;
    padding-left: 40px;
}

.roadmap-timeline::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color), var(--success-color));
    border-radius: 2px;
}

.roadmap-item {
    position: relative;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
}

.roadmap-item::before {
    content: '';
    position: absolute;
    left: -31px;
    top: 20px;
    width: 12px;
    height: 12px;
    background: var(--bg-body);
    border: 3px solid var(--primary-color);
    border-radius: 50%;
}

.roadmap-item.completed::before {
    background: var(--success-color);
    border-color: var(--success-color);
}

.roadmap-item.current {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}

.roadmap-item.current::before {
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

.roadmap-item:hover {
    transform: translateX(4px);
    border-color: var(--primary-light);
}

.roadmap-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.roadmap-item-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 新版路线图项目标题 */
.roadmap-items .roadmap-item-title {
    font-size: 15px;
    margin-bottom: 4px;
}

.roadmap-item-time {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-hover);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.roadmap-item-desc {
    font-size: 14px;
    color: var(--text-secondary);
}

.roadmap-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.roadmap-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.roadmap-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* ==================== 路线图增强样式 ==================== */
/* 新版路线图不使用时间轴标记 */
.roadmap-items .roadmap-item::before {
    display: none;
}

.roadmap-items .roadmap-item {
    margin-bottom: 0;
}

.roadmap-phase {
    margin-bottom: 40px;
}

.roadmap-phase:last-child {
    margin-bottom: 0;
}

.roadmap-phase-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.roadmap-phase-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.roadmap-phase-time {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-hover);
    padding: 6px 14px;
    border-radius: var(--radius-full);
}

.roadmap-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.roadmap-item-marker {
    width: 40px;
    height: 40px;
    background: var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s;
}

.roadmap-item-marker svg {
    width: 20px;
    height: 20px;
    color: white;
}

.roadmap-item-content {
    flex: 1;
    min-width: 0;
}

.roadmap-item-meta {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.roadmap-item-difficulty {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: var(--bg-hover);
    color: var(--text-muted);
}

.roadmap-item-difficulty:contains("简单") {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.roadmap-item-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all 0.2s;
    flex-shrink: 0;
}

.roadmap-item-link:hover {
    background: var(--primary-color);
    color: white;
}

/* 路线图进度 */
.roadmap-progress {
    margin-top: 32px;
    padding: 24px;
    background: var(--bg-hover);
    border-radius: var(--radius-md);
}

.roadmap-progress h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.roadmap-progress-bar {
    height: 10px;
    background: var(--bg-body);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 16px;
}

.roadmap-progress-fill {
    height: 100%;
    background: var(--gradient-success);
    border-radius: var(--radius-full);
    transition: width 0.5s ease-out;
}

.roadmap-progress-stats {
    display: flex;
    gap: 32px;
}

.roadmap-progress-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.roadmap-progress-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

.roadmap-progress-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* 路线图操作区 */
.roadmap-actions {
    margin-top: 32px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
    border-radius: var(--radius-lg);
    text-align: center;
}

.roadmap-actions h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
}

/* 响应式 */
@media (max-width: 768px) {
    .roadmap-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .roadmap-item-link {
        align-self: flex-end;
    }

    .roadmap-phase-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ==================== 字体大小调节 ==================== */
.font-size-controls {
    position: fixed;
    bottom: 30px;
    left: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    z-index: 90;
}

.font-size-controls button {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-hover);
    color: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.font-size-controls button:hover {
    background: var(--primary-color);
    color: white;
}

.font-size-controls .font-size-display {
    font-size: 12px;
    color: var(--text-muted);
    padding: 0 8px;
    min-width: 40px;
    text-align: center;
}

/* ==================== 下载引导视觉组件 ==================== */
.download-guide-visual {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

/* Node.js 页面模拟 */
.nodejs-page-mockup {
    width: 100%;
    max-width: 580px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.nodejs-header {
    background: #333;
    color: white;
    padding: 10px 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nodejs-header::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #ff5f57;
    border-radius: 50%;
    box-shadow: 20px 0 0 #ffbd2e, 40px 0 0 #28c940;
}

.nodejs-hero {
    background: linear-gradient(135deg, #68a063 0%, #4d7c46 100%);
    padding: 32px 24px;
    text-align: center;
    color: white;
}

.nodejs-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.nodejs-subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.nodejs-download-section {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg-hover);
}

.nodejs-download-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
}

.nodejs-lts {
    border: 2px solid #68a063;
    background: linear-gradient(135deg, rgba(104, 160, 99, 0.1) 0%, rgba(77, 124, 70, 0.05) 100%);
}

.nodejs-current {
    border: 1px solid var(--border-color);
    opacity: 0.7;
}

.nodejs-badge {
    position: absolute;
    top: -10px;
    left: 16px;
    background: #68a063;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.nodejs-badge-current {
    position: absolute;
    top: -10px;
    left: 16px;
    background: var(--text-muted);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.nodejs-version {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.nodejs-download-btn {
    background: #68a063;
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.nodejs-download-btn .nodejs-windows-icon {
    width: 18px;
    height: 18px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M0 3.449L9.75 2.1v9.451H0m10.949-9.602L24 0v11.4H10.949M0 12.6h9.75v9.451L0 20.699M10.949 12.6H24V24l-12.9-1.801"/></svg>') center/contain no-repeat;
}

.nodejs-highlight {
    box-shadow: 0 0 0 3px rgba(104, 160, 99, 0.4);
}

.nodejs-arrow {
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    animation: nodejs-pulse 2s infinite;
}

@keyframes nodejs-pulse {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.05); }
}

/* Mac 安装选项 */
.mac-install-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mac-install-option {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
}

.mac-install-option-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.mac-install-option-icon {
    font-size: 32px;
}

.mac-install-option-title {
    flex: 1;
}

.mac-install-option-badge {
    background: var(--gradient-success);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    margin-left: 8px;
}

.mac-install-option-badge-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    margin-left: 8px;
}

/* 下载引导增强样式 */
.download-guide-step-content {
    flex: 1;
}

.download-guide-step-content p {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.download-guide-step-content strong {
    font-size: 15px;
    color: var(--text-primary);
}

.download-guide-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: #d97706;
    margin-top: 20px;
}

.download-guide-tip svg {
    flex-shrink: 0;
    margin-top: 2px;
}

/* 工具类 */
.text-sm {
    font-size: 13px;
}

.text-secondary {
    color: var(--text-secondary);
}

.highlight-text {
    background: rgba(124, 58, 237, 0.2);
    color: var(--primary-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.download-guide-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 深色模式下的 Node.js 卡片适配 */
@media (prefers-color-scheme: dark) {
    .nodejs-download-card {
        background: var(--bg-card);
    }

    .nodejs-version {
        color: var(--text-primary);
    }

    .nodejs-page-mockup {
        background: #1a1a2e;
    }
}
