/* 基础样式 - 明亮暖光模式 */
:root, [data-theme="warm"] {
    --primary: #ea580c;
    --primary-dark: #c2410c;
    --primary-light: #fb923c;
    --secondary: #6366f1;
    --secondary-light: #818cf8;
    --bg-dark: #fef7ed;
    --bg-secondary: #fff7ed;
    --bg-card: #fffbf5;
    --bg-hover: #fef3e2;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border: #fed7aa;
    --gradient-1: linear-gradient(135deg, #ea580c, #f97316);
    --gradient-2: linear-gradient(135deg, #6366f1, #8b5cf6);
    --gradient-hero: linear-gradient(135deg, #fef3c7 0%, #fed7aa 50%, #fecaca 100%);
    --shadow: 0 4px 6px -1px rgba(234, 88, 12, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(234, 88, 12, 0.15);
    --shadow-xl: 0 20px 25px -5px rgba(234, 88, 12, 0.1);
    --radius: 12px;
    --radius-lg: 16px;
}

/* 海洋蓝主题 */
[data-theme="ocean"] {
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-light: #38bdf8;
    --secondary: #06b6d4;
    --secondary-light: #22d3ee;
    --bg-dark: #f0f9ff;
    --bg-secondary: #e0f2fe;
    --bg-card: #ffffff;
    --bg-hover: #e0f2fe;
    --text-primary: #0c4a6e;
    --text-secondary: #0369a1;
    --text-muted: #64748b;
    --border: #bae6fd;
    --gradient-1: linear-gradient(135deg, #0ea5e9, #06b6d4);
    --gradient-2: linear-gradient(135deg, #0284c7, #0ea5e9);
    --gradient-hero: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 50%, #7dd3fc 100%);
    --shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(14, 165, 233, 0.15);
    --shadow-xl: 0 20px 25px -5px rgba(14, 165, 233, 0.1);
}

/* 森林绿主题 */
[data-theme="forest"] {
    --primary: #22c55e;
    --primary-dark: #16a34a;
    --primary-light: #4ade80;
    --secondary: #10b981;
    --secondary-light: #34d399;
    --bg-dark: #f0fdf4;
    --bg-secondary: #dcfce7;
    --bg-card: #ffffff;
    --bg-hover: #dcfce7;
    --text-primary: #14532d;
    --text-secondary: #166534;
    --text-muted: #64748b;
    --border: #bbf7d0;
    --gradient-1: linear-gradient(135deg, #22c55e, #10b981);
    --gradient-2: linear-gradient(135deg, #16a34a, #22c55e);
    --gradient-hero: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 50%, #86efac 100%);
    --shadow: 0 4px 6px -1px rgba(34, 197, 94, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(34, 197, 94, 0.15);
    --shadow-xl: 0 20px 25px -5px rgba(34, 197, 94, 0.1);
}

/* 薰衣草紫主题 */
[data-theme="lavender"] {
    --primary: #a855f7;
    --primary-dark: #9333ea;
    --primary-light: #c084fc;
    --secondary: #8b5cf6;
    --secondary-light: #a78bfa;
    --bg-dark: #faf5ff;
    --bg-secondary: #f3e8ff;
    --bg-card: #ffffff;
    --bg-hover: #f3e8ff;
    --text-primary: #3b0764;
    --text-secondary: #6b21a8;
    --text-muted: #64748b;
    --border: #e9d5ff;
    --gradient-1: linear-gradient(135deg, #a855f7, #8b5cf6);
    --gradient-2: linear-gradient(135deg, #9333ea, #a855f7);
    --gradient-hero: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 50%, #d8b4fe 100%);
    --shadow: 0 4px 6px -1px rgba(168, 85, 247, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(168, 85, 247, 0.15);
    --shadow-xl: 0 20px 25px -5px rgba(168, 85, 247, 0.1);
}

/* 日落橙主题 */
[data-theme="sunset"] {
    --primary: #f97316;
    --primary-dark: #ea580c;
    --primary-light: #fb923c;
    --secondary: #ef4444;
    --secondary-light: #f87171;
    --bg-dark: #fffbeb;
    --bg-secondary: #fef3c7;
    --bg-card: #ffffff;
    --bg-hover: #fef3c7;
    --text-primary: #78350f;
    --text-secondary: #92400e;
    --text-muted: #64748b;
    --border: #fde68a;
    --gradient-1: linear-gradient(135deg, #f97316, #ef4444);
    --gradient-2: linear-gradient(135deg, #ea580c, #f97316);
    --gradient-hero: linear-gradient(135deg, #fef3c7 0%, #fde68a 50%, #fdba74 100%);
    --shadow: 0 4px 6px -1px rgba(249, 115, 22, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(249, 115, 22, 0.15);
    --shadow-xl: 0 20px 25px -5px rgba(249, 115, 22, 0.1);
}

/* 午夜深蓝主题 */
[data-theme="midnight"] {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --secondary-light: #a78bfa;
    --bg-dark: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #334155;
    --gradient-1: linear-gradient(135deg, #6366f1, #8b5cf6);
    --gradient-2: linear-gradient(135deg, #4f46e5, #6366f1);
    --gradient-hero: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e3a5f 100%);
    --shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(99, 102, 241, 0.2);
}

/* 暗夜模式 */
[data-theme="dark"] {
    --primary: #fb923c;
    --primary-dark: #ea580c;
    --primary-light: #fdba74;
    --secondary: #818cf8;
    --secondary-light: #a5b4fc;
    --bg-dark: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #334155;
    --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0c4a6e 100%);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

/* 各主题的导航栏适配 */
[data-theme="ocean"] .navbar,
[data-theme="forest"] .navbar,
[data-theme="lavender"] .navbar,
[data-theme="sunset"] .navbar {
    background: rgba(255, 255, 255, 0.95);
}

[data-theme="midnight"] .navbar {
    background: rgba(15, 23, 42, 0.95);
}

/* 各主题的页脚适配 */
[data-theme="ocean"] .footer,
[data-theme="forest"] .footer,
[data-theme="lavender"] .footer,
[data-theme="sunset"] .footer {
    background: var(--bg-hover);
}

[data-theme="midnight"] .footer,
[data-theme="dark"] .footer {
    background: #0f172a;
}

/* 新主页页脚：与 .footer 一样随浅色主题抬高对比，避免与 stats 区块糊成一片 */
[data-theme="ocean"] .footer-main,
[data-theme="forest"] .footer-main,
[data-theme="lavender"] .footer-main,
[data-theme="sunset"] .footer-main {
    background: var(--bg-secondary);
}

[data-theme="midnight"] .footer-main,
[data-theme="dark"] .footer-main {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
}

[data-theme="light"] .footer-main {
    background: var(--bg-secondary);
}

/* 暗色主题的代码块适配 */
[data-theme="midnight"] .code-window {
    background: #0d1117;
    border: 1px solid #30363d;
}

/* 明亮模式（经典） */
[data-theme="light"] {
    --bg-dark: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --gradient-hero: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 50%, #f8fafc 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
}

/* 动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(var(--primary), 0.3); }
    50% { box-shadow: 0 0 40px rgba(var(--primary), 0.5); }
}

.animate-fade-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* 渐变动画背景 */
.gradient-animate {
    background-size: 200% 200%;
    animation: gradient 8s ease infinite;
}

/* 卡片悬停光效 */
.card-glow:hover {
    position: relative;
    overflow: hidden;
}

.card-glow:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 1.5s infinite;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s ease;
}

[data-theme="dark"] .navbar {
    background: rgba(15, 23, 42, 0.95);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.2rem;
}

.logo-icon {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-github {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #24292e;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-github:hover {
    background: #1a1e22;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lang-select {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-github {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

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

/* 主题切换按钮 */
.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--bg-hover);
    transform: scale(1.05);
}

.theme-icon-dark {
    display: none;
}

[data-theme="dark"] .theme-icon-light {
    display: none;
}

[data-theme="dark"] .theme-icon-dark {
    display: inline;
}

/* Hero 区域 */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 100px 20px 60px;
    overflow: hidden;
    background: var(--gradient-hero);
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(251, 146, 60, 0.2) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(249, 115, 22, 0.1) 0%, transparent 60%);
    z-index: 0;
    animation: gradient 15s ease infinite;
    background-size: 200% 200%;
}

/* 装饰性元素 */
.hero::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 5%;
    width: 100px;
    height: 100px;
    background: var(--gradient-1);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 6s ease-in-out infinite;
    filter: blur(20px);
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 20%;
    right: 10%;
    width: 150px;
    height: 150px;
    background: var(--gradient-2);
    border-radius: 50%;
    opacity: 0.2;
    animation: float 8s ease-in-out infinite reverse;
    filter: blur(30px);
}

/* 额外的装饰粒子 */
.hero-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.hero-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 10s ease-in-out infinite;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(217, 119, 6, 0.2);
    border: 1px solid var(--primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--primary);
    margin-bottom: 24px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    position: relative;
}

.gradient-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto;
    animation: gradient 3s ease infinite;
}

/* 副标题样式增强 */
.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    position: relative;
    padding-left: 20px;
    border-left: 3px solid var(--primary);
}

/* 徽章样式增强 */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(var(--primary), 0.1);
    border: 1px solid var(--primary);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.875rem;
    color: var(--primary);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.hero-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 3s infinite;
}

.badge-icon {
    animation: pulse 2s ease-in-out infinite;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-item {
    text-align: center;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 8px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.hero-actions {
    display: flex;
    gap: 16px;
}

.btn {
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

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

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

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

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

/* Hero 代码块 */
.hero-code {
    flex: 1;
    max-width: 550px;
}

.code-window {
    background: #0d1117;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
}

.code-window:hover {
    transform: translateY(-5px);
}

[data-theme="dark"] .code-window {
    background: #0d1117;
    border: 1px solid #30363d;
}

[data-theme="light"] .code-window,
[data-theme="warm"] .code-window {
    background: #1e293b;
}

.code-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #161b22;
    border-bottom: 1px solid #30363d;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27ca40; }

.code-title {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.code-content {
    padding: 20px;
    overflow-x: auto;
}

.code-content code {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.keyword { color: #ff7b72; }
.function { color: #d2a8ff; }
.comment { color: #8b949e; }

/* Section 样式 */
.section {
    padding: 100px 20px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
}

.section-desc {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 48px;
}

/* Overview 网格 */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.overview-card {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-lg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
}

.overview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overview-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.overview-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}

.overview-card:hover::before {
    opacity: 1;
}

.overview-card:hover::after {
    transform: translateX(100%);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.overview-card h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.overview-card p {
    color: var(--text-secondary);
}

/* 架构图 */
.arch-diagram {
    max-width: 800px;
    margin: 0 auto 60px;
}

.arch-layer {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    border-left: 4px solid var(--primary);
}

.layer-title {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
}

.layer-items {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.arch-item {
    background: var(--bg-hover);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.875rem;
}

.arch-arrow {
    text-align: center;
    padding: 16px;
    font-size: 1.5rem;
    color: var(--text-muted);
}

/* Features 网格 */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    padding: 16px;
    border-radius: 8px;
}

.feature-icon {
    font-size: 1.5rem;
}

.feature-name {
    font-weight: 600;
}

.feature-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Mermaid 流程图（深色画布 + Tokyo Night 系变量，与站点主题独立以保证对比度） */
.mermaid-figure {
    margin: 0 0 36px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    overflow: hidden;
}

.mermaid-caption {
    margin: 0;
    padding: 14px 18px;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    background: var(--bg-hover);
}

.mermaid-caption strong {
    color: var(--text-primary);
}

.mermaid-diagram-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 16px 12px 20px;
    background: #11111b;
    -webkit-overflow-scrolling: touch;
}

.mermaid-diagram-scroll .mermaid-flowchart {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.mermaid-diagram-scroll svg {
    max-width: 100%;
    height: auto;
}

/* 新版首页：流程图与区块标题的间距 */
.mermaid-figure--main {
    margin-top: 8px;
}

/* 十二章总览图：略增高画布，便于大图可读 */
.mermaid-figure--course-map .mermaid-diagram-scroll--xl {
    padding: 20px 16px 28px;
    min-height: 320px;
}

.mermaid-figure--course-map .mermaid-diagram-scroll--xl .mermaid-flowchart {
    min-width: min(100%, 720px);
}

/* 课程网格 */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.course-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-lg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.course-card::after {
    content: '→';
    position: absolute;
    right: 20px;
    bottom: 20px;
    font-size: 1.5rem;
    color: var(--primary);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.course-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.course-card:hover::after {
    opacity: 1;
    transform: translateX(0);
}

.course-card[data-part="1"] { border-top: 3px solid #10b981; }
.course-card[data-part="2"] { border-top: 3px solid #6366f1; }
.course-card[data-part="3"] { border-top: 3px solid #f59e0b; }

.course-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.course-number {
    font-weight: 700;
    color: var(--primary);
}

.course-part {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.course-title {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.course-desc {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.course-meta {
    display: flex;
    gap: 16px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Source Map 区域 */
.sourcemap-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.sourcemap-info h3 {
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.sourcemap-info p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.sourcemap-info ul {
    list-style: none;
    margin-bottom: 16px;
}

.sourcemap-info li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
}

.sourcemap-info li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
}

.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid #f59e0b;
    padding: 12px 16px;
    border-radius: 8px;
}

.sourcemap-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 12px;
    text-align: center;
}

.stat-card .stat-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .stat-text {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* 资源网格 */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.resource-card {
    background: var(--bg-card);
    padding: 32px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.resource-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.resource-card h3 {
    margin-bottom: 8px;
}

.resource-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* 每日推送 */
.daily-push {
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-hover) 100%);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.section-date {
    background: var(--gradient-1);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.daily-article {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.daily-article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-1);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.article-tag {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.article-tag.hot {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid #ef4444;
}

.article-tag.new {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid #22c55e;
}

.article-source {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.article-title {
    font-size: 1.5rem;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.article-section {
    margin-bottom: 28px;
}

.article-section h4 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--primary);
}

.article-section p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 12px;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 8px 0 8px 24px;
    position: relative;
    color: var(--text-secondary);
}

.feature-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary);
}

.tip-box {
    padding: 16px 20px;
    border-radius: 8px;
    margin-top: 16px;
}

.tip-box.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid #f59e0b;
    color: var(--text-primary);
}

.tip-box.info {
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid #0ea5e9;
    color: var(--text-primary);
}

.hidden-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.feature-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: var(--bg-hover);
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.feature-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.feature-info h5 {
    font-size: 1rem;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.feature-info p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.tool-recommend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.tool-card {
    display: flex;
    gap: 16px;
    padding: 24px;
    background: var(--bg-hover);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.tool-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.tool-info h5 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.tool-info p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.tool-info code {
    display: block;
    background: var(--bg-dark);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.8rem;
    margin-top: 8px;
}

.tool-info a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
}

.tool-info a:hover {
    text-decoration: underline;
}

.article-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.article-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword {
    background: var(--bg-hover);
    color: var(--text-muted);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    border: 1px solid var(--border);
}

/* 响应式适配 */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .hidden-features {
        grid-template-columns: 1fr;
    }

    .tool-recommend {
        grid-template-columns: 1fr;
    }

    .feature-card, .tool-card {
        flex-direction: column;
        text-align: center;
    }
}

/* ============ 交互式组件 ============ */

/* 交互式代码演示 */
.interactive-demo {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 24px 0;
    border: 1px solid var(--border);
}

.demo-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.demo-tab {
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.demo-tab:hover {
    background: var(--bg-hover);
}

.demo-tab.active {
    background: var(--gradient-1);
    color: white;
    border-color: transparent;
}

.demo-content {
    min-height: 200px;
}

/* 流程图动画 */
.flow-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 30px;
    margin: 20px 0;
    background: linear-gradient(135deg, var(--bg-hover) 0%, var(--bg-card) 100%);
    border-radius: var(--radius-lg);
    overflow-x: auto;
}

.flow-node {
    background: var(--bg-card);
    padding: 16px 24px;
    border-radius: 12px;
    border: 2px solid var(--border);
    text-align: center;
    min-width: 100px;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.flow-node:hover {
    transform: scale(1.05);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.flow-node.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(var(--primary), 0.1) 100%);
}

.flow-node .node-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.flow-node .node-label {
    font-weight: 600;
    color: var(--text-primary);
}

.flow-arrow {
    font-size: 1.5rem;
    color: var(--primary);
    animation: pulse 2s ease-in-out infinite;
}

/* 知识卡片翻转 */
.flip-card {
    perspective: 1000px;
    width: 100%;
    height: 200px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

.flip-card-front {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.flip-card-back {
    background: var(--gradient-1);
    color: white;
    transform: rotateY(180deg);
}

.flip-card-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

/* 学习进度条 */
.progress-container {
    background: var(--bg-hover);
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.progress-label {
    font-weight: 600;
    color: var(--text-primary);
}

.progress-value {
    color: var(--primary);
    font-weight: 600;
}

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

.progress-fill {
    height: 100%;
    background: var(--gradient-1);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* 交互式问答 */
.quiz-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 24px 0;
    border: 1px solid var(--border);
}

.quiz-question {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-option {
    padding: 16px;
    background: var(--bg-hover);
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.quiz-option:hover {
    border-color: var(--primary-light);
    background: var(--bg-card);
}

.quiz-option.selected {
    border-color: var(--primary);
    background: rgba(var(--primary), 0.1);
}

.quiz-option.correct {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.quiz-option.incorrect {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.quiz-option-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.quiz-feedback {
    margin-top: 16px;
    padding: 16px;
    border-radius: 8px;
    display: none;
}

.quiz-feedback.show {
    display: block;
}

.quiz-feedback.correct {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid #22c55e;
    color: #22c55e;
}

.quiz-feedback.incorrect {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    color: #ef4444;
}

/* 时间线组件 */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gradient-1);
}

.timeline-item {
    position: relative;
    padding-bottom: 30px;
    padding-left: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--bg-card);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-time {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 4px;
}

.timeline-content {
    background: var(--bg-card);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* 代码高亮增强 */
.code-block {
    position: relative;
    margin: 16px 0;
}

/* 深色底代码区：正文色勿用 var(--text-primary)。暖光/浅色主题下其为 #1e293b，
   与背景同色会导致整段代码「看不见」。 */
.code-block pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0;
    border: 1px solid #334155;
}

.code-block pre code {
    color: inherit;
}

.code-block code {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f172a;
    padding: 8px 16px;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #334155;
}

.code-lang {
    color: #94a3b8;
    font-size: 0.875rem;
}

.copy-btn {
    background: transparent;
    border: 1px solid #334155;
    color: #94a3b8;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: #334155;
    color: white;
}

/* 交互式解释 */
.explainable {
    border-bottom: 2px dotted var(--primary);
    cursor: help;
    position: relative;
}

.explainable:hover::after {
    content: attr(data-explanation);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    z-index: 100;
}

/* 成就徽章 */
.badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0;
}

.badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border);
    font-size: 0.875rem;
}

.badge.earned {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.2));
    border-color: #22c55e;
}

.badge-icon {
    font-size: 1.2rem;
}

/* 打字机效果 */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--primary);
    white-space: nowrap;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--primary) }
}

/* 可折叠内容 */
.collapsible {
    background: var(--bg-card);
    border-radius: 8px;
    margin: 16px 0;
    overflow: hidden;
    border: 1px solid var(--border);
}

.collapsible-header {
    padding: 16px 20px;
    background: var(--bg-hover);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    transition: background 0.2s;
}

.collapsible-header:hover {
    background: var(--bg-card);
}

.collapsible-icon {
    transition: transform 0.3s;
}

.collapsible.open .collapsible-icon {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.collapsible.open .collapsible-content {
    max-height: 1000px;
}

.collapsible-inner {
    padding: 20px;
}

/* 交互式图表 */
.chart-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 24px 0;
    border: 1px solid var(--border);
}

.chart-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 12px 0;
}

.chart-label {
    width: 100px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.chart-track {
    flex: 1;
    height: 24px;
    background: var(--bg-hover);
    border-radius: 12px;
    overflow: hidden;
}

.chart-fill {
    height: 100%;
    background: var(--gradient-1);
    border-radius: 12px;
    transition: width 1s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
}

/* 页脚 */
.footer {
    background: #f1f5f9;
    padding: 80px 20px 40px;
    border-top: 1px solid var(--border);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-1);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 48px;
    margin-bottom: 40px;
}

.footer-logo {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-brand p {
    color: var(--text-muted);
    margin-top: 12px;
}

.footer-brand {
    position: relative;
}

.footer-brand::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--gradient-1);
    border-radius: 2px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.footer-col h4 {
    color: var(--text-primary);
    margin-bottom: 16px;
}

.footer-col a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 0;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.disclaimer {
    margin-top: 8px;
    font-size: 0.75rem !important;
}

/* 全站访问计数（由 app.js 注入 hits.sh 徽章） */
.footer-views {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.6rem;
    margin: 0.75rem 0 0;
    padding: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.footer-views__label {
    opacity: 0.92;
}

.footer-views a {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.footer-views img,
.footer-views__img {
    height: 20px;
    width: auto;
    max-width: 100%;
    display: block;
    vertical-align: middle;
}

.footer-bottom-main .footer-views {
    margin-top: 1rem;
}

/* 响应式 */
@media (max-width: 1024px) {
    .hero {
        flex-direction: column;
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-code {
        max-width: 100%;
        margin-top: 40px;
    }

    .sourcemap-content {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-links {
        grid-template-columns: 1fr;
    }
}

/* ================================
   教程专栏样式
   ================================ */

.tutorials {
    background: var(--bg-dark);
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header .section-desc {
    color: var(--text-muted);
    margin-top: 12px;
}

/* 教程选项卡 */
.tutorials-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tab-btn.active {
    background: var(--gradient-1);
    border-color: var(--primary);
    color: white;
}

/* 教程内容 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.tutorial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.tutorial-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.tutorial-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.tutorial-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.tutorial-card h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.tutorial-card > p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.tutorial-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tutorial-meta span {
    font-size: 0.8rem;
    padding: 4px 10px;
    background: var(--bg-hover);
    border-radius: 12px;
    color: var(--text-secondary);
}

.tutorial-steps {
    background: var(--bg-hover);
    border-radius: var(--radius);
    padding: 16px;
}

.step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
}

.step:last-child {
    border-bottom: none;
}

.step code {
    background: var(--bg-card);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
    white-space: nowrap;
}

.step span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ================================
   面试问题专栏样式
   ================================ */

.interview {
    background: var(--bg-card);
}

/* 面试分类按钮 */
.interview-categories {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 10px 20px;
    background: transparent;
    border: 2px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.category-btn:hover {
    border-color: var(--secondary);
    color: var(--secondary);
}

.category-btn.active {
    background: var(--gradient-2);
    border-color: var(--secondary);
    color: white;
}

/* 面试内容 */
.category-content {
    display: none;
}

.category-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.question-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.question-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s ease;
}

.question-card:hover {
    box-shadow: var(--shadow-lg);
}

.question-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border);
}

.question-number {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.question-tag {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.question-tag.concept {
    background: #dbeafe;
    color: #1e40af;
}

.question-tag.practice {
    background: #dcfce7;
    color: #166534;
}

.question-tag.compare {
    background: #fef3c7;
    color: #92400e;
}

.question-tag.scenario {
    background: #fce7f3;
    color: #9d174d;
}

.difficulty {
    margin-left: auto;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.difficulty.easy {
    background: #dcfce7;
    color: #166534;
}

.difficulty.medium {
    background: #fef3c7;
    color: #92400e;
}

.difficulty.hard {
    background: #fee2e2;
    color: #991b1b;
}

.question-body {
    padding: 20px;
}

.question-body h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.answer-preview {
    color: var(--text-secondary);
    line-height: 1.7;
}

.answer-preview p {
    margin-bottom: 12px;
}

.answer-preview ul {
    margin-left: 20px;
    margin-bottom: 12px;
}

.answer-preview li {
    margin-bottom: 8px;
}

.answer-preview pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
}

.answer-preview code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
}

.answer-preview > code {
    background: var(--bg-hover);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
}

.expand-btn {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 16px;
    background: var(--bg-hover);
    border: none;
    border-radius: 8px;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* 对比表格 */
.compare-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.compare-table th,
.compare-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid var(--border);
}

.compare-table th {
    background: var(--bg-hover);
    color: var(--text-primary);
    font-weight: 600;
}

.compare-table td {
    color: var(--text-secondary);
}

/* 解决方案步骤 */
.solution-box {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.solution-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-num {
    width: 32px;
    height: 32px;
    background: var(--gradient-1);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content strong {
    color: var(--primary);
    display: block;
    margin-bottom: 8px;
}

.step-content pre {
    margin: 0;
    padding: 12px;
    font-size: 0.85rem;
}

/* 面试统计 */
.interview-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.stat-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 32px;
    background: var(--bg-hover);
    border-radius: var(--radius-lg);
}

.stat-badge .stat-num {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-badge .stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 响应式补充 */
@media (max-width: 768px) {
    .tutorials-tabs,
    .interview-categories {
        gap: 8px;
    }

    .tab-btn,
    .category-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .tutorial-grid {
        grid-template-columns: 1fr;
    }

    .question-header {
        flex-wrap: wrap;
    }

    .difficulty {
        margin-left: 0;
        margin-top: 8px;
    }

    .compare-table {
        font-size: 0.85rem;
    }

    .compare-table th,
    .compare-table td {
        padding: 8px;
    }

    .interview-stats {
        gap: 16px;
    }

    .stat-badge {
        padding: 16px 24px;
    }
}

/* -----------------------------------------------------------------
   代码选区高对比度（S01–S12 课程页：Prism token 色 + 系统选区易糊在一起）
   .course-main 覆盖全部章节内 pre/code（含 .diagram、.code-block），不依赖是否加载 Prism
   使用 !important 以压过 prism.css 中可能存在的 ::selection
   ----------------------------------------------------------------- */
/* 课程章节页：顶栏留白 + 章节导航与正文分离（避免与思考题等重叠） */
.course-main {
    padding-top: 72px;
    padding-bottom: 48px;
}

.course-content {
    padding-bottom: 24px;
}

.section-block {
    margin-bottom: 1.75rem;
}

.thinking-questions {
    margin-bottom: 1.25rem;
    padding-bottom: 0.25rem;
}

.thinking-questions li {
    margin-bottom: 0.5rem;
}

/* S12 等页「结业」块：无样式时内联 a.btn 可能与上文挤在同一行视觉重叠，强制纵向栈 */
.course-complete {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    padding: 1.25rem 1.25rem 1.5rem;
    max-width: 100%;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    clear: both;
    position: relative;
    z-index: 1;
    isolation: isolate;
}

.course-complete h2 {
    margin: 0;
    font-size: 1.25rem;
}

.course-complete p {
    margin: 0;
    max-width: 100%;
    line-height: 1.65;
    color: var(--text-secondary);
}

.course-complete .btn {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    flex-shrink: 0;
}

/* 课程内链式按钮统一为块级盒，避免行内 padding 与相邻文字争位 */
.course-content > .btn {
    display: inline-flex;
}

.chapter-navigation {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 2rem;
    padding-top: 1.5rem;
    padding-bottom: 0.5rem;
    border-top: 1px solid var(--border);
    clear: both;
    position: relative;
    z-index: 0;
}

.course-main pre ::selection,
.course-main pre *::selection,
.course-main code::selection,
.course-main code *::selection,
.code-block ::selection,
.code-block *::selection,
.code-window pre ::selection,
.code-window pre *::selection,
.code-window code::selection,
.code-window .code-content *::selection {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
}

.course-main pre ::-moz-selection,
.course-main pre *::-moz-selection,
.course-main code::-moz-selection,
.course-main code *::-moz-selection,
.code-block ::-moz-selection,
.code-block *::-moz-selection,
.code-window pre ::-moz-selection,
.code-window pre *::-moz-selection,
.code-window code::-moz-selection,
.code-window .code-content *::-moz-selection {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
}
/* ================================
   手册页面专用样式
   ================================ */

.handbook-hero {
    min-height: 50vh;
    background: var(--gradient-hero);
}

/* 快速开始区域 */
.quickstart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.quickstart-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    position: relative;
}

.qs-number {
    position: absolute;
    top: -15px;
    left: 20px;
    width: 40px;
    height: 40px;
    background: var(--gradient-1);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.quickstart-card h3 {
    margin-top: 16px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.quickstart-card pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.85rem;
}

/* 学习路线图 */
.roadmap-section {
    background: var(--bg-dark);
}

.roadmap-intro {
    text-align: center;
    margin-bottom: 32px;
}

.roadmap-intro p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.level-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.level-tab {
    padding: 12px 24px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.level-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.level-tab.active {
    background: var(--gradient-1);
    border-color: var(--primary);
    color: white;
}

.level-content {
    display: none;
}

.level-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* 时间线 */
.roadmap-timeline {
    position: relative;
    padding-left: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.roadmap-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 32px;
}

.timeline-dot {
    position: absolute;
    left: -26px;
    top: 4px;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    border: 3px solid var(--bg-card);
}

.timeline-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
}

.timeline-time {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-hover);
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.timeline-content h4 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

.timeline-content p {
    color: var(--text-muted);
    margin-bottom: 12px;
}

.timeline-content ul {
    list-style: none;
    padding: 0;
}

.timeline-content li {
    padding: 6px 0;
    color: var(--text-secondary);
}

.timeline-content li::before {
    content: '→ ';
    color: var(--primary);
}

.timeline-content code {
    background: var(--bg-hover);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--primary);
    font-size: 0.9rem;
}

.roadmap-total {
    text-align: center;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-top: 24px;
    color: var(--text-primary);
}

/* 功能手风琴 */
.features-accordion {
    max-width: 900px;
    margin: 0 auto;
}

.accordion-item {
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.accordion-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.accordion-header:hover {
    background: var(--bg-hover);
}

.accordion-icon {
    font-size: 1.5rem;
}

.accordion-header h3 {
    flex: 1;
    color: var(--text-primary);
    margin: 0;
}

.accordion-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.accordion-toggle {
    width: 32px;
    height: 32px;
    background: var(--bg-hover);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--primary);
    transition: transform 0.3s;
}

.accordion-item.active .accordion-toggle {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-item.active .accordion-content {
    border-top: 1px solid var(--border);
}

.feature-detail {
    padding: 24px;
}

.feature-detail h4 {
    color: var(--text-primary);
    margin: 20px 0 12px;
}

.feature-detail h4:first-child {
    margin-top: 0;
}

.feature-detail p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.feature-detail ul {
    margin-left: 20px;
    color: var(--text-secondary);
}

.feature-detail li {
    margin-bottom: 8px;
}

.feature-detail pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
}

.feature-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.feature-table th,
.feature-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid var(--border);
}

.feature-table th {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.feature-table td {
    color: var(--text-secondary);
}

.feature-table code {
    background: var(--bg-hover);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--primary);
}

/* Memory 类型卡片 */
.memory-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 16px 0;
}

.memory-type {
    background: var(--bg-hover);
    border-radius: var(--radius);
    padding: 16px;
}

.memory-type h5 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

.memory-type code {
    display: block;
    background: var(--bg-card);
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 0.85rem;
}

.memory-type p {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.memory-type .hint {
    color: var(--text-muted);
    font-style: italic;
}

/* FAQ */
.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.faq-question {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    cursor: pointer;
}

.faq-icon {
    width: 32px;
    height: 32px;
    background: var(--gradient-1);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.faq-question h4 {
    flex: 1;
    color: var(--text-primary);
    margin: 0;
}

.faq-answer {
    display: none;
    padding: 0 20px 20px 68px;
}

.faq-item.active .faq-answer {
    display: block;
}

.faq-answer ul {
    margin-left: 20px;
    color: var(--text-secondary);
}

.faq-answer li {
    margin-bottom: 8px;
}

.faq-answer pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.85rem;
}

/* 手册页响应式 */
@media (max-width: 768px) {
    .quickstart-grid {
        grid-template-columns: 1fr;
    }

    .level-tabs {
        gap: 8px;
    }

    .level-tab {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .roadmap-timeline {
        padding-left: 20px;
    }

    .timeline-dot {
        left: -16px;
        width: 12px;
        height: 12px;
    }

    .memory-types {
        grid-template-columns: 1fr;
    }

    .faq-answer {
        padding-left: 20px;
    }
}

/* ================================
   教程页面专用样式
   ================================ */

.tutorial-hero {
    min-height: 50vh;
    background: var(--gradient-hero);
}

/* 安装指南 */
.install-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.install-tab {
    padding: 12px 24px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.install-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.install-tab.active {
    background: var(--gradient-1);
    border-color: var(--primary);
    color: white;
}

.install-content {
    max-width: 800px;
    margin: 0 auto;
}

.platform-content {
    display: none;
}

.platform-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.install-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.install-card h4 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

.install-card p {
    color: var(--text-muted);
    margin-bottom: 16px;
}

.install-card pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
}

.install-note {
    padding: 16px;
    background: var(--bg-hover);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}

.install-note.warning {
    background: #fef3c7;
    border-left-color: #f59e0b;
}

.install-note.warning a {
    color: #92400e;
}

.install-note strong {
    color: var(--text-primary);
}

/* 其他平台 */
.other-platforms {
    margin-top: 48px;
    text-align: center;
}

.other-platforms h3 {
    color: var(--text-primary);
    margin-bottom: 24px;
}

.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    max-width: 800px;
    margin: 0 auto;
}

.platform-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all 0.3s ease;
}

.platform-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.platform-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.platform-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.platform-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

/* 快速开始 */
.quickstart-section {
    background: var(--bg-dark);
}

.quickstart-steps {
    max-width: 800px;
    margin: 0 auto;
}

.qs-step {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.qs-step-num {
    width: 48px;
    height: 48px;
    background: var(--gradient-1);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.qs-step-content {
    flex: 1;
}

.qs-step-content h4 {
    color: var(--text-primary);
    margin-bottom: 12px;
}

.qs-step-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.qs-step-content p {
    color: var(--text-muted);
}

.basic-commands {
    max-width: 800px;
    margin: 48px auto 0;
}

.basic-commands h3 {
    color: var(--text-primary);
    margin-bottom: 24px;
}

.commands-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
}

.commands-table th,
.commands-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.commands-table th {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.commands-table td {
    color: var(--text-secondary);
}

.commands-table code {
    background: var(--bg-hover);
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--primary);
}

/* Memory 系统 */
.memory-section {
    background: var(--bg-card);
}

.memory-intro {
    text-align: center;
    margin-bottom: 32px;
    color: var(--text-secondary);
}

.memory-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    max-width: 900px;
    margin: 0 auto 48px;
}

.memory-type-card {
    background: var(--bg-hover);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
}

.memory-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.memory-type-card h3 {
    color: var(--text-primary);
    margin-bottom: 16px;
}

.memory-type-card p {
    margin: 8px 0;
    color: var(--text-secondary);
}

.memory-type-card .memory-who {
    font-size: 0.9rem;
}

.memory-type-card .memory-use {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 16px;
}

.claude-md-locations,
.claude-md-example,
.memory-rules,
.memory-tips {
    max-width: 900px;
    margin: 0 auto 48px;
}

.claude-md-locations h3,
.claude-md-example h3,
.memory-rules h3,
.memory-tips h3 {
    color: var(--text-primary);
    margin-bottom: 24px;
}

.locations-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-hover);
    border-radius: var(--radius);
    overflow: hidden;
}

.locations-table th,
.locations-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.locations-table th {
    background: var(--bg-card);
    color: var(--text-primary);
}

.locations-table td {
    color: var(--text-secondary);
}

.locations-table code {
    background: var(--bg-card);
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--primary);
    font-size: 0.85rem;
}

.claude-md-example pre,
.memory-rules pre,
.rule-example pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
}

.rule-example {
    margin-top: 24px;
}

.rule-example h4 {
    color: var(--text-primary);
    margin-bottom: 16px;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.tip-card {
    background: var(--bg-hover);
    border-radius: var(--radius);
    padding: 20px;
}

.tip-card h4 {
    color: var(--text-primary);
    margin-bottom: 12px;
}

.tip-card p,
.tip-card ul {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.tip-card ul {
    margin-left: 16px;
}

.tip-card li {
    margin-bottom: 8px;
}

/* 教程：.claude/ 专节与解剖配图 */
.claude-dir-section {
    background: var(--bg-card);
}

/* 教程 #claude-dir：图 1 目录解剖 + 图 2 配置层级左右并列 */
.tutorial-claude-figures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 1280px;
    margin: 0 auto 40px;
    align-items: stretch;
}

.tutorial-claude-figures .tutorial-claude-figure-panel {
    margin: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tutorial-claude-figures .mermaid-caption {
    flex-shrink: 0;
}

.tutorial-claude-figures .tutorial-figure-img-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 16px 20px;
    background: #11111b;
    border-top: 1px solid var(--border);
    min-height: 0;
}

.tutorial-claude-figures .tutorial-figure-img-wrap img {
    max-width: 100%;
    height: auto;
    max-height: min(72vh, 920px);
    width: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

@media (max-width: 960px) {
    .tutorial-claude-figures {
        grid-template-columns: 1fr;
    }

    .tutorial-claude-figures .tutorial-figure-img-wrap img {
        max-height: none;
    }
}

.claude-dir-key-rules {
    max-width: 960px;
    margin: 0 auto 32px;
}

.claude-dir-text {
    margin-top: 8px;
}

/* Skills 系统 */
.skills-section {
    background: var(--bg-dark);
}

.skills-intro {
    text-align: center;
    margin-bottom: 32px;
    color: var(--text-secondary);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.bundled-skills,
.create-skill,
.skill-locations,
.skill-frontmatter,
.skill-arguments {
    max-width: 900px;
    margin: 0 auto 48px;
}

.bundled-skills h3,
.create-skill h3,
.skill-locations h3,
.skill-frontmatter h3,
.skill-arguments h3 {
    color: var(--text-primary);
    margin-bottom: 24px;
}

.skills-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
}

.skills-table th,
.skills-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.skills-table th {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.skills-table td {
    color: var(--text-secondary);
}

.skills-table code {
    background: var(--bg-hover);
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--primary);
}

.skill-steps {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.skill-step {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
}

.skill-step h4 {
    color: var(--text-primary);
    margin-bottom: 16px;
}

.skill-step pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
}

.frontmatter-fields {
    margin-top: 24px;
}

.frontmatter-fields h4 {
    color: var(--text-primary);
    margin-bottom: 16px;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.field-item {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
}

.field-item code {
    display: block;
    background: var(--bg-hover);
    padding: 8px;
    border-radius: 4px;
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.field-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 常见工作流 */
.workflows-section {
    background: var(--bg-card);
}

.workflow-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
}

.workflow-card {
    background: var(--bg-hover);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.workflow-icon {
    font-size: 2rem;
    margin-bottom: 16px;
}

.workflow-card h3 {
    color: var(--text-primary);
    margin-bottom: 16px;
}

.workflow-card p {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.workflow-card pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    margin: 12px 0;
    font-size: 0.9rem;
}

/* 命令参考 */
.reference-section {
    background: var(--bg-dark);
}

.reference-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.reference-category {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
}

.reference-category h3 {
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.ref-table {
    width: 100%;
}

.ref-table td {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.ref-table td:first-child {
    width: 40%;
}

.ref-table code {
    background: var(--bg-hover);
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--primary);
}

.ref-table tr:last-child td {
    border-bottom: none;
}

.reference-lead {
    max-width: 900px;
    margin: 0 auto 28px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

.reference-lead a {
    color: var(--primary);
    font-weight: 600;
}

.reference-detail-wrap {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.reference-detail-category {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px 28px;
    border: 1px solid var(--border);
}

.reference-detail-category > h3 {
    color: var(--text-primary);
    font-size: 1.15rem;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.ref-table--detail td {
    vertical-align: top;
    padding: 14px 12px 14px 0;
}

.ref-table--detail td:first-child {
    width: 16%;
    min-width: 7rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ref-table--detail td:nth-child(2) {
    width: 26%;
    color: var(--text-secondary);
}

.ref-table--detail .ref-usage {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.65;
}

.ref-table--detail .ref-usage p {
    margin: 0 0 8px;
}

.ref-table--detail .ref-usage ul {
    margin: 6px 0 0 1.15rem;
    padding: 0;
}

.ref-table--detail .ref-usage li {
    margin-bottom: 6px;
}

.ref-table--detail .ref-note {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* 教程页响应式 */
@media (max-width: 768px) {
    .ref-table--detail td:first-child,
    .ref-table--detail td:nth-child(2) {
        width: 100%;
    }

    .ref-table--detail tr {
        display: block;
        padding-bottom: 12px;
        margin-bottom: 12px;
        border-bottom: 1px solid var(--border);
    }

    .ref-table--detail tr:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .ref-table--detail td {
        display: block;
        padding: 6px 0;
        border-bottom: none;
    }

    .install-tabs {
        gap: 8px;
    }

    .install-tab {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .qs-step {
        flex-direction: column;
        gap: 16px;
    }

    .qs-step-num {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .workflow-grid {
        grid-template-columns: 1fr;
    }

    .reference-categories {
        grid-template-columns: 1fr;
    }
}

/* ================================
   新主页设计样式 (参考 AgentGuide)
   ================================ */

/* 主导航 */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    gap: 0.75rem;
}

.main-nav-start {
    display: flex;
    align-items: center;
    gap: 0.75rem 1.25rem;
    flex-wrap: wrap;
    min-width: 0;
}

.main-nav-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.9rem;
}

.main-nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

.main-nav-links a:hover {
    color: var(--primary);
}

.nav-center {
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-hover);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1);
}

.search-shortcut {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.github-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.github-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    transform: translateY(-2px);
}

/* Hero 主区域 */
.hero-main {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 80px;
    overflow: hidden;
}

.hero-bg-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 1000px 600px at 50% -20%, var(--primary) 0%, var(--primary-dark) 30%, transparent 70%);
    opacity: 0.1;
}

.hero-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    left: var(--x);
    top: var(--y);
    animation: float 8s ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.3; }
    50% { transform: translateY(-20px) scale(1.5); opacity: 0.8; }
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 24px;
}

a.hero-badge--jump {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

a.hero-badge--jump:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

a.hero-badge--jump:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.hero-badge-hint {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding-left: 10px;
    border-left: 1px solid var(--border);
}

/* Source Map 事件简讯（首页 Hero 下方） */
.source-map-event-section {
    scroll-margin-top: 88px;
    padding: 40px 20px 48px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.source-map-event-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin: 0 auto 20px;
    max-width: 720px;
    line-height: 1.35;
}

.source-map-event-body {
    max-width: 720px;
    margin: 0 auto;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

.source-map-event-body > p {
    margin: 0 0 16px;
}

.source-map-event-list {
    margin: 0 0 20px;
    padding-left: 1.25rem;
    list-style: disc;
}

.source-map-event-list li {
    margin-bottom: 10px;
}

.source-map-event-list li::marker {
    color: var(--primary);
}

.source-map-event-more {
    margin: 0;
    font-size: 0.95rem;
}

.source-map-event-more a {
    color: var(--primary);
    font-weight: 600;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 1.2;
}

.gradient-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-hero {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-hero.btn-primary {
    background: var(--gradient-1);
    color: white;
}

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

.btn-hero.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-hero.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* 功能入口区 */
.features-main {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 48px;
}

.features-grid-main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card-main {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 32px;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card-main:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.feature-card-main.feature-primary {
    border-left: 4px solid var(--primary);
}

.feature-card-main.feature-secondary {
    border-left: 4px solid var(--secondary);
}

.feature-card-main.feature-accent {
    border-left: 4px solid #14b8a6;
}

.feature-card-main.feature-warning {
    border-left: 4px solid #f59e0b;
}

.feature-card-main.feature-topic {
    border-left: 4px solid #8b5cf6;
}

/* 学习入口：主打源码课程（全宽 + 横向布局） */
.features-grid-has-flagship .feature-card-main.feature-flagship {
    grid-column: 1 / -1;
    padding: 28px 32px 32px;
    border-left-width: 6px;
    box-shadow: 0 8px 32px rgba(13, 148, 136, 0.12);
    background: linear-gradient(
        135deg,
        var(--bg-card) 0%,
        rgba(20, 184, 166, 0.07) 55%,
        var(--bg-card) 100%
    );
}

.feature-flagship-badge {
    position: absolute;
    top: 18px;
    right: 22px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #0f766e;
    background: rgba(20, 184, 166, 0.22);
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(20, 184, 166, 0.35);
}

[data-theme="dark"] .feature-flagship-badge,
[data-theme="midnight"] .feature-flagship-badge {
    color: #5eead4;
    background: rgba(20, 184, 166, 0.14);
    border-color: rgba(94, 234, 212, 0.28);
}

.feature-flagship-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding-right: 72px;
}

@media (min-width: 640px) {
    .feature-flagship-inner {
        flex-direction: row;
        align-items: center;
        gap: 28px;
        padding-right: 80px;
    }

    .feature-card-main.feature-flagship .feature-icon-main {
        font-size: 3.5rem;
        margin-bottom: 0;
    }

    .feature-card-main.feature-flagship .feature-title-main {
        font-size: 1.65rem;
    }
}

.feature-flagship-text {
    flex: 1;
    min-width: 0;
}

.feature-card-main.feature-flagship .feature-tags {
    margin-top: 4px;
}

.feature-icon-main {
    font-size: 3rem;
    margin-bottom: 16px;
}

.feature-title-main {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.feature-desc-main {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

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

.feature-tags .tag {
    background: var(--bg-hover);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.feature-arrow {
    position: absolute;
    right: 24px;
    bottom: 24px;
    font-size: 1.5rem;
    color: var(--primary);
    opacity: 0;
    transition: all 0.3s ease;
}

.feature-card-main:hover .feature-arrow {
    opacity: 1;
    transform: translateX(5px);
}

/* 学习路径 */
.learning-path-main {
    padding: 80px 0;
    background: var(--bg-card);
}

.path-steps-main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.path-step {
    background: var(--bg-hover);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.path-step.animate {
    opacity: 1;
    transform: translateY(0);
}

.path-step:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.path-step .step-number {
    width: 48px;
    height: 48px;
    background: var(--gradient-1);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0 auto 16px;
}

.path-step h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.path-step p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.step-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* 课程区域 */
.courses-main {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.courses-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.courses-tab {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.courses-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.courses-tab.active {
    background: var(--gradient-1);
    border-color: var(--primary);
    color: white;
}

.courses-grid-main {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.course-card-main {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.course-card-main:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

article.course-card-main {
    display: block;
    color: inherit;
}

.course-card-pair .course-pair-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.course-pair-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border);
    background: var(--bg-hover);
    color: var(--text-primary);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.course-pair-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.course-pair-link--d {
    border-color: rgba(20, 184, 166, 0.45);
    background: rgba(20, 184, 166, 0.08);
}

.course-pair-link--d:hover {
    border-color: #14b8a6;
    color: #0f766e;
}

.course-pair-lab {
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
    opacity: 0.9;
}

.course-lesson-badge {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin: 0 0 12px;
    padding: 8px 12px;
    background: var(--bg-hover);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.course-lesson-badge a {
    color: var(--primary);
    font-weight: 600;
}

.course-header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.course-number {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.course-part {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-hover);
    padding: 4px 8px;
    border-radius: 4px;
}

.course-title-main {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.course-desc-main {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.course-meta-main {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* 面试区域 */
.interview-main {
    padding: 80px 0;
    background: var(--bg-card);
}

.interview-categories-main {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.interview-cat {
    padding: 8px 16px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.interview-cat:hover,
.interview-cat.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.interview-grid-main {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.question-card-main {
    background: var(--bg-hover);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    cursor: pointer;
}

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

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

.q-number {
    font-weight: 700;
    color: var(--primary);
}

.q-type {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
}

.q-type.concept { background: #dbeafe; color: #1e40af; }
.q-type.practice { background: #dcfce7; color: #166534; }
.q-type.compare { background: #fef3c7; color: #92400e; }
.q-type.scenario { background: #fce7f3; color: #9d174d; }

.q-difficulty {
    margin-left: auto;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
}

.q-difficulty.easy { background: #dcfce7; color: #166534; }
.q-difficulty.medium { background: #fef3c7; color: #92400e; }
.q-difficulty.hard { background: #fee2e2; color: #991b1b; }

.question-card-main h4 {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 8px;
}

.question-preview {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.question-card-main.is-expanded {
    cursor: default;
}

.question-card-main__top {
    pointer-events: auto;
}

.question-expand-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 10px 0 0;
    opacity: 0.85;
}

.question-card-main.is-expanded .question-expand-hint {
    display: none;
}

.question-answer-main {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
    cursor: auto;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.9rem;
}

.question-answer-main[hidden] {
    display: none !important;
}

.question-answer-main p {
    margin-bottom: 12px;
}

.question-answer-main ul {
    margin: 0 0 12px 20px;
}

.question-answer-main li {
    margin-bottom: 8px;
}

.question-answer-main pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
    font-size: 0.85rem;
}

.question-answer-main code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
}

.question-toggle-main {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 12px;
    position: relative;
    z-index: 2;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.question-toggle-main:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.interview-more {
    text-align: center;
    margin-top: 32px;
}

.btn-more {
    display: inline-block;
    padding: 12px 24px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

/* 热点话题（知乎稿 Markdown，链到 GitHub 渲染） */
.daily-main {
    padding: 80px 0;
    background: var(--bg-secondary);
    scroll-margin-top: 88px;
}

/* 旧锚点 #daily 仍指向本区块顶部 */
.hot-topics-legacy-anchor {
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    scroll-margin-top: 88px;
}

.section-header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.section-header-main.hot-topics-header {
    max-width: 1200px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-date {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.hot-topics-intro {
    text-align: center;
    color: var(--text-secondary);
    max-width: 720px;
    margin: -12px auto 28px;
    font-size: 0.95rem;
    line-height: 1.65;
}

.hot-topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.hot-topics-repo-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
}

.hot-topics-repo-link:hover {
    text-decoration: underline;
}

.daily-article-main {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 32px;
    border: 1px solid var(--border);
}

.hot-topic-card.daily-article-main {
    max-width: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.hot-topic-card .article-excerpt {
    flex: 1;
}

.article-meta-main {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.article-tag-main {
    background: #fee2e2;
    color: #991b1b;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.article-source-main {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.daily-article-main h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.article-excerpt {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.read-more {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.read-more:hover {
    text-decoration: underline;
}

/* 统计数据 */
.stats-main {
    padding: 80px 0;
    background: var(--bg-dark);
}

.stats-grid-main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.stat-card-main {
    padding: 24px;
}

.stat-value-main {
    font-size: 3rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.stat-label-main {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* 页脚 */
.footer-main {
    background: var(--bg-dark);
    color: var(--text-primary);
    padding: 60px 0 30px;
}

.footer-grid-main {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 48px;
    margin-bottom: 40px;
}

.footer-logo-main {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
    margin-bottom: 16px;
}

.footer-brand-main p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.footer-disclaimer {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-links-main {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.footer-col-main h5 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.footer-col-main a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 6px 0;
    transition: color 0.2s;
}

.footer-col-main a:hover {
    color: var(--primary);
}

.footer-bottom-main {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 响应式 */
@media (max-width: 1024px) {
    .nav-center {
        display: none;
    }

    .main-nav-links {
        display: none;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .footer-grid-main {
        grid-template-columns: 1fr;
    }

    .footer-links-main {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .main-nav {
        padding: 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-stats {
        gap: 24px;
    }

    .section-title {
        font-size: 2rem;
    }

    .features-grid-main,
    .path-steps-main,
    .courses-grid-main,
    .interview-grid-main {
        grid-template-columns: 1fr;
    }

    .footer-links-main {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ========== 可收缩站点侧栏（html[data-site-sidebar]） ========== */
:root {
    --site-sidebar-w: 260px;
    --site-sidebar-w-collapsed: 56px;
}

body.has-site-sidebar {
    padding-left: var(--site-sidebar-w);
    transition: padding-left 0.22s ease;
}

body.has-site-sidebar.sidebar-collapsed {
    padding-left: var(--site-sidebar-w-collapsed);
}

body.has-site-sidebar .navbar,
body.has-site-sidebar .main-header {
    left: var(--site-sidebar-w);
    width: calc(100% - var(--site-sidebar-w));
    transition: left 0.22s ease, width 0.22s ease;
}

body.has-site-sidebar.sidebar-collapsed .navbar,
body.has-site-sidebar.sidebar-collapsed .main-header {
    left: var(--site-sidebar-w-collapsed);
    width: calc(100% - var(--site-sidebar-w-collapsed));
}

.site-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1100;
    width: var(--site-sidebar-w);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: width 0.22s ease, transform 0.25s ease;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.06);
}

.site-sidebar--collapsed {
    width: var(--site-sidebar-w-collapsed);
}

.site-sidebar--collapsed .site-sidebar__txt,
.site-sidebar--collapsed .site-sidebar__summary .site-sidebar__txt,
.site-sidebar--collapsed .site-sidebar__chapters,
.site-sidebar--collapsed .site-sidebar__details > summary ~ * {
    display: none !important;
}

.site-sidebar--collapsed .site-sidebar__link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.site-sidebar--collapsed .site-sidebar__link .site-sidebar__ico {
    margin: 0;
}

.site-sidebar__scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 52px 0 20px;
}

.site-sidebar__collapse {
    position: absolute;
    top: 10px;
    right: 8px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-hover);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-sidebar__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin: 2px 8px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.site-sidebar__link:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.site-sidebar__link--brand {
    font-weight: 700;
    color: var(--text-primary);
}

.site-sidebar__ico {
    width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

.site-sidebar__link--sub {
    padding-left: 20px;
    font-size: 0.85rem;
    margin: 0 8px 0 12px;
}

.site-sidebar__link--deep {
    padding-left: 28px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.site-sidebar__link--deep:hover {
    color: #14b8a6;
}

.site-sidebar__details {
    margin: 6px 0;
}

.site-sidebar__summary {
    padding: 8px 14px;
    margin: 0 8px;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-muted);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-sidebar__summary::-webkit-details-marker {
    display: none;
}

.site-sidebar__chapters {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 0 10px;
}

/* 侧栏：Source Map 源码专题内嵌「十二章」 */
.site-sidebar__details--nested {
    margin: 4px 0 8px;
}

.site-sidebar__details--nested > .site-sidebar__summary {
    padding-left: 22px;
    font-size: 0.84rem;
}

.site-sidebar__details--nested .site-sidebar__chapters .site-sidebar__link--sub {
    padding-left: 26px;
}

.site-sidebar__details--nested .site-sidebar__chapters .site-sidebar__link--deep {
    padding-left: 34px;
}

.site-sidebar__backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(0, 0, 0, 0.4);
}

.site-sidebar__fab {
    display: none;
    position: fixed;
    left: 12px;
    bottom: 88px;
    z-index: 1080;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    align-items: center;
    justify-content: center;
}

@media (max-width: 900px) {
    /* 左下角固定 FAB 勿盖住章节底部按钮与正文 */
    body.has-site-sidebar .course-main {
        padding-bottom: 120px;
    }

    body.has-site-sidebar {
        padding-left: 0 !important;
    }

    body.has-site-sidebar.sidebar-collapsed {
        padding-left: 0 !important;
    }

    body.has-site-sidebar .navbar,
    body.has-site-sidebar .main-header {
        left: 0 !important;
        width: 100% !important;
    }

    .site-sidebar {
        width: min(290px, 88vw);
        transform: translateX(-100%);
        box-shadow: none;
    }

    .site-sidebar.site-sidebar--open {
        transform: translateX(0);
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.18);
    }

    .site-sidebar--collapsed {
        width: min(290px, 88vw);
        transform: translateX(-100%);
    }

    .site-sidebar--collapsed.site-sidebar--open {
        transform: translateX(0);
    }

    .site-sidebar--collapsed .site-sidebar__txt,
    .site-sidebar--collapsed .site-sidebar__summary .site-sidebar__txt,
    .site-sidebar--collapsed .site-sidebar__chapters,
    .site-sidebar--collapsed .site-sidebar__details > summary ~ * {
        display: revert !important;
    }

    .site-sidebar__fab {
        display: flex;
    }

    .site-sidebar__backdrop:not([hidden]) {
        display: block;
    }
}

/* 开发日志页 */
.devlog-main .devlog-content {
    max-width: 820px;
    margin: 0 auto;
}

.devlog-figure {
    margin: 24px 0;
    padding: 12px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
}

.devlog-figure img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.devlog-figure figcaption {
    margin-top: 10px;
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Markdown 源文件链接（页脚） */
.md-source-link {
    text-align: center;
    margin: 0.75rem 0 0;
    font-size: 0.875rem;
}
.md-source-link a {
    color: var(--text-muted);
}
.md-source-link a:hover {
    color: var(--primary);
}

/* 网页版 ↔ GitHub Markdown 双版本提示（深挖页等） */
.md-source-dual {
    margin-top: 0.75rem;
    text-align: center;
}

.md-source-dual .md-source-link {
    margin-top: 0;
}

.md-source-hint {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.45;
}
