/* ============================================================
   JDK 学习手册 — site.css
   在 manual.css / content.css 之上的 JDK 身份与业务组件
   视觉：深空蓝 × 熔金 LTS
   ============================================================ */

/* ---------- 1. JDK 调色 ---------- */
:root, :root[data-theme="light"] {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #edf1f7;
  --bg-code: #eef1f6;
  --text: #17202b;
  --text-soft: #3d4855;
  --muted: #66717f;
  --faint: #949daa;
  --border: #dfe5ed;
  --border-strong: #c6d0dc;
  --accent: #1c5f8a;
  --accent-2: #2d7da8;
  --accent-soft: #e3eff7;
  --accent-text: #185577;
  --accent-hover: #144866;
  --on-accent: #ffffff;
  --link: #185577;
  --blue: #35608f;
  --topbar-bg: rgba(244,246,249,.88);
  --metal: linear-gradient(160deg,#2a3546,#111722);
  --gold: linear-gradient(135deg,#f2c568,#b8860b);
}
:root[data-theme="dark"] {
  --bg: #070b12;
  --surface: #111a28;
  --surface-2: #1a2534;
  --bg-code: #0b121b;
  --text: #eaf0f7;
  --text-soft: #cfd9e4;
  --muted: #a7b6c6;
  --faint: #7d8ba1;
  --border: #26354a;
  --border-strong: #3c5069;
  --accent: #57b1e6;
  --accent-2: #7ecbf2;
  --accent-soft: #10283a;
  --accent-text: #7ecbf2;
  --accent-hover: #9adaf8;
  --on-accent: #08131c;
  --link: #7ecbf2;
  --blue: #8cc0e8;
  --topbar-bg: rgba(7,11,18,.86);
  --metal: linear-gradient(160deg,#243145,#090e15);
  --gold: linear-gradient(135deg,#f6cd7a,#a97a0e);
}

/* ---------- 2. 顶栏扩展 ---------- */
.brand-mark.jdk { width: 44px; font-size: 12px; letter-spacing: .4px; }
.brand-text strong { font-size: 14.5px; }
.brand-text small { font-size: 10.5px; letter-spacing: .04em; }
.version-switch { position: relative; flex-shrink: 0; }
.version-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 11px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-soft); font: inherit; font-size: 13px; cursor: pointer;
}
.version-btn:hover { border-color: var(--border-strong); color: var(--text); }
.version-btn b { color: var(--accent-text); font-size: 14px; font-variant-numeric: tabular-nums; }
.version-btn .vb-lts {
  font-size: 9.5px; font-weight: 800; letter-spacing: .06em;
  color: #7a5300; background: linear-gradient(135deg,#f4d58d,#e4b44a);
  border-radius: 4px; padding: 1px 5px;
}
[data-theme="dark"] .version-btn .vb-lts { color: #1b1208; }
.version-btn .vb-caret { font-size: 9px; color: var(--faint); }
.version-menu {
  position: absolute; top: 44px; left: 0; z-index: 260;
  width: min(620px, 92vw); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 14px;
  box-shadow: var(--shadow-md); padding: 14px;
}
.version-menu[hidden] { display: none; }
.vm-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 2px 4px 10px; }
.vm-head strong { font-size: 13.5px; }
.vm-head span { font-size: 11.5px; color: var(--faint); }
.vm-group-title { font-size: 10.5px; font-weight: 750; letter-spacing: .12em; color: var(--faint); padding: 8px 4px 6px; text-transform: uppercase; }
.vm-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 6px; }
.vm-item {
  display: block; padding: 7px 8px; border-radius: 8px; border: 1px solid transparent;
  color: var(--text-soft); line-height: 1.25;
}
.vm-item:hover { background: var(--surface-2); border-color: var(--border); text-decoration: none; color: var(--text); }
.vm-item.active { background: var(--accent-soft); border-color: var(--accent-2); color: var(--accent-text); }
.vm-item b { display: block; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.vm-item span { display: block; font-size: 10px; color: var(--faint); margin-top: 1px; }
.vm-item.lts b::after { content: " LTS"; font-size: 9px; font-weight: 800; color: #a9760b; }
[data-theme="dark"] .vm-item.lts b::after { color: #e5b64b; }
.vm-foot { display: flex; gap: 10px; flex-wrap: wrap; padding: 11px 4px 2px; margin-top: 8px; border-top: 1px solid var(--border); font-size: 12px; }
.vm-foot a { color: var(--accent-text); }

/* 侧栏折叠后的竖排标签 */
.sidebar-rail {
  display: none; writing-mode: vertical-rl; text-orientation: mixed;
  margin: 10px auto 0; font-size: 10.5px; letter-spacing: .16em;
  color: var(--faint); font-weight: 700; white-space: nowrap;
}
html[data-sidebar="collapsed"] .sidebar-rail { display: block; }
html[data-sidebar="collapsed"] .sidebar-site { display: none; }

/* ---------- 3. 首页 ---------- */
.jdk-hero {
  position: relative; overflow: hidden; border: 1px solid var(--border);
  border-radius: 20px; background: var(--surface); padding: 40px 42px 34px;
  margin-top: 8px;
}
.jdk-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(560px 260px at 12% -10%, color-mix(in srgb, var(--accent) 17%, transparent), transparent 70%),
    radial-gradient(420px 240px at 92% 8%, color-mix(in srgb, #d9a441 14%, transparent), transparent 72%);
}
.jdk-hero > * { position: relative; }
.jdk-hero .hero-kicker { font-size: 11.5px; font-weight: 800; letter-spacing: .18em; color: var(--accent-text); text-transform: uppercase; }
.jdk-hero h1 { margin: 10px 0 12px; font-size: clamp(30px, 5vw, 46px); letter-spacing: -.02em; }
.jdk-hero h1 .grad { background: linear-gradient(120deg, var(--accent), #2f9ab5 55%, #c7952a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.jdk-hero .lead { max-width: 70ch; font-size: 16px; color: var(--text-soft); }
.hero-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.hero-badges span, .hero-badges a {
  font-size: 11.5px; font-weight: 650; padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}
.hero-badges a:hover { color: var(--accent-text); border-color: var(--accent-2); text-decoration: none; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-actions .button.primary { box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 24%, transparent); }
.hero-side-note { margin-top: 14px; font-size: 12px; color: var(--faint); }
.home-section { margin-top: 38px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head .kicker { font-size: 10.5px; font-weight: 800; letter-spacing: .16em; color: var(--accent-text); text-transform: uppercase; }
.section-head h2 { margin: 3px 0 0; font-size: clamp(20px, 2.5vw, 26px); }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; max-width: 68ch; }
.section-head .more { font-size: 13px; color: var(--accent-text); font-weight: 650; white-space: nowrap; }

/* 版本长条 */
.version-strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(82px, 1fr);
  gap: 7px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: thin;
}
.version-node {
  position: relative; display: block; padding: 12px 10px 10px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  text-align: center; transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
  min-width: 82px;
}
.version-node:hover { transform: translateY(-2px); border-color: var(--accent-2); box-shadow: var(--shadow-sm); text-decoration: none; color: var(--text); }
.version-node b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.version-node span { display: block; font-size: 10px; color: var(--faint); margin-top: 4px; white-space: nowrap; }
.version-node.lts { border-color: color-mix(in srgb, #c7952a 55%, var(--border)); }
.version-node.lts::before {
  content: "LTS"; position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  font-size: 8.5px; font-weight: 850; letter-spacing: .06em; color: #5b3d00;
  background: linear-gradient(135deg,#f6db9a,#e0af3e); border-radius: 4px; padding: 0 5px;
}
[data-theme="dark"] .version-node.lts::before { color: #1b1208; }
.version-node.current { border-color: var(--accent); background: var(--accent-soft); }
.version-node.full { box-shadow: inset 0 -3px 0 var(--accent); }
.version-node .vn-state { font-size: 9px; color: var(--accent-text); margin-top: 3px; font-weight: 700; }

/* 三模式 */
.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.mode-card {
  display: flex; flex-direction: column; gap: 8px; padding: 20px 20px 18px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.mode-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--accent-2); text-decoration: none; color: var(--text); }
.mode-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 10px; font-size: 17px; font-weight: 800;
  background: var(--accent-soft); color: var(--accent-text); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
}
.mode-card:nth-child(2) .mode-icon { background: color-mix(in srgb, #8a6fc0 14%, var(--surface)); color: var(--purple); border-color: color-mix(in srgb, var(--purple) 25%, var(--border)); }
.mode-card:nth-child(3) .mode-icon { background: color-mix(in srgb, #c7952a 14%, var(--surface)); color: #9a6a0a; border-color: color-mix(in srgb, #c7952a 30%, var(--border)); }
[data-theme="dark"] .mode-card:nth-child(3) .mode-icon { color: #e5b64b; }
.mode-card h3 { margin: 0; font-size: 17px; }
.mode-card p { margin: 0; font-size: 13px; color: var(--muted); flex: 1; }
.mode-card .mode-meta { font-size: 11.5px; color: var(--accent-text); font-weight: 650; }

/* 特性卡 */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.feature-card { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 16px 18px; }
.feature-card .fc-tag { font-size: 10.5px; font-weight: 750; letter-spacing: .06em; color: var(--accent-text); }
.feature-card h3 { margin: 5px 0 5px; font-size: 15.5px; }
.feature-card p { margin: 0; font-size: 12.8px; color: var(--muted); }
.feature-card code { font-size: 12px; }

/* 学习法 */
.method-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.method-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px 15px; background: var(--surface); }
.method-card b { display: block; font-size: 13.5px; margin-bottom: 4px; }
.method-card span { font-size: 12px; color: var(--muted); }
.method-card .step-no { font-family: var(--font-mono); font-size: 11px; color: var(--accent-text); }

/* ---------- 4. 版本档案 ---------- */
.version-hero {
  position: relative; overflow: hidden; border: 1px solid var(--border);
  border-radius: 18px; background: var(--surface); padding: 30px 32px 26px;
  border-left: 5px solid var(--accent);
}
.version-hero::after {
  content: attr(data-v); position: absolute; right: 18px; bottom: -34px;
  font-size: 150px; font-weight: 850; line-height: 1; letter-spacing: -.06em;
  color: color-mix(in srgb, var(--accent) 7%, transparent); pointer-events: none;
}
.version-hero.lts { border-left-color: #c7952a; }
.version-hero > * { position: relative; z-index: 1; }
.version-hero h1 { margin: 6px 0 8px; font-size: clamp(30px, 4.4vw, 44px); }
.version-hero h1 .lts-tag {
  display: inline-block; vertical-align: middle; margin-left: 10px; font-size: 12px; font-weight: 850;
  letter-spacing: .06em; color: #5b3d00; background: linear-gradient(135deg,#f6db9a,#e0af3e);
  border-radius: 6px; padding: 3px 8px;
}
[data-theme="dark"] .version-hero h1 .lts-tag { color: #1b1208; }
.version-hero .lead { max-width: 72ch; color: var(--text-soft); font-size: 15px; }
.version-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.version-meta span { font-size: 11.5px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.version-meta span b { color: var(--text); }
.version-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.version-stats > div { min-width: 110px; padding: 10px 13px; border-radius: 10px; background: var(--surface-2); }
.version-stats strong { display: block; font-size: 22px; color: var(--accent-text); line-height: 1.15; font-variant-numeric: tabular-nums; }
.version-stats span { font-size: 10.5px; color: var(--muted); }
.story-block { font-size: 14.5px; color: var(--text-soft); max-width: 78ch; }
.story-block p { margin: .7em 0; }
.story-block strong { color: var(--text); }
.highlight-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px,1fr)); gap: 12px; }
.highlight-card { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 15px 17px; }
.highlight-card .hc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.highlight-card h3 { margin: 0; font-size: 15px; }
.highlight-card p { margin: 6px 0 0; font-size: 12.8px; color: var(--muted); }
.jep-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.jep-table th, .jep-table td { text-align: left; padding: 8px 11px; border-bottom: 1px solid var(--border); vertical-align: top; }
.jep-table th { background: var(--surface-2); color: var(--text-soft); font-size: 12px; position: sticky; top: 0; z-index: 1; }
.jep-table td:first-child { width: 70px; font-family: var(--font-mono); color: var(--accent-text); font-size: 12px; }
.jep-table .jep-state { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.jep-table .jep-state.final { color: var(--green); background: var(--green-soft); }
.jep-table .jep-state.preview { color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, var(--surface)); }
.jep-table .jep-state.incubator,
.jep-table .jep-state.experimental { color: var(--purple); background: color-mix(in srgb, var(--purple) 12%, var(--surface)); }
.jep-table .jep-state.deprecated { color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, var(--surface)); }
.jep-table .jep-state.removed { color: var(--red); background: var(--red-soft); }
.version-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 30px; }
.version-nav a { display: block; padding: 13px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); }
.version-nav a:hover { border-color: var(--accent-2); text-decoration: none; }
.version-nav .next { text-align: right; }
.version-nav small { display: block; color: var(--faint); font-size: 10.5px; }

/* 状态 / 标签 */
.tag-lts { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; color: #5b3d00; background: linear-gradient(135deg,#f6db9a,#e0af3e); border-radius: 4px; padding: 1px 7px; }
[data-theme="dark"] .tag-lts { color: #1b1208; }
.tag-preview { display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, var(--surface)); border-radius: 999px; padding: 1px 8px; }
.tag-final { display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--green); background: var(--green-soft); border-radius: 999px; padding: 1px 8px; }
.tag-removed { display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--red); background: var(--red-soft); border-radius: 999px; padding: 1px 8px; }
.tag-incubator { display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--purple); background: color-mix(in srgb, var(--purple) 12%, var(--surface)); border-radius: 999px; padding: 1px 8px; }

/* ---------- 5. 速查 / 深钻 ---------- */
.goal-box {
  margin: 18px 0 22px; padding: 16px 20px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%);
}
.goal-box h2 { margin: 0 0 8px; font-size: 14px; letter-spacing: .04em; color: var(--accent-text); text-transform: uppercase; }
.goal-box ol { margin: 0; padding-left: 1.25em; color: var(--text-soft); font-size: 13.8px; }
.goal-box li { margin: 4px 0; }
.quickref-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0 0; }
.quickref-meta span { font-size: 11.5px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.quickref-meta .qm-j21 { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 30%, var(--border)); }

pre.code-block {
  position: relative; margin: 12px 0 16px; padding: 14px 16px;
  background: #0d1420; color: #d9e4f2; border: 1px solid #26344a;
  border-radius: 10px; overflow: auto; font-size: 12.8px; line-height: 1.6;
}
[data-theme="light"] pre.code-block { background: #111a27; color: #dce7f5; border-color: #28384f; }
pre.code-block code { background: none; color: inherit; padding: 0; font-size: inherit; }
pre.code-block .code-copy { opacity: .7; }
pre.code-block:hover .code-copy { opacity: 1; }
.cm { color: #7f93ad; }
.kw { color: #7cc4ff; }
.str { color: #a8d48a; }
.num { color: #e6b96a; }
.an { color: #d8a0e8; }
.fn { color: #f0c674; }

.callout {
  margin: 16px 0; padding: 13px 16px; border-radius: 0 10px 10px 0;
  border-left: 4px solid var(--accent); background: var(--accent-soft);
  font-size: 13.5px; color: var(--text-soft);
}
.callout b { color: var(--text); }
.callout.warn { border-left-color: var(--amber); background: color-mix(in srgb, var(--amber) 9%, var(--surface)); }
.callout.danger { border-left-color: var(--red); background: var(--red-soft); }
.callout.ok { border-left-color: var(--green); background: var(--green-soft); }
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

.boundary-table td:first-child { width: 90px; font-family: var(--font-mono); color: var(--accent-text); font-size: 12px; }
.boundary-table .bd-preview { color: var(--amber); font-weight: 700; }
.boundary-table .bd-final { color: var(--green); font-weight: 700; }
.boundary-table .bd-removed { color: var(--red); font-weight: 700; }

.selfcheck { margin: 14px 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.selfcheck summary { cursor: pointer; padding: 12px 16px; font-weight: 650; font-size: 13.5px; color: var(--text); list-style: none; display: flex; gap: 10px; align-items: baseline; }
.selfcheck summary::-webkit-details-marker { display: none; }
.selfcheck summary::before { content: "?"; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex-shrink: 0; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); font-size: 11px; font-weight: 800; }
.selfcheck[open] summary { border-bottom: 1px solid var(--border); }
.selfcheck .sc-answer { padding: 12px 16px; font-size: 13.5px; color: var(--text-soft); }
.selfcheck .sc-answer p { margin: .4em 0; }
.mastery-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 24px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.mastery-row .mr-label { font-size: 12.5px; color: var(--muted); }
.mastery-row .mr-hint { font-size: 11.5px; color: var(--faint); margin-left: auto; }

.deepdive-tabs .sectab-bar { background: var(--bg); }
.deepdive-tabs .tp-panel { padding-top: 18px; }
.deepdive-step { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 0; }
.deepdive-step span { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.deep-essence { margin: 16px 0 6px; padding: 16px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); font-size: 15px; color: var(--text); }
.deep-essence b { color: var(--accent-text); }
.mental-model { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 10px; margin: 14px 0; }
.mental-model > div { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--surface); font-size: 13px; color: var(--text-soft); }
.mental-model > div b { display: block; color: var(--text); font-size: 13.5px; margin-bottom: 3px; }
.mental-model > div code { font-size: 11.8px; }
.code-expected { margin: -6px 0 16px; font-size: 12px; color: var(--muted); }
.code-expected b { color: var(--green); }

/* ---------- 6. 面试 ---------- */
.interview-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); margin: 16px 0 6px; position: sticky; top: calc(var(--topbar-h) + 4px); z-index: 40;
}
.interview-toolbar input, .interview-toolbar select {
  height: 34px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--text); font: inherit; font-size: 13px;
}
.interview-toolbar input { flex: 1 1 220px; min-width: 0; }
.interview-toolbar .it-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.interview-toolbar button {
  height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-soft); font: inherit; font-size: 12.5px; cursor: pointer;
}
.interview-toolbar button:hover { border-color: var(--accent-2); color: var(--accent-text); }
.interview-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.interview-card { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.interview-card.mastered { border-color: var(--green); }
.iq-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px 10px; flex-wrap: wrap; }
.iq-no { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); padding-top: 3px; }
.iq-head h3 { margin: 0; font-size: 15px; flex: 1 1 320px; line-height: 1.5; }
.iq-meta { display: flex; gap: 5px; flex-wrap: wrap; }
.iq-meta span { font-size: 10.5px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.iq-meta .lv-hi { color: var(--red); background: var(--red-soft); border-color: transparent; }
.iq-meta .lv-mid { color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, var(--surface)); border-color: transparent; }
.iq-body { padding: 0 16px 14px 48px; }
.iq-body .reveal-btn {
  font: inherit; font-size: 12.5px; font-weight: 650; color: var(--accent-text);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-radius: 7px; padding: 5px 12px; cursor: pointer;
}
.iq-body .reveal-btn:hover { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.iq-answer { margin-top: 10px; font-size: 13.5px; color: var(--text-soft); }
.iq-answer[hidden] { display: none; }
.iq-answer p { margin: .5em 0; }
.iq-answer .follow, .iq-answer .trap { margin-top: 9px; padding: 9px 12px; border-radius: 8px; font-size: 12.8px; }
.iq-answer .follow { background: var(--surface-2); border-left: 3px solid var(--accent-2); }
.iq-answer .trap { background: color-mix(in srgb, var(--amber) 8%, var(--surface)); border-left: 3px solid var(--amber); }
.iq-answer .follow b, .iq-answer .trap b { color: var(--text); }
.iq-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.iq-actions .mastery-btn { margin: 0; }
.interview-empty { padding: 36px; text-align: center; color: var(--muted); border: 1.5px dashed var(--border-strong); border-radius: 12px; }

/* ---------- 7. 演进矩阵 ---------- */
.matrix-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.matrix-table { width: 100%; border-collapse: collapse; font-size: 12.8px; min-width: 720px; }
.matrix-table th, .matrix-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.matrix-table th { background: var(--surface-2); font-size: 11.5px; color: var(--text-soft); position: sticky; top: 0; z-index: 2; }
.matrix-table th:first-child, .matrix-table td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 150px; }
.matrix-table th:first-child { background: var(--surface-2); z-index: 3; }
.matrix-table td.c { text-align: center; font-family: var(--font-mono); white-space: nowrap; }
.matrix-table .yes { color: var(--green); font-weight: 750; }
.matrix-table .no { color: var(--faint); }
.matrix-table .pre { color: var(--amber); font-weight: 700; font-size: 11px; }
.matrix-table .inc { color: var(--purple); font-weight: 700; font-size: 11px; }
.matrix-table tr:hover td { background: var(--surface-2); }
.matrix-table .src-link { font-family: var(--font-mono); font-size: 11.5px; color: var(--accent); text-decoration: none; border-bottom: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); }
.matrix-table .src-link:hover { border-bottom-style: solid; }
.matrix-note { font-size: 11.5px; color: var(--faint); margin-top: 8px; }
.evo-timeline { display: flex; flex-direction: column; gap: 0; margin-top: 10px; }
.evo-row { display: grid; grid-template-columns: 74px 18px minmax(0,1fr); gap: 10px; }
.evo-year { font-family: var(--font-mono); font-size: 12px; color: var(--faint); text-align: right; padding-top: 10px; }
.evo-axis { position: relative; }
.evo-axis::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--border-strong); }
.evo-dot { position: absolute; left: 3px; top: 14px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); }
.evo-row.lts .evo-dot { border-color: #c7952a; background: #f0c968; }
.evo-body { padding: 8px 0 14px; border-bottom: 1px dashed var(--border); }
.evo-body h3 { margin: 0 0 3px; font-size: 14.5px; }
.evo-body h3 a { color: var(--text); }
.evo-body p { margin: 0; font-size: 12.8px; color: var(--muted); }
.evo-body .evo-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.evo-body .evo-tags span { font-size: 10.5px; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 1px 8px; }

/* ---------- 8. 代码样例 ---------- */
.snippet-card { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin: 14px 0; overflow: hidden; }
.snippet-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.snippet-head h3 { margin: 0; font-size: 14px; }
.snippet-head code { font-size: 11.5px; }
.snippet-body { padding: 10px 16px 14px; }
.snippet-body pre.code-block { margin: 6px 0 10px; }
.snippet-results { display: flex; flex-wrap: wrap; gap: 5px; }
.snippet-results span { font-size: 10.5px; padding: 1px 8px; border-radius: 999px; font-family: var(--font-mono); }
.snippet-results .ok { color: var(--green); background: var(--green-soft); }
.snippet-results .bad { color: var(--red); background: var(--red-soft); }

/* ---------- 9. 通用 ---------- */
.page-foot { margin-top: 34px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--faint); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-foot a { color: var(--muted); }
.page-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.page-nav a { display: block; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); }
.page-nav a:hover { border-color: var(--accent-2); text-decoration: none; }
.page-nav .next { text-align: right; }
.page-nav small { display: block; color: var(--faint); font-size: 10.5px; }
.home-note { font-size: 12.5px; color: var(--muted); }
.source-list { font-size: 12.5px; color: var(--muted); }
.source-list a { color: var(--accent-text); }

@media (max-width: 1180px) {
  .mode-grid { grid-template-columns: 1fr; }
  .method-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .jdk-hero { padding: 28px 22px 24px; }
  .version-hero { padding: 24px 20px 20px; }
  .version-menu { position: fixed; top: calc(var(--topbar-h) + 8px); left: 12px; right: 12px; width: auto; max-height: 70vh; overflow: auto; }
  .vm-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .version-strip { grid-auto-columns: minmax(72px, 1fr); }
  .section-head { align-items: flex-start; }
  .interview-toolbar { position: static; }
  .iq-body { padding-left: 16px; }
}
@media (max-width: 640px) {
  .vm-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .method-grid { grid-template-columns: 1fr; }
  .version-nav, .page-nav { grid-template-columns: 1fr; }
  .version-nav .next, .page-nav .next { text-align: left; }
  .jdk-hero h1 { font-size: 30px; }
  .version-hero h1 { font-size: 30px; }
  .hero-actions .button { width: 100%; justify-content: center; }
  .version-stats > div { min-width: 96px; }
  .jdk-hero { padding: 24px 18px 20px; }
  .brand-text small { display: none; }
}
@media (max-width: 420px) {
  .vm-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media print {
  .version-menu, .version-switch, .interview-toolbar, .mastery-row, .page-nav, .version-nav { display: none !important; }
}

/* ---------- 10. 站内导航 / 课程组件 ---------- */
.sidebar-version-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 3px; padding: 0 6px 8px; }
.sidebar-version-grid a {
  display: block; text-align: center; padding: 4px 2px; border-radius: 6px;
  font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--muted); border: 1px solid transparent;
}
.sidebar-version-grid a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.sidebar-version-grid a.active { color: var(--accent-text); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 24%, var(--border)); font-weight: 700; }
.sidebar-version-grid a.lts { color: #8a5a0a; }
.sidebar-version-grid a.lts::after { content: "•"; margin-left: 2px; color: #c7952a; }
[data-theme="dark"] .sidebar-version-grid a.lts { color: #e2b355; }
.sidebar-types a.mastered::after { content: "✓"; margin-left: auto; color: var(--green); font-weight: 800; font-size: 11px; }
.sidebar-types a { justify-content: flex-start; }
.sidebar-types a .st-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-types a .st-min { margin-left: auto; font-size: 10px; color: var(--faint); }
.sidebar-types a.mastered .st-min { display: none; }
pre.code-block:not([data-title])::before { display: none; }
pre.output-block {
  margin: -4px 0 16px; padding: 10px 14px; border-radius: 8px;
  background: var(--surface-2); border: 1px dashed var(--border-strong);
  font-size: 12.2px; color: var(--text-soft); overflow-x: auto;
}
pre.output-block::before { content: "运行结果"; display: block; font-size: 10.5px; color: var(--faint); letter-spacing: .08em; margin-bottom: 5px; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 14px; }
.topic-card {
  display: flex; flex-direction: column; gap: 6px; padding: 16px 17px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text);
}
.topic-card:hover { border-color: var(--accent-2); box-shadow: var(--shadow-sm); text-decoration: none; color: var(--text); }
.topic-card .tc-top { display: flex; align-items: center; gap: 8px; }
.topic-card .tc-num { font-family: var(--font-mono); font-size: 11px; color: var(--faint); }
.topic-card h3 { margin: 0; font-size: 15.5px; }
.topic-card p { margin: 0; font-size: 12.8px; color: var(--muted); flex: 1; }
.topic-card .tc-meta { font-size: 11px; color: var(--accent-text); font-weight: 650; display: flex; gap: 8px; flex-wrap: wrap; }
.topic-card .tc-meta .muted { color: var(--faint); font-weight: 500; }
.topic-card.done { border-color: var(--green); }
.course-track { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 16px 18px; margin-bottom: 12px; }
.course-track .ct-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.course-track h3 { margin: 0; font-size: 15.5px; }
.course-track .ct-sub { font-size: 12px; color: var(--faint); }
.course-track p { font-size: 13px; color: var(--muted); margin: 5px 0 10px; }
.course-track .ct-links { display: flex; flex-wrap: wrap; gap: 7px; }
.hero-panel { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(260px,.9fr); gap: 20px; align-items: stretch; }
.hero-panel .hp-side { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 18px 20px; }
.hero-panel .hp-side h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-text); }
.hero-panel .hp-side ul { margin: 0; padding-left: 1.2em; font-size: 13px; color: var(--text-soft); }
.hero-panel .hp-side li { margin: 5px 0; }
.progress-card { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 16px 18px; margin: 16px 0; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.progress-card .pc-text { font-size: 13px; color: var(--muted); }
.progress-card .pc-text b { color: var(--accent-text); font-size: 16px; }
.progress-card .progress-bar { flex: 1 1 180px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip-row .chip { font-size: 11.5px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.chip-row a.chip:hover { color: var(--accent-text); border-color: var(--accent-2); text-decoration: none; }
.jep-line { border-left: 3px solid var(--border-strong); padding: 2px 0 2px 14px; margin: 10px 0; font-size: 13px; color: var(--text-soft); }
.jep-line b { color: var(--accent-text); font-family: var(--font-mono); font-size: 12px; margin-right: 6px; }
.jep-line .jl-state { font-size: 10.5px; color: var(--faint); margin-left: 6px; }
.link-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 10px; margin-top: 12px; }
.link-cards a { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--surface); color: var(--text); font-size: 13.5px; }
.link-cards a:hover { border-color: var(--accent-2); text-decoration: none; }
.link-cards a small { display: block; color: var(--faint); font-size: 11px; margin-top: 3px; }
@media (max-width: 980px) {
  .hero-panel { grid-template-columns: 1fr; }
}
.jdk-hero h1 { text-wrap: balance; }
.jdk-hero h1 .grad { white-space: nowrap; }
@media (max-width: 520px) {
  .jdk-hero h1 .grad { white-space: normal; }
}

/* ---------- 深钻 · 先猜再看 ---------- */
.guess {
  margin: 16px 0; border: 1px dashed color-mix(in srgb, var(--amber) 45%, var(--border));
  border-radius: 10px; background: color-mix(in srgb, var(--amber) 7%, var(--surface));
}
.guess summary {
  cursor: pointer; padding: 12px 16px; font-weight: 650; font-size: 13.8px;
  color: var(--text); list-style: none; display: flex; gap: 9px; align-items: baseline;
}
.guess summary::-webkit-details-marker { display: none; }
.guess .g-lbl {
  flex-shrink: 0; font-size: 10.5px; font-weight: 800; letter-spacing: .05em;
  color: #5b3d00; background: linear-gradient(135deg,#f6db9a,#e0af3e);
  border-radius: 4px; padding: 1px 7px;
}
[data-theme="dark"] .guess .g-lbl { color: #1b1208; }
.guess summary::after { content: "展开"; margin-left: auto; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.guess[open] summary::after { content: "收起"; }
.guess[open] summary { border-bottom: 1px dashed color-mix(in srgb, var(--amber) 35%, var(--border)); }
.guess .g-answer { padding: 12px 16px; font-size: 13.5px; color: var(--text-soft); }
.guess .g-answer p { margin: .4em 0; }

/* ---------- 11. 一页速查卡 ---------- */
.cheat-banner {
  display: flex; align-items: center; gap: 16px;
  margin: 18px 0 4px; padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: 12px; color: var(--text);
  background: linear-gradient(120deg, var(--accent-soft), transparent 62%), var(--surface);
}
.cheat-banner:hover { border-color: var(--accent-2); text-decoration: none; }
.cb-kicker {
  flex-shrink: 0; font-family: var(--font-mono); font-size: 10.5px; font-weight: 750;
  letter-spacing: .08em; color: var(--accent-text);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: 6px; padding: 4px 8px;
}
.cb-main { display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; min-width: 0; }
.cb-main b { font-size: 15px; }
.cb-main span { font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.cb-action { flex-shrink: 0; font-size: 12.5px; font-weight: 650; color: var(--accent-text); white-space: nowrap; }

.cheat-head .cheat-actions { margin-top: 14px; }
.cheat-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cheat-actions.bottom { margin-top: 18px; }
.cheat-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 20px; }
.cheat-meta span {
  font-size: 11px; color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px;
}
.cheat-groups { display: flex; flex-direction: column; gap: 18px; }
.cheat-group { --cheat-color: var(--accent); }
.cheat-group-head {
  display: flex; align-items: baseline; gap: 10px; margin: 0 0 8px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.cheat-en { font-family: var(--font-mono); font-size: 10px; font-weight: 750; letter-spacing: .1em; color: var(--cheat-color); }
.cheat-group-head h2 { margin: 0; padding: 0; font-size: 17px; }
.cheat-count { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); }
.cheat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; }
.cheat-card {
  display: flex; flex-direction: column; min-width: 0; break-inside: avoid;
  border: 1px solid var(--border); border-top: 3px solid var(--cheat-color);
  border-radius: 10px; background: var(--surface); padding: 11px 12px 10px;
}
.cheat-card-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 7px; }
.cheat-tag {
  font-size: 9.5px; font-weight: 750; letter-spacing: .03em; color: var(--cheat-color);
  background: color-mix(in srgb, var(--cheat-color) 10%, var(--surface));
  border-radius: 4px; padding: 1px 6px;
}
.cheat-card-head h3 { margin: 0; font-size: 13px; line-height: 1.35; }
.cheat-code {
  margin: 0 0 8px; padding: 8px 9px; border-radius: 7px;
  background: #0d1420; color: #d9e4f2; border: 1px solid #26344a;
  overflow-x: auto; font-size: 10.8px; line-height: 1.55;
}
[data-theme="light"] .cheat-code { background: #111a27; }
.cheat-code code { background: none; padding: 0; color: inherit; font-size: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.cheat-note { margin: auto 0 0; padding-top: 4px; font-size: 11.3px; line-height: 1.55; color: var(--muted); }
.cheat-note code, .cheat-list code { font-size: 10.8px; }
.cheat-list { margin: 0; padding-left: 1.1em; font-size: 11.3px; line-height: 1.55; color: var(--muted); }
.cheat-list li { margin: 3px 0; }
.cheat-traps { margin-top: 24px; }
.cheat-traps h2 { margin: 0 0 10px; padding: 0; font-size: 17px; }
.cheat-trap-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cheat-trap {
  border: 1px solid color-mix(in srgb, var(--amber) 25%, var(--border));
  border-radius: 9px; background: color-mix(in srgb, var(--amber) 6%, var(--surface));
  padding: 10px 12px; break-inside: avoid;
}
.cheat-trap b { display: block; font-size: 12px; color: var(--text); margin-bottom: 3px; }
.cheat-trap p { margin: 0; font-size: 11.3px; line-height: 1.6; color: var(--muted); }
.cheat-more { margin-top: 26px; }
.cheat-source { font-size: 11.5px; color: var(--faint); margin-top: 14px; }

@media screen and (min-width: 1101px) {
  .cheat-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 18px; align-items: start; }
  .cheat-cards { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .cheat-cards, .cheat-trap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .cheat-banner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .cb-action { white-space: normal; }
  .cheat-cards, .cheat-trap-grid { grid-template-columns: 1fr; }
  .cheat-code { font-size: 11.5px; }
}

/* 打印：白底、去 chrome、单页 A4 速查卡 */
@media print {
  @page { size: A4 portrait; margin: 9mm; }
  .topbar, .sidebar, .toc, .search-overlay, .skip-link, .footer, .breadcrumb,
  .cheat-actions, .sidebar-toggle, .menu-toggle { display: none !important; }
  html, body { background: #fff !important; color: #000 !important; }
  .layout { display: block !important; margin: 0 !important; padding: 0 !important; max-width: none !important; }
  .main, .cheat-page { max-width: none !important; }
  .cheat-head { border-bottom: 1px solid #999; padding-bottom: 3px; margin-bottom: 2px; }
  .cheat-head h1 { font-size: 17px; margin: 0; }
  .cheat-head .type-kicker, .cheat-head .sub { color: #444 !important; font-size: 8px; }
  .cheat-page .essence, .cheat-meta { display: none !important; }
  .cheat-groups { display: flex; gap: 2px; }
  .cheat-group { break-inside: avoid; }
  .cheat-group-head { margin-bottom: 1px; padding-bottom: 1px; border-bottom-color: #bbb; }
  .cheat-group-head h2 { font-size: 11px; }
  .cheat-en { font-size: 7px; color: #555 !important; }
  .cheat-count { display: none; }
  .cheat-cards { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 3px; }
  .cheat-card { padding: 3px 4px; border: 1px solid #bbb; border-top: 2px solid #555; border-radius: 4px; background: #fff; }
  .cheat-card-head { margin-bottom: 2px; gap: 4px; }
  .cheat-tag { background: #eee !important; color: #333 !important; font-size: 6.8px; padding: 0 3px; }
  .cheat-card-head h3 { font-size: 8.4px; }
  .cheat-code {
    background: #f5f5f5 !important; color: #222 !important; border: 1px solid #ccc;
    font-size: 7px; line-height: 1.25; padding: 1px 2px; margin-bottom: 1px;
    overflow: visible; border-radius: 2px;
  }
  .cheat-code code { white-space: pre-wrap; overflow-wrap: anywhere; }
  .cheat-code .cm { color: #666 !important; }
  .cheat-code .kw { color: #0b4f8a !important; }
  .cheat-code .str { color: #2f6f1f !important; }
  .cheat-note, .cheat-list { font-size: 7.1px; line-height: 1.25; color: #333 !important; }
  .cheat-note { padding-top: 1px; }
  .cheat-note code, .cheat-list code { font-size: 6.8px; }
  .cheat-traps { margin-top: 2px; break-inside: auto; }
  .cheat-traps h2 { margin: 0 0 1px !important; padding: 0; font-size: 9px; }
  .cheat-trap-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; }
  .cheat-trap { padding: 2px 3px; border: 1px solid #bbb; background: #fff; }
  .cheat-trap b { font-size: 7px; margin-bottom: 0; }
  .cheat-trap p { font-size: 6.5px; line-height: 1.2; color: #333 !important; }
  .cheat-more, .cheat-source { display: none !important; }
  .cheat-card, .cheat-trap { break-inside: avoid; page-break-inside: avoid; }
  a { color: inherit !important; text-decoration: none !important; }
}

/* ---------- 12. 多版本课程切换 ---------- */
.vm-item.has-course { box-shadow: inset 0 -2px 0 var(--accent); }
.vm-item.has-course:hover { box-shadow: inset 0 -2px 0 var(--accent); }
.sidebar-version-grid a.has-course { border-color: color-mix(in srgb, var(--accent) 24%, transparent); }
.course-grid { grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }
.course-card { display: flex; flex-direction: column; }
.course-card.featured { border-color: var(--accent-2); box-shadow: 0 0 0 1px var(--accent-soft); }
.course-card p { flex: 0 0 auto; }
.course-card-stats { display: flex; flex-wrap: wrap; gap: 4px; margin: 11px 0 2px; }
.course-card-stats span {
  font-family: var(--font-mono); font-size: 10px; padding: 2px 7px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}
.course-card-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: auto; padding-top: 10px; font-size: 12.5px; }
.course-card-links .course-go { font-weight: 700; }
.course-switch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-top: 14px; }
.course-switch-card {
  display: flex; flex-direction: column; gap: 5px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  color: var(--text); transition: border-color .15s ease, transform .15s ease;
}
.course-switch-card:hover { border-color: var(--accent-2); transform: translateY(-1px); text-decoration: none; color: var(--text); }
.course-switch-card.current { border-color: var(--accent-2); background: var(--accent-soft); }
.cs-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cs-top b { font-size: 16px; font-variant-numeric: tabular-nums; }
.cs-top span, .cs-meta { font-size: 10.5px; color: var(--faint); }
.course-switch-card strong { font-size: 13px; line-height: 1.45; }
.cs-action { margin-top: auto; padding-top: 4px; font-size: 11.5px; font-weight: 650; color: var(--accent-text); }
@media (max-width: 640px) {
  .course-switch-grid { grid-template-columns: 1fr 1fr; }
  .course-card-links { gap: 10px; }
}
@media (max-width: 430px) {
  .course-switch-grid { grid-template-columns: 1fr; }
}

/* 4 分区速查卡的打印版式：2×2 分区、卡片纵向堆叠，保持文字可读 */
@media print {
  .cheat-page.cheat-n4 .cheat-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 6px; }
  .cheat-page.cheat-n4 .cheat-cards { grid-template-columns: 1fr !important; gap: 3px; }
  .cheat-page.cheat-n4 .cheat-card { padding: 4px 6px; }
  .cheat-page.cheat-n4 .cheat-card-head h3 { font-size: 10px; }
  .cheat-page.cheat-n4 .cheat-tag { font-size: 7.5px; }
  .cheat-page.cheat-n4 .cheat-code { font-size: 8px; line-height: 1.3; }
  .cheat-page.cheat-n4 .cheat-note, .cheat-page.cheat-n4 .cheat-list { font-size: 8px; line-height: 1.3; }
  .cheat-page.cheat-n4 .cheat-note code, .cheat-page.cheat-n4 .cheat-list code { font-size: 7.6px; }
  .cheat-page.cheat-n4 .cheat-traps h2 { font-size: 10px; }
  .cheat-page.cheat-n4 .cheat-trap-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cheat-page.cheat-n4 .cheat-trap b { font-size: 8px; }
  .cheat-page.cheat-n4 .cheat-trap p { font-size: 7.6px; line-height: 1.3; }
}

/* ============================================================
   13. 全站活力层 · Alive Layer
   GitHub 方格网背景 / 定制滚动条 / 阅读进度 / 回顶 / toast / 滚动显现
   微交互与正反馈。背景 Canvas 由 site.js 注入，全站（含 API 页）统一。
   ============================================================ */

/* ---------- 13.1 背景：GitHub 风格方格网 · 整网漂移呼吸 + 鼠标聚焦放大（Canvas，JS 注入） ---------- */
.fx-grid-bg { position: fixed; inset: 0; z-index: 0; display: block; pointer-events: none; }
body:not(.api-mode) .layout { position: relative; z-index: 1; }

/* ---------- 13.2 定制滚动条 ---------- */
html { scrollbar-width: thin; scrollbar-color: var(--accent-2) var(--surface-2); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb {
  border-radius: 8px; border: 2px solid var(--surface-2);
  background: linear-gradient(180deg, var(--accent-2), color-mix(in srgb, #c7952a 65%, var(--accent)));
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--accent-hover), #c7952a); }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------- 13.3 阅读进度条 ---------- */
.fx-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 300; pointer-events: none; }
.fx-progress i {
  display: block; height: 100%; width: 100%;
  transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent), #2f9ab5 45%, #e0af3e);
  box-shadow: 0 0 10px color-mix(in srgb, #e0af3e 50%, transparent);
}

/* ---------- 13.4 回到顶部（环形进度） ---------- */
.fx-top {
  position: fixed; right: 22px; bottom: 26px; z-index: 220;
  width: 44px; height: 44px; border-radius: 50%; padding: 2px; border: 0; cursor: pointer;
  background: conic-gradient(var(--accent-2) calc(var(--p, 0) * 3.6deg), var(--border) 0deg);
  box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.fx-top span {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
  border-radius: 50%; background: var(--surface); color: var(--accent-text);
  font-size: 17px; line-height: 1; transition: color .15s ease;
}
.fx-top.show { opacity: 1; transform: none; pointer-events: auto; }
.fx-top:hover { transform: translateY(-2px); }
.fx-top:hover span { color: var(--accent-hover); }

/* ---------- 13.5 站点 toast ---------- */
.fx-toast {
  position: fixed; left: 50%; bottom: 30px; z-index: 400;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text);
  font-size: 13px; box-shadow: var(--shadow-md);
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.fx-toast.show { opacity: 1; transform: translate(-50%, 0); }
.fx-toast.ok { border-color: color-mix(in srgb, var(--green) 45%, var(--border)); }
.fx-toast.ok::before { content: "✓"; color: var(--green); font-weight: 800; }
.fx-toast.warn { border-color: color-mix(in srgb, var(--amber) 50%, var(--border)); }
.fx-toast.warn::before { content: "!"; color: var(--amber); font-weight: 800; }

/* ---------- 13.6 滚动显现（仅 JS 添加类，无 JS 时内容始终可见） ---------- */
.fx-reveal { opacity: 0; transform: translateY(16px); }
.fx-reveal.fx-in {
  opacity: 1; transform: none;
  transition: opacity .55s ease, transform .55s cubic-bezier(.2, .7, .2, 1);
}

/* ---------- 13.7 首页 hero：入场 / 渐变流动 / 漂浮特性 chips ---------- */
@keyframes fxRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.jdk-hero > * { animation: fxRise .55s cubic-bezier(.2, .7, .2, 1) both; }
.jdk-hero > *:nth-child(1) { animation-delay: .04s; }
.jdk-hero > *:nth-child(2) { animation-delay: .10s; }
.jdk-hero > *:nth-child(3) { animation-delay: .16s; }
.jdk-hero > *:nth-child(4) { animation-delay: .22s; }
.jdk-hero > *:nth-child(5) { animation-delay: .28s; }
.jdk-hero > *:nth-child(6) { animation-delay: .34s; }
.jdk-hero > .hero-orbit { animation: none; }
body.fx-settled .jdk-hero > * { animation: none; }
.jdk-hero h1 .grad { background-size: 220% 100%; animation: fxGrad 9s ease-in-out infinite alternate; }
@keyframes fxGrad { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }

.hero-orbit { display: none; position: absolute; top: 0; right: 0; bottom: 0; width: 300px; pointer-events: none; }
.ho-chip {
  position: absolute; padding: 5px 11px; border-radius: 8px; white-space: nowrap;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600;
  color: var(--text-soft); background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border); border-left: 3px solid var(--ho, var(--accent));
  box-shadow: var(--shadow-sm);
  animation: fxFloat 5.5s ease-in-out infinite alternate;
}
.ho-1 { top: 12%; left: 6%; --ho: #c7952a; transform: rotate(-5deg); animation-delay: .2s; }
.ho-2 { top: 6%; left: 52%; --ho: #2d7da8; transform: rotate(3deg); animation-duration: 6.4s; }
.ho-3 { top: 33%; left: 58%; --ho: #2f9ab5; transform: rotate(-3deg); animation-delay: 1.1s; }
.ho-4 { top: 41%; left: 9%; --ho: #8a6fc0; transform: rotate(4deg); animation-duration: 7s; animation-delay: .6s; }
.ho-5 { top: 60%; left: 3%; --ho: #4d9a6a; transform: rotate(-2deg); animation-delay: 1.6s; }
.ho-6 { top: 68%; left: 24%; --ho: #c25e8a; transform: rotate(2deg); animation-duration: 6.8s; animation-delay: .9s; }
@keyframes fxFloat {
  from { translate: 0 0; }
  to { translate: 0 -9px; }
}
.ho-ring {
  position: absolute; right: 12px; bottom: 12px; width: 96px; height: 96px; border-radius: 50%;
  border: 9px solid color-mix(in srgb, #c7952a 26%, transparent);
  box-shadow: inset 0 0 0 5px color-mix(in srgb, #c7952a 10%, transparent);
}
.ho-ring::before, .ho-ring::after {
  content: ""; position: absolute; bottom: 96%; width: 7px; height: 30px; border-radius: 8px;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--muted) 40%, transparent));
  filter: blur(3px); animation: fxSteam 3.6s ease-in-out infinite;
}
.ho-ring::before { left: 26%; }
.ho-ring::after { left: 56%; animation-delay: 1.4s; height: 24px; }
@keyframes fxSteam {
  0% { opacity: 0; transform: translateY(6px) scaleY(.7); }
  35% { opacity: .8; }
  100% { opacity: 0; transform: translateY(-16px) scaleY(1.15); }
}
@media (min-width: 1200px) {
  .jdk-hero { padding-right: 320px; }
  .hero-orbit { display: block; }
}

/* ---------- 13.8 渐变 kicker / 按钮扫光 / 主题按钮 ---------- */
.section-head .kicker, .jdk-hero .hero-kicker { display: inline-flex; align-items: center; gap: 8px; }
.section-head .kicker::before, .jdk-hero .hero-kicker::before {
  content: ""; width: 18px; height: 2px; border-radius: 2px; flex-shrink: 0;
  background: linear-gradient(90deg, var(--accent), #e0af3e);
}
.button.primary { position: relative; overflow: hidden; }
.button.primary::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -70%; width: 45%;
  transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .32), transparent);
  transition: left .55s ease;
}
.button.primary:hover::after { left: 130%; }
#theme-toggle { transition: transform .3s ease, background .15s ease, border-color .15s ease; }
#theme-toggle:active { transform: rotate(40deg) scale(.9); }

/* ---------- 13.9 卡片悬浮光晕 ---------- */
.feature-card, .topic-card, .highlight-card, .method-card, .course-switch-card, .link-cards a, .stat-grid > div {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.feature-card:hover, .topic-card:hover, .highlight-card:hover, .method-card:hover,
.course-switch-card:hover, .link-cards a:hover, .stat-grid > div:hover {
  transform: translateY(-3px); border-color: var(--accent-2);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 15%, transparent);
}
.hero-badges span, .hero-badges a { transition: transform .15s ease, border-color .15s ease, color .15s ease; }
.hero-badges span:hover, .hero-badges a:hover { transform: translateY(-1px); border-color: var(--accent-2); }

/* ---------- 13.10 统计数字：渐变 + 顶部色条 ---------- */
.stat-grid > div { position: relative; overflow: hidden; }
.stat-grid > div::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), #2f9ab5, #e0af3e); opacity: .85;
}
.stat-grid strong {
  background: linear-gradient(120deg, var(--accent-text), #a9760b);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
[data-theme="dark"] .stat-grid strong { background: linear-gradient(120deg, var(--accent-text), #e0af3e); -webkit-background-clip: text; background-clip: text; }
.version-stats strong { font-variant-numeric: tabular-nums; }

/* ---------- 13.11 版本长条：时间线连接 + 推荐脉冲 ---------- */
.version-node::after {
  content: ""; position: absolute; top: 50%; right: -8px; width: 8px; height: 2px;
  background: var(--border-strong);
}
.version-node:last-child::after { display: none; }
.version-node.current { animation: fxPulse 2.8s ease-in-out infinite; }
@keyframes fxPulse {
  0%, 100% { box-shadow: inset 0 -3px 0 var(--accent), 0 0 0 0 color-mix(in srgb, var(--accent) 32%, transparent); }
  55% { box-shadow: inset 0 -3px 0 var(--accent), 0 0 0 7px transparent; }
}

/* ---------- 13.12 Bento 课程网格（宽屏） ---------- */
@media (min-width: 1360px) {
  .course-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .course-grid .course-card { grid-column: span 2; }
  .course-grid .course-card.featured { grid-column: span 3; }
  .course-grid .course-card:last-child { grid-column: span 3; }
}
.course-card.featured {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, var(--accent-2), #e0af3e) border-box;
  box-shadow: 0 8px 26px color-mix(in srgb, var(--accent) 14%, transparent);
}
.course-card.featured:hover { box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 22%, transparent); }
.course-card.featured h3 { font-size: 18px; }
.course-card.featured .fc-tag { color: #9a6a0a; }
[data-theme="dark"] .course-card.featured .fc-tag { color: #e5b64b; }

/* ---------- 13.13 继续学习卡（JS 注入首页） ---------- */
.fx-continue {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin: 20px 0 4px; padding: 14px 18px; border-radius: 14px;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(120deg, color-mix(in srgb, var(--accent) 55%, var(--border)), color-mix(in srgb, #e0af3e 55%, var(--border))) border-box;
  box-shadow: var(--shadow-sm);
}
.fx-continue .fc-ico {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 42px; height: 42px; border-radius: 12px; font-size: 19px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
}
.fx-continue .fc-main { flex: 1 1 240px; min-width: 0; }
.fx-continue .fc-main b { display: block; font-size: 14.5px; }
.fx-continue .fc-sub { font-size: 12px; color: var(--muted); }
.fx-continue .fx-bar { flex: 1 1 150px; max-width: 260px; }
.fx-continue .button { flex-shrink: 0; }
.fx-bar { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.fx-bar i {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #2f9ab5, #e0af3e);
  transition: width .9s cubic-bezier(.2, .7, .2, 1);
}

/* ---------- 13.14 掌握粒子（正反馈） ---------- */
.fx-spark {
  position: fixed; z-index: 420; width: 7px; height: 7px; border-radius: 50%;
  pointer-events: none; transform: translate(-50%, -50%);
  animation: fxSpark .7s cubic-bezier(.15, .7, .3, 1) forwards;
}
@keyframes fxSpark {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px))) scale(.3); }
}

/* ---------- 13.16 换肤工坊（角落按钮 + 自定义面板） ---------- */
:root { --sl-accent: #58a6ff; }
.skin-fab {
  position: fixed; left: 18px; bottom: 18px; z-index: 260;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
  cursor: pointer; transition: transform .2s, box-shadow .2s, border-color .2s;
}
.skin-fab:hover { transform: translateY(-2px) scale(1.06); border-color: var(--sl-accent); box-shadow: 0 10px 24px rgba(0, 0, 0, .25); }
.skin-fab.active { border-color: var(--sl-accent); }
.skin-fab-dot {
  position: absolute; right: 3px; bottom: 3px; width: 13px; height: 13px;
  border-radius: 50%; border: 2px solid var(--surface); background: #58a6ff;
}
.skin-lab {
  --sl-accent: #58a6ff;
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 270;
  width: min(340px, 94vw);
  display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(14px);
  border-left: 1px solid color-mix(in srgb, var(--sl-accent) 35%, var(--border));
  box-shadow: -18px 0 40px rgba(0, 0, 0, .25);
  transform: translateX(105%);
  transition: transform .38s cubic-bezier(.2, .7, .2, 1);
}
.skin-lab.open { transform: none; }
.sl-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; flex-shrink: 0; }
.sl-kicker { font-size: 10px; letter-spacing: .18em; font-weight: 700; color: var(--sl-accent); }
.sl-title h2 { margin: 2px 0 0; font-size: 18px; }
.sl-close {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--muted); font-size: 16px; cursor: pointer;
}
.sl-close:hover { color: var(--text); border-color: var(--sl-accent); }
.sl-preview {
  position: relative; margin: 4px 18px 6px; height: 110px; border-radius: 12px;
  overflow: hidden; border: 1px solid var(--border); background: var(--bg); flex-shrink: 0;
}
.sl-preview canvas { display: block; width: 100%; height: 100%; }
.sl-name {
  position: absolute; left: 8px; bottom: 8px; font-size: 11px; padding: 2px 9px;
  border-radius: 999px; color: var(--text);
  background: color-mix(in srgb, var(--sl-accent) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--sl-accent) 45%, transparent);
}
.sl-body {
  flex: 1; overflow-y: auto; padding: 0 18px 18px;
  scrollbar-width: thin; scrollbar-color: var(--sl-accent) var(--surface-2);
}
.sl-body::-webkit-scrollbar { width: 8px; }
.sl-body::-webkit-scrollbar-track { background: var(--surface-2); }
.sl-body::-webkit-scrollbar-thumb {
  border-radius: 8px; border: 2px solid var(--surface-2);
  background: color-mix(in srgb, var(--sl-accent) 65%, var(--surface-2));
}
.sl-body::-webkit-scrollbar-thumb:hover { background: var(--sl-accent); }
.sl-sec { margin-top: 14px; }
.sl-sec h3 { margin: 0 0 8px; font-size: 11px; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.sl-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sl-preset {
  display: flex; align-items: center; gap: 7px; padding: 7px 9px; font-size: 12px;
  border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); cursor: pointer; transition: border-color .15s, transform .15s;
}
.sl-preset i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.sl-preset:hover { transform: translateY(-1px); border-color: var(--sl-accent); }
.sl-preset.active { border-color: var(--sl-accent); box-shadow: 0 0 0 1px var(--sl-accent) inset; }
.sl-color { display: flex; gap: 8px; align-items: center; }
.sl-picker {
  width: 42px; height: 30px; padding: 2px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface-2); cursor: pointer;
}
.sl-hex {
  flex: 1; min-width: 0; font-family: var(--font-mono, ui-monospace, monospace); font-size: 12px;
  padding: 6px 9px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text);
}
.sl-hex:focus, .sl-picker:focus { outline: 2px solid color-mix(in srgb, var(--sl-accent) 60%, transparent); outline-offset: 1px; }
.sl-swatches { display: flex; gap: 7px; margin-top: 8px; flex-wrap: wrap; }
.sl-swatch {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border); cursor: pointer; transition: transform .15s;
}
.sl-swatch:hover { transform: scale(1.18); }
.sl-styles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.sl-style {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px;
  font-size: 10px; color: var(--muted); border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface-2); cursor: pointer;
}
.sl-style:hover { color: var(--text); }
.sl-style.active { color: var(--sl-accent); border-color: var(--sl-accent); box-shadow: 0 0 0 1px var(--sl-accent) inset; }
.sl-row { display: block; margin-bottom: 10px; }
.sl-row-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--text); margin-bottom: 4px; }
.sl-row output { font-family: var(--font-mono, ui-monospace, monospace); font-size: 11px; color: var(--sl-accent); }
.sl-row input[type="range"] { width: 100%; height: 18px; -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; }
.sl-row input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: color-mix(in srgb, var(--sl-accent) 30%, var(--surface-2)); }
.sl-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--sl-accent); border: 2px solid var(--surface); margin-top: -5px;
  box-shadow: 0 0 0 1px var(--border); transition: box-shadow .15s;
}
.sl-row input[type="range"]:hover::-webkit-slider-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--sl-accent) 25%, transparent); }
.sl-row input[type="range"]::-moz-range-track { height: 4px; border-radius: 999px; background: color-mix(in srgb, var(--sl-accent) 30%, var(--surface-2)); }
.sl-row input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--sl-accent); border: 2px solid var(--surface); }
.sl-switches { display: flex; flex-direction: column; gap: 8px; }
.sl-switch { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--text); cursor: pointer; }
.sl-switch input { position: absolute; opacity: 0; }
.sl-switch i {
  width: 34px; height: 20px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--border); position: relative; flex-shrink: 0;
  transition: background .2s, border-color .2s;
}
.sl-switch i::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s;
}
.sl-switch input:checked + i { background: color-mix(in srgb, var(--sl-accent) 35%, var(--surface-2)); border-color: var(--sl-accent); }
.sl-switch input:checked + i::after { transform: translateX(14px); background: var(--sl-accent); }
.sl-switch input:focus-visible + i { outline: 2px solid var(--sl-accent); outline-offset: 2px; }
.sl-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sl-actions button {
  padding: 8px 6px; font-size: 12px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.sl-actions button:hover { border-color: var(--sl-accent); transform: translateY(-1px); }
.sl-import { margin-top: 8px; }
.sl-json {
  width: 100%; height: 74px; resize: vertical; font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px; padding: 8px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text);
}
.sl-apply {
  margin-top: 6px; width: 100%; padding: 7px; font-size: 12px; border-radius: 9px;
  border: 1px solid var(--sl-accent); color: var(--text); cursor: pointer;
  background: color-mix(in srgb, var(--sl-accent) 18%, var(--surface-2));
}

/* ---------- 13.17 夜间模式：氛围与体感 ---------- */
/* 主题切换平滑过渡：JS 在切换瞬间挂 theme-anim，约 520ms 后移除 */
html.theme-anim body, html.theme-anim .topbar, html.theme-anim .sidebar, html.theme-anim .toc,
html.theme-anim pre, html.theme-anim .button, html.theme-anim .fx-continue,
html.theme-anim .feature-card, html.theme-anim .topic-card, html.theme-anim .highlight-card,
html.theme-anim .method-card, html.theme-anim .course-switch-card, html.theme-anim .course-card,
html.theme-anim .link-cards a, html.theme-anim .stat-grid > div, html.theme-anim .version-node,
html.theme-anim .mode-card, html.theme-anim .interview-card, html.theme-anim .api-method,
html.theme-anim input, html.theme-anim textarea {
  transition: background-color .45s ease, color .45s ease, border-color .45s ease, box-shadow .45s ease !important;
}
/* 夜间氛围：顶部随皮肤色的微冷光 + 四周轻暗角，聚焦内容、加深空间感（位于网格之上、内容之下） */
[data-theme="dark"] body::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--sl-accent, #58a6ff) 4%, transparent), transparent 62%),
    radial-gradient(150% 120% at 50% 58%, transparent 55%, rgba(1,3,7,.4) 100%);
}
/* 白天氛围：顶部冷光 + 右上暖金 + 极轻四周纵深，纸感空气感 */
[data-theme="light"] body::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--accent) 5%, transparent), transparent 62%),
    radial-gradient(90% 60% at 88% 0%, color-mix(in srgb, #d9a441 5%, transparent), transparent 70%),
    radial-gradient(150% 120% at 50% 58%, transparent 60%, rgba(23,32,43,.06) 100%);
}
/* 顶栏玻璃加深，底边染一点熔金 */
[data-theme="dark"] .topbar {
  -webkit-backdrop-filter: blur(14px) saturate(1.25); backdrop-filter: blur(14px) saturate(1.25);
  border-bottom-color: color-mix(in srgb, var(--accent) 16%, var(--border));
}
/* 卡片顶部内发光：暗色下给出"被照亮"的层次 */
[data-theme="dark"] .feature-card, [data-theme="dark"] .topic-card, [data-theme="dark"] .highlight-card,
[data-theme="dark"] .method-card, [data-theme="dark"] .course-switch-card, [data-theme="dark"] .course-card,
[data-theme="dark"] .link-cards a, [data-theme="dark"] .stat-grid > div, [data-theme="dark"] .version-node,
[data-theme="dark"] .mode-card, [data-theme="dark"] .interview-card {
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.05);
}
/* 夜间悬浮：皮肤色光晕 + 更深的投影 */
[data-theme="dark"] .feature-card:hover, [data-theme="dark"] .topic-card:hover, [data-theme="dark"] .highlight-card:hover,
[data-theme="dark"] .method-card:hover, [data-theme="dark"] .course-switch-card:hover, [data-theme="dark"] .course-card:hover,
[data-theme="dark"] .link-cards a:hover, [data-theme="dark"] .stat-grid > div:hover, [data-theme="dark"] .version-node:hover,
[data-theme="dark"] .mode-card:hover {
  border-color: color-mix(in srgb, var(--sl-accent, #58a6ff) 45%, var(--border-strong));
  box-shadow: 0 12px 30px rgba(0,0,0,.55), 0 0 22px color-mix(in srgb, var(--sl-accent, #58a6ff) 15%, transparent),
    inset 0 1px 0 rgba(255,255,255,.07);
}
[data-theme="dark"] pre { border-color: #223046; box-shadow: inset 0 1px 0 rgba(255,255,255,.04), var(--shadow-sm); }
[data-theme="dark"] ::selection { background: color-mix(in srgb, var(--accent) 38%, transparent); }
[data-theme="dark"] .sidebar-links a.active, [data-theme="dark"] .sidebar-types a.active {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}
[data-theme="dark"] .toc a.active { text-shadow: 0 0 12px color-mix(in srgb, var(--accent) 35%, transparent); }
/* 白天：玻璃顶栏 + 纸感双层卡片阴影 + 蓝金悬浮 */
[data-theme="light"] .topbar {
  -webkit-backdrop-filter: blur(14px) saturate(1.15); backdrop-filter: blur(14px) saturate(1.15);
  border-bottom-color: color-mix(in srgb, var(--accent) 14%, var(--border));
}
[data-theme="light"] .feature-card, [data-theme="light"] .topic-card, [data-theme="light"] .highlight-card,
[data-theme="light"] .method-card, [data-theme="light"] .course-switch-card, [data-theme="light"] .course-card,
[data-theme="light"] .link-cards a, [data-theme="light"] .stat-grid > div, [data-theme="light"] .version-node,
[data-theme="light"] .mode-card, [data-theme="light"] .interview-card {
  box-shadow: 0 1px 2px rgba(23,32,43,.05), 0 4px 14px rgba(23,32,43,.06);
}
[data-theme="light"] .feature-card:hover, [data-theme="light"] .topic-card:hover, [data-theme="light"] .highlight-card:hover,
[data-theme="light"] .method-card:hover, [data-theme="light"] .course-switch-card:hover, [data-theme="light"] .course-card:hover,
[data-theme="light"] .link-cards a:hover, [data-theme="light"] .stat-grid > div:hover, [data-theme="light"] .version-node:hover,
[data-theme="light"] .mode-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong));
  box-shadow: 0 12px 28px rgba(28,95,138,.16), 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}
[data-theme="light"] pre { box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
[data-theme="light"] ::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* ---------- 13.18 手机端体验 ---------- */
body { -webkit-tap-highlight-color: transparent; }
@media (max-width: 640px) {
  .topbar { padding: 8px 12px; gap: 6px; }
  .topbar .search-trigger { width: 42px; padding: 0; justify-content: center; }
  .version-btn > span:first-child { display: none; }
  .version-btn .vb-lts { display: none; }
  .brand-mark.jdk { width: 38px; height: 38px; font-size: 11px; }
  .brand-text strong { font-size: 13.5px; }
  .product-link { padding: 10px 12px; font-size: 13px; }
  .version-strip { scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .version-node { scroll-snap-align: start; padding: 14px 10px 12px; }
  .vm-item { min-height: 48px; }
  .interview-toolbar button { min-height: 40px; }
  .interview-toolbar input, .interview-toolbar select,
  .scenario-toolbar input, .scenario-toolbar select,
  .api-toolbar input[type="search"], .sl-hex, .sl-json { font-size: 16px; }
  .hero-actions { gap: 8px; }
  .hero-actions .button { min-height: 44px; }
  /* 换肤工坊：手机上变为底部抽屉，单手可达 */
  .skin-lab {
    top: auto; left: 0; right: 0; bottom: 0; width: auto;
    max-height: 82vh; max-height: 82dvh;
    border-left: none;
    border-top: 1px solid color-mix(in srgb, var(--sl-accent) 35%, var(--border));
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -18px 40px rgba(0, 0, 0, .3);
    transform: translateY(105%);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .skin-lab::before {
    content: ""; position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    width: 44px; height: 4px; border-radius: 999px; background: var(--border-strong);
  }
  .sl-head { padding-top: 22px; }
  .sl-close { width: 40px; height: 40px; }
  .sl-preview { height: 92px; }
  .sl-body { flex: 1 1 auto; min-height: 0; }
  .sl-preset { padding: 10px 9px; }
  .sl-style { padding: 10px 2px; }
  .sl-actions button, .sl-apply { min-height: 42px; }
  .sl-row input[type="range"] { height: 28px; }
}

/* ---------- 13.15 降级与打印守卫 ---------- */
@media (prefers-reduced-motion: reduce) {
  .ho-chip, .ho-ring::before, .ho-ring::after,
  .version-node.current, .jdk-hero > *, .jdk-hero h1 .grad { animation: none !important; }
  .fx-reveal { opacity: 1 !important; transform: none !important; }
  .fx-reveal.fx-in, .fx-top, .fx-toast, .fx-bar i, .button.primary::after { transition: none !important; }
  .fx-spark { display: none !important; }
  .skin-lab, .skin-fab, .sl-switch i, .sl-switch i::after, .sl-preset, .sl-swatch { transition: none !important; }
  html.theme-anim body, html.theme-anim .topbar, html.theme-anim .sidebar, html.theme-anim .toc,
  html.theme-anim pre, html.theme-anim .button, html.theme-anim .fx-continue,
  html.theme-anim .feature-card, html.theme-anim .topic-card, html.theme-anim .highlight-card,
  html.theme-anim .method-card, html.theme-anim .course-switch-card, html.theme-anim .course-card,
  html.theme-anim .link-cards a, html.theme-anim .stat-grid > div, html.theme-anim .version-node,
  html.theme-anim .mode-card, html.theme-anim .interview-card, html.theme-anim .api-method,
  html.theme-anim input, html.theme-anim textarea { transition: none !important; }
}
@media print {
  .fx-grid-bg, .fx-progress, .fx-top, .fx-toast, .hero-orbit, .fx-continue, .fx-spark, .skin-fab, .skin-lab, body::after { display: none !important; }
  .fx-reveal { opacity: 1 !important; transform: none !important; }
  .jdk-hero > *, .jdk-hero h1 .grad, .version-node.current { animation: none !important; }
  .stat-grid strong { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--accent-text); }
}
@media (max-width: 640px) {
  .fx-top { right: 14px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: 40px; height: 40px; }
  .fx-toast { max-width: calc(100vw - 32px); }
  .fx-continue { gap: 12px; padding: 12px 14px; }
  .fx-continue .fx-bar { max-width: none; flex-basis: 100%; order: 5; }
  .skin-fab { left: 14px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: 42px; height: 42px; }
}
