:root {
  /* ── 配色系统（暗黑宇宙主题） ── */
  --hue: 240;
  --bg-base: #07080f;
  --bg-surface: rgba(255,255,255,0.04);
  --bg-surface-hover: rgba(255,255,255,0.08);
  --bg-card: rgba(255,255,255,0.05);
  --bg-sidebar: rgba(10,11,20,0.85);
  --glass-border: rgba(255,255,255,0.08);
  --glass-border-hover: rgba(255,255,255,0.18);

  --primary: #818cf8;          /* indigo-400 */
  --primary-glow: rgba(129,140,248,0.35);
  --primary-dark: #4f46e5;
  --accent-violet: #a78bfa;    /* violet-400 */
  --accent-cyan: #22d3ee;      /* cyan-400 */
  --accent-green: #34d399;     /* emerald-400 */
  --accent-amber: #fbbf24;     /* amber-400 */
  --accent-rose: #fb7185;      /* rose-400 */

  --text: #e2e8f0;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.15);

  --green: #34d399;
  --green-glow: rgba(52,211,153,0.3);
  --green-bg: rgba(52,211,153,0.08);
  --green-border: rgba(52,211,153,0.25);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 20px var(--primary-glow);
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* ── 亮色主题覆盖 ── */
[data-theme="light"] {
  --bg-base: #f0f4ff;
  --bg-surface: rgba(255,255,255,0.7);
  --bg-surface-hover: rgba(255,255,255,0.9);
  --bg-card: rgba(255,255,255,0.75);
  --bg-sidebar: rgba(240,244,255,0.92);
  --glass-border: rgba(79,70,229,0.12);
  --glass-border-hover: rgba(79,70,229,0.25);

  --primary: #4f46e5;
  --primary-glow: rgba(79,70,229,0.2);
  --accent-violet: #7c3aed;
  --accent-cyan: #0891b2;
  --accent-green: #059669;
  --accent-amber: #d97706;

  --text: #1e293b;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --border: rgba(79,70,229,0.1);
  --border-strong: rgba(79,70,229,0.2);

  --green: #059669;
  --green-glow: rgba(5,150,105,0.2);
  --green-bg: rgba(5,150,105,0.06);
  --green-border: rgba(5,150,105,0.2);

  --shadow-sm: 0 1px 4px rgba(79,70,229,0.08);
  --shadow-md: 0 4px 16px rgba(79,70,229,0.1);
  --shadow-lg: 0 8px 32px rgba(79,70,229,0.12);
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg-base);
  line-height: 1.75;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ── 动态背景 ── */
.bg-canvas {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; overflow: hidden;
}
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  animation: orbFloat 20s ease-in-out infinite;
}
.bg-orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #4f46e5, #7c3aed);
  top: -200px; left: -150px;
  animation-delay: 0s;
}
.bg-orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #0891b2, #06b6d4);
  top: 30%; right: -200px;
  animation-delay: -7s;
  animation-duration: 25s;
}
.bg-orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #7c3aed, #a855f7);
  bottom: -100px; left: 30%;
  animation-delay: -14s;
  animation-duration: 18s;
}
[data-theme="light"] .bg-orb { opacity: 0.07; }

.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(129,140,248,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(129,140,248,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
}
[data-theme="light"] .bg-grid {
  background-image:
    linear-gradient(rgba(79,70,229,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79,70,229,0.05) 1px, transparent 1px);
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ── 阅读进度条 ── */
.reading-progress {
  position: fixed; top: 0; left: 0; z-index: 9999;
  height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent-violet), var(--accent-cyan));
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px var(--primary-glow);
}

/* ── 布局 ── */
.layout {
  display: flex; min-height: 100vh;
  position: relative; z-index: 1;
}

/* ── 侧栏遮罩 ── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 99;
  backdrop-filter: blur(4px);
}
.sidebar-overlay.active { display: block; }

/* ── 侧边栏 ── */
.sidebar {
  width: 272px; flex-shrink: 0;
  background: var(--bg-sidebar);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-right: 1px solid var(--glass-border);
  display: flex; flex-direction: column;
  height: 100vh; position: sticky; top: 0;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}

.sidebar-header {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex; align-items: center; gap: 0.75rem;
}

.brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent-violet));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 700; color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
  font-family: 'Inter', serif;
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-title { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.brand-sub { font-size: 0.68rem; color: var(--text-muted); letter-spacing: 0.05em; }

.sidebar-actions { display: flex; gap: 0.5rem; }

.icon-btn {
  width: 32px; height: 32px;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; transition: all 0.2s;
  position: relative; overflow: hidden;
}
.icon-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }

/* ── 侧栏搜索 ── */
.sidebar-search {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.search-box {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: 8px; padding: 0.45rem 0.75rem;
  transition: all 0.2s;
}
.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--bg-surface-hover);
}
.search-icon { font-size: 0.8rem; opacity: 0.5; flex-shrink: 0; }
#nav-search {
  background: none; border: none; outline: none;
  color: var(--text); font-size: 0.82rem;
  width: 100%; font-family: inherit;
}
#nav-search::placeholder { color: var(--text-muted); }

/* ── 侧栏导航 ── */
.sidebar-nav {
  flex: 1; overflow-y: auto; padding: 0.75rem 0.75rem;
  scrollbar-width: thin; scrollbar-color: var(--glass-border) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 2px; }

.sidebar-section { margin-bottom: 0.25rem; }

.section-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem; font-weight: 700;
  color: var(--text-muted);
  cursor: pointer; border-radius: 8px;
  transition: all 0.2s; letter-spacing: 0.04em;
  text-transform: uppercase; user-select: none;
}
.section-title::after {
  content: '▾';
  font-size: 0.7rem; opacity: 0.6;
  transition: transform 0.25s ease;
}
.section-title:hover {
  color: var(--text); background: var(--bg-surface);
}
.sidebar-section.collapsed .section-title::after {
  transform: rotate(-90deg);
}

.section-items {
  padding: 0.25rem 0; overflow: hidden;
  max-height: 600px;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  opacity: 1;
}
.sidebar-section.collapsed .section-items {
  max-height: 0; opacity: 0;
}

.sidebar-link {
  display: flex; align-items: center;
  padding: 0.38rem 0.75rem; margin: 0.1rem 0;
  font-size: 0.82rem; color: var(--text-subtle);
  text-decoration: none; border-radius: 7px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: all 0.18s; position: relative;
}
.sidebar-link::before {
  content: ''; position: absolute; left: 0; top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 2px; height: 60%; background: var(--primary);
  border-radius: 0 2px 2px 0; transition: transform 0.2s ease;
}
.sidebar-link:hover {
  background: var(--bg-surface);
  color: var(--text);
}
.sidebar-link:hover::before { transform: translateY(-50%) scaleY(1); }
.sidebar-link.active {
  background: linear-gradient(90deg, rgba(129,140,248,0.18), rgba(129,140,248,0.06));
  color: var(--primary);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(129,140,248,0.15);
}
.sidebar-link.active::before { transform: translateY(-50%) scaleY(1); }
[data-theme="light"] .sidebar-link.active {
  background: linear-gradient(90deg, rgba(79,70,229,0.12), rgba(79,70,229,0.04));
  box-shadow: inset 0 0 0 1px rgba(79,70,229,0.12);
}

.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.home-link {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; color: var(--text-muted);
  text-decoration: none; padding: 0.4rem 0.5rem;
  border-radius: 6px; transition: all 0.2s;
}
.home-link:hover { color: var(--primary); background: var(--bg-surface); }

/* ── 主内容区 ── */
.main-content {
  flex: 1; display: flex; flex-direction: column;
  min-width: 0; max-width: 900px;
}

/* ── 顶部栏 ── */
.top-bar {
  display: none; /* 桌面端隐藏 */
  align-items: center; gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-sidebar);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky; top: 0; z-index: 50;
}

.menu-toggle {
  width: 36px; height: 36px; background: var(--bg-surface);
  border: 1px solid var(--glass-border); border-radius: 8px;
  cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  transition: all 0.2s; flex-shrink: 0;
}
.menu-toggle span {
  display: block; width: 18px; height: 2px;
  background: var(--text); border-radius: 1px;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}
.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

.breadcrumb { font-size: 0.8rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.25rem; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.bc-sep { opacity: 0.4; margin: 0 0.2rem; }
.bc-current { color: var(--text); font-weight: 500; }

/* ── 文章内容 ── */
.content {
  flex: 1;
  padding: 2.5rem 3rem;
  font-size: 0.95rem;
}

.content h1 {
  font-size: 2rem; font-weight: 800; line-height: 1.2;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text), var(--primary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--glass-border);
  position: relative;
}
.content h1::after {
  content: ''; position: absolute; bottom: -1px; left: 0;
  width: 60px; height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent-violet));
  border-radius: 1px;
}

.content h2 {
  font-size: 1.25rem; font-weight: 700; margin: 2rem 0 0.75rem;
  padding: 0.5rem 0.75rem 0.5rem 1rem;
  position: relative;
  background: var(--bg-surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  border-left: 3px solid var(--primary);
  color: var(--text);
}

.content h3 {
  font-size: 1.05rem; font-weight: 600; margin: 1.5rem 0 0.5rem;
  color: var(--accent-violet);
  display: flex; align-items: center; gap: 0.5rem;
}
.content h3::before {
  content: '◆'; font-size: 0.5em; opacity: 0.7;
}

.content h4 { font-size: 0.95rem; font-weight: 600; margin: 1rem 0 0.4rem; color: var(--accent-cyan); }
.content h5 { font-size: 0.9rem; font-weight: 600; margin: 0.75rem 0 0.3rem; color: var(--text-subtle); }

.content p { margin: 0.6rem 0; line-height: 1.9; }

.content ul, .content ol {
  padding-left: 1.5rem; margin: 0.75rem 0;
}
.content li {
  margin: 0.3rem 0; line-height: 1.8;
}
.content ul li::marker { color: var(--primary); }
.content ol li::marker { color: var(--accent-violet); font-weight: 600; }

.content strong { color: var(--accent-amber); font-weight: 700; }
.content em { color: var(--accent-cyan); font-style: italic; }

.content table {
  width: 100%; border-collapse: collapse; margin: 1.25rem 0;
  font-size: 0.875rem; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.content thead th {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white; padding: 0.65rem 1rem;
  text-align: left; font-weight: 600; font-size: 0.82rem;
  letter-spacing: 0.03em;
}
.content td {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--glass-border);
}
.content tr:nth-child(even) td { background: var(--bg-surface); }
.content tr:hover td { background: var(--bg-surface-hover); }

.content blockquote {
  margin: 1rem 0; padding: 1rem 1.25rem;
  border-left: 3px solid var(--accent-violet);
  background: rgba(167,139,250,0.07);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-subtle);
  font-style: italic;
  box-shadow: inset 0 0 0 1px rgba(167,139,250,0.1);
}
[data-theme="light"] .content blockquote { background: rgba(124,58,237,0.05); }

.content code {
  background: rgba(129,140,248,0.12);
  border: 1px solid rgba(129,140,248,0.2);
  color: var(--accent-cyan);
  padding: 0.15rem 0.45rem; border-radius: 5px;
  font-size: 0.85em; font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.content pre {
  background: rgba(0,0,0,0.4); border: 1px solid var(--glass-border);
  border-radius: var(--radius); padding: 1.25rem;
  overflow-x: auto; margin: 1rem 0;
}
.content pre code {
  background: none; border: none; color: #a8ff78; padding: 0;
  font-size: 0.88em;
}
[data-theme="light"] .content pre { background: rgba(15,23,42,0.06); }

.content hr {
  margin: 2rem 0; border: none;
  border-top: 1px solid var(--glass-border);
}

/* ── KaTeX 公式高亮 ── */
.katex-display {
  margin: 1.25rem 0 !important;
  padding: 1rem 1.5rem;
  background: rgba(129,140,248,0.06);
  border: 1px solid rgba(129,140,248,0.12);
  border-radius: var(--radius);
  overflow-x: auto;
}
[data-theme="light"] .katex-display { background: rgba(79,70,229,0.04); }

/* ── 练习区 ── */
.exercise-section {
  margin-top: 3rem;
  padding: 2rem;
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 30px rgba(52,211,153,0.05);
}
.exercise-section > h2 {
  border-left-color: var(--green) !important;
  background: rgba(52,211,153,0.08) !important;
  color: var(--green) !important;
}
.exercise-section > h3 {
  color: var(--green) !important;
}
.exercise-section > h3::before { color: var(--green); }

.toggle-all-wrapper {
  display: flex; gap: 0.5rem; margin-bottom: 1.5rem;
}
.toggle-all-btn {
  padding: 0.45rem 1.2rem;
  font-size: 0.82rem; font-weight: 600; color: #0d1117;
  background: linear-gradient(135deg, var(--green), #22c55e);
  border: none; border-radius: 20px; cursor: pointer;
  transition: all 0.2s; box-shadow: 0 2px 8px var(--green-glow);
}
.toggle-all-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--green-glow);
}

.exercise-card {
  margin: 1rem 0; padding: 1.25rem 1.5rem;
  border: 1px solid var(--green-border);
  border-radius: var(--radius);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  transition: all 0.25s;
  position: relative; overflow: hidden;
}
.exercise-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 3px; height: 100%;
  background: linear-gradient(180deg, var(--green), transparent);
  border-radius: 2px 0 0 2px;
}
.exercise-card:hover {
  border-color: var(--green);
  box-shadow: 0 4px 20px var(--green-glow);
  transform: translateX(2px);
}
.exercise-card .exercise-question {
  font-weight: 600; line-height: 1.9;
}

.answer-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-top: 0.75rem; padding: 0.35rem 1rem;
  font-size: 0.8rem; font-weight: 600; color: var(--green);
  background: var(--green-bg); border: 1px solid var(--green-border);
  border-radius: 20px; cursor: pointer; transition: all 0.2s;
}
.answer-btn:hover { background: var(--green-border); }
.answer-btn.answer-shown {
  color: var(--accent-rose);
  background: rgba(251,113,133,0.08);
  border-color: rgba(251,113,133,0.25);
}

.exercise-answer {
  max-height: 0; overflow: hidden;
  opacity: 0; margin-top: 0;
  padding: 0 1rem; border-radius: var(--radius);
  background: rgba(52,211,153,0.06);
  border-left: 3px solid var(--green);
  transition: max-height 0.35s ease, opacity 0.3s ease, margin-top 0.3s ease, padding 0.3s ease;
  line-height: 1.9;
}
.exercise-answer.visible {
  max-height: 600px; opacity: 1;
  margin-top: 0.75rem; padding: 0.85rem 1rem;
}

.difficulty-badge {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  font-size: 0.7rem; font-weight: 700; border-radius: 10px; margin-left: 0.5rem;
  letter-spacing: 0.04em;
}
.difficulty-badge.easy { background: rgba(52,211,153,0.15); color: var(--green); border: 1px solid var(--green-border); }
.difficulty-badge.medium { background: rgba(251,191,36,0.12); color: var(--accent-amber); border: 1px solid rgba(251,191,36,0.25); }
.difficulty-badge.hard { background: rgba(251,113,133,0.12); color: var(--accent-rose); border: 1px solid rgba(251,113,133,0.25); }

.learn-tip {
  margin: 1rem 0; padding: 1rem 1.25rem;
  border-left: 3px solid var(--accent-amber);
  background: rgba(251,191,36,0.07);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.learn-tip strong { color: var(--accent-amber); }

/* ── 首页特定样式 ── */
.hero-section {
  padding: 3rem 0 2rem;
  text-align: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(129,140,248,0.1);
  border: 1px solid rgba(129,140,248,0.2);
  border-radius: 20px; padding: 0.3rem 1rem;
  font-size: 0.78rem; color: var(--primary); font-weight: 600;
  margin-bottom: 1.5rem; letter-spacing: 0.05em;
}
.hero-title {
  font-size: 3rem; font-weight: 900; line-height: 1.1;
  background: linear-gradient(135deg, #e2e8f0 0%, var(--primary) 40%, var(--accent-violet) 70%, var(--accent-cyan) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 1rem;
  text-shadow: none;
  border: none !important; padding: 0 !important;
}
.hero-title::after { display: none !important; }
[data-theme="light"] .hero-title {
  background: linear-gradient(135deg, #1e293b 0%, var(--primary) 50%, var(--accent-violet) 100%);
  -webkit-background-clip: text; background-clip: text;
}
.hero-sub {
  font-size: 1rem; color: var(--text-muted); margin-bottom: 0.5rem;
  font-weight: 400; letter-spacing: 0.02em;
}

/* ── 统计数字栏 ── */
.hero-stats {
  display: flex; align-items: center; justify-content: center;
  gap: 2rem; margin: 2rem 0;
  flex-wrap: wrap;
}
.hero-stat {
  text-align: center;
}
.hero-stat-num {
  font-size: 2rem; font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent-violet));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; display: block;
}
.hero-stat-label {
  font-size: 0.75rem; color: var(--text-muted); margin-top: 0.1rem;
  letter-spacing: 0.05em;
}
.hero-stat-divider {
  width: 1px; height: 40px;
  background: var(--glass-border);
}

/* ── 学段卡片 ── */
.stage-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem; margin: 2.5rem 0;
}

.stage-card {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  cursor: pointer;
  display: flex; flex-direction: column;
}
.stage-card::before {
  content: ''; position: absolute;
  inset: 0; opacity: 0; transition: opacity 0.3s;
  border-radius: inherit;
  pointer-events: none;
}
.stage-card.green::before  { background: radial-gradient(circle at 50% 0%, rgba(52,211,153,0.12), transparent 70%); }
.stage-card.blue::before   { background: radial-gradient(circle at 50% 0%, rgba(34,211,238,0.10), transparent 70%); }
.stage-card.purple::before { background: radial-gradient(circle at 50% 0%, rgba(167,139,250,0.12), transparent 70%); }
.stage-card.amber::before  { background: radial-gradient(circle at 50% 0%, rgba(251,191,36,0.10), transparent 70%); }

.stage-card:hover { transform: translateY(-6px); border-color: var(--glass-border-hover); }
.stage-card:hover::before { opacity: 1; }
.stage-card:hover { box-shadow: var(--shadow-lg); }

.stage-card-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.stage-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.stage-card.green .stage-icon  { background: rgba(52,211,153,0.15); box-shadow: 0 4px 12px rgba(52,211,153,0.2); }
.stage-card.blue .stage-icon   { background: rgba(34,211,238,0.12); box-shadow: 0 4px 12px rgba(34,211,238,0.2); }
.stage-card.purple .stage-icon { background: rgba(167,139,250,0.15); box-shadow: 0 4px 12px rgba(167,139,250,0.2); }
.stage-card.amber .stage-icon  { background: rgba(251,191,36,0.12); box-shadow: 0 4px 12px rgba(251,191,36,0.2); }

.stage-done-badge {
  font-size: 0.68rem; font-weight: 700; padding: 0.15rem 0.6rem;
  border-radius: 10px; letter-spacing: 0.05em;
}
.stage-card.green .stage-done-badge  { background: rgba(52,211,153,0.15); color: var(--accent-green); }
.stage-card.blue .stage-done-badge   { background: rgba(34,211,238,0.12); color: var(--accent-cyan); }
.stage-card.purple .stage-done-badge { background: rgba(167,139,250,0.15); color: var(--accent-violet); }
.stage-card.amber .stage-done-badge  { background: rgba(251,191,36,0.12); color: var(--accent-amber); }

.stage-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.25rem; }
.stage-card p  { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.75rem; flex: 1; }

.stage-progress {
  height: 4px; background: var(--bg-surface);
  border-radius: 2px; overflow: hidden; margin-bottom: 0.4rem;
}
.stage-progress-fill {
  height: 100%; border-radius: 2px;
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}
.stage-card.green .stage-progress-fill  { background: linear-gradient(90deg, #34d399, #22c55e); }
.stage-card.blue .stage-progress-fill   { background: linear-gradient(90deg, #22d3ee, #0ea5e9); }
.stage-card.purple .stage-progress-fill { background: linear-gradient(90deg, #a78bfa, #818cf8); }
.stage-card.amber .stage-progress-fill  { background: linear-gradient(90deg, #fbbf24, #f59e0b); }

.stage-progress-label { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 0.75rem; }

.stage-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.82rem; font-weight: 600;
  text-decoration: none; transition: gap 0.2s;
  margin-top: auto;
}
.stage-card.green .stage-link  { color: var(--accent-green); }
.stage-card.blue .stage-link   { color: var(--accent-cyan); }
.stage-card.purple .stage-link { color: var(--accent-violet); }
.stage-card.amber .stage-link  { color: var(--accent-amber); }
.stage-link:hover { gap: 0.6rem; }

/* ── 学习路径 ── */
.section-heading {
  font-size: 1.4rem; font-weight: 800; margin: 3rem 0 1.5rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.section-heading::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--glass-border), transparent);
}

.path-timeline {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}
.path-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg); padding: 1.25rem;
  backdrop-filter: blur(8px);
  transition: all 0.25s;
  position: relative; overflow: hidden;
}
.path-card:hover { border-color: var(--glass-border-hover); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.path-badge {
  display: inline-block; padding: 0.2rem 0.7rem;
  border-radius: 6px; font-size: 0.72rem; font-weight: 700;
  color: white; margin-bottom: 0.75rem; letter-spacing: 0.05em;
}
.path-card h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.75rem; }
.path-steps {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 0.35rem; margin-bottom: 0.75rem;
}
.step {
  background: var(--bg-surface); padding: 0.2rem 0.6rem;
  border-radius: 5px; border: 1px solid var(--glass-border);
  font-size: 0.78rem;
}
.step-arrow { color: var(--text-muted); font-size: 0.85rem; }
.path-link {
  font-size: 0.82rem; color: var(--primary); text-decoration: none;
  font-weight: 600; display: inline-flex; align-items: center; gap: 0.3rem;
  transition: gap 0.2s;
}
.path-link:hover { gap: 0.5rem; }

/* ── 页脚 ── */
.footer {
  padding: 2rem 3rem;
  border-top: 1px solid var(--glass-border);
  margin-top: auto;
}
.footer-inner {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.78rem; color: var(--text-muted);
}
.footer-logo {
  font-size: 1.2rem; font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent-violet));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── 响应式 ── */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; z-index: 100;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .top-bar { display: flex; }
  .content { padding: 1.5rem; }
  .footer { padding: 1.5rem; }
  .hero-title { font-size: 2rem; }
  .hero-stats { gap: 1rem; }
  .stage-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .stage-cards { grid-template-columns: 1fr; }
  .path-timeline { grid-template-columns: 1fr; }
  .hero-stat-divider { display: none; }
  .hero-stats { gap: 1.5rem; }
}
