/* ============================================================
   Claude Code 教程 · macOS 风格共享样式
   所有模块页面共用；颜色一律走 :root token，深浅色各一套
   ============================================================ */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Inter", "Noto Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Inter", "Noto Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, "JetBrains Mono", Consolas, monospace;

  --wall: radial-gradient(120% 90% at 10% 0%, #a9ccff 0%, transparent 55%),
          radial-gradient(90% 80% at 100% 20%, #e2cbff 0%, transparent 60%),
          radial-gradient(100% 90% at 70% 100%, #ffd2b8 0%, transparent 60%),
          linear-gradient(160deg, #8fb0f0 0%, #bfaef2 50%, #f2bcaa 100%);
  --menubar-bg: rgba(255, 255, 255, .42);
  --menubar-fg: rgba(0, 0, 0, .85);

  --window-bg: #ffffff;
  --sidebar-bg: rgba(236, 236, 240, .74);
  --toolbar-bg: rgba(255, 255, 255, .85);
  --window-shadow: 0 0 0 .5px rgba(0, 0, 0, .22), 0 24px 70px 6px rgba(20, 20, 60, .35);

  --label: rgba(0, 0, 0, .86);
  --label-2: rgba(0, 0, 0, .56);
  --label-3: rgba(0, 0, 0, .32);
  --sep: rgba(0, 0, 0, .1);
  --fill: rgba(0, 0, 0, .045);
  --fill-2: rgba(0, 0, 0, .08);
  --fill-3: rgba(0, 0, 0, .14);
  --group: #f5f5f7;
  --group-border: rgba(0, 0, 0, .06);
  --control: #ffffff;
  --control-border: rgba(0, 0, 0, .14);
  --control-shadow: 0 .5px 1.5px rgba(0, 0, 0, .12);
  --seg-bg: rgba(0, 0, 0, .06);
  --seg-on: #ffffff;
  --popover: rgba(250, 250, 252, .92);

  --accent: #007aff;
  --accent-press: #0062cc;
  --accent-soft: rgba(0, 122, 255, .11);
  --red: #ff3b30;    --red-soft: rgba(255, 59, 48, .11);
  --orange: #ff9500; --orange-soft: rgba(255, 149, 0, .13);
  --yellow: #ffcc00;
  --green: #28cd41;  --green-soft: rgba(40, 205, 65, .13);
  --green-text: #1a8f2e;
  --teal: #30b0c7;
  --indigo: #5856d6;
  --purple: #af52de; --purple-soft: rgba(175, 82, 222, .12);
  --pink: #ff2d55;
  --gray: #8e8e93;

  --editor-bg: #ffffff;
  --editor-gutter: rgba(0, 0, 0, .28);
  --editor-line: rgba(0, 122, 255, .07);
  --syn-key: #9b2393;
  --syn-str: #c41a16;
  --syn-com: #5d6c79;
  --syn-num: #1c00cf;
  --syn-head: #0f68a0;
  --syn-var: #3e8087;
  --syn-cmd: #b35900;
  --syn-link: #0e0eff;

  --term-bg: #1e1f22;
  --term-fg: #e6e6e6;
  --term-dim: #8b8d93;
  --term-green: #5fd35f;
  --term-blue: #6cb6ff;
  --term-orange: #f0a35e;
  --term-purple: #d49cff;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --wall: radial-gradient(120% 90% at 10% 0%, #1f3a78 0%, transparent 55%),
            radial-gradient(90% 80% at 100% 20%, #4a2a78 0%, transparent 60%),
            radial-gradient(100% 90% at 70% 100%, #6b3326 0%, transparent 60%),
            linear-gradient(160deg, #101a3a 0%, #2a1c48 50%, #3a1c1c 100%);
    --menubar-bg: rgba(20, 20, 24, .45);
    --menubar-fg: rgba(255, 255, 255, .9);
    --window-bg: #1e1e1e;
    --sidebar-bg: rgba(42, 42, 46, .72);
    --toolbar-bg: rgba(30, 30, 30, .86);
    --window-shadow: 0 0 0 .5px rgba(0, 0, 0, .9), inset 0 0 0 .5px rgba(255, 255, 255, .16), 0 24px 70px 6px rgba(0, 0, 0, .55);
    --label: rgba(255, 255, 255, .88);
    --label-2: rgba(255, 255, 255, .56);
    --label-3: rgba(255, 255, 255, .3);
    --sep: rgba(255, 255, 255, .1);
    --fill: rgba(255, 255, 255, .06);
    --fill-2: rgba(255, 255, 255, .1);
    --fill-3: rgba(255, 255, 255, .16);
    --group: #262628;
    --group-border: rgba(255, 255, 255, .07);
    --control: #3a3a3d;
    --control-border: rgba(255, 255, 255, .08);
    --control-shadow: 0 .5px 1.5px rgba(0, 0, 0, .4);
    --seg-bg: rgba(255, 255, 255, .08);
    --seg-on: #636366;
    --popover: rgba(44, 44, 48, .94);
    --accent: #0a84ff;
    --accent-press: #409cff;
    --accent-soft: rgba(10, 132, 255, .2);
    --red: #ff453a;    --red-soft: rgba(255, 69, 58, .18);
    --orange: #ff9f0a; --orange-soft: rgba(255, 159, 10, .18);
    --yellow: #ffd60a;
    --green: #32d74b;  --green-soft: rgba(50, 215, 75, .16);
    --green-text: #32d74b;
    --teal: #40c8e0;
    --indigo: #5e5ce6;
    --purple: #bf5af2; --purple-soft: rgba(191, 90, 242, .18);
    --pink: #ff375f;
    --gray: #98989d;
    --scroll: rgba(255, 255, 255, .22); --scroll-hover: rgba(255, 255, 255, .4);
    --editor-bg: #1f1f24;
    --editor-gutter: rgba(255, 255, 255, .28);
    --editor-line: rgba(10, 132, 255, .12);
    --syn-key: #fc5fa3;
    --syn-str: #fc6a5d;
    --syn-com: #7f8c98;
    --syn-num: #d0bf69;
    --syn-head: #5dd8ff;
    --syn-var: #67b7a4;
    --syn-cmd: #fd8f3f;
    --syn-link: #6699ff;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --wall: radial-gradient(120% 90% at 10% 0%, #1f3a78 0%, transparent 55%),
          radial-gradient(90% 80% at 100% 20%, #4a2a78 0%, transparent 60%),
          radial-gradient(100% 90% at 70% 100%, #6b3326 0%, transparent 60%),
          linear-gradient(160deg, #101a3a 0%, #2a1c48 50%, #3a1c1c 100%);
  --menubar-bg: rgba(20, 20, 24, .45);
  --menubar-fg: rgba(255, 255, 255, .9);
  --window-bg: #1e1e1e;
  --sidebar-bg: rgba(42, 42, 46, .72);
  --toolbar-bg: rgba(30, 30, 30, .86);
  --window-shadow: 0 0 0 .5px rgba(0, 0, 0, .9), inset 0 0 0 .5px rgba(255, 255, 255, .16), 0 24px 70px 6px rgba(0, 0, 0, .55);
  --label: rgba(255, 255, 255, .88);
  --label-2: rgba(255, 255, 255, .56);
  --label-3: rgba(255, 255, 255, .3);
  --sep: rgba(255, 255, 255, .1);
  --fill: rgba(255, 255, 255, .06);
  --fill-2: rgba(255, 255, 255, .1);
  --fill-3: rgba(255, 255, 255, .16);
  --group: #262628;
  --group-border: rgba(255, 255, 255, .07);
  --control: #3a3a3d;
  --control-border: rgba(255, 255, 255, .08);
  --control-shadow: 0 .5px 1.5px rgba(0, 0, 0, .4);
  --seg-bg: rgba(255, 255, 255, .08);
  --seg-on: #636366;
  --popover: rgba(44, 44, 48, .94);
  --accent: #0a84ff;
  --accent-press: #409cff;
  --accent-soft: rgba(10, 132, 255, .2);
  --red: #ff453a;    --red-soft: rgba(255, 69, 58, .18);
  --orange: #ff9f0a; --orange-soft: rgba(255, 159, 10, .18);
  --yellow: #ffd60a;
  --green: #32d74b;  --green-soft: rgba(50, 215, 75, .16);
  --green-text: #32d74b;
  --teal: #40c8e0;
  --indigo: #5e5ce6;
  --purple: #bf5af2; --purple-soft: rgba(191, 90, 242, .18);
  --pink: #ff375f;
  --gray: #98989d;
  --scroll: rgba(255, 255, 255, .22); --scroll-hover: rgba(255, 255, 255, .4);
  --editor-bg: #1f1f24;
  --editor-gutter: rgba(255, 255, 255, .28);
  --editor-line: rgba(10, 132, 255, .12);
  --syn-key: #fc5fa3;
  --syn-str: #fc6a5d;
  --syn-com: #7f8c98;
  --syn-num: #d0bf69;
  --syn-head: #5dd8ff;
  --syn-var: #67b7a4;
  --syn-cmd: #fd8f3f;
  --syn-link: #6699ff;
  color-scheme: dark;
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--label);
  background: var(--wall);
  background-color: #6f8fe6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: default; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, kbd, pre { font-family: var(--mono); }
::selection { background: var(--accent-soft); }
/* 滚动条：仿 macOS 细滚动条（Windows 默认带箭头的粗滚动条太出戏） */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-thumb { background-color: var(--scroll, rgba(0, 0, 0, .2)); border-radius: 11px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--scroll-hover, rgba(0, 0, 0, .36)); }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: var(--scroll, rgba(0, 0, 0, .2)) transparent; } }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; border-radius: 6px; }

/* ---------- 菜单栏 ---------- */
.menubar {
  position: fixed; inset: 0 0 auto 0; height: 26px; z-index: 50;
  display: flex; align-items: center; gap: 2px; padding: 0 10px;
  background: var(--menubar-bg);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  color: var(--menubar-fg);
  font-size: 13px; line-height: 1;
}
.menubar .mb-item {
  position: relative; height: 22px; padding: 0 9px; border: 0; background: none;
  border-radius: 5px; display: flex; align-items: center;
}
.menubar .mb-item.app { font-weight: 700; }
.menubar .mb-item:hover, .menubar .mb-item[aria-expanded="true"] { background: rgba(127, 127, 127, .28); }
.menubar .mb-right { margin-left: auto; display: flex; align-items: center; gap: 14px; padding-right: 6px; font-variant-numeric: tabular-nums; }
.menu {
  position: absolute; top: 25px; left: 0; min-width: 230px; padding: 5px;
  background: var(--popover);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-radius: 8px;
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .25), 0 10px 30px rgba(0, 0, 0, .22);
  color: var(--label); display: none; z-index: 60;
}
.menu.open { display: block; }
.menu button {
  width: 100%; text-align: left; border: 0; background: none; padding: 4px 10px; border-radius: 4px;
  display: flex; justify-content: space-between; gap: 18px; font-size: 13px; line-height: 1.5;
}
.menu button:hover { background: var(--accent); color: #fff; }
.menu button .k { color: var(--label-3); }
.menu button:hover .k { color: rgba(255, 255, 255, .75); }
.menu hr { border: 0; border-top: .5px solid var(--sep); margin: 5px 8px; }
.menu .check { width: 14px; display: inline-block; }

/* ---------- 桌面与窗口 ---------- */
.desktop {
  position: fixed; inset: 26px 0 0 0;
  display: flex; align-items: center; justify-content: center;
  padding: 22px 28px 28px;
  transition: padding .35s cubic-bezier(.3, .7, .2, 1);
}
.desktop.zoomed { padding: 0; }
.window {
  position: relative;
  width: 100%; max-width: 1480px; height: 100%; max-height: 1000px;
  border-radius: 12px; overflow: hidden;
  display: grid; grid-template-columns: 264px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
  box-shadow: var(--window-shadow);
  transition: border-radius .35s, max-width .35s, max-height .35s, grid-template-columns .3s cubic-bezier(.3, .7, .2, 1);
}
.desktop.zoomed .window { border-radius: 0; max-width: none; max-height: none; }
.window.no-sidebar { grid-template-columns: 0 minmax(0, 1fr); }
.window.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.traffic { display: flex; gap: 8px; align-items: center; }
.traffic span {
  width: 12px; height: 12px; border-radius: 50%;
  box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .18);
  display: grid; place-items: center;
  font-size: 9px; line-height: 1; font-weight: 700; color: transparent;
}
.traffic span:nth-child(1) { background: #ff5f57; }
.traffic span:nth-child(2) { background: #febc2e; }
.traffic span:nth-child(3) { background: #28c840; }
.traffic:hover span { color: rgba(0, 0, 0, .55); }
.traffic.small span { width: 10px; height: 10px; }
.traffic.inactive span { background: var(--fill-3); box-shadow: none; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  background: var(--sidebar-bg);
  backdrop-filter: blur(50px) saturate(190%);
  -webkit-backdrop-filter: blur(50px) saturate(190%);
  border-right: .5px solid var(--sep);
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
}
.sidebar-top { height: 52px; flex: none; display: flex; align-items: center; padding: 0 20px; }
.sidebar-search {
  margin: 0 12px 10px; display: flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 8px; border-radius: 7px; background: var(--fill-2);
  color: var(--label-2);
}
.sidebar-search input { border: 0; background: none; outline: none; width: 100%; font-size: 13px; color: var(--label); }
.sidebar-search input::placeholder { color: var(--label-3); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 0 10px 12px; }
.nav-group { margin-top: 12px; }
.nav-group h4 { margin: 0 10px 3px; font-size: 11px; font-weight: 600; color: var(--label-3); letter-spacing: .02em; }
.nav-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  height: 30px; padding: 0 8px; margin: 1px 0; border: 0; border-radius: 7px;
  background: none; text-align: left; font-size: 13px; color: var(--label);
  white-space: nowrap;
}
.nav-item:hover { background: var(--fill); }
.nav-item .tile {
  width: 20px; height: 20px; flex: none; border-radius: 5px;
  display: grid; place-items: center; color: #fff;
  box-shadow: inset 0 -.5px 0 rgba(0, 0, 0, .12);
}
.nav-item .tile svg { width: 13px; height: 13px; }
.nav-item .txt { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-item .done { color: var(--label-3); width: 14px; height: 14px; opacity: 0; }
.nav-item.is-done .done { opacity: 1; color: var(--green); }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-item.active .done { color: #fff; }
.nav-item[hidden] { display: none; }
.sidebar-foot {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 12px 18px 14px; border-top: .5px solid var(--sep); font-size: 12px; color: var(--label-2);
}
.ring { width: 30px; height: 30px; flex: none; }
.ring circle { fill: none; stroke-width: 3.2; }
.ring .bg { stroke: var(--fill-2); }
.ring .fg { stroke: var(--green); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .6s; }
.sidebar-foot strong { display: block; color: var(--label); font-size: 13px; font-weight: 600; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-size: 12px; }
.link-btn:hover { text-decoration: underline; }

/* ---------- 主区域 ---------- */
.main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--window-bg); }
.toolbar {
  position: relative; z-index: 10; height: 52px; flex: none;
  display: flex; align-items: center; gap: 8px; padding: 0 14px 0 12px;
  background: var(--window-bg);
  border-bottom: .5px solid var(--sep);
}
.toolbar .traffic { display: none; margin: 0 10px 0 6px; }
.window.no-sidebar .toolbar .traffic { display: flex; }
.tb-btn {
  height: 28px; min-width: 30px; padding: 0 6px; border: 0; border-radius: 6px; background: none;
  display: inline-grid; place-items: center; color: var(--label-2);
}
.tb-btn:hover { background: var(--fill); color: var(--label); }
.tb-btn:disabled { opacity: .35; background: none; }
.tb-btn svg { width: 18px; height: 18px; }
.tb-title { margin-left: 6px; min-width: 0; line-height: 1.2; }
.tb-title strong { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-title span { font-size: 11px; color: var(--label-2); white-space: nowrap; }
.tb-spacer { flex: 1; }
.content { flex: 1; overflow-y: auto; overflow-x: hidden; scroll-padding-top: 16px; overscroll-behavior: contain; }
.article { max-width: 800px; margin: 0 auto; padding: 48px 44px 120px; }

/* ---------- 控件 ---------- */
.seg {
  display: inline-flex; padding: 2px; border-radius: 8px; background: var(--seg-bg); gap: 2px;
  font-size: 13px; line-height: 1;
}
.seg button {
  border: 0; background: none; height: 24px; padding: 0 12px; border-radius: 6px;
  color: var(--label); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px;
}
.seg button[aria-pressed="true"] { background: var(--seg-on); box-shadow: 0 .5px 2px rgba(0, 0, 0, .18), 0 0 0 .5px rgba(0, 0, 0, .05); font-weight: 600; }
.seg.icons button { padding: 0 8px; }
.seg svg { width: 15px; height: 15px; }

.btn {
  height: 28px; padding: 0 14px; border-radius: 7px; font-size: 13px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--control); border: .5px solid var(--control-border); box-shadow: var(--control-shadow);
  color: var(--label); white-space: nowrap;
}
.btn:active { filter: brightness(.94); }
.btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #fff), var(--accent)); color: #fff; border-color: transparent; }
.btn.primary:active { background: var(--accent-press); }
.btn:disabled { opacity: .45; }
.btn svg { width: 14px; height: 14px; }
.btn.large { height: 34px; padding: 0 18px; font-size: 14px; border-radius: 8px; }

.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: default; z-index: 1; }
.switch i {
  position: absolute; inset: 0; border-radius: 11px; background: var(--fill-3);
  transition: background .2s;
}
.switch i::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 0 0 .5px rgba(0, 0, 0, .06);
  transition: transform .2s cubic-bezier(.3, .7, .3, 1.2);
}
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 3px solid color-mix(in srgb, var(--accent) 50%, transparent); }

.field {
  width: 100%; border-radius: 7px; border: .5px solid var(--control-border);
  background: var(--editor-bg); padding: 6px 10px; font-size: 14px; line-height: 1.5;
  box-shadow: inset 0 .5px 1.5px rgba(0, 0, 0, .08); outline: none;
}
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
textarea.field { resize: vertical; min-height: 70px; }
.field.mono { font-family: var(--mono); font-size: 13px; }
.field.invalid { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
select.field { appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, var(--label-2) 50%), linear-gradient(135deg, var(--label-2) 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }

/* ---------- 分组列表（系统设置风格） ---------- */
.group {
  background: var(--group); border: .5px solid var(--group-border); border-radius: 10px;
  margin: 18px 0; overflow: hidden;
}
.group-title { margin: 26px 0 7px 4px; font-size: 13px; font-weight: 600; color: var(--label-2); line-height: 1.4; }
.group-title + .group { margin-top: 0; }
.row {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 14px;
  font-size: 14px; line-height: 1.45;
}
.row + .row { border-top: .5px solid var(--sep); }
.row .grow { flex: 1; min-width: 0; }
.row .sub { display: block; font-size: 12px; color: var(--label-2); margin-top: 1px; }
.row code { font-size: 12.5px; }

/* ---------- 文章排版 ---------- */
.hero { padding: 10px 0 18px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: .02em; }
h1 { font-family: var(--font-display); font-size: 38px; line-height: 1.18; letter-spacing: -.02em; margin: 6px 0 14px; font-weight: 700; }
h2 { font-family: var(--font-display); font-size: 28px; line-height: 1.25; letter-spacing: -.015em; margin: 0 0 10px; font-weight: 700; }
h3 { font-size: 18px; line-height: 1.4; margin: 30px 0 8px; font-weight: 600; }
/* 标题里常有 /clear、/compact 这类连在一起的英文命令，窄屏上必须允许断行，否则会被裁掉 */
h1, h2, h3 { overflow-wrap: anywhere; }
p { margin: 10px 0; }
.lede { font-size: 17px; line-height: 1.7; color: var(--label-2); }
.muted { color: var(--label-2); }
.small { font-size: 13px; }
:not(pre) > code { font-size: .88em; padding: 1px 5px; border-radius: 5px; background: var(--fill); color: var(--label); overflow-wrap: anywhere; }
kbd { font-size: 12px; padding: 1px 6px; border-radius: 5px; background: var(--control); border: .5px solid var(--control-border); box-shadow: 0 1px 0 var(--control-border); }
ul.clean, ol.clean { padding-left: 1.3em; margin: 8px 0; }
ul.clean li, ol.clean li { margin: 4px 0; }
strong { font-weight: 600; }

.meta-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px;
  border-radius: 13px; background: var(--fill); font-size: 12.5px; color: var(--label-2); white-space: nowrap;
}
.chip svg { width: 13px; height: 13px; }

.chapter { padding: 56px 0 8px; border-top: .5px solid var(--sep); margin-top: 48px; }
.chapter-head { margin-bottom: 8px; }
.badge {
  display: inline-block; font-size: 11.5px; font-weight: 600; line-height: 1; padding: 5px 8px; border-radius: 5px;
  margin-bottom: 10px; letter-spacing: .02em;
}
.badge.l1 { background: var(--green-soft); color: var(--green-text); }
.badge.l2 { background: var(--accent-soft); color: var(--accent); }
.badge.l3 { background: var(--orange-soft); color: var(--orange); }
.badge.l4 { background: var(--purple-soft); color: var(--purple); }
.badge .num { opacity: .6; margin-right: 4px; }

/* 提示框：统一中性底色，只用标题颜色区分类型，避免满屏色块 */
.aside {
  --c: var(--accent);
  margin: 20px 0; padding: 13px 16px 13px 18px; border-radius: 10px; font-size: 14px; line-height: 1.7;
  background: var(--group); border: .5px solid var(--group-border); position: relative;
}
.aside::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c); }
.aside > b:first-child { display: block; font-size: 13px; margin-bottom: 3px; color: var(--c); }
.aside.tip { --c: var(--green-text); }
.aside.important { --c: var(--orange); }
.aside.warning { --c: var(--red); }
.aside p { margin: 4px 0; }

/* 表格 */
.table-wrap { overflow-x: auto; margin: 16px 0; border-radius: 10px; border: .5px solid var(--group-border); background: var(--group); }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; line-height: 1.5; }
th, td { text-align: left; padding: 9px 12px; vertical-align: top; }
th { font-size: 12px; font-weight: 600; color: var(--label-2); background: var(--fill); white-space: nowrap; }
tr + tr td { border-top: .5px solid var(--sep); }
td code { white-space: nowrap; }

/* 代码块 */
.code {
  position: relative; margin: 14px 0; border-radius: 10px; background: var(--group);
  border: .5px solid var(--group-border); overflow: hidden;
}
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 13px; line-height: 1.65; tab-size: 2; }
.code .code-label { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 14px; font-size: 12px; color: var(--label-2); border-bottom: .5px solid var(--sep); }
.copy-btn {
  height: 24px; padding: 0 9px; border-radius: 6px; border: 0; background: none; font-size: 12px; color: var(--label-2);
  display: inline-flex; align-items: center; gap: 4px;
}
.copy-btn:hover { background: var(--fill-2); color: var(--label); }
.copy-btn.ok { color: var(--green-text); }
.copy-btn svg { width: 13px; height: 13px; }

/* 语法高亮 */
.t-key { color: var(--syn-key); }
.t-str { color: var(--syn-str); }
.t-com { color: var(--syn-com); font-style: italic; }
.t-num { color: var(--syn-num); }
.t-head { color: var(--syn-head); font-weight: 700; }
.t-var { color: var(--syn-var); font-weight: 600; }
.t-cmd { color: var(--syn-cmd); }
.t-link { color: var(--syn-link); }
.t-punc { color: var(--label-3); }

/* ---------- 迷你窗口（终端 / 编辑器 / 访达） ---------- */
.mwin {
  margin: 20px 0; border-radius: 11px; overflow: hidden; overflow: clip; background: var(--window-bg);
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .2), 0 10px 32px rgba(0, 0, 0, .16);
}
:root[data-theme="dark"] .mwin { box-shadow: 0 0 0 .5px rgba(0, 0, 0, .8), inset 0 0 0 .5px rgba(255, 255, 255, .12), 0 10px 32px rgba(0, 0, 0, .5); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mwin { box-shadow: 0 0 0 .5px rgba(0, 0, 0, .8), inset 0 0 0 .5px rgba(255, 255, 255, .12), 0 10px 32px rgba(0, 0, 0, .5); } }
.mwin-bar {
  position: relative; height: 34px; display: flex; align-items: center; padding: 0 12px;
  background: var(--toolbar-bg); border-bottom: .5px solid var(--sep);
}
.mwin-bar .title {
  position: absolute; left: 90px; right: 90px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--label-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mwin-bar .right { margin-left: auto; display: flex; gap: 6px; position: relative; }

/* 终端 */
.term { background: var(--term-bg); color: var(--term-fg); }
.term .mwin-bar { background: #2b2c30; border-bottom-color: rgba(0, 0, 0, .5); }
.term .mwin-bar .title { color: rgba(255, 255, 255, .55); }
.term-screen {
  --scroll: rgba(255, 255, 255, .2); --scroll-hover: rgba(255, 255, 255, .36);
  height: 400px; overflow-y: auto; padding: 12px 16px 16px;
  font-family: var(--mono); font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}
.term-screen .dim { color: var(--term-dim); }
.term-screen .g { color: var(--term-green); }
.term-screen .b { color: var(--term-blue); }
.term-screen .o { color: var(--term-orange); }
.term-screen .p { color: var(--term-purple); }
.term-screen .w { color: #fff; font-weight: 700; }
.term-screen .hl { background: rgba(108, 182, 255, .18); border-radius: 3px; }
/* 终端欢迎框：用边框画，不用 ╭─╮ 字符（不同字体下宽度不一，右边框会对不齐） */
.term-screen .tbox { display: inline-block; border: 1px solid var(--term-orange); border-radius: 7px; padding: 5px 16px 6px 12px; line-height: 1.6; }
.term-screen .caret { display: inline-block; width: 8px; height: 15px; background: var(--term-fg); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.term-input {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-top: .5px solid rgba(255, 255, 255, .1);
  font-family: var(--mono); font-size: 13px; background: #25262a;
}
.term-input input { flex: 1; background: none; border: 0; outline: none; color: var(--term-fg); font-family: var(--mono); }
.term-input input::placeholder { color: #6a6c72; }
.term-input input:disabled { opacity: .5; }

/* 编辑器 */
.editor { font-family: var(--mono); font-size: 13px; line-height: 1.7; background: var(--editor-bg); }
.editor .ln { display: grid; grid-template-columns: 38px 1fr; min-height: 22px; }
.editor .ln .n { text-align: right; padding-right: 12px; color: var(--editor-gutter); user-select: none; }
.editor .ln .c { padding-right: 14px; white-space: pre-wrap; word-break: break-word; }

/* 窗口里的底部状态栏 */
.status-bar { display: flex; align-items: center; gap: 12px; height: 26px; padding: 0 12px; font-size: 11.5px; color: var(--label-2); border-top: .5px solid var(--sep); background: var(--toolbar-bg); }

/* ---------- Sheet（模态） ---------- */
.sheet-scrim {
  position: absolute; inset: 0; z-index: 40; background: rgba(0, 0, 0, .18);
  display: none; justify-content: center; align-items: flex-start;
}
.sheet-scrim.open { display: flex; }
.sheet {
  margin-top: 52px; width: min(460px, calc(100% - 32px)); max-height: calc(100% - 80px); overflow: auto;
  background: var(--window-bg); border-radius: 0 0 12px 12px; padding: 24px 24px 18px;
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .2), 0 18px 50px rgba(0, 0, 0, .35);
  animation: sheet-in .28s cubic-bezier(.3, .7, .2, 1);
}
@keyframes sheet-in { from { transform: translateY(-24px); opacity: 0; } }
.sheet h3 { margin: 0 0 6px; }
.sheet .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ---------- 页脚 ---------- */
.foot { margin-top: 70px; padding-top: 24px; border-top: .5px solid var(--sep); font-size: 12.5px; color: var(--label-2); }
/* 页脚课程列表（mac.js 的 buildCourse 生成） */
.course-nav { margin: 22px 0 18px; }
.course-nav h4 { margin: 0 0 8px 2px; font-size: 12px; font-weight: 600; color: var(--label-3); }
.course-nav > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.course-nav .cn-item { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 10px; border-radius: 8px; background: var(--group); border: .5px solid var(--group-border); color: var(--label); font-size: 13px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.course-nav .cn-item b { flex: none; min-width: 22px; font: 600 11.5px var(--mono); color: var(--label-3); }
.course-nav .cn-item:hover { border-color: var(--accent); }
.course-nav .cn-item.here { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; pointer-events: none; }
.course-nav .cn-item.here b { color: var(--accent); }
.next-card {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 12px; margin-bottom: 28px;
  background: var(--group); border: .5px solid var(--group-border); color: var(--label);
}
.next-card:hover { text-decoration: none; }
.next-card .tile { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; }
.next-card .tile svg { width: 22px; height: 22px; }
.next-card small { display: block; color: var(--label-2); font-size: 12px; }

/* ---------- 宽组件：可超出正文栏，按内容区宽度居中 ---------- */
.content { container-type: inline-size; }
.wide { --w: max(100%, min(1080px, 100cqw - 64px)); width: var(--w); margin-left: calc((100% - var(--w)) / 2); }

/* ---------- 小屏 ---------- */
.scrim { display: none; }
@media (max-width: 880px) {
  body { overflow: hidden; }
  .menubar { display: none; }
  .desktop { inset: 0; padding: 0; }
  .window { border-radius: 0; max-height: none; grid-template-columns: minmax(0, 1fr); }
  .window.no-sidebar { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: absolute; z-index: 30; top: 0; bottom: 0; left: 0; width: 284px;
    transform: translateX(-102%); transition: transform .3s cubic-bezier(.3, .7, .2, 1);
    box-shadow: 0 0 40px rgba(0, 0, 0, .25);
  }
  .window.sidebar-open .sidebar { transform: none; }
  .window.sidebar-open .scrim { display: block; position: absolute; inset: 0; z-index: 25; background: rgba(0, 0, 0, .25); }
  .sidebar-top .traffic, .toolbar .traffic, .window.no-sidebar .toolbar .traffic { display: none; }
  .main { grid-column: 1; }
  .article { padding: 28px 16px 90px; }
  h1 { font-size: 30px; }
  h2 { font-size: 24px; }
  .tb-hide-sm { display: none !important; }
  .mwin-bar .title { left: 70px; right: 12px; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}
