/* =========================================================
 * KernelCraft — 暗黑苹果官网风
 * ========================================================= */

:root {
  --bg: #000000;
  --bg-2: #0b0b0d;
  --bg-3: #141416;
  --card: rgba(255, 255, 255, 0.045);
  --card-hover: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #6e6e73;
  --blue: #0a84ff;
  --purple: #bf5af2;
  --green: #30d158;
  --orange: #ff9f0a;
  --pink: #ff6482;
  --teal: #64d2ff;
  --yellow: #ffd60a;
  --radius: 20px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas,
    "Courier New", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.6;
}

::selection { background: rgba(10, 132, 255, 0.35); }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: #2c2c2e; border-radius: 6px; border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: #48484a; }

/* ---------- 毛玻璃导航 ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 10, 12, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.nav-inner {
  width: min(1060px, 92vw);
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  display: flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 15px; letter-spacing: 0.3px;
  color: var(--text); text-decoration: none;
}
.nav-logo .logo-chip {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; font-weight: 700; color: #fff;
}
.nav-links { display: flex; gap: 34px; }
.nav-links a {
  color: var(--text-2); text-decoration: none; font-size: 13px;
  transition: color 0.25s;
  position: relative;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); font-weight: 600; }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -17px;
  height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--blue), var(--purple));
}
.nav-progress-pill {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; color: var(--text-2);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 12px; cursor: pointer; text-decoration: none;
  transition: border-color .25s, background .25s;
}
.nav-progress-pill:hover { border-color: var(--border-strong); background: var(--card); }
.nav-progress-pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: conic-gradient(var(--green) var(--p, 0%), #3a3a3c 0);
}
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-burger {
  display: none;
  flex-direction: column; justify-content: center; gap: 4px;
  width: 34px; height: 34px; padding: 7px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; transition: background .25s, border-color .25s;
}
.nav-burger:hover { background: var(--card); border-color: var(--border-strong); }
.nav-burger i {
  display: block; height: 2px; border-radius: 2px; background: var(--text);
  transition: transform .3s, opacity .3s;
}
.nav-burger.open i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger.open i:nth-child(2) { opacity: 0; }
.nav-burger.open i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.nav-mobile {
  display: none;
  position: absolute; top: 100%; left: 0; right: 0;
  flex-direction: column;
  background: rgba(10, 10, 12, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 4vw 14px;
}
.nav-mobile a {
  color: var(--text-2); text-decoration: none; font-size: 15px;
  padding: 13px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.nav-mobile a:last-child { border-bottom: none; }
.nav-mobile a.active { color: var(--text); font-weight: 600; }

/* ---------- 通用容器 ---------- */
.container { width: min(1060px, 92vw); margin: 0 auto; }
.section { padding: 110px 0; }

/* ---------- 渐变标题 ---------- */
.gradient-text {
  background: linear-gradient(100deg, #58b7ff 0%, #bf5af2 45%, #ff6482 90%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.gradient-text-green {
  background: linear-gradient(100deg, #30d158, #64d2ff);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  position: relative;
  padding: 140px 5vw 80px;
}
#hero-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.hero-content { position: relative; z-index: 2; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--text-2); margin-bottom: 22px;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 18px;
  background: rgba(255,255,255,0.03);
}
.hero-eyebrow .pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 12px var(--green);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1);} 50% { opacity: .45; transform: scale(.75);} }

.hero h1 {
  font-size: clamp(46px, 8.5vw, 96px);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.05;
  margin-bottom: 26px;
}
.hero p.sub {
  font-size: clamp(17px, 2.2vw, 22px);
  color: var(--text-2); max-width: 640px; margin: 0 auto 42px;
  font-weight: 400;
}
.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 30px; border-radius: 999px;
  font-size: 16px; font-weight: 600; text-decoration: none;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s, background .25s;
  border: none; cursor: pointer; font-family: var(--font);
}
.btn:hover { transform: translateY(-2px) scale(1.02); }
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--blue); color: #fff;
  box-shadow: 0 8px 30px rgba(10, 132, 255, 0.35);
}
.btn-primary:hover { background: #1a90ff; box-shadow: 0 12px 40px rgba(10,132,255,.45); }
.btn-ghost {
  background: transparent; color: var(--blue);
  border: 1.5px solid rgba(10,132,255,.6);
}
.btn-ghost:hover { background: rgba(10,132,255,.1); }

.hero-stats {
  display: flex; gap: clamp(24px, 6vw, 72px); justify-content: center;
  margin-top: 76px; flex-wrap: wrap; position: relative; z-index: 2;
}
.hstat { text-align: center; }
.hstat .num {
  font-size: clamp(30px, 4vw, 44px); font-weight: 800; letter-spacing: -0.02em;
  font-family: var(--mono);
}
.hstat .label { font-size: 13px; color: var(--text-3); margin-top: 4px; letter-spacing: 1px; }

.scroll-hint {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  color: var(--text-3); font-size: 12px; letter-spacing: 2px;
  animation: bob 2.4s ease-in-out infinite; z-index: 2;
}
@keyframes bob { 0%,100% { transform: translate(-50%, 0);} 50% { transform: translate(-50%, 8px);} }

/* ---------- 滚动显现 ---------- */
.reveal {
  opacity: 0; transform: translateY(36px);
  transition: opacity .8s cubic-bezier(.22,1,.36,1), transform .8s cubic-bezier(.22,1,.36,1);
}
.reveal.visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }

/* ---------- 章节标题 ---------- */
.sec-head { text-align: center; margin-bottom: 64px; }
.sec-head .kicker {
  font-size: 13px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 14px;
}
.sec-head h2 {
  font-size: clamp(32px, 5vw, 52px); font-weight: 800; letter-spacing: -0.02em;
}
.sec-head p { color: var(--text-2); margin-top: 16px; font-size: 17px; max-width: 560px; margin-inline: auto; }

/* ---------- 路线图 ---------- */
.roadmap { position: relative; padding-left: 34px; }
.roadmap::before {
  content: ""; position: absolute; left: 9px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--blue), var(--purple), var(--pink), var(--green));
  border-radius: 2px; opacity: .6;
}
.road-item {
  position: relative; padding: 18px 0 18px 22px;
  transition: transform .3s;
}
.road-item:hover { transform: translateX(6px); }
.road-item::before {
  content: ""; position: absolute; left: -32px; top: 26px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--item-color, var(--blue));
  box-shadow: 0 0 14px var(--item-color, var(--blue));
}
.road-item .stage {
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--item-color, var(--blue)); font-weight: 700;
}
.road-item h4 { font-size: 19px; font-weight: 700; margin: 3px 0 2px; }
.road-item p { color: var(--text-2); font-size: 14px; }

/* ---------- 章节卡片 ---------- */
.chapter-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}
.ch-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 28px 26px;
  text-decoration: none; color: var(--text);
  overflow: hidden;
  transition: transform .35s cubic-bezier(.22,1,.36,1), border-color .35s, background .35s;
  display: flex; flex-direction: column; gap: 12px;
}
.ch-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(420px 200px at 20% -10%, var(--ch-glow, rgba(10,132,255,.18)), transparent 65%);
  opacity: 0; transition: opacity .4s;
}
.ch-card:hover { transform: translateY(-6px); border-color: var(--border-strong); background: var(--card-hover); }
.ch-card:hover::before { opacity: 1; }
.ch-card > * { position: relative; }
.ch-card .ch-num {
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  color: var(--ch-color, var(--blue));
  letter-spacing: 2px;
}
.ch-card h3 { font-size: 22px; font-weight: 750; letter-spacing: -0.01em; }
.ch-card .ch-sub { color: var(--text-2); font-size: 14px; }
.ch-card .ch-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: auto; padding-top: 14px;
  font-size: 12px; color: var(--text-3);
}
.ch-card .ch-bar {
  height: 4px; border-radius: 4px; background: rgba(255,255,255,.08);
  overflow: hidden;
}
.ch-card .ch-bar i {
  display: block; height: 100%; border-radius: 4px;
  background: var(--ch-color, var(--blue));
  transition: width 1s cubic-bezier(.22,1,.36,1);
}
.ch-card .done-badge {
  position: absolute; top: 18px; right: 18px;
  font-size: 11px; font-weight: 700; color: var(--green);
  border: 1px solid rgba(48,209,88,.4); border-radius: 999px; padding: 3px 10px;
  background: rgba(48,209,88,.08);
}

/* ---------- 章节详情 ---------- */
.chapter-hero {
  padding: 150px 0 60px;
  position: relative;
  overflow: hidden;
}
.chapter-hero .bg-glow {
  position: absolute; top: -180px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 500px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--ch-glow, rgba(10,132,255,.2)), transparent);
  filter: blur(40px); pointer-events: none;
}
.chapter-hero .ch-num-big {
  font-family: var(--mono); font-size: 14px; letter-spacing: 4px;
  color: var(--ch-color, var(--blue)); font-weight: 700; margin-bottom: 14px;
}
.chapter-hero h1 {
  font-size: clamp(38px, 6vw, 64px); font-weight: 800; letter-spacing: -0.025em;
  line-height: 1.1;
}
.chapter-hero .ch-sub-big { color: var(--text-2); font-size: 20px; margin-top: 12px; }
.chapter-hero .ch-intro {
  color: var(--text-2); max-width: 720px; margin-top: 24px; font-size: 16px;
}
.chapter-hero .ch-head-meta {
  display: flex; gap: 14px; align-items: center; margin-top: 30px; flex-wrap: wrap;
}
.meta-chip {
  font-size: 13px; color: var(--text-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px;
  background: rgba(255,255,255,.03);
}

/* 章节进度条 */
.chapter-progress-wrap {
  display: flex; align-items: center; gap: 16px;
  margin-top: 28px; max-width: 480px;
}
.chapter-progress-wrap .bar {
  flex: 1; height: 6px; border-radius: 6px; background: rgba(255,255,255,.08);
  overflow: hidden;
}
.chapter-progress-wrap .bar i {
  display: block; height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--ch-color, var(--blue)), var(--purple));
  transition: width .9s cubic-bezier(.22,1,.36,1);
}
.chapter-progress-wrap .pct { font-family: var(--mono); font-size: 14px; color: var(--text-2); min-width: 44px; }

/* 理论小节 */
.theory-section {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 34px 34px 30px;
  margin-bottom: 26px;
  transition: border-color .3s, background .3s;
}
.theory-section:hover { border-color: var(--border-strong); }
.theory-section.done { border-color: rgba(48,209,88,.35); }
.theory-section .ts-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
}
.theory-section h3 { font-size: 22px; font-weight: 750; margin-bottom: 14px; }
.theory-section p { color: var(--text-2); margin-bottom: 12px; font-size: 15px; }
.ts-points {
  list-style: none; margin-top: 16px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px;
}
.ts-points li {
  font-size: 14px; color: var(--text);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 14px;
  display: flex; align-items: center; gap: 9px;
}
.ts-points li::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ch-color, var(--blue)); flex-shrink: 0;
}

/* 完成勾选按钮 */
.check-btn {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; font-family: var(--font);
  color: var(--text-2);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 15px; cursor: pointer;
  transition: all .25s;
}
.check-btn:hover { border-color: var(--border-strong); color: var(--text); }
.check-btn .cb-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--text-3);
  display: grid; place-items: center;
  transition: all .25s;
  font-size: 10px; color: transparent;
}
.check-btn.done { color: var(--green); border-color: rgba(48,209,88,.5); background: rgba(48,209,88,.08); }
.check-btn.done .cb-dot { background: var(--green); border-color: var(--green); color: #000; }

/* ---------- 练习卡片 ---------- */
.ex-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  margin-bottom: 26px;
}
.ex-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 22px 28px 0;
}
.ex-head h3 { font-size: 19px; font-weight: 750; }
.ex-tag {
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  border-radius: 6px; padding: 3px 9px;
}
.ex-tag.code { background: rgba(10,132,255,.15); color: #58b7ff; }
.ex-tag.quiz { background: rgba(191,90,242,.15); color: #da9fff; }
.ex-diff { margin-left: auto; color: var(--yellow); font-size: 13px; letter-spacing: 2px; }
.ex-desc { padding: 14px 28px 6px; color: var(--text-2); font-size: 14.5px; white-space: pre-line; }

.code-block {
  margin: 14px 28px;
  background: #0d0d10;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.code-block .cb-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}
.code-block .cb-bar i { width: 10px; height: 10px; border-radius: 50%; }
.code-block .cb-bar i:nth-child(1) { background: #ff5f57; }
.code-block .cb-bar i:nth-child(2) { background: #febc2e; }
.code-block .cb-bar i:nth-child(3) { background: #28c840; }
.code-block .cb-bar span {
  margin-left: 8px; font-family: var(--mono); font-size: 12px; color: var(--text-3);
}
.code-block pre {
  padding: 18px 20px; overflow-x: auto;
  font-family: var(--mono); font-size: 13px; line-height: 1.65;
  color: #d4d4d8;
  tab-size: 4;
}
.ex-actions {
  display: flex; gap: 12px; padding: 4px 28px 24px; flex-wrap: wrap;
}
.mini-btn {
  font-size: 13px; font-weight: 600; font-family: var(--font);
  border-radius: 999px; padding: 8px 18px; cursor: pointer;
  transition: all .25s; border: 1px solid var(--border);
  background: rgba(255,255,255,.05); color: var(--text-2);
}
.mini-btn:hover { color: var(--text); border-color: var(--border-strong); }
.mini-btn.accent { background: rgba(10,132,255,.14); color: #58b7ff; border-color: rgba(10,132,255,.35); }
.mini-btn.accent:hover { background: rgba(10,132,255,.24); }
.mini-btn.done-btn { background: rgba(48,209,88,.1); color: var(--green); border-color: rgba(48,209,88,.35); }
.mini-btn.done-btn.marked { background: var(--green); color: #000; border-color: var(--green); }

.answer-block { display: none; }
.answer-block.open { display: block; }
.answer-block .ans-label {
  margin: 6px 28px 0; font-size: 12px; font-weight: 700; letter-spacing: 2px;
  color: var(--green); text-transform: uppercase;
}
.answer-block pre { white-space: pre-wrap; }

/* ---------- 资源链接 ---------- */
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.res-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 18px 20px;
  text-decoration: none; color: var(--text);
  transition: transform .3s, border-color .3s, background .3s;
}
.res-card:hover { transform: translateY(-3px); border-color: var(--border-strong); background: var(--card-hover); }
.res-card .res-tag {
  flex-shrink: 0;
  font-size: 11px; font-weight: 700;
  border-radius: 8px; padding: 5px 10px;
  background: rgba(255,255,255,.07); color: var(--text-2);
  min-width: 56px; text-align: center;
}
.res-card .res-name { font-size: 14.5px; font-weight: 550; }
.res-card .res-arrow { margin-left: auto; color: var(--text-3); transition: transform .3s, color .3s; }
.res-card:hover .res-arrow { transform: translateX(4px); color: var(--blue); }

/* ---------- 章节导航 footer ---------- */
.chapter-nav {
  display: flex; justify-content: space-between; gap: 18px;
  padding: 60px 0 90px;
}
.chapter-nav a {
  flex: 1; max-width: 48%;
  display: block; text-decoration: none;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 28px;
  color: var(--text);
  transition: transform .3s, border-color .3s;
}
.chapter-nav a:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.chapter-nav a .dir { font-size: 12px; color: var(--text-3); letter-spacing: 2px; text-transform: uppercase; }
.chapter-nav a .t { font-size: 18px; font-weight: 700; margin-top: 6px; }
.chapter-nav a.next { text-align: right; }

/* ---------- 进度看板 ---------- */
.dash-grid {
  display: grid; grid-template-columns: 340px 1fr; gap: 26px;
  align-items: start;
}
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }

.panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px;
}
.panel h3 { font-size: 17px; font-weight: 700; margin-bottom: 20px; letter-spacing: .5px; }

.ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.ring-svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,.07); }
.ring-fg {
  fill: none; stroke: url(#ringGrad);
  stroke-linecap: round;
  transition: stroke-dashoffset 1.4s cubic-bezier(.22,1,.36,1);
}
.ring-center { text-align: center; margin-top: -160px; position: relative; z-index: 2; }
.ring-center .pct { font-size: 46px; font-weight: 800; font-family: var(--mono); letter-spacing: -2px; }
.ring-center .lbl { color: var(--text-3); font-size: 13px; }
.ring-stats { display: flex; gap: 28px; margin-top: 150px; }
.ring-stats .rs { text-align: center; }
.ring-stats .rs b { display: block; font-size: 22px; font-family: var(--mono); }
.ring-stats .rs span { font-size: 12px; color: var(--text-3); }

.dash-ch-row {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.dash-ch-row:last-child { border-bottom: none; }
.dash-ch-row .n { font-family: var(--mono); font-size: 13px; color: var(--row-color, var(--blue)); font-weight: 700; }
.dash-ch-row .t { font-size: 14.5px; font-weight: 600; }
.dash-ch-row .bar {
  height: 5px; border-radius: 5px; background: rgba(255,255,255,.07);
  overflow: hidden; margin-top: 6px;
}
.dash-ch-row .bar i {
  display: block; height: 100%; border-radius: 5px;
  background: var(--row-color, var(--blue));
  transition: width 1.1s cubic-bezier(.22,1,.36,1);
}
.dash-ch-row .pct { font-family: var(--mono); font-size: 13px; color: var(--text-2); min-width: 42px; text-align: right; }

/* 热力图 */
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); gap: 3px; justify-content: start; }
.hm-cell {
  width: 12px; height: 12px; border-radius: 3px;
  background: rgba(255,255,255,.06);
  transition: transform .15s;
}
.hm-cell:hover { transform: scale(1.35); }
.hm-cell.l1 { background: rgba(48,209,88,.25); }
.hm-cell.l2 { background: rgba(48,209,88,.45); }
.hm-cell.l3 { background: rgba(48,209,88,.7); }
.hm-cell.l4 { background: #30d158; box-shadow: 0 0 8px rgba(48,209,88,.5); }
.hm-legend { display: flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 11px; color: var(--text-3); }
.hm-legend .hm-cell { width: 10px; height: 10px; }

.danger-zone { margin-top: 26px; }
.danger-btn {
  font-size: 13px; font-family: var(--font); font-weight: 600;
  color: #ff6961; background: rgba(255,105,97,.08);
  border: 1px solid rgba(255,105,97,.3); border-radius: 999px;
  padding: 8px 18px; cursor: pointer; transition: all .25s;
}
.danger-btn:hover { background: rgba(255,105,97,.18); }

/* ---------- 特性区块（首页） ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.feature-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 34px 30px;
  transition: transform .35s cubic-bezier(.22,1,.36,1), border-color .35s;
}
.feature-card:hover { transform: translateY(-6px); border-color: var(--border-strong); }
.feature-card .f-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(135deg, var(--f-c1, rgba(10,132,255,.2)), var(--f-c2, rgba(191,90,242,.15)));
  margin-bottom: 18px;
}
.feature-card h3 { font-size: 19px; font-weight: 750; margin-bottom: 10px; }
.feature-card p { color: var(--text-2); font-size: 14.5px; }

/* ---------- CTA 尾区 ---------- */
.cta-final { text-align: center; padding: 120px 5vw 140px; }
.cta-final h2 { font-size: clamp(34px, 5.5vw, 60px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 20px; }
.cta-final p { color: var(--text-2); margin-bottom: 38px; font-size: 17px; }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 40px 0 48px;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px;
  color: var(--text-3); font-size: 13px;
}
.footer a { color: var(--text-2); text-decoration: none; }
.footer a:hover { color: var(--text); }

/* ---------- 返回顶部/工具 ---------- */
.mark-all-btn {
  font-size: 13px; font-family: var(--font); font-weight: 600;
  color: var(--text-2); background: rgba(255,255,255,.05);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 18px; cursor: pointer; transition: all .25s;
}
.mark-all-btn:hover { color: var(--text); border-color: var(--border-strong); }

/* ---------- 彩带 canvas ---------- */
#confetti-canvas {
  position: fixed; inset: 0; pointer-events: none; z-index: 2000;
}

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .nav-mobile.open { display: flex; }
  .section { padding: 80px 0; }
  .theory-section { padding: 24px 20px; }
  .ex-head, .ex-desc { padding-left: 20px; padding-right: 20px; }
  .code-block { margin-left: 16px; margin-right: 16px; }
  .ex-actions { padding-left: 20px; padding-right: 20px; }
  .chapter-nav { flex-direction: column; }
  .chapter-nav a { max-width: 100%; }
}

/* =========================================================
 * 深挖一层
 * ========================================================= */
.deep-block {
  margin-top: 18px;
  border-top: 1px dashed var(--border);
  padding-top: 14px;
}
.deep-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; font-family: var(--font);
  color: var(--teal); background: rgba(100, 210, 255, 0.08);
  border: 1px solid rgba(100, 210, 255, 0.3); border-radius: 999px;
  padding: 7px 16px; cursor: pointer; transition: all .25s;
}
.deep-toggle:hover { background: rgba(100,210,255,.16); border-color: rgba(100,210,255,.5); }
.deep-toggle .deep-arrow { display: inline-block; transition: transform .3s; }
.deep-block.open .deep-toggle .deep-arrow { transform: rotate(180deg); }
.deep-body { display: none; padding: 4px 6px 0; }
.deep-block.open .deep-body { display: block; animation: deepIn .45s cubic-bezier(.22,1,.36,1); }
@keyframes deepIn { from { opacity: 0; transform: translateY(10px); } }
.deep-body p {
  color: var(--text-2); font-size: 14.5px; line-height: 1.75;
  padding: 12px 16px; margin-top: 10px;
  background: rgba(100, 210, 255, 0.05);
  border-left: 3px solid rgba(100, 210, 255, 0.45);
  border-radius: 0 12px 12px 0;
}

/* =========================================================
 * 章节测验
 * ========================================================= */
.quiz-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 34px 30px 26px;
}
.quiz-q { padding: 20px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.quiz-q:first-child { padding-top: 0; }
.qq-title { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; font-weight: 700; line-height: 1.5; }
.qq-num {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 8px;
  display: grid; place-items: center;
  background: rgba(191, 90, 242, 0.18); color: #da9fff;
  font-family: var(--mono); font-size: 13px;
}
.qq-opts { display: grid; gap: 10px; margin: 16px 0 0 36px; }
@media (min-width: 721px) { .qq-opts { grid-template-columns: 1fr 1fr; } }
.qq-opt {
  text-align: left; font-family: var(--font); font-size: 14px; line-height: 1.5;
  color: var(--text-2); background: rgba(255,255,255,.04);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 11px 16px; cursor: pointer; transition: all .2s;
}
.qq-opt:hover:not(:disabled) { color: var(--text); border-color: var(--border-strong); background: var(--card-hover); }
.qq-opt.sel { color: var(--text); border-color: var(--blue); background: rgba(10,132,255,.14); box-shadow: 0 0 0 1px rgba(10,132,255,.35); }
.qq-opt.right { color: #7af0c0; border-color: rgba(48,209,88,.6); background: rgba(48,209,88,.12); }
.qq-opt.wrong { color: #ff6961; border-color: rgba(255,105,97,.55); background: rgba(255,105,97,.1); }
.qq-opt:disabled { cursor: default; }
.qq-why {
  display: none; margin: 14px 0 0 36px; font-size: 13.5px; line-height: 1.7; color: var(--text-2);
  background: rgba(255,214,10,.05); border-left: 3px solid rgba(255,214,10,.4);
  border-radius: 0 10px 10px 0; padding: 10px 14px;
}
.qq-why b { color: var(--yellow); margin-right: 6px; }
.quiz-q.graded .qq-why { display: block; animation: deepIn .4s ease; }
.quiz-foot { display: flex; align-items: center; gap: 16px; padding: 24px 0 4px; }
.quiz-note { font-size: 12px; color: var(--text-3); }
.quiz-result:not(:empty) {
  margin-top: 18px; border-top: 1px dashed var(--border); padding-top: 20px;
  animation: deepIn .45s ease;
}
.qr-line { font-size: 22px; font-weight: 800; font-family: var(--mono); }
.qr-line.pass { color: var(--green); }
.qr-line.fail { color: var(--orange); }
.qr-best { font-size: 13px; color: var(--text-3); margin: 8px 0 14px; }

/* 测验徽章（学习路线卡片） */
.quiz-badge {
  position: absolute; top: 18px; right: 18px;
  font-size: 11px; font-weight: 700; color: #da9fff;
  border: 1px solid rgba(191,90,242,.4); border-radius: 999px; padding: 3px 10px;
  background: rgba(191,90,242,.1);
}
.quiz-badge.with-done { top: 52px; }

/* =========================================================
 * 游乐场
 * ========================================================= */
.game-panel {
  position: relative;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px 30px 28px;
  transition: border-color .35s;
}
.game-panel:hover { border-color: var(--border-strong); }
.gp-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 22px; }
.gp-head .gp-ico {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(135deg, rgba(10,132,255,.25), rgba(191,90,242,.18));
}
.gp-head h3 { font-size: 19px; font-weight: 750; }
.gp-head p { color: var(--text-2); font-size: 13.5px; margin-top: 4px; }
.gp-head code {
  font-family: var(--mono); font-size: 12px; color: #7af0c0;
  background: rgba(48,209,88,.08); border: 1px solid rgba(48,209,88,.2);
  border-radius: 6px; padding: 1px 6px;
}

.bit-hud { display: flex; flex-wrap: wrap; gap: 12px 26px; margin-bottom: 20px; }
.bh-item span { display: block; font-size: 11px; letter-spacing: 1px; color: var(--text-3); }
.bh-item b { font-family: var(--mono); font-size: 18px; font-weight: 700; }

.bit-grid {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px;
  max-width: 560px; margin: 0 auto 16px;
  padding: 14px; border-radius: 16px;
  background: #0d0d10; border: 1px solid var(--border);
  transition: border-color .3s, box-shadow .3s;
}
.bit-grid.win { border-color: rgba(48,209,88,.7); box-shadow: 0 0 24px rgba(48,209,88,.25); }
.bit-cell {
  position: relative; aspect-ratio: 1; border-radius: 12px;
  border: 1px solid var(--border); background: rgba(255,255,255,.03);
  color: var(--text-3); font-family: var(--mono);
  cursor: pointer; transition: transform .15s, background .15s, border-color .15s;
}
.bit-cell i { position: absolute; top: 5px; left: 0; right: 0; font-style: normal; font-size: 9px; opacity: .6; text-align: center; }
.bit-cell b { font-size: clamp(20px, 4vw, 30px); font-weight: 700; color: var(--text-3); }
.bit-cell:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.bit-cell.on { background: rgba(10,132,255,.18); border-color: rgba(10,132,255,.6); }
.bit-cell.on b { color: #58b7ff; text-shadow: 0 0 14px rgba(10,132,255,.8); }
.bit-grid.win .bit-cell.on { background: rgba(48,209,88,.2); border-color: rgba(48,209,88,.65); }
.bit-grid.win .bit-cell.on b { color: #7af0c0; text-shadow: 0 0 14px rgba(48,209,88,.8); }
.bit-op {
  text-align: center; font-family: var(--mono); font-size: 12.5px; color: var(--text-2);
  margin-bottom: 18px; min-height: 20px;
}
.game-panel .btn { display: block; margin: 0 auto; }

.mem-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  max-width: 640px; margin: 0 auto 20px;
}
.mem-card {
  perspective: 600px; background: none; border: none; padding: 0;
  cursor: pointer; aspect-ratio: 2.6; font-family: var(--font);
}
.mem-inner {
  position: relative; display: block; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform .45s cubic-bezier(.22,1,.36,1);
}
.mem-card.flipped .mem-inner, .mem-card.matched .mem-inner { transform: rotateY(180deg); }
.mem-face {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  border-radius: 12px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  font-size: clamp(10px, 2.4vw, 14px); font-weight: 700;
  padding: 4px 8px; text-align: center; line-height: 1.3;
}
.mem-back {
  font-family: var(--mono); font-size: 16px; color: var(--text-3);
  background: linear-gradient(135deg, #14141a, #0d0d10);
  border: 1px solid var(--border);
  transition: border-color .25s, color .25s;
}
.mem-card:hover .mem-back { border-color: var(--border-strong); color: var(--text-2); }
.mem-front { transform: rotateY(180deg); }
.mem-front.term { color: #58b7ff; background: rgba(10,132,255,.14); border: 1px solid rgba(10,132,255,.45); }
.mem-front.def { color: #da9fff; background: rgba(191,90,242,.12); border: 1px solid rgba(191,90,242,.4); }
.mem-card.matched .mem-front { color: #7af0c0; box-shadow: inset 0 0 0 2px rgba(48,209,88,.55); }
.mem-card.matched .mem-inner { animation: memPop .35s ease; }
@keyframes memPop { 0%,100% { transform: rotateY(180deg); } 50% { transform: rotateY(180deg) scale(1.07); } }

/* =========================================================
 * 全站动效
 * ========================================================= */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1001;
  background: linear-gradient(90deg, var(--blue), var(--purple), var(--pink), var(--green));
  transform-origin: 0 50%; transform: scaleX(0);
  pointer-events: none;
}
.cursor-glow {
  position: fixed; left: 0; top: 0; width: 300px; height: 300px;
  border-radius: 50%; pointer-events: none; z-index: 1;
  background: radial-gradient(circle, rgba(10,132,255,.10), rgba(191,90,242,.05) 45%, transparent 70%);
  mix-blend-mode: screen;
}
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.35), transparent 60%);
  transform: scale(0); animation: rippleGo .6s ease-out forwards;
}
@keyframes rippleGo { to { transform: scale(1); opacity: 0; } }
.burst {
  position: fixed; width: 7px; height: 7px; border-radius: 2px;
  pointer-events: none; z-index: 3000;
  animation: burstGo .7s cubic-bezier(.16,1,.3,1) forwards;
}
@keyframes burstGo { to { transform: translate(var(--bx), var(--by)) rotate(240deg) scale(.2); opacity: 0; } }
.back-top {
  position: fixed; right: 26px; bottom: 26px; z-index: 1500;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 18px; color: var(--text); font-family: var(--font);
  background: rgba(20,20,24,.8); border: 1px solid var(--border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  cursor: pointer; opacity: 0; pointer-events: none; transform: translateY(12px);
  transition: opacity .3s, transform .3s, border-color .3s;
}
.back-top.visible { opacity: 1; pointer-events: auto; transform: none; }
.back-top:hover { border-color: var(--border-strong); transform: translateY(-3px); }

/* 打字机光标 */
.hero p.sub.typing::after {
  content: "▌"; margin-left: 2px; color: var(--blue);
  animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* 渐变文字流动 */
.gradient-text, .gradient-text-green {
  background-size: 200% auto;
  animation: gradShift 7s linear infinite;
}
@keyframes gradShift { to { background-position: 200% center; } }

/* 页面淡入 */
body { animation: pageIn .5s ease; }
@keyframes pageIn { from { opacity: 0; } }

/* 卡片扫光 */
.ch-card::after {
  content: ""; position: absolute; top: 0; left: -70%;
  width: 45%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.07), transparent);
  transform: skewX(-15deg); transition: left .55s ease;
  pointer-events: none;
}
.ch-card:hover::after { left: 130%; }

/* 波纹目标 */
.btn, .mini-btn, .check-btn, .mark-all-btn, .qq-opt, .nav-progress-pill, .res-card {
  position: relative; overflow: hidden;
}

@media (max-width: 720px) {
  .mem-grid { gap: 8px; }
  .bit-hud { gap: 10px 18px; }
  .bh-item b { font-size: 15px; }
  .qq-opts { grid-template-columns: 1fr; margin-left: 0; }
  .qq-why { margin-left: 0; }
  .back-top { right: 16px; bottom: 16px; }
}
