/* 终端配色工作台样式 —— 全部作用域化到 .term-root，避免污染站点 styles.css。
   沿用 Theme Forge 的「画廊展墙」美学：炭黑底 + 骨色字 + 编辑感衬线/等宽，
   中央一台 CSS 变量驱动的「假终端」装置（换锚色只改 --ansi-* 变量，零节点重渲染）。 */

/* 页面层（站点浅色区，不作用域化）—— 全宽，与 gradients / theme-forge 一致 */
.terminal-page{max-width:none;padding:clamp(16px,2vw,26px) clamp(16px,2.4vw,36px) clamp(40px,5vw,64px)}

.term-root{
  --ink:#0d0d0b; --ink2:#15150f; --bone:#ece7da; --ash:#88847a; --ash2:#6a675f;
  --line:rgba(236,231,218,.13); --line2:rgba(236,231,218,.26);
  --wash:rgba(236,231,218,.06); --wash-strong:rgba(236,231,218,.1);
  --shell-shadow:0 40px 90px -30px rgba(0,0,0,.85),0 0 0 1px rgba(236,231,218,.08);
  --scroll-thumb:rgba(236,231,218,.18); --scroll-thumb-strong:rgba(236,231,218,.22);
  --serif:'Fraunces',serif; --sans:'Noto Sans SC',system-ui,sans-serif;
  --cn:'Noto Serif SC',serif; --mono:'Space Mono','SFMono-Regular',monospace;
  position:relative; height:min(1500px,calc(100vh - 24px)); min-height:760px;
  display:grid; grid-template-rows:auto 1fr;
  background:var(--ink); color:var(--bone); font-family:var(--sans);
  border:1px solid var(--line2); overflow:hidden;
  -webkit-font-smoothing:antialiased;
}
.term-root[data-mode="dark"]{
  --ink:#0d0d0b; --ink2:#15150f; --bone:#ece7da; --ash:#88847a; --ash2:#6a675f;
  --line:rgba(236,231,218,.13); --line2:rgba(236,231,218,.26);
  --wash:rgba(236,231,218,.06); --wash-strong:rgba(236,231,218,.1);
  --shell-shadow:0 40px 90px -30px rgba(0,0,0,.85),0 0 0 1px rgba(236,231,218,.08);
  --scroll-thumb:rgba(236,231,218,.18); --scroll-thumb-strong:rgba(236,231,218,.22);
}
.term-root[data-mode="light"]{
  --ink:#f2eadb; --ink2:#fffaf0; --bone:#16130e; --ash:#635b4f; --ash2:#8d8271;
  --line:rgba(22,19,14,.12); --line2:rgba(22,19,14,.22);
  --wash:rgba(22,19,14,.05); --wash-strong:rgba(22,19,14,.09);
  --shell-shadow:0 34px 76px -42px rgba(64,47,24,.44),0 0 0 1px rgba(22,19,14,.06);
  --scroll-thumb:rgba(22,19,14,.18); --scroll-thumb-strong:rgba(22,19,14,.22);
}
.term-root *,.term-root *::before,.term-root *::after{box-sizing:border-box}
.term-root *{margin:0;padding:0}
.term-root button,.term-root input{font:inherit;color:inherit;border-radius:0;border:0;background:none}
.term-root button{cursor:pointer}
/* 站点 styles.css 给全局 <code> 配了浅色药丸底（背景/边框/内距）——在终端装置内一律清掉，
   否则会盖住假终端的深色底。pre 同理。各自的专用样式（.export pre / .md-code …）特异性更高，不受影响。 */
.term-root code,.term-root pre{background:none;border:0;padding:0;margin:0;font:inherit;color:inherit;border-radius:0}
.term-root::before{content:"";position:absolute;inset:0;pointer-events:none;z-index:9;opacity:.035;mix-blend-mode:multiply;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");}
.term-root[data-mode="dark"]::before{opacity:.04;mix-blend-mode:screen}

/* 顶栏 */
.term-root .bar{display:flex;align-items:center;gap:24px;padding:0 22px;height:58px;border-bottom:1px solid var(--line2);background:linear-gradient(180deg,var(--ink2),var(--ink));flex-wrap:wrap}
.term-root .brand{display:flex;align-items:baseline;gap:11px;white-space:nowrap}
.term-root .brand .cn{font-family:var(--cn);font-weight:900;font-size:19px;letter-spacing:.06em}
.term-root .brand .en{font-family:var(--serif);font-weight:600;font-size:12px;letter-spacing:.34em;text-transform:uppercase;color:var(--ash)}
.term-root .bar .tag{font-family:var(--mono);font-size:10px;letter-spacing:.12em;color:var(--ash2);border:1px solid var(--line2);padding:3px 8px;text-transform:uppercase}
.term-root .bar .sp{flex:1}
.term-root .quick{display:flex;gap:5px}
.term-root .quick button{width:22px;height:22px;border:1px solid var(--line2);transition:transform .15s,outline-color .15s;outline:2px solid transparent;outline-offset:2px}
.term-root .quick button:hover{transform:translateY(-2px)}
.term-root .quick button[aria-pressed=true]{outline-color:var(--bone)}
.term-root .tm-search{
  --term-search-ink:#111111;
  --term-search-muted:#777777;
  --term-search-panel:#ffffff;
  --term-search-line:#ddd6ca;
  --term-search-line-strong:#aaa093;
  --term-search-hover-bg:#111111;
  --term-search-hover-text:#f7f7f4;
  --term-search-shadow:0 18px 50px rgba(17,17,17,.08);
  --ink:var(--term-search-ink);
  --muted:var(--term-search-muted);
  --panel:var(--term-search-panel);
  --line:var(--term-search-line);
  --hover-bg:var(--term-search-hover-bg);
  --hover-text:var(--term-search-hover-text);
  --shadow-soft:var(--term-search-shadow);
  display:flex;align-items:center;gap:8px;border:1px solid var(--term-search-line);padding:7px 11px;width:210px;background:var(--term-search-panel);color:var(--term-search-muted);transition:transform .18s var(--ease-out-quart),border-color .18s ease,background .18s ease,color .18s ease;
}
:root[data-theme="dark"] .term-root .tm-search{
  --term-search-ink:#f2f0ea;
  --term-search-muted:#9c968c;
  --term-search-panel:#191816;
  --term-search-line:#38332d;
  --term-search-line-strong:#625a4f;
  --term-search-hover-bg:#050505;
  --term-search-hover-text:#f2f0ea;
  --term-search-shadow:0 22px 56px rgba(0,0,0,.38);
}
.term-root .tm-search:focus-within{color:var(--term-search-ink);background:var(--term-search-panel);border-color:var(--term-search-line-strong);transform:translateY(-1px)}
.term-root .tm-search svg{width:13px;height:13px;color:currentColor;flex:none}
.term-root .tm-search input{width:100%;font-family:var(--mono);font-size:12px;letter-spacing:.02em;color:var(--term-search-ink);outline:0}
.term-root .tm-search input::placeholder{color:var(--term-search-muted);opacity:.88}
.term-root .ghost{font-family:var(--mono);font-size:11px;letter-spacing:.08em;text-transform:uppercase;border:1px solid var(--line2);padding:7px 12px;color:var(--bone);transition:background .15s}
.term-root .ghost:hover{background:var(--wash-strong)}
.term-root .seg{display:flex;border:1px solid var(--line2)}
.term-root .seg button{font-family:var(--mono);font-size:11px;letter-spacing:.06em;padding:7px 13px;color:var(--ash)}
.term-root .seg button[aria-pressed=true]{background:var(--bone);color:var(--ink)}

/* 工作区：装置 + 标本面板 */
.term-root .work{display:grid;grid-template-columns:1fr 380px;min-height:0}
.term-root .stage{display:flex;flex-direction:column;gap:14px;padding:22px 26px;min-height:0;overflow:hidden;
  background:radial-gradient(120% 90% at 50% -10%,var(--wash-strong),transparent 60%),var(--ink)}

/* 假终端装置 */
.term-root .term{flex:1;display:flex;flex-direction:column;min-height:0;
  background:var(--term-bg,#111);border:1px solid var(--line2);
  box-shadow:var(--shell-shadow);
  animation:tm-rise .55s cubic-bezier(.2,.7,.2,1) both;transition:background-color .5s ease}
@keyframes tm-rise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
.term-root .term-chrome{display:flex;align-items:center;gap:14px;padding:0 14px;height:40px;flex:none;
  background:linear-gradient(180deg,color-mix(in srgb,var(--term-bg,#111) 82%,var(--term-fg,#ddd)),var(--term-bg,#111));
  border-bottom:1px solid color-mix(in srgb,var(--term-fg,#ddd) 18%,transparent)}
.term-root .term-chrome .dots{display:flex;gap:7px}
.term-root .term-chrome .dots i{width:11px;height:11px;border-radius:50%;display:block}
.term-root .term-chrome .dots i:nth-child(1){background:var(--ansi-red,#e36)}
.term-root .term-chrome .dots i:nth-child(2){background:var(--ansi-yellow,#ec5)}
.term-root .term-chrome .dots i:nth-child(3){background:var(--ansi-green,#5c6)}
.term-root .term-chrome .ttl{font-family:var(--mono);font-size:11px;color:var(--ash);letter-spacing:.04em;white-space:nowrap;margin:0 auto}
.term-root .term-chrome .chrome-tag{font-family:var(--mono);font-size:9px;letter-spacing:.1em;color:var(--ash2);text-transform:uppercase;white-space:nowrap}

.term-root .term-body{flex:1;overflow:auto;background:var(--term-bg,#111);color:var(--term-fg,#ddd);
  transition:background-color .5s ease,color .5s ease}
.term-root .term-body ::selection{background:var(--term-sel,#345)}
/* 一页连续会话：命令行提示符 + 程序输出 */
.term-root .term-scroll{font-family:var(--mono);font-size:12.5px;line-height:1.62;padding:14px 20px 22px;color:var(--term-fg,#ddd)}
.term-root .cmd{margin:17px 0 6px;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--term-fg)}
.term-root .cmd:first-child{margin-top:2px}
.term-root .pr{color:var(--term-anchor-vivid,var(--term-fg));font-weight:700}
.term-root .out{white-space:pre;overflow-x:auto;color:var(--term-fg);margin-bottom:2px}
.term-root .md{white-space:normal;margin:2px 0 4px}
/* bat 风格行号栏 */
.term-root .codeblk{margin:4px 0;font-size:12px;line-height:1.6}
.term-root .cl{display:flex;align-items:baseline}
.term-root .cl i{flex:none;width:42px;text-align:right;padding-right:16px;font-style:normal;color:var(--ansi-bright_black);opacity:.5;user-select:none;-webkit-user-select:none}
.term-root .cl code{flex:1;white-space:pre;font-family:inherit;min-width:0;overflow-x:auto}
.term-root .cl:hover{background:color-mix(in srgb,var(--term-fg,#ddd) 5%,transparent)}

/* fastfetch 风格：logo + 信息 + 经典 16 色块 */
.term-root .fetch{display:flex;gap:30px;padding:8px 2px 12px;align-items:flex-start}
.term-root .fetch .logo{flex:none;color:var(--term-anchor-vivid,var(--term-fg));font-size:13px;line-height:1.18;white-space:pre;text-shadow:0 0 18px color-mix(in srgb,var(--term-anchor-vivid) 45%,transparent)}
.term-root .finfo{font-size:12.5px;line-height:1.72;min-width:0}
.term-root .fhdr{font-weight:700;margin-bottom:2px}
.term-root .frule{color:var(--ansi-bright_black)}
.term-root .frow{color:var(--term-fg)}
.term-root .frow .fk{display:inline-block;min-width:84px;color:var(--ansi-cyan);font-weight:700}
.term-root .fblocks{margin-top:14px;display:flex;flex-direction:column;gap:5px}
.term-root .fbrow{display:flex;gap:5px}
.term-root .fbrow span{width:26px;height:15px;display:block}

/* 会话 ANSI 文本类 */
.term-root .a-red{color:var(--ansi-red)} .term-root .a-grn{color:var(--ansi-green)}
.term-root .a-yel{color:var(--ansi-yellow)} .term-root .a-blu{color:var(--ansi-blue)}
.term-root .a-mag{color:var(--ansi-magenta)} .term-root .a-cyn{color:var(--ansi-cyan)}
.term-root .a-wht{color:var(--ansi-white)} .term-root .a-dim{color:var(--ansi-bright_black)}
.term-root .curs{display:inline-block;width:.6em;height:1.05em;vertical-align:-.18em;background:var(--term-cursor,#fff);animation:tm-blink 1.1s steps(1) infinite}
@keyframes tm-blink{50%{opacity:.25}}

/* 代码 token → ANSI（bat 约定）*/
.term-root .tok-comment{color:var(--ansi-bright_black);font-style:italic}
.term-root .tok-keyword{color:var(--ansi-magenta)}
.term-root .tok-string{color:var(--ansi-green)}
.term-root .tok-number{color:var(--ansi-yellow)}
.term-root .tok-fn{color:var(--ansi-blue)}
.term-root .tok-type{color:var(--ansi-cyan)}

/* Markdown → ANSI（glow 约定）*/
.term-root .md{padding:18px 22px;line-height:1.6;font-size:13px}
.term-root .md-h1{font-family:var(--cn);font-weight:900;font-size:19px;color:var(--term-anchor-vivid);margin:2px 0 6px}
.term-root .md-h2{font-family:var(--cn);font-weight:700;font-size:15px;color:var(--term-anchor-vivid);margin:14px 0 4px}
.term-root .md-p{color:var(--term-fg);margin:3px 0}
.term-root .md-strong{color:var(--ansi-bright_white);font-weight:700}
.term-root .md-em{color:var(--ansi-yellow);font-style:italic}
.term-root .md-code{color:var(--ansi-green);background:color-mix(in srgb,var(--term-fg,#ddd) 7%,transparent);padding:1px 5px}
.term-root .md-link{color:var(--ansi-blue);text-decoration:underline}
.term-root .md-quote{color:var(--ansi-bright_black);border-left:2px solid var(--ansi-bright_black);padding-left:12px;font-style:italic;margin:4px 0}
.term-root .md-li{color:var(--term-fg);margin:2px 0;padding-left:4px}
.term-root .md-bullet{color:var(--ansi-cyan);margin-right:6px}
.term-root .md-codeblock{font-family:var(--mono);font-size:12px;line-height:1.55;white-space:pre;background:color-mix(in srgb,var(--term-bg,#111) 88%,var(--term-fg,#ddd));padding:12px 14px;margin:8px 0;border-left:2px solid var(--ansi-bright_black);overflow-x:auto}
.term-root .md-gap{height:8px}

/* 预览旁的 Claude Code 用法提示 */
.term-root .stage-note{flex:none;font-family:var(--mono);font-size:10px;line-height:1.5;letter-spacing:.01em;color:var(--ash2);text-align:center}
.term-root .stage-note code{font-family:var(--mono);font-size:9.5px;color:var(--ash)}
.term-root .stage-note b{color:var(--ash);font-weight:700}

/* 16 色板带 */
.term-root .strip{flex:none;display:grid;grid-template-columns:repeat(16,1fr);gap:4px}
.term-root .strip .chip{position:relative;display:flex;flex-direction:column;align-items:stretch;gap:3px;cursor:default}
.term-root .strip .chip i{height:30px;display:block;outline:1px solid var(--line);transition:transform .15s}
.term-root .strip .chip:hover i{transform:translateY(-3px)}
.term-root .strip .chip b{font-family:var(--mono);font-size:9px;color:var(--ash2);text-align:center;font-weight:400}
.term-root .strip .chip.nud i::after{content:"";position:absolute;top:3px;right:3px;width:5px;height:5px;background:var(--bone);outline:1px solid var(--ink)}

/* 右侧标本 / 导出面板 */
.term-root .spec{border-left:1px solid var(--line2);background:linear-gradient(180deg,var(--ink2),var(--ink));display:grid;grid-template-rows:auto 1fr auto;min-height:0}
.term-root .anchor{display:flex;gap:14px;align-items:center;padding:18px 18px 16px;border-bottom:1px solid var(--line)}
.term-root .anchor .sw{position:relative;width:52px;height:52px;flex:none;outline:1px solid var(--line2);transition:transform .18s var(--ease-out-quart),outline-color .18s ease,box-shadow .18s ease}
.term-root .anchor .sw::after{content:"";position:absolute;right:5px;bottom:5px;width:13px;height:13px;background:var(--ink);border:1px solid color-mix(in srgb,var(--bone) 42%,transparent)}
.term-root .anchor .sw:hover,.term-root .anchor .sw:focus-visible{outline-color:var(--bone);box-shadow:0 14px 34px -20px var(--bone);transform:translateY(-2px)}
.term-root .anchor .sw:focus-visible{outline-width:2px;outline-offset:3px}
.term-root .anchor .k{font-family:var(--mono);font-size:9px;letter-spacing:.14em;text-transform:uppercase;color:var(--ash2)}
.term-root .anchor .nm{font-family:var(--cn);font-weight:700;font-size:20px;margin:2px 0 3px}
.term-root .anchor .hex{font-family:var(--mono);font-size:11px;color:var(--ash)}
.term-root .anchor .ok{font-family:var(--mono);font-size:10px;color:var(--ash2);margin-top:2px}

.tm-color-dialog{width:min(860px,calc(100vw - 28px));max-height:min(84vh,760px);padding:0;overflow:hidden;color:var(--bone,#16130e);background:var(--ink2,#fffaf0);border:1px solid var(--line2,rgba(22,19,14,.22));box-shadow:0 30px 80px -38px rgba(0,0,0,.72)}
.tm-color-dialog[open]{display:grid;grid-template-rows:auto auto auto minmax(0,1fr)}
.tm-color-dialog::backdrop{background:rgba(12,10,7,.54);backdrop-filter:blur(3px)}
.tm-color-head{display:flex;align-items:start;justify-content:space-between;gap:18px;padding:20px clamp(18px,3vw,28px) 16px;border-bottom:1px solid var(--line2,rgba(22,19,14,.22))}
.tm-color-head span{display:block;margin-bottom:5px;font-family:var(--mono,'Space Mono',monospace);font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--ash2,#8d8271)}
.tm-color-head h2{font-family:var(--cn,'Noto Serif SC',serif);font-size:clamp(1.35rem,2.6vw,2rem);line-height:1.1;margin:0}
.tm-color-close{width:38px;height:38px;display:grid;place-items:center;color:var(--bone,#16130e);background:transparent;border:1px solid var(--line2,rgba(22,19,14,.22));font-size:22px;line-height:1;cursor:pointer}
.tm-color-close:hover,.tm-color-close:focus-visible{color:var(--ink,#f2eadb);background:var(--bone,#16130e);outline:none}
.tm-color-search{display:flex;align-items:center;gap:10px;margin:14px clamp(18px,3vw,28px);min-height:46px;padding:0 14px;color:var(--ash,#635b4f);background:var(--ink,#f2eadb);border:1px solid var(--line2,rgba(22,19,14,.22))}
.tm-color-search:focus-within{color:var(--bone,#16130e);border-color:var(--bone,#16130e)}
.tm-color-search input{width:100%;min-width:0;height:44px;color:var(--bone,#16130e);background:transparent;border:0;outline:0;font-family:var(--mono,'Space Mono',monospace);font-size:12px}
.tm-color-search input::placeholder{color:var(--ash2,#8d8271)}
.tm-color-current{display:grid;grid-template-columns:repeat(auto-fit,minmax(132px,1fr));gap:1px;margin:0 clamp(18px,3vw,28px) 14px;background:var(--line2,rgba(22,19,14,.22));border:1px solid var(--line2,rgba(22,19,14,.22))}
.tm-color-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(154px,1fr));gap:1px;min-height:220px;overflow:auto;background:var(--line2,rgba(22,19,14,.22));border-top:1px solid var(--line2,rgba(22,19,14,.22))}
.tm-color-pick{display:grid;grid-template-columns:34px minmax(0,1fr);gap:10px;align-items:center;min-height:68px;padding:10px 12px;color:var(--bone,#16130e);background:var(--ink2,#fffaf0);border:0;text-align:left;cursor:pointer}
.tm-color-pick:hover,.tm-color-pick:focus-visible,.tm-color-pick[aria-current=true]{color:var(--ink,#f2eadb);background:var(--bone,#16130e);outline:none}
.tm-color-pick i{width:34px;height:42px;background:var(--tm-pick);display:block}
.tm-color-pick strong,.tm-color-pick small{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tm-color-pick strong{font-family:var(--cn,'Noto Serif SC',serif);font-size:13px}
.tm-color-pick small{margin-top:3px;color:var(--ash,#635b4f);font-family:var(--mono,'Space Mono',monospace);font-size:10px}
.tm-color-pick:hover small,.tm-color-pick:focus-visible small,.tm-color-pick[aria-current=true] small{color:color-mix(in srgb,var(--ink,#f2eadb) 72%,transparent)}
.tm-color-empty{grid-column:1/-1;padding:28px;color:var(--ash,#635b4f);font-family:var(--mono,'Space Mono',monospace);font-size:12px;text-align:center;background:var(--ink2,#fffaf0)}
:root[data-theme="dark"] .tm-color-dialog{color:#ece7da;background:#15150f;border-color:rgba(236,231,218,.26)}
:root[data-theme="dark"] .tm-color-search{color:#88847a;background:#0d0d0b;border-color:rgba(236,231,218,.26)}
:root[data-theme="dark"] .tm-color-search input{color:#ece7da}

.term-root .scroll{overflow-y:auto;padding:14px 18px;min-height:0}
.term-root .sec-h{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.term-root .sec-h b{font-family:var(--serif);font-weight:600;font-size:11px;letter-spacing:.16em;text-transform:uppercase;color:var(--ash);white-space:nowrap}
.term-root .sec-h .ln{flex:1;height:1px;background:var(--line2)}
.term-root .sp{display:flex;align-items:center;gap:10px;padding:6px 0;border-top:1px solid var(--line)}
.term-root .sp:first-child{border-top:0}
.term-root .sp i{width:22px;height:22px;flex:none;outline:1px solid var(--line2)}
.term-root .sp .role{font-family:var(--mono);font-size:11px;color:var(--bone);min-width:96px}
.term-root .sp .src{flex:1;font-size:11px}
.term-root .sp .src .nm{font-family:var(--cn);color:var(--ash)}
.term-root .sp .src .algo{font-family:var(--mono);font-size:9px;letter-spacing:.06em;color:#e8a04b;border:1px solid rgba(232,160,75,.4);padding:1px 5px;text-transform:uppercase}
.term-root .sp .src .adj{font-family:var(--mono);font-size:8.5px;letter-spacing:.04em;color:var(--ash2);border:1px solid var(--line2);padding:0 4px;margin-left:7px;white-space:nowrap}
.term-root .sp .right{display:flex;align-items:center;gap:8px}
.term-root .sp .ok{font-family:var(--mono);font-size:10px;color:var(--ash2)}
.term-root .sp .aa{font-family:var(--mono);font-size:9px;padding:1px 4px;letter-spacing:.04em}
.term-root .sp .aa.ok{color:#7fc8a9;border:1px solid rgba(127,200,169,.35)}
.term-root .sp .aa.no{color:#e8896b;border:1px solid rgba(232,137,107,.4)}

/* 导出 */
.term-root .export{flex:none;border-top:1px solid var(--line2);background:var(--wash);padding:12px 16px 14px;display:flex;flex-direction:column;gap:9px}
/* 格式选择器（下拉 combobox） */
.term-root .fmt-select{position:relative}
.term-root .fmt-trigger{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;
  font-family:var(--mono);font-size:11.5px;letter-spacing:.04em;color:var(--bone);
  border:1px solid var(--line2);background:var(--ink);padding:8px 11px;transition:border-color .15s}
.term-root .fmt-trigger:hover{border-color:var(--bone)}
.term-root .fmt-trigger svg{color:var(--ash);flex:none;transition:transform .18s}
.term-root .fmt-select.open .fmt-trigger svg{transform:rotate(180deg)}
.term-root .fmt-menu{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:20;list-style:none;
  background:var(--ink2);border:1px solid var(--line2);box-shadow:0 22px 48px -18px rgba(0,0,0,.85);
  max-height:300px;overflow-y:auto}
.term-root .fmt-menu[hidden]{display:none}
.term-root .fmt-menu li{display:flex;flex-direction:column;gap:2px;padding:9px 12px;cursor:pointer;border-left:2px solid transparent}
.term-root .fmt-menu li:hover,.term-root .fmt-menu li:focus-visible,.term-root .fmt-menu li:focus{background:rgba(236,231,218,.07);outline:none}
.term-root .fmt-menu li[aria-selected=true]{border-left-color:var(--term-anchor-vivid,var(--bone))}
.term-root .fmt-menu .fmt-lbl{font-family:var(--mono);font-size:11.5px;color:var(--bone);letter-spacing:.02em}
.term-root .fmt-menu .fmt-hint{font-size:9.5px;color:var(--ash2);line-height:1.4}
.term-root .export .hd{display:flex;align-items:baseline;gap:10px}
.term-root .export .hd .fmt-tip{font-family:var(--mono);font-size:10px;letter-spacing:.02em;color:var(--ash);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.term-root .export .hd .stat{font-family:var(--mono);font-size:9px;letter-spacing:.04em;color:var(--ash2);margin-left:auto;flex:none}
.term-root .export pre{max-height:clamp(180px,28vh,320px);overflow-y:auto;overflow-x:hidden;white-space:pre-wrap;overflow-wrap:anywhere;
  font-family:var(--mono);font-size:10.5px;line-height:1.62;color:var(--ash);background:var(--ink);border:1px solid var(--line);padding:11px 13px}
.term-root .exp-act{display:flex;gap:8px}
.term-root .export .copy{flex:1;display:flex;align-items:center;justify-content:center;gap:9px;background:var(--bone);color:var(--ink);font-weight:700;font-size:12px;letter-spacing:.04em;padding:11px;transition:background .2s}
.term-root .export .copy svg{width:14px;height:14px}
.term-root .export .copy.done{background:var(--term-anchor-vivid,#1ba784);color:#fff}
.term-root .export .dl{flex:none;width:44px;display:grid;place-items:center;border:1px solid var(--line2);color:var(--bone);transition:background .15s}
.term-root .export .dl:hover{background:var(--wash-strong)}
.term-root .export .dl svg{width:15px;height:15px}

/* 统一细淡滚动条 */
.term-root .term-body,.term-root .scroll,.term-root .export pre,.term-root .md-codeblock,.term-root .fmt-menu{scrollbar-width:thin;scrollbar-color:var(--scroll-thumb-strong) transparent}
.term-root .term-body::-webkit-scrollbar,.term-root .scroll::-webkit-scrollbar,.term-root .export pre::-webkit-scrollbar,.term-root .md-codeblock::-webkit-scrollbar,.term-root .fmt-menu::-webkit-scrollbar{width:8px;height:8px}
.term-root .term-body::-webkit-scrollbar-thumb,.term-root .scroll::-webkit-scrollbar-thumb,.term-root .export pre::-webkit-scrollbar-thumb,.term-root .md-codeblock::-webkit-scrollbar-thumb,.term-root .fmt-menu::-webkit-scrollbar-thumb{background:var(--scroll-thumb);border-radius:0}
.term-root .term-body::-webkit-scrollbar-track,.term-root .scroll::-webkit-scrollbar-track,.term-root .export pre::-webkit-scrollbar-track,.term-root .fmt-menu::-webkit-scrollbar-track{background:transparent}

/* 窄屏退化 */
@media (max-width:1080px){
  .term-root{height:auto}
  .term-root .work{grid-template-columns:1fr}
  .term-root .spec{border-left:0;border-top:1px solid var(--line2)}
  .term-root .term{min-height:440px}
}
