:root {
    color-scheme: light;
    --bg: #ffffff;
    --ink: #17171d;
    --muted: #66666f;
    --faint: #74747e;
    --border: #e9e9ef;
    --border-strong: #dcdce4;
    --accent: #2563eb;
    --accent-deep: #1d4ed8;
    --accent-soft: #eef4ff;
    /* 编辑态选区底色（半透明）：textarea 在高亮层之上，不透明底会把底层语法色文字盖住；
       半透明让选中文字透出来可辨认（用户反馈：选区成一块看不清字） */
    --sel-soft: rgba(37, 99, 235, .18);
    --ok: #178a5e;
    --ok-soft: #ecf8f2;
    --ok-ink: #0f6e4a;
    /* 全屏遮罩（lightbox/弹层底）：暗化页面 + 突出浮层，暗色下加深保对比 */
    --scrim: rgba(15, 18, 26, .62);
    --err: #cf3f3f;
    --err-soft: #fdf1f1;
    /* 错误语义色分两支：--err 是图形色（边框/图标，≥3:1 即可），--err-ink 是文字色 */
    --err-ink: #b3261e;
    /* 警示语义色与错误色同构分两支：「校验通过但有隐患」的体检提醒态 */
    --warn: #b07d10; --warn-soft: #fbf4e4; --warn-ink: #7a5608;
    /* 代码语法色（已加深过对比度，可做 13px 正文色）；kw/com/typ 为代码转换高亮
       三色（关键字/注释/类型名），对比度实测：亮 6.11/4.55/5.59，暗 8.00/5.63/8.70 */
    --tk-str: #1a7f57; --tk-num: #8a6408; --tk-bool: #7c3aed;
    --tk-kw: #a626a4; --tk-com: #6e7781; --tk-typ: #0b7285;
    --code-bg: #f8f7fb;
    --surface: #ffffff;
    --surface-2: #fbfbfd;
    --nav-bg: rgba(255,255,255,.85);
    --accent-line: #d7e5fd;
    --radius: 16px;
    --mono: ui-monospace, "Cascadia Code", Consolas, "Courier New", monospace;
    /* 代码区行高定值：行号列与代码列字号不同（12/13px），不能共用倍率 */
    --code-line: 22px;
    --shadow-sm: 0 1px 2px rgba(23,23,29,.05);
    --shadow-md: 0 2px 6px rgba(23,23,29,.05), 0 16px 40px -24px rgba(23,23,29,.18);
    --shadow-lg: 0 2px 8px rgba(23,23,29,.05), 0 28px 64px -32px rgba(37,99,235,.22);
    /* 卡片投影（v12）：两层 —— 贴地勾边 + 弥散浮起；卡片"浮起来"靠它不靠描边 */
    --shadow-card: 0 1px 2px rgba(23,23,29,.05), 0 10px 24px -12px rgba(23,23,29,.16);
    --shadow-card-hover: 0 2px 4px rgba(23,23,29,.06), 0 18px 38px -16px rgba(23,23,29,.22);
    /* 局部阴影/描边分支：抽屉滑出阴影、浮起把手在图片上的细描边光圈（暗色下换纯黑系保可见） */
    --shadow-drawer: 0 0 0 1px transparent, 16px 0 32px -20px rgba(20, 22, 30, .14);
    --shadow-hairline: 0 0 0 1px rgba(23, 23, 29, .18);
    /* 详情页工作台高度 = 100vh - 本值（导航+页头+工具条），响应式里逐档覆写。
       346px（2026-10-07 用户口径）：空态工作台不再吃满折叠线——900px 视口下
       工作台 ≈554px，底部给「相关工具」分区留出首屏可见余量。 */
    --wb-offset: 346px;
    /* 分类色域：--cat-* 用于色点/图标描边/承诺行勾（图形元素需 ≥3:1）；
       --cat-*-soft 为其配对的软底。亮色 img/txt/zh 三色相对品牌原色加深过。 */
    --cat-dev:#2563eb; --cat-dev-soft:#eef4ff;
    --cat-color:#0f766e; --cat-color-soft:#e9f7f5;
    --cat-img:#c9633c; --cat-img-soft:#fdf1ec;
    --cat-txt:#358468; --cat-txt-soft:#ecf6f2;
    --cat-zh: #a8761c; --cat-zh-soft: #fbf3e2;
    --cat-fun:#c026d3; --cat-fun-soft:#fdf0fc;
    /* 2026-10-09 分类表驱动化：dev 拆 5 类新令牌（dev 令牌保留至存量引用清零后移除） */
    --cat-convert:#0e7490; --cat-convert-soft:#e8f4f8; --cat-convert-ink:#0c5e74;
    --cat-format:#2563eb; --cat-format-soft:#eef4ff; --cat-format-ink:#1d4fb8;
    --cat-crypto:#be123c; --cat-crypto-soft:#fdeef2; --cat-crypto-ink:#9f1239;
    --cat-net:#15803d; --cat-net-soft:#edf7ee; --cat-net-ink:#166534;
    --cat-gen:#b45309; --cat-gen-soft:#fbf3e7; --cat-gen-ink:#92400e;
    /* 2026-10-11 批次十：新增「文件」分类（file）—— zip-tool / pdf-pages / font-viewer。
       无缩写（类名与编码同源，CssOf 走默认分支）；色相取蓝紫，与既有 10 类均不撞。 */
    --cat-file:#5b4bd6; --cat-file-soft:#efedfd; --cat-file-ink:#4638b0;
    /* cat-*-ink：文字级分支（小字号 ≥4.5 实测口径，同 err-ink/warn-ink 模式） */
    --cat-txt-ink:#2e7a5e; --cat-img-ink:#b35129; --cat-zh-ink:#8f650f; --cat-fun-ink:#a21caf;
    --cat-color-ink:#0d635c;
  }
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #141419;
    --ink: #e9e9f0;
    --muted: #a2a2ad;
    --faint: #82828d;
    --border: #272731;
    --border-strong: #34343f;
    --accent: #5b8bef;
    --accent-deep: #85aaf5;
    --accent-soft: #1d2a4a;
    --sel-soft: rgba(91, 139, 239, .30);
    --accent-line: #2b3c66;
    --ok: #43c98d;
    --ok-soft: #12291e;
    --ok-ink: #7ee0b3;
    --scrim: rgba(4, 6, 12, .68);
    --err: #e57676;
    --err-soft: #32191c;
    --err-ink: #f0a0a0;
    --warn: #d8b44a; --warn-soft: #2a2213; --warn-ink: #e2ba55;
    --tk-str: #43c98d; --tk-num: #d8b44a; --tk-bool: #c99cf5;
    --tk-kw: #e896d0; --tk-com: #8b949e; --tk-typ: #4cc9cf;
    --code-bg: #1b1b23;
    --surface: #1a1a21;
    --surface-2: #1e1e27;
    --nav-bg: rgba(20,20,25,.85);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 2px 6px rgba(0,0,0,.35), 0 16px 40px -24px rgba(0,0,0,.6);
    --shadow-lg: 0 2px 8px rgba(0,0,0,.35), 0 28px 64px -32px rgba(0,0,0,.7);
    --shadow-card: 0 1px 2px rgba(0,0,0,.5), 0 10px 24px -12px rgba(0,0,0,.72);
    --shadow-card-hover: 0 2px 4px rgba(0,0,0,.55), 0 18px 38px -16px rgba(0,0,0,.8);
    --shadow-drawer: 0 0 0 1px transparent, 16px 0 32px -20px rgba(0, 0, 0, .5);
    --shadow-hairline: 0 0 0 1px rgba(0, 0, 0, .55);
    --cat-dev:#6f9bf5; --cat-dev-soft:#16203a;
    --cat-color:#4dd0c4; --cat-color-soft:#0e2422;
    --cat-img:#e08d6b; --cat-img-soft:#2a1a14;
    --cat-txt:#63c39c; --cat-txt-soft:#10241c;
    --cat-zh: #dbb35e; --cat-zh-soft: #2a2213;
    --cat-fun:#e879f9; --cat-fun-soft:#2b1628;
    --cat-convert:#5fc6de; --cat-convert-soft:#0e2329; --cat-convert-ink:#5fc6de;
    --cat-format:#6f9bf5; --cat-format-soft:#16203a; --cat-format-ink:#6f9bf5;
    --cat-crypto:#f07d95; --cat-crypto-soft:#2a1218; --cat-crypto-ink:#f07d95;
    --cat-net:#6cc786; --cat-net-soft:#10241a; --cat-net-ink:#6cc786;
    --cat-gen:#ecb45c; --cat-gen-soft:#2a2013; --cat-gen-ink:#ecb45c;
    --cat-file:#9d8dfb; --cat-file-soft:#1b1733; --cat-file-ink:#9d8dfb;
    --cat-txt-ink:#63c39c; --cat-img-ink:#e08d6b; --cat-zh-ink:#dbb35e; --cat-fun-ink:#e879f9;
    --cat-color-ink:#4dd0c4;
  }
  * { margin: 0; padding: 0; box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
  }
  ::selection { background: var(--accent-soft); color: var(--accent-deep); }
  p, h1, h2, h3 { text-wrap: pretty; }
  a { color: inherit; text-decoration: none; }
  button, select, input, textarea { font-family: inherit; }
  button { cursor: pointer; }
  [hidden] { display: none !important; }
  .wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; }

  /* ============ entrance ============ */
  @keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  .fx { opacity: 0; animation: fadeUp .6s cubic-bezier(.22,.8,.36,1) forwards; }
  .fx-1 { animation-delay: .05s; } .fx-2 { animation-delay: .14s; }
  .fx-3 { animation-delay: .23s; } .fx-4 { animation-delay: .34s; }
  .fx-5 { animation-delay: .45s; }

  /* ============ nav ============ */
  nav {
    position: sticky; top: 0; z-index: 50;
    background: var(--nav-bg); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
  }
  .nav-inner { display: flex; align-items: center; gap: 34px; height: 62px; }
  .logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
  .logo .mark { width: 22px; height: 22px; flex-shrink: 0; display: block; }
  .logo small { font-weight: 500; color: var(--faint); font-size: 12.5px; letter-spacing: .02em; }
  .nav-links { display: flex; gap: 28px; font-size: 14.5px; color: var(--muted); }
  /* 顶栏链接做成 44px 高的命中区，同时把下划线钉回文字基线附近（v12 口径） */
  .nav-links a {
    position: relative; display: inline-flex; align-items: center; min-height: 44px;
    transition: color .15s;
  }
  .nav-links a::after {
    content: ""; position: absolute; left: 0; right: 100%; bottom: 12px; height: 2px;
    background: var(--accent); border-radius: 2px; transition: right .2s ease;
  }
  .nav-links a:hover { color: var(--ink); }
  .nav-links a:hover::after { right: 0; }
  .nav-links a.is-here { color: var(--ink); }
  .nav-links a.is-here::after { right: 0; }
  /* Ctrl+K 触发钮（2026-10-10 改版）：由裸 kbd 提示改为「搜索框」形态——
     放大镜 + 文案 + 快捷键 chips，靠右贴站内输入控件同族语言；hover/聚焦有明确反馈。 */
  .nav-kbd {
    display: inline-flex; align-items: center; gap: 9px;
    margin-left: auto;
    height: 34px; padding: 0 8px 0 12px;
    border: 1px solid var(--border-strong); border-radius: 10px;
    background: var(--surface-2); color: var(--muted);
    font: inherit; font-size: 13px;
    transition: border-color .15s, color .15s, background .15s;
  }
  .nav-kbd:hover { border-color: var(--accent); color: var(--accent-deep); background: var(--surface); }
  .nav-kbd:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
  .nav-kbd-ic { flex-shrink: 0; opacity: .85; }
  .nav-kbd-txt { white-space: nowrap; }
  .nav-kbd-keys { display: inline-flex; align-items: center; gap: 3px; }
  .nav-kbd kbd {
    font-family: var(--mono); font-size: 10.5px; line-height: 1; color: var(--muted);
    border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px;
    padding: 3px 5px; background: var(--bg);
  }
  .nav-kbd:hover kbd { border-color: var(--accent-line); color: var(--accent-deep); }
  kbd {
    font-family: var(--mono); font-size: 11px; color: var(--muted);
    border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px;
    padding: 2px 6px; background: var(--surface);
  }
  .theme-btn {
    width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; cursor: pointer;
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted);
    display: flex; align-items: center; justify-content: center;
    transition: color .15s, border-color .15s;
  }
  .theme-btn:hover { color: var(--accent-deep); border-color: var(--accent); }
  .theme-btn .ic-sun { display: none; }
  [data-theme="dark"] .theme-btn .ic-sun { display: block; }
  [data-theme="dark"] .theme-btn .ic-moon { display: none; }

  /* ============ hero ============ */
  .hero { position: relative; padding: 58px 0 4px; text-align: center; overflow: hidden; }
  .hero::before {
    content: ""; position: absolute; top: -260px; left: 50%; transform: translateX(-50%);
    width: 1100px; height: 520px; pointer-events: none;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%);
  }
  .eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 500; letter-spacing: .12em; color: var(--accent-deep);
    background: var(--accent-soft); border: 1px solid var(--accent-line);
    padding: 5px 15px; border-radius: 999px;
  }
  .eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
  .hero h1 {
    margin-top: 18px;
    font-size: clamp(26px, 3.2vw, 34px); font-weight: 700;
    letter-spacing: -.02em; line-height: 1.3;
  }
  .hero h1 .em { position: relative; color: var(--accent-deep); white-space: nowrap; }
  .hero h1 .em svg {
    position: absolute; left: 0; bottom: -7px; width: 100%; height: 9px;
  }
  .hero .sub { margin-top: 14px; font-size: 15.5px; color: var(--muted); }
  .hero .sub b { color: var(--ink); font-weight: 600; }
  .hero .caps {
    margin-top: 10px; font-family: var(--mono); font-size: 10.5px;
    letter-spacing: .3em; color: var(--faint); text-transform: uppercase;
  }

  /* ============ universal input ============ */
  .stage { max-width: 1060px; margin: 40px auto 0; position: relative; z-index: 1; }
  .input-card {
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transition: border-color .18s, box-shadow .18s;
    overflow: hidden; text-align: left;
  }
  .input-card:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-lg);
  }
  .input-bar {
    display: flex; align-items: center; gap: 8px; padding: 12px 18px 0;
  }
  .input-bar .dots { display: flex; gap: 5px; }
  .input-bar .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
  .input-bar .bar-label { font-family: var(--mono); font-size: 11px; color: var(--faint); letter-spacing: .08em; margin-left: 6px; }
  .input-card textarea {
    display: block; width: 100%; min-height: 150px; resize: vertical;
    border: 0; outline: 0; background: transparent; padding: 12px 22px 6px;
    font-family: var(--mono); font-size: 14px; line-height: 1.75; color: var(--ink);
  }
  .input-card textarea::placeholder { color: var(--faint); }
  .input-foot {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 18px 14px; border-top: 1px solid var(--border);
  }
  .preset-label { font-size: 12.5px; color: var(--faint); }
  .preset {
    font-size: 12.5px; color: var(--muted); border: 1px solid var(--border);
    padding: 5px 13px; border-radius: 999px; cursor: pointer; background: var(--surface);
    transition: all .15s; min-height: 30px;
  }
  .preset:hover { color: var(--accent-deep); border-color: var(--accent); background: var(--accent-soft); }
  .input-foot .spacer { flex: 1; }
  .detect-state { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--faint); transition: color .15s; }
  .detect-state .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); transition: background .15s; }
  .detect-state.on { color: var(--ok); } .detect-state.on .dot { background: var(--ok); }
  .detect-state.err { color: var(--err); } .detect-state.err .dot { background: var(--err); }
  .clear-btn { border: 0; background: none; color: var(--faint); font-size: 12.5px; cursor: pointer; padding: 4px 8px; border-radius: 7px; }
  .clear-btn:hover { color: var(--ink); background: var(--bg); }

  /* ============ result panel ============ */
  .result-card {
    margin-top: 20px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-md);
    overflow: hidden; display: none; text-align: left;
  }
  .result-card.show { display: block; animation: fadeUp .35s cubic-bezier(.22,.8,.36,1); }
  .result-head {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2);
  }
  .type-badge {
    font-size: 12.5px; font-weight: 600; color: var(--accent-deep);
    background: var(--accent-soft); padding: 4px 13px; border-radius: 999px;
  }
  .type-badge.bad { color: var(--err); background: var(--err-soft); }
  .type-badge.good { color: var(--ok); background: var(--ok-soft); }
  .result-meta { font-size: 12.5px; color: var(--faint); font-family: var(--mono); }
  .result-head .spacer { flex: 1; }
  .btn {
    display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
    font-size: 13px; font-weight: 500; padding: 8px 16px; border-radius: 10px;
    transition: all .15s; min-height: 36px;
  }
  .btn:hover { border-color: var(--accent); color: var(--accent-deep); }
  .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 50%, transparent); }
  .btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--bg); }
  .result-body { padding: 20px 22px; }

  /* code excerpt with line numbers + column highlight */
  .code-box {
    background: var(--code-bg); border: 1px solid var(--border); border-radius: 12px;
    font-family: var(--mono); font-size: 13px; line-height: 1.9; overflow-x: auto;
    padding: 12px 0;
  }
  .code-line { display: flex; padding: 0 16px; white-space: pre; }
  .code-line .ln { width: 34px; flex-shrink: 0; color: var(--faint); user-select: none; }
  .code-line.active { background: var(--err-soft); }
  .code-line.active .ln { color: var(--err); font-weight: 700; }
  .code-line .caret {
    background: var(--err); color: var(--bg); border-radius: 4px; padding: 0 3px;
    font-weight: 700; box-shadow: 0 0 0 2px color-mix(in srgb, var(--err) 25%, transparent);
  }
  .error-summary { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }
  .error-row { display: flex; gap: 10px; align-items: baseline; }
  .error-row .tag {
    flex-shrink: 0; font-size: 11.5px; font-weight: 600; letter-spacing: .06em;
    color: var(--err); background: var(--err-soft); border-radius: 6px; padding: 2px 9px;
  }
  .error-row .tag.blue { color: var(--accent-deep); background: var(--accent-soft); }
  .error-row .tag.green { color: var(--ok); background: var(--ok-soft); }
  .error-row p { font-size: 14px; }
  .error-row p code { font-family: var(--mono); font-size: 12.5px; background: var(--code-bg); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }

  /* generic result: stat tiles / kv rows */
  .stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .stat-tile {
    border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
    background: var(--surface-2);
  }
  .stat-tile .num { font-family: var(--mono); font-size: 24px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
  .stat-tile .num small { font-size: 13px; font-weight: 400; color: var(--faint); margin-left: 2px; }
  .stat-tile .lbl { margin-top: 2px; font-size: 12px; color: var(--muted); }
  .kv-rows { display: grid; gap: 4px; }
  .kv { display: flex; gap: 14px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
  .kv:last-child { border-bottom: 0; }
  .kv .k { color: var(--muted); min-width: 88px; flex-shrink: 0; }
  .kv .v { font-family: var(--mono); font-size: 13.5px; word-break: break-all; }
  .kv .v.big { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
  .decoded-box {
    background: var(--code-bg); border: 1px solid var(--border); border-radius: 12px;
    font-family: var(--mono); font-size: 13.5px; line-height: 1.8; padding: 14px 16px;
    white-space: pre-wrap; word-break: break-all; margin-top: 12px;
  }

  /* ============ trust strip ============ */
  .trust { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 34px 0 0; }
  .trust span {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 12.5px; color: var(--muted);
    border: 1px solid var(--border); background: var(--surface); padding: 6px 15px; border-radius: 999px;
    box-shadow: var(--shadow-sm);
  }
  .trust svg { color: var(--ok); }

  /* ============ tools ============ */
  .tools { padding: 72px 0 56px; }
  .tools-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 8px; }
  .tools-head h2 { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
  .tools-head .count { font-size: 13px; color: var(--faint); font-family: var(--mono); }
  .tools-head a { margin-left: auto; font-size: 14px; color: var(--accent-deep); font-weight: 500; }
  .tools-head a:hover { text-decoration: underline; }
  .tools-sub { color: var(--muted); font-size: 14.5px; margin-bottom: 34px; }
  /* 首页工具区已改 v12 列表页同构（cat-section + flat-grid，样式复用列表页组件类）；
     旧 5 列行条（tool-grid/tool-col/tool-item/tool-icon/tool-ghost/tool-more）已删 */

  /* ============ a11y & ghost ============ */
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  /* ============ footer ============ */
  /* 内容与页脚的分层间距统一在模板层给定（footer margin-top），不再靠各页最后一个元素
     的 margin 撞出来 —— 改前实测：首页 0 / 列表页 0 / 分类页 0（内容紧贴页脚线），
     详情页仅因 .related 碰巧有 margin-bottom 才得 48，属偶然值。
     2026-10-11 用户口径：应在页模板上定，全站页面底部与内容都有分层。 */
  footer { margin-top: 64px; border-top: 1px solid var(--border); padding: 32px 0 46px; }
  .foot-inner { display: flex; align-items: center; gap: 22px; font-size: 13px; color: var(--faint); }
  .foot-inner .logo { font-size: 15px; }
  .foot-links { margin-left: auto; display: flex; gap: 22px; }
  .foot-links a:hover { color: var(--ink); }

  /* ============ toast ============ */
  /* 布局页 #toast 现挂 tool-toast 类（全站统一：顶部白底卡片，样式见 .tool-toast 区） */

  @media (max-width: 920px) {
    .hero { padding-top: 64px; }
    /* 窄屏收成图标钮（搜索可达性保留）；原「隐藏第 3 个导航项（关于）」规则随导航收敛退役 */
    .nav-kbd-txt, .nav-kbd-keys { display: none; }
    .nav-kbd { padding: 0 10px; }
    .stat-tiles { grid-template-columns: repeat(2, 1fr); }
  }
  @media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
    .fx { opacity: 1; }
  }

/* ==========================================================================
   工具工作台（M1：json-formatter / timestamp / html-format 共用骨架）
   ========================================================================== */
.tool-app { max-width: 880px; }
/* 双栏工作台标杆（json-formatter 等）：吃满 .wrap 行宽，两栏各 ~590px */
.tool-app.tool-app--wide { max-width: none; }
.tool-crumb {
  font-size: 12px; color: var(--faint); letter-spacing: .08em;
  text-transform: uppercase; margin-bottom: 12px;
}
.tool-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.tool-panel-title { font-size: 15px; font-weight: 650; margin-bottom: 12px; letter-spacing: -.01em; }
.tool-input { margin-bottom: 12px; }
.tool-textarea {
  width: 100%; min-height: 180px; resize: vertical;
  font-family: var(--mono); font-size: 13px; line-height: 1.6;
  color: var(--ink); background: var(--code-bg);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.tool-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tool-textarea::placeholder { color: var(--faint); }
.tool-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.tool-label { font-size: 13px; color: var(--muted); }
.tool-select {
  font: inherit; font-size: 13px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; outline: none; cursor: pointer;
}
.tool-btn {
  font: inherit; font-size: 13.5px; font-weight: 550;
  padding: 7px 16px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--ink);
  transition: background .15s, border-color .15s, transform .06s;
}
.tool-btn:hover { border-color: var(--accent); color: var(--accent-deep); }
.tool-btn:active { transform: scale(.97); }
.tool-btn.primary {
  background: var(--accent); border-color: var(--accent); color: var(--bg);
}
.tool-btn.primary:hover { background: var(--accent-deep); color: var(--bg); }
.tool-btn.ghost { background: transparent; }
.tool-status {
  font-size: 13px; padding: 8px 12px; border-radius: 9px; margin: 8px 0;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
}
.tool-status.ok  { background: var(--ok-soft);  color: var(--ok);  border-color: transparent; }
.tool-status.err { background: var(--err-soft); color: var(--err); border-color: transparent; }
.tool-output { margin-top: 4px; }
.tool-pre {
  font-family: var(--mono); font-size: 13px; line-height: 1.65;
  background: var(--code-bg); color: var(--ink);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; overflow: auto; max-height: 420px;
  white-space: pre-wrap; word-break: break-all; min-height: 52px;
}
.tool-pre:empty::before { content: "（空）"; color: var(--faint); }
/* JSON 报错面板 */
.tool-errbox {
  border: 1px solid var(--err); border-radius: 10px;
  background: var(--err-soft); padding: 12px 14px; margin: 10px 0;
}
.tool-err-title { font-size: 13.5px; color: var(--err); }
.tool-err-loc { font-family: var(--mono); margin-left: 6px; opacity: .85; }
.tool-err-hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.tool-err-src {
  font-family: var(--mono); font-size: 12.5px; margin-top: 8px;
  color: var(--err); white-space: pre; overflow-x: auto;
}
.tool-err-fixes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; font-size: 13px; color: var(--muted); }
.tool-err-fixes .tool-btn { padding: 4px 10px; font-size: 12.5px; }
/* toast（工具页共用） */
/* toast（全站统一）：顶部居中白底卡片（用户口径：顶部提示 + 白底 + 对/错/警告图标）。
   亮色白卡浮起；暗色 --surface/--ink/--border 令牌自动反转成深色面板。
   图标色走语义图形支 --ok/--err/--warn（两主题已配对）；info 无图标纯文本。
   z-index 130 > 全屏工作台 120 —— 全屏态提示仍可见。 */
.tool-toast {
  position: fixed; left: 50%; top: 76px; transform: translateX(-50%) translateY(-8px);
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  font-size: 13px; padding: 9px 16px 9px 13px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  z-index: 130;
}
.tool-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.tool-toast .t-ic { display: inline-flex; flex-shrink: 0; }
.tool-toast .t-ic.k-ok { color: var(--ok); }
.tool-toast .t-ic.k-err { color: var(--err); }
.tool-toast .t-ic.k-warn { color: var(--warn); }

/* ---------- 工具页通用小件（M1 批次二：dev 5 + text 2） ---------- */
.tool-check {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink); cursor: pointer; user-select: none;
}
.tool-check input { accent-color: var(--accent); width: 15px; height: 15px; }
.tool-hl { margin: 4px 0 0; }
.tool-mark {
  background: var(--ok-soft); color: var(--ok);
  border-radius: 3px; padding: 0 2px;
}
.tool-groups { margin-top: 4px; }
.tool-groups .tool-item {
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); padding: 8px 12px; margin-top: 8px;
}
.tool-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin: 12px 0;
}
.tool-stat {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
}
.tool-stat-head { font-size: 12px; color: var(--muted); }
.tool-stat-num { font-family: var(--mono); font-size: 21px; font-weight: 600; margin-top: 4px; color: var(--ink); }
@media (max-width: 720px) {
  .tool-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   外壳补件（v12）：skip link / 屏幕阅读器
   ========================================================================== */
.skip {
  position: fixed; left: 12px; top: -64px; z-index: 90;
  background: var(--ink); color: var(--bg);
  font-size: 13px; font-weight: 500; padding: 10px 16px; border-radius: 0 0 10px 10px;
  transition: top .18s ease;
}
.skip:focus { top: 0; outline-offset: -2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   列表页（v12 定稿「压扁索引 + 浮起卡片」）
   ========================================================================== */
.page-head { padding: 20px 0 18px; }
.head-inner { display: flex; align-items: baseline; gap: 14px; }
.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.3; }
.head-count { font-size: 13px; color: var(--muted); white-space: nowrap; }
.head-count b { color: var(--ink); font-weight: 600; }
.head-note { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }

/* 索引条：搜索 + 分类筛选，sticky 在顶栏之下 */
.index-bar {
  position: sticky; top: 63px; z-index: 40;
  background: var(--nav-bg); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.index-inner { display: flex; align-items: center; gap: 14px; }
.search-wrap-sm { position: relative; flex: 0 0 268px; }
.search-sm {
  display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--border-strong); border-radius: 11px;
  background: var(--surface); padding: 8px 12px;
  transition: border-color .15s, box-shadow .15s;
}
.search-sm:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-sm > svg { flex-shrink: 0; color: var(--faint); }
.search-sm input {
  border: 0; outline: none; background: transparent; color: var(--ink);
  font-family: inherit; font-size: 13.5px; width: 100%; min-width: 0;
}
.search-sm input::placeholder { color: var(--faint); }
.search-sm .kbd {
  font-family: var(--mono); font-size: 10px; border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px;
  color: var(--faint); background: var(--surface); white-space: nowrap;
}

/* 搜索即时建议 / 快捷入口（初始态） */
.sug {
  position: absolute; top: calc(100% + 8px); left: 0; width: 340px; max-width: 82vw; z-index: 60;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 6px; max-height: 340px; overflow-y: auto;
}
.sug-h { font-family: var(--mono); font-size: 10px; color: var(--faint); letter-spacing: .1em; padding: 6px 10px 5px; }
.sug-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px; font-size: 13.5px; color: var(--ink);
}
.sug-item .icm {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center; background: var(--cat-soft); color: var(--cat);
}
.sug-item .icm svg { width: 15px; height: 15px; }
.sug-item .cat { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--faint); }
.sug-item.is-sel, .sug-item:hover { background: var(--accent-soft); }
.sug-empty { padding: 14px 12px; font-size: 13px; color: var(--faint); }

/* 分类筛选：radiogroup（筛选语义，不是标签页）。
   布局必须 flex: 0 1 auto + min-width: 0 —— 0 0 auto 不收缩，分类一多就把整页
   撑出横向滚动条。溢出时光标提示可拖 + 两端渐隐（"还有更多"必须看得见）。 */
.cat-tabs {
  display: inline-flex; gap: 2px; padding: 3px;
  flex: 0 1 auto; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tabs[data-edge] { cursor: grab; }
.cat-tabs.is-dragging { cursor: grabbing; }
.cat-tabs[data-edge="right"] {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
}
.cat-tabs[data-edge="left"] {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px);
  mask-image: linear-gradient(90deg, transparent, #000 36px);
}
.cat-tabs[data-edge="both"] {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent);
}
.cat-tab {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  border: 0; background: transparent; border-radius: 8px;
  padding: 6px 13px; font-size: 13.5px; font-weight: 500; color: var(--muted);
  transition: background .15s, color .15s;
}
.cat-tab i { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--cat, var(--ink)); }
.cat-tab .n { font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--faint); }
.cat-tab:hover { color: var(--ink); }
.cat-tab[aria-checked="true"] { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }
.cat-tab[aria-checked="true"] .n { color: var(--accent-deep); }
.filter-note { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* 分区（间距统一 40）与分类头 */
.cat-section { padding: 40px 0 0; }
#tools { scroll-margin-top: 130px; }
.sec-dev { --cat: var(--cat-dev); --cat-soft: var(--cat-dev-soft); }
.sec-color { --cat: var(--cat-color); --cat-soft: var(--cat-color-soft); }
.sec-img { --cat: var(--cat-img); --cat-soft: var(--cat-img-soft); }
.sec-txt { --cat: var(--cat-txt); --cat-soft: var(--cat-txt-soft); }
.sec-zh  { --cat: var(--cat-zh);  --cat-soft: var(--cat-zh-soft); }
.sec-fun { --cat: var(--cat-fun); --cat-soft: var(--cat-fun-soft); }
/* 2026-10-09 分类表驱动化：dev 拆 5 类新分区（dev 分区保留至存量引用清零后移除） */
.sec-convert { --cat: var(--cat-convert); --cat-soft: var(--cat-convert-soft); }
.sec-format { --cat: var(--cat-format); --cat-soft: var(--cat-format-soft); }
.sec-crypto { --cat: var(--cat-crypto); --cat-soft: var(--cat-crypto-soft); }
.sec-net    { --cat: var(--cat-net);    --cat-soft: var(--cat-net-soft); }
.sec-gen    { --cat: var(--cat-gen);    --cat-soft: var(--cat-gen-soft); }
.sec-file   { --cat: var(--cat-file);   --cat-soft: var(--cat-file-soft); }
.sec-soon { --cat: var(--faint); --cat-soft: var(--surface-2); }
.cat-head {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding-bottom: 11px; margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.cat-head i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--cat); }
.cat-head h2 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.cat-head .en { font-family: var(--mono); font-size: 11px; color: var(--faint); letter-spacing: .14em; }
.cat-head .cdesc { font-size: 13px; color: var(--muted); margin-left: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-head .cnt { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--muted); letter-spacing: .06em; white-space: nowrap; }
.sec-soon .cat-head { border-bottom-color: var(--border-strong); }
.sec-soon .cat-head h2 { color: var(--muted); }

/* 卡片：浮起来靠 --shadow-card，不靠描边 */
.flat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.fitem {
  display: grid; grid-template-columns: 40px minmax(0, 1fr);
  column-gap: 13px; row-gap: 8px; align-items: center;
  padding: 17px 18px 15px; border-radius: 14px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.fitem:hover, .fitem.sel { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); border-color: var(--border-strong); }
.fitem.sel { outline: 2px solid var(--accent); outline-offset: -1px; }
.fitem:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.fitem .ic {
  grid-column: 1; grid-row: 1;
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--cat-soft); color: var(--cat);
}
.fitem .ic svg { width: 20px; height: 20px; }
.fitem .t-name { grid-column: 2; grid-row: 1; font-size: 15px; font-weight: 600; line-height: 1.35; letter-spacing: -.01em; }
.fitem:hover .t-name, .fitem.sel .t-name { color: var(--accent-deep); }
.fitem .t-desc {
  grid-column: 1 / -1; grid-row: 2;
  font-size: 13px; color: var(--muted); line-height: 1.55;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fitem .t-desc.eg { color: var(--accent-deep); }
.fitem .t-promise {
  grid-column: 1 / -1; grid-row: 3;
  font-family: var(--mono); font-size: 11.5px; color: var(--muted); letter-spacing: .01em;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fitem .t-promise::before { content: "✓"; font-weight: 700; color: var(--cat); flex-shrink: 0; }

/* 规划中：虚线 + 软底，弱化但不靠缩进表达 */
.fitem.ghost {
  background: var(--surface-2); border-style: dashed; border-color: var(--border-strong);
  box-shadow: none; cursor: default;
}
.fitem.ghost:hover { transform: none; box-shadow: none; border-color: var(--border-strong); }
.fitem.ghost .ic { background: transparent; border: 1px dashed var(--border-strong); color: var(--faint); }
.fitem.ghost .t-name { color: var(--muted); font-weight: 500; }
.fitem.ghost:hover .t-name { color: var(--muted); }
/* 规划徽章：11px + --muted（10px 的 --faint 只有 4.47:1 不达标） */
.fitem .plan {
  grid-column: 1 / -1; grid-row: 3; justify-self: start;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 0 8px; white-space: nowrap;
}

/* 分区尾「更多 N 个 →」（首页封顶 4 卡超限时由服务端渲染）：右对齐跳索引页分区锚点 */
.cat-more {
  display: inline-flex; align-items: center; justify-content: flex-end;
  width: 100%; margin-top: 14px; padding: 2px 0;
  font-size: 12.5px; color: var(--muted); text-decoration: none;
  transition: color .15s;
}
.cat-more:hover { color: var(--accent-deep); }

/* 列表页折叠（2026-10-09 用户口径：每分类默认 2 排其余折叠，不足 2 排不出钮）。
   服务端全量直出（no-JS 可见全部），tools-list.js 对 data-count>8 的分区加 .sec-fold
   并生成展开钮——渐进增强，无 JS 无死按钮。桌面 4 列 × 2 排 = 8 卡可见。
   ★类名必须用 sec-fold 不用 fold：.fold 已被行号折叠控件占用（1019 行，height:18px），
   同名单类选择器会全局碰撞（实测分区高度被钉死 18px 残影叠加）。 */
.cat-section.sec-fold .flat-grid > .fitem:nth-child(n+9) { display: none; }
.fold-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px; padding: 0 14px; height: 32px;
  font-size: 12.5px; font-weight: 600; color: var(--accent-deep);
  background: var(--accent-soft); border: none; border-radius: 999px; cursor: pointer;
}
.fold-toggle:hover { background: color-mix(in srgb, var(--accent) 14%, var(--bg)); }
.fold-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fold-toggle .arr { transition: transform .15s ease; }
.cat-section:not(.sec-fold) .fold-toggle .arr { transform: rotate(180deg); }

/* 稀疏分区并列：按卡片数分配轨道，与主网格逐像素对齐 */
.cat-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; align-items: start; margin-top: 40px; }
.cat-band > .sp1 { grid-column: span 1; --span: 1; }
.cat-band > .sp2 { grid-column: span 2; --span: 2; }
.cat-band > .sp3 { grid-column: span 3; --span: 3; }
.cat-band > .sp4 { grid-column: span 4; --span: 4; }
.cat-band > .cat-section > .flat-grid { grid-template-columns: repeat(var(--span, 1), minmax(0, 1fr)); }
.cat-band > .cat-section { padding-top: 0; }
.cat-band .cat-head .cdesc { display: none; }

/* 站内搜索无结果 */
.nohit { padding: 64px 0 72px; text-align: center; color: var(--muted); font-size: 14px; }
.nohit b { color: var(--ink); }

/* 页脚信任行（v12 外壳） */
.foot-trust { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.foot-trust::before { content: "✓"; color: var(--accent); font-weight: 700; }

/* ==========================================================================
   详情页（恒定外壳 + 双栏工作台）
   ========================================================================== */
.tool-head { padding: 22px 0 14px; }
.crumb { display: flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; }
.crumb a { display: inline-flex; align-items: center; min-height: 24px; padding: 0 1px; transition: color .15s; }
.crumb a:hover { color: var(--accent-deep); }
.crumb .sep { color: var(--faint); }
.crumb [aria-current] { color: var(--ink); }
.head-row { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.tool-head h1 { font-size: 27px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
.tool-head .desc { color: var(--muted); font-size: 14.5px; margin-top: 4px; }
.tool-head .desc b { color: var(--ink); font-weight: 600; }
/* M2 社交证明：详情页「本周 N 次使用」（WeeklyCount>0 才渲染） */
.tool-head .t-usage { margin-top: 7px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tool-head .t-usage b { color: var(--accent-deep); font-weight: 600; }
.local-badge {
  margin-left: auto; display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 500; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 13px; white-space: nowrap;
}
.local-badge svg { color: var(--ok); flex-shrink: 0; }

/* M2.5 详情页收藏星标（core.js 动态挂 head-row，local-badge 左侧；aria-pressed 开关语义） */
.fav-btn {
  display: inline-flex; align-items: center; gap: 6px; align-self: center; flex-shrink: 0;
  font-family: inherit; font-size: 12.5px; font-weight: 500; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 13px; cursor: pointer; white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s;
}
.fav-btn svg { flex-shrink: 0; }
.fav-btn:hover { color: var(--accent-deep); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.fav-btn.is-on { color: var(--accent-deep); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.fav-btn.is-on svg { fill: currentColor; }
.fav-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 工具条：输出设置 ｜ 输入变换（两组各有标签与权重）；组自身必须 flex-wrap */
.optbar { display: flex; align-items: center; gap: 8px; padding-bottom: 14px; flex-wrap: wrap; row-gap: 8px; }
.ogrp { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; row-gap: 6px; }
.ogrp-label { font-size: 12px; color: var(--muted); white-space: nowrap; margin-right: 2px; }
.selwrap {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 9px; padding: 3px 8px;
  transition: border-color .15s;
}
.selwrap:hover { border-color: var(--border-strong); }
.selwrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.optbar select {
  border: 0; outline: none; background: transparent; color: var(--ink);
  font-size: 12.5px; min-height: 24px; cursor: pointer;
}
.optbar .sep { width: 1px; height: 20px; background: var(--border-strong); margin: 0 2px; }
.tbtn {
  display: inline-flex; align-items: center; gap: 5px;
  border: 0; background: transparent; color: var(--muted);
  font-size: 12px; line-height: 1.7; border-radius: 7px; padding: 3px 9px;
  transition: color .15s, background .15s;
}
.tbtn .bico { flex-shrink: 0; }
.tbtn:hover { color: var(--accent-deep); background: var(--accent-soft); }
.tbtn[aria-pressed="true"] { color: var(--accent-deep); background: var(--accent-soft); font-weight: 600; }
/* 「更多」pop 菜单：trigger aria-expanded + 浮层面板；捕获阶段外点关、Esc 关 */
.pop-wrap { position: relative; display: inline-flex; }
.pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  min-width: 178px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-card-hover);
  display: none; flex-direction: column; gap: 4px;
}
.pop.open { display: flex; }
.pop .pop-item {
  display: block; width: 100%; text-align: left; cursor: pointer;
  border: 0; background: transparent; color: var(--ink);
  font-size: 12.5px; line-height: 1.8; border-radius: 7px; padding: 5px 9px;
  transition: background .15s, color .15s;
}
.pop .pop-item:hover { background: var(--accent-soft); color: var(--accent-deep); }
.pop .pop-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 4px; }
.pop .pop-label { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.pop .pop-sep { height: 1px; background: var(--border); margin: 3px 2px; }
/* segmented：一组互斥取值，aria-pressed 表态 */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.seg button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 11.5px; line-height: 1.7; padding: 2px 9px; white-space: nowrap;
  transition: color .15s, background .15s;
}
.seg button + button { border-left: 1px solid var(--border); }
.seg button:hover { color: var(--ink); }
/* 选中态：soft 底 + accent 内环 + 深色字——仅浅底太弱（用户实测反馈），内环保亮暗两套可辨。
   内环断裂修复（用户反馈）：相邻分隔线正好压在环边上、容器圆角又裁方角——
   按压钮自身与右侧邻钮的 border-left 透明化，组端钮补 7px 圆角（容器 8px - 1px 边）让环跟随圆角。 */
.seg button[aria-pressed="true"] {
  background: var(--accent-soft); color: var(--accent-deep); font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--accent);
  border-left-color: transparent;
}
.seg button[aria-pressed="true"] + button { border-left-color: transparent; }
.seg button:first-child { border-radius: 7px 0 0 7px; }
.seg button:last-child { border-radius: 0 7px 7px 0; }
.kbd-note { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.kbd-note kbd { padding: 2px 5px; }

/* 双栏工作台：校验条是横跨三列的第二行，不塞进任何一列（否则造死区）。
   三列 = 左栏 + 8px 分隔条列 + 右栏（可拖拽，用户口径：两栏看作一个整体）；
   gap 归零（分隔条列本身即左右视觉间距，延续扁平贴近），校验条补 margin。 */
.workbench {
  display: grid;
  grid-template-columns: minmax(0, var(--split-a, 1fr)) 8px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0;
  height: clamp(360px, calc(100vh - var(--wb-offset)), 760px);
}
/* 可拖拽分隔条：window 级 mousemove 拖动（项目红线：不用 setPointerCapture）；
   双击恢复平分（JS）。≤860 单列断点隐藏。 */
.wb-split {
  grid-row: 1; grid-column: 2;
  position: relative; min-width: 0; cursor: col-resize;
  touch-action: none;
  z-index: 2;   /* 浮动握把溢出 8px 列压在两 pane 边框上（右 pane 后绘，须抬层级） */
}
/* 浮动胶囊握把（用户口径：中间一个浮动图标相连）：10×40 胶囊内置上下双点（38%/62%），
   hover / 拖动中 / 键盘聚焦 转 --accent 系 + 投影加深 = 焦点可见性 */
.wb-split::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 10px; height: 40px; transform: translate(-50%, -50%);
  border-radius: 999px;
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  background-image:
    radial-gradient(circle at 50% 38%, var(--muted) 1.4px, transparent 1.5px),
    radial-gradient(circle at 50% 62%, var(--muted) 1.4px, transparent 1.5px);
  background-repeat: no-repeat;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.wb-split:hover::after,
.workbench.dragging .wb-split::after,
.wb-split:focus-visible::after {
  border-color: var(--accent);
  background-color: var(--accent-soft);
  background-image:
    radial-gradient(circle at 50% 38%, var(--accent-deep) 1.4px, transparent 1.5px),
    radial-gradient(circle at 50% 62%, var(--accent-deep) 1.4px, transparent 1.5px);
  box-shadow: var(--shadow-md);
}
.wb-split:focus-visible { outline: none; }
.workbench.dragging { cursor: col-resize; user-select: none; }
/* 全屏铺底色（用户口径：分隔缝不能透出底下页面文字）——普通态在文档流里缝隙露页面底色无此问题 */
.workbench.fs { position: fixed; inset: 0; z-index: 120; height: 100vh; background: var(--bg); }
/* 扁平 pane（用户反馈）：细边框定边界，去投影、收圆角（14→10），
   覆盖 v12「卡片浮起靠投影」基因 —— 仅限工作台双栏，列表卡片不动 */
.pane {
  position: relative;   /* 历史浮动拉手（.hist-tab）的定位锚 */
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: none; overflow: hidden;
}
.pane-bar {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  flex-wrap: wrap; row-gap: 4px;   /* 按钮多（Unicode/转义外置后）窄屏折行不溢出 */
  padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.pane-bar .acts { margin-left: auto; display: flex; gap: 4px; flex-shrink: 0; }
/* 左栏顶栏左右分组（用户口径）：左组钉左（清空收尾），右组靠 margin-left:auto 贴最右、「更多」收尾
   （只有一个 auto margin：自由空间全归它 → 左右两组各自钉边；若两侧都 auto 会平分空间导致右组不贴边） */
.pane-bar .acts-l { margin-left: 0; }
/* 扁平按钮族：透明底 + hover 浮色（图标+文字），主操作保留实色 primary。
   作用域为 .acts 通用（M2-D 轮）：pane-bar 与 fst-head（C 舞台页头）同源命中——
   曾因写死 .pane-bar 导致 fst 头部图标钮/主钮裸奔（浏览器默认样式） */
.acts button {
  display: inline-flex; align-items: center; gap: 5px;
  border: 0; background: transparent; color: var(--muted);
  font-size: 12px; line-height: 1.7; border-radius: 7px; padding: 3px 9px;
  transition: color .15s, background .15s;
}
.acts button .bico { flex-shrink: 0; }
.acts button:hover { color: var(--accent-deep); background: var(--accent-soft); }
/* 主操作按钮进顶栏（格式化/压缩/校验）：复用 .btn.primary 语义，规格缩到 acts 同一档。
   kbd 提示不进顶栏（空间预算），快捷键信息走 title + aria-keyshortcuts。 */
.acts button.tool-btn, .acts .btn { min-height: 0; padding: 3px 10px; font-size: 12px; line-height: 1.7; border-radius: 7px; }
/* 顶栏 primary 必须压过 .acts button 扁平规则（曾因选择器只写 .btn 不命中 .tool-btn，
   全站顶栏主按钮退化成透明灰字——用户口径「优化按钮不够明显」即此根因） */
.acts button.primary, .acts .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 600; box-shadow: none; }
.acts button.primary:hover, .acts .btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--bg); }
:root[data-theme="dark"] .acts button.primary, :root[data-theme="dark"] .acts .btn.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
:root[data-theme="dark"] .acts button.primary:hover, :root[data-theme="dark"] .acts .btn.primary:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
/* 图标钮（校验/复制/清空收进右组，bejson 同款）：28px 方形纯图标，操作提示走
   data-tip + ::after 深色气泡（--ink 底 --bg 字，两主题令牌自动反转），hover/focus 显现；
   不用原生 title —— 防与气泡双显。气泡随 attr() 即时求值，复制反馈改 data-tip 即换文案。 */
.acts .ibtn {
  width: 28px; height: 26px; padding: 0; justify-content: center; position: relative;
}
.acts .ibtn::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 7px); right: -6px;
  background: var(--ink); color: var(--bg);
  font-size: 12px; line-height: 1; white-space: nowrap;
  padding: 6px 9px; border-radius: 6px;
  opacity: 0; transform: translateY(-3px); pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
  z-index: 40;
}
.acts .ibtn:hover::after, .acts .ibtn:focus-visible::after {
  opacity: 1; transform: translateY(0);
}
/* 带文字的图标钮（M2-D）：低自明度操作（下载/示例）加标签，宽度自适应；tooltip 保留 */
.acts .ibtn-lbl { width: auto; padding: 0 9px; gap: 4px; }
.acts .ibtn-lbl .ibtn-txt { font-size: 12px; line-height: 1.7; }
.pane-body { flex: 1; min-height: 0; display: flex; }
.pane textarea {
  flex: 1; min-width: 0; width: 100%; resize: none; border: 0; outline: none;
  background: var(--surface); color: var(--ink);
  font-family: var(--mono); font-size: 13px; line-height: var(--code-line);
  padding: 14px 16px;
}
.pane textarea::placeholder { color: var(--muted); }

/* 编辑态：透明 textarea 叠加高亮层（bejson/CodeMirror 同款三明治，零依赖自研）。
   .edit-stack relative 定位；textarea absolute 接输入但文字透明（caret 可见）；
   .edit-hl 同字体/同行高/同 padding 像素对齐，pointer-events:none 不挡交互，
   overflow:hidden，scrollTop/scrollLeft 从 textarea 抄写。
   textarea wrap="off"（软换行会让行号与高亮层双双错位）。 */
.edit-lined { flex: 1; min-width: 0; display: flex; }
.edit-stack { flex: 1; min-width: 0; position: relative; }
.edit-stack textarea {
  position: absolute; inset: 0; width: 100%; height: 100%;
  color: transparent; caret-color: var(--ink); background: transparent;
}
.edit-stack textarea::selection { background: var(--sel-soft); color: transparent; }
/* 叠加层降级（>200KB 或语言缺失）：恢复 textarea 墨色，高亮层留空 */
.edit-stack.no-hl textarea { color: var(--ink); caret-color: var(--ink); }
.edit-hl {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  padding: 14px 16px;
  font-family: var(--mono); font-size: 13px; line-height: var(--code-line);
  white-space: pre; color: var(--ink);
}
.edit-hl .elh { height: var(--code-line); line-height: var(--code-line); }
.edit-hl .elh.ln-err { background: var(--err-soft); border-radius: 2px; }
.edit-ln {
  flex: 0 0 auto; min-width: 34px; text-align: right; padding: 14px 10px 14px 12px;
  font-family: var(--mono); font-size: 12px; line-height: var(--code-line);
  white-space: pre; user-select: none; overflow: hidden;
  color: var(--muted);
  border-right: 1px solid var(--border); background: var(--surface-2);
}
.edit-lined.no-ln .edit-ln { display: none; }
/* 空值态：占位文本软换行（wrap="off" 下长占位单行不折 → 横向滚动条）；
   有内容即由 core 摘除 empty 类恢复 pre——行号与高亮层对齐不受影响 */
.edit-lined.empty textarea { white-space: pre-wrap; overflow-wrap: anywhere; }

/* 输出：行号列（定值行高，与代码列共用 --code-line） */
.out { flex: 1; min-width: 0; background: var(--surface); }
.out.lined { display: grid; grid-template-columns: auto minmax(0, 1fr); }
.out.lined .ln {
  text-align: right; padding: 14px 10px 14px 12px;
  font-family: var(--mono); font-size: 12px; line-height: var(--code-line);
  white-space: pre; user-select: none; overflow: hidden;
  color: var(--muted);
  border-right: 1px solid var(--border); background: var(--surface-2);
}
.out.lined .code {
  padding: 14px 16px; overflow: auto; white-space: pre;
  font-family: var(--mono); font-size: 13px; line-height: var(--code-line); color: var(--ink);
}
.tk-key { color: var(--accent-deep); }
/* 语法色类同时开放给编辑态高亮层（.edit-hl）：编辑态与冻结视图同色，
   键名/属性值/字面量着色不因回编辑而丢失（用户反馈第四点） */
.out .tk-str, .edit-hl .tk-str { color: var(--tk-str); }
.out .tk-num, .edit-hl .tk-num { color: var(--tk-num); }
.out .tk-bool, .edit-hl .tk-bool { color: var(--tk-bool); }
.out .tk-null, .edit-hl .tk-null { color: var(--muted); font-style: italic; }
.out .tk-note { color: var(--muted); font-style: italic; }
/* 代码转换高亮（C#/Java/Python/TS）+ 标记语言标签名/注释：编辑态叠加层（.edit-hl）与输出同色
   ——标签名 tk-typ 是 XML/HTML 最显眼的 token，漏开作用域 = 编辑态全黑（用户反馈「XML 没高亮」根因） */
.out .tk-kw, .edit-hl .tk-kw { color: var(--tk-kw); font-weight: 600; }
.out .tk-com, .edit-hl .tk-com { color: var(--tk-com); font-style: italic; }
.out .tk-typ, .edit-hl .tk-typ { color: var(--tk-typ); }
/* 冲突键行标记（json-merge）：琥珀底 = verdict warn 同支令牌，扫一眼定位冲突键所在行 */
.out.plain .code .cln.ln-conflict { background: var(--warn-soft); border-radius: 2px; }
/* 合并输出来源三色：琥珀=冲突覆盖（上） 蓝=仅 A 绿=仅 B（令牌亮暗两套已配对，零新增） */
.out.plain .code .cln.ln-onlya { background: var(--accent-soft); border-radius: 2px; }
.out.plain .code .cln.ln-onlyb { background: var(--ok-soft); border-radius: 2px; }
/* 行号输入区行标记：有叠加层时标在 .elh 行 div（整行背景透过透明 textarea 显示——
   用户口径「标行不标号」）；无叠加层 / no-hl 降级时标在行号 span（.eln）兜底。
   三色：错误红 / diff 仅 A 蓝 / diff 仅 B 绿（令牌亮暗两套已配对，零新增）。 */
.edit-hl .elh.eln-err { background: var(--err-soft); }
.edit-hl .elh.eln-onlya { background: var(--accent-soft); }
.edit-hl .elh.eln-onlyb { background: var(--ok-soft); }
.edit-ln .eln { display: inline; }
.edit-ln .eln.eln-err { background: var(--err-soft); color: var(--err); border-radius: 2px; }
.edit-ln .eln.eln-onlya { background: var(--accent-soft); border-radius: 2px; }
.edit-ln .eln.eln-onlyb { background: var(--ok-soft); border-radius: 2px; }

/* ---------- markdown 渲染视图（批次七）：.md-body 排版 + Prism 令牌着色 ----------
   ★ 配色不写进 vendor（Prism 主题 CSS 刻意不入 vendor 目录），全部在站点令牌层覆写；
     令牌亮暗两套已配对，无需新增色值。 */
.md-body {
  flex: 1; min-width: 0; min-height: 0; overflow: auto;
  padding: 18px 22px; background: var(--surface); color: var(--ink);
  font-size: 14.5px; line-height: 1.72;
}
.md-body > :first-child { margin-top: 0; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4, .md-body h5, .md-body h6 {
  margin: 1.5em 0 .6em; line-height: 1.32; font-weight: 650;
}
.md-body h1 { font-size: 1.7em; padding-bottom: .28em; border-bottom: 1px solid var(--border); }
.md-body h2 { font-size: 1.4em; padding-bottom: .24em; border-bottom: 1px solid var(--border); }
.md-body h3 { font-size: 1.18em; }
.md-body h4 { font-size: 1.04em; }
.md-body h5, .md-body h6 { font-size: .95em; color: var(--muted); }
.md-body p { margin: .85em 0; }
.md-body a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-line); }
.md-body a:hover { border-bottom-color: var(--accent); }
.md-body ul, .md-body ol { margin: .85em 0; padding-left: 1.6em; }
.md-body li { margin: .28em 0; }
.md-body li > ul, .md-body li > ol { margin: .28em 0; }
.md-body blockquote {
  margin: .9em 0; padding: .2em 1em; color: var(--muted);
  border-left: 3px solid var(--accent-line); background: var(--surface-2);
}
.md-body hr { margin: 1.6em 0; border: 0; border-top: 1px solid var(--border); }
.md-body img { max-width: 100%; height: auto; border-radius: 8px; }
.md-body code {
  font-family: var(--mono); font-size: .9em;
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: 5px; padding: .1em .38em;
}
.md-body pre {
  margin: 1em 0; padding: 14px 16px; overflow: auto;
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px;
  line-height: var(--code-line);
}
.md-body pre code { background: none; border: 0; padding: 0; font-size: 13px; }
.md-body table { margin: 1em 0; border-collapse: collapse; width: 100%; font-size: .94em; }
.md-body th, .md-body td { padding: .45em .7em; border: 1px solid var(--border); text-align: left; }
.md-body th { background: var(--surface-2); font-weight: 650; }
.md-body tbody tr:nth-child(even) td { background: var(--surface-2); }
.md-body input[type="checkbox"] { margin-right: .45em; vertical-align: middle; }
.md-body .md-task { list-style: none; margin-left: -1.3em; }
.md-body kbd {
  font-family: var(--mono); font-size: .85em; padding: .1em .4em;
  border: 1px solid var(--border-strong); border-bottom-width: 2px;
  border-radius: 5px; background: var(--surface-2);
}
/* Prism 令牌 → 站点令牌（语义与 --tk-* 同源，与核心高亮器一致的六色体系） */
.md-body .token.comment, .md-body .token.prolog, .md-body .token.doctype, .md-body .token.cdata { color: var(--tk-com); font-style: italic; }
.md-body .token.punctuation { color: var(--muted); }
.md-body .token.property, .md-body .token.tag, .md-body .token.constant, .md-body .token.symbol,
.md-body .token.deleted { color: var(--err-ink); }
.md-body .token.boolean, .md-body .token.number { color: var(--tk-num); }
.md-body .token.selector, .md-body .token.attr-name, .md-body .token.string, .md-body .token.char,
.md-body .token.builtin, .md-body .token.inserted { color: var(--tk-str); }
.md-body .token.operator, .md-body .token.entity, .md-body .token.url { color: var(--muted); }
.md-body .token.atrule, .md-body .token.attr-value, .md-body .token.keyword { color: var(--tk-kw); }
.md-body .token.function, .md-body .token.class-name { color: var(--tk-typ); }
.md-body .token.regex, .md-body .token.important, .md-body .token.variable { color: var(--tk-bool); }
.md-body .token.important, .md-body .token.bold { font-weight: 600; }
.md-body .token.italic { font-style: italic; }
/* HTML 源码模式：同一容器里放代码块（Prism markup 语言） */
.md-body.is-source { padding: 14px 16px; }
.md-body.is-source pre { margin: 0; border: 0; background: none; padding: 0; }


/* ---------- text-diff（批次七）：双输入堆叠 + 左右对照视图 ---------- */
/* 左栏堆叠两个输入：.pane-body 默认 row（json-merge 双输入并排），本工具要上下平分，
   故用一个作用域类改方向，不动公共 .pane-body。 */
.pane-body.tfd-in { flex-direction: column; }
.pane-body.tfd-in > .edit-lined { flex: 1 1 50%; min-height: 0; }
.pane-body.tfd-in > .edit-lined + .edit-lined { border-top: 1px solid var(--border); }
/* diff 行标记（复用 linedInput 的 markLines 通道）：删除红 / 新增绿，与令牌亮暗两套配对 */
.edit-hl .elh.eln-del { background: var(--err-soft); }
.edit-hl .elh.eln-add { background: var(--ok-soft); }
.edit-ln .eln.eln-del { background: var(--err-soft); border-radius: 2px; color: var(--err); }
.edit-ln .eln.eln-add { background: var(--ok-soft); border-radius: 2px; color: var(--ok-ink); }

/* 左右对照视图：行 × 4 列（左号 左文 右号 右文）。行高与会话等宽字体对齐，
   变更行整行着色（左删右增），空位保列宽不塌。 */
.tfd-view {
  flex: 1; min-width: 0; min-height: 0; overflow: auto;
  font-family: var(--mono); font-size: 13px; line-height: var(--code-line);
  background: var(--surface);
}
.tfd-row { display: grid; grid-template-columns: 3.2em 1fr 3.2em 1fr; }
.tfd-row + .tfd-row { border-top: 1px solid var(--border); }
.tfd-ln {
  padding: 0 8px; text-align: right; color: var(--faint);
  background: var(--surface-2); user-select: none; white-space: nowrap;
  border-right: 1px solid var(--border);
}
.tfd-tx {
  padding: 0 10px; white-space: pre-wrap; word-break: break-word;
  color: var(--ink);
}
.tfd-row.is-del .tfd-tx:nth-child(2) { background: var(--err-soft); }
.tfd-row.is-del .tfd-ln:nth-child(1) { background: var(--err-soft); color: var(--err-ink); }
.tfd-row.is-add .tfd-tx:nth-child(4) { background: var(--ok-soft); }
.tfd-row.is-add .tfd-ln:nth-child(3) { background: var(--ok-soft); color: var(--ok-ink); }
/* 左右同一行都有内容但不同（成对变更）：两侧同时着色，语义「这一行改了」 */
.tfd-row.is-mod .tfd-tx:nth-child(2) { background: var(--err-soft); }
.tfd-row.is-mod .tfd-tx:nth-child(4) { background: var(--ok-soft); }
.tfd-row.is-mod .tfd-ln:nth-child(1) { background: var(--err-soft); color: var(--err-ink); }
.tfd-row.is-mod .tfd-ln:nth-child(3) { background: var(--ok-soft); color: var(--ok-ink); }
/* 折叠的相同行（首尾各留 3 行上下文，中间折叠） */
.tfd-row.is-gap .tfd-tx { color: var(--faint); text-align: center; background: var(--surface-2); }
.tfd-row.is-gap .tfd-ln { background: var(--surface-2); color: var(--faint); }
.tfd-legend { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.tfd-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.tfd-legend .lg-del i { background: var(--err-soft); border: 1px solid var(--err); }
.tfd-legend .lg-add i { background: var(--ok-soft); border: 1px solid var(--ok); }

/* 左框冻结视图的节点折叠：逐行 DOM（.ln 列与 .code 列逐行 div 共用 --code-line）。
   每行都有等宽 .fold-cell 占位（无折叠的行留空），代码列纵向对齐不抖动；
   折叠后隐藏中间行（行号列同步隐藏），开行追加 .fold-more 占位。 */
.out.lined .ln.lnl { white-space: normal; }
.out.lined .ln.lnl > div { height: var(--code-line); line-height: var(--code-line); }
.cline { height: var(--code-line); line-height: var(--code-line); white-space: pre; }
.cline[hidden] { display: none; }
/* 宽度走 CSS 变量：默认 15px+3px 边距 = 降级编辑器（无 CM）时的自洽占位；
   json-formatter 冻结渲染时用编辑态折叠槽实测宽回写变量（syncFrozenGutter），
   两态行号列与分隔线像素级对齐。折叠钮随占位同步缩放。 */
.fold-cell { display: inline-block; width: var(--fold-cell-w, 15px); margin-right: var(--fold-cell-gap, 3px); text-align: center; user-select: none; }
.fold {
  border: 0; background: transparent; color: var(--faint); cursor: pointer;
  font-family: var(--mono); font-size: 12px; line-height: 16px;
  width: var(--fold-cell-w, 15px); height: 18px; padding: 0; border-radius: 4px; vertical-align: -3px;
  transition: color .15s, background .15s;
}
.fold:hover { color: var(--accent-deep); background: var(--accent-soft); }
.fold:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.cline.is-folded .fold { color: var(--accent-deep); font-weight: 700; }
.fold-more { color: var(--muted); font-style: italic; margin-left: 6px; }

/* 树视图：只有容器节点渲染 details（标量带三角是假交互） */
.treeview { flex: 1; min-width: 0; padding: 12px 16px; overflow: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.9; }
.treeview details { padding-left: 15px; }
.treeview details > summary { cursor: pointer; list-style: none; margin-left: -15px; border-radius: 6px; }
.treeview details > summary::-webkit-details-marker { display: none; }
.treeview details > summary::before {
  content: "▸"; display: inline-block; width: 15px; color: var(--muted);
  transition: transform .12s;
}
.treeview details[open] > summary::before { transform: rotate(90deg); }
.treeview .trow { padding-left: 15px; }
.treeview .k { color: var(--accent-deep); }
.treeview .num { color: var(--tk-num); }
.treeview .str { color: var(--tk-str); }
.treeview .bool { color: var(--tk-bool); }
.treeview .null { color: var(--muted); font-style: italic; }
.treeview .cnt { color: var(--muted); font-size: 11px; margin-left: 6px; }
.treeview .badge {
  display: inline-block; font-size: 11px; letter-spacing: .06em;
  border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 5px;
  color: var(--muted); margin-left: 7px; vertical-align: 1px;
}
.treeview .empty { color: var(--muted); font-style: italic; padding-left: 15px; }

/* 树编辑（bejson 同款）：值/键名悬停出可编辑暗示，删除钮悬停浮现 */
.treeview .tval { cursor: text; border-bottom: 1px dashed transparent; transition: border-color .12s; }
.treeview .tval:hover { border-bottom-color: currentColor; }
.treeview .k-ed { cursor: text; }
.treeview .k-ed:hover { text-decoration: underline dashed; text-underline-offset: 3px; }
.treeview .k-ix { cursor: default; }
.treeview .tdel {
  border: 0; background: transparent; color: var(--faint); cursor: pointer;
  font-size: 11px; line-height: 1; padding: 2px 4px; border-radius: 4px; margin-left: 6px;
  opacity: 0; transition: opacity .12s, color .12s, background .12s; vertical-align: 1px;
}
.treeview .trow:hover .tdel, .treeview details > summary:hover .tdel,
.treeview .tdel:focus-visible { opacity: 1; }
.treeview .tdel:hover { color: var(--err); background: var(--err-soft); }
.treeview .tedit {
  font-family: var(--mono); font-size: 12.5px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--accent);
  border-radius: 6px; padding: 1px 6px; min-width: 90px; max-width: 70%; outline: none;
}
.treeview .tedit:focus { box-shadow: 0 0 0 2px var(--accent-soft); }

/* 输出面板 tabs（tablist 语义） */
.pane-bar .tabs { display: flex; gap: 2px; flex-shrink: 0; }
.pane-bar .tabs button {
  border: 1px solid transparent; background: transparent; color: var(--muted);
  font-size: 11.5px; line-height: 1.7; border-radius: 7px; padding: 3px 10px;
  transition: color .15s, background .15s, border-color .15s;
}
.pane-bar .tabs button:hover { color: var(--ink); }
.pane-bar .tabs button[aria-selected="true"] {
  background: var(--surface); border-color: var(--border); color: var(--accent-deep); font-weight: 600;
}

/* 面板底栏：两栏底栏钉等高定高（高度由内容决定会生 2–14px 死区） */
.pane-foot {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  height: 52px; padding: 0 12px;
  border-top: 1px solid var(--border); background: var(--surface-2);
}
/* 工作台按钮扁平化（与顶栏同族）：透明底 + hover 浮色，覆盖首页 .btn 的描边口径 */
.pane-foot .btn {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 0; padding: 4px 11px; font-size: 12.5px; border-radius: 7px;
  border: 0; background: transparent; color: var(--muted);
  transition: color .15s, background .15s;
}
.pane-foot .btn:hover { color: var(--accent-deep); background: var(--accent-soft); box-shadow: none; }
.pane-foot .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); box-shadow: none; }
/* 主按钮内嵌快捷键提示（kbd-note 退役后的常驻口径）：currentColor 跟随亮暗两套 */
.pane-foot .btn kbd {
  margin-left: 7px; font-family: var(--mono); font-size: 10.5px; line-height: 1.5;
  border: 1px solid currentColor; border-radius: 5px; padding: 0 5px; opacity: .8;
}
.pane-foot .btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--bg); }
/* 暗色主按钮不能拿 --accent 当底（白字压 #5b8bef 只有 3.29）→ --ink 底 + --bg 字 */
:root[data-theme="dark"] .pane-foot .btn.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
:root[data-theme="dark"] .pane-foot .btn.primary:hover { background: var(--bg); border-color: var(--ink); color: var(--ink); }
.pane-foot .btn[aria-pressed="true"] { color: var(--accent-deep); background: var(--accent-soft); }
.stat { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 校验条：横跨两列。三态：红错误 / is-warn 提醒 / 隐藏 */
.verdict {
  grid-column: 1 / -1;
  margin-top: 8px;   /* 栅格 gap 归零（分隔条列自管间距），校验条与双栏的呼吸缝自己补 */
  border: 1px solid var(--err); border-radius: 12px;
  background: var(--err-soft); padding: 11px 14px;
}
.verdict .v-head { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.verdict .v-title { font-size: 13.5px; font-weight: 600; color: var(--err-ink); }
.verdict .v-loc { font-family: var(--mono); font-size: 12px; color: var(--err-ink); }
.verdict .v-hint { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.verdict .v-src { font-family: var(--mono); font-size: 12px; color: var(--err-ink); margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.verdict .v-src mark { background: color-mix(in srgb, var(--err) 20%, transparent); color: var(--err-ink); border-radius: 3px; }
.verdict .v-fixes { display: flex; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.verdict .v-fixes button {
  font-size: 12px; line-height: 1.7; border: 1px solid color-mix(in srgb, var(--err) 45%, transparent);
  background: transparent; color: var(--err-ink); border-radius: 999px; padding: 3px 12px;
  transition: background .15s;
}
.verdict .v-fixes button:hover { background: color-mix(in srgb, var(--err) 12%, transparent); }
/* 体检提醒态：语法合法但有隐患（重复 key / 大数精度）——结论仍是"校验通过" */
.verdict.is-warn { border-color: var(--warn); background: var(--warn-soft); }
.verdict.is-warn .v-title, .verdict.is-warn .v-loc { color: var(--warn-ink); }
.verdict .v-item { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.verdict .v-item b { color: var(--warn-ink); font-weight: 600; }

/* 恢复条：上次输入自动暂存在本机 */
.restore {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; row-gap: 6px;
  border: 1px solid var(--accent-line); background: var(--accent-soft);
  border-radius: 12px; padding: 9px 14px; margin-bottom: 12px;
  font-size: 13px; color: var(--accent-deep);
}
.restore .r-txt { min-width: 0; }
.restore .r-act { margin-left: auto; display: flex; gap: 8px; }

/* 信任条（纯本地处理事实承诺） */
.trustbar {
  display: flex; gap: 26px; align-items: center; flex-wrap: wrap;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 13px 0; margin: 26px 0 34px;
  font-size: 13px; color: var(--muted);
}
.trustbar span { display: inline-flex; align-items: center; gap: 7px; }
.trustbar svg { color: var(--ok); flex-shrink: 0; }

/* 相关工具（卡片与列表页 v12 同源）——
   顶距与工作台隔开（L 轮用户口径：cron 底部也太贴——实测全站 workbench→related 间距为 0）。
   底部呼吸距离**已上移到模板层**（见 footer 的 margin-top，2026-10-11）：此处不再自挂
   margin-bottom，否则详情页会变成「48 + 64」双重间距，反而与列表页不一致。 */
.related { margin-top: 32px; }
.related h2 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 14px; }

/* M4 详情页常见问题（details/summary 原生折叠，零 JS；与 FAQPage schema 同源） */
.faq { margin-top: 32px; }
.faq h2 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 8px; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 2px; font-size: 14.5px; font-weight: 600; color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: ""; flex-shrink: 0;
  width: 7px; height: 7px; margin-left: 2px;
  border-right: 1.6px solid var(--faint); border-bottom: 1.6px solid var(--faint);
  transform: rotate(-45deg); transition: transform .15s;
}
.faq-item[open] summary::before { transform: rotate(45deg); }
.faq-item summary:hover { color: var(--accent-deep); }
.faq-item summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.faq-item p { margin: 0; padding: 0 2px 14px 19px; font-size: 14px; line-height: 1.75; color: var(--muted); }

/* 历史浮动拉手（用户口径：钉左栏左缘垂直居中，点击从左栏后侧拉出历史）：
   竖排「历史」小拉手，贴 pane 左缘（pane overflow:hidden 内侧贴边不受剪）；
   全屏时随 workbench.fs 仍在视口内 → 全屏也能开历史（抽屉层级见下） */
.hist-tab {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  z-index: 5;
  writing-mode: vertical-rl; letter-spacing: .14em;
  padding: 12px 3px; font-size: 11px; line-height: 1;
  color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--border); border-left: 0;
  border-radius: 0 8px 8px 0;
  cursor: pointer; transition: color .15s, background .15s;
}
.hist-tab:hover { color: var(--accent-deep); background: var(--accent-soft); }
.hist-tab[aria-pressed="true"] { color: var(--accent-deep); background: var(--accent-soft); }

/* 历史记录侧抽屉（本机 localStorage，不上传）：钉视口左缘，不占 workbench 栅格——
   220px 定宽（用户三轮反馈逐轮收窄：340→300→260→220，两行小字仍够用）；
   不足时退 86vw overlay（≤860 带遮罩点按即关）；
   fixed 祖先不得有 transform（.tool-app 无）。
   z-index 130 > 全屏 workbench 的 120：全屏内也能开抽屉（用户口径：全屏也分配历史区），
   抽屉 top 随全屏从 63px 提到 0（兄弟选择器：histAside 与 workbench 同父 root） */
.hist-drawer {
  position: fixed; top: 63px; left: 0; bottom: 0; z-index: 130;
  width: 220px; max-width: 86vw;
  display: flex; flex-direction: column; min-height: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  box-shadow: var(--shadow-drawer);
  transform: translateX(-102%); visibility: hidden; overflow: hidden;
  transition: transform .22s ease, visibility .22s;
}
.hist-drawer.open { transform: translateX(0); visibility: visible; }
.workbench.fs ~ .hist-drawer { top: 0; }
.hist-scrim {
  position: fixed; inset: 0; z-index: 125; background: var(--scrim);
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
}
.hist-scrim.show { opacity: 1; visibility: visible; }
/* 遮罩只在窄屏（≤860 抽屉盖住内容时）出现；宽屏抽屉落左侧空白，不遮内容 */
@media (min-width: 861px) {
  .hist-scrim.show { opacity: 0; visibility: hidden; }
}
.hist-head {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.hist-title { font-size: 12.5px; font-weight: 700; letter-spacing: .02em; color: var(--ink); }
.hist-count {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 0 7px; line-height: 1.6;
}
.hist-close {
  margin-left: auto; border: 0; background: transparent; color: var(--muted);
  font-size: 14px; line-height: 1; cursor: pointer; border-radius: 6px; padding: 4px 7px;
  transition: color .15s, background .15s;
}
.hist-close:hover { color: var(--ink); background: var(--surface-2); }
.hist-clear {
  border: 0; background: transparent; color: var(--muted);
  font-size: 11.5px; cursor: pointer; border-radius: 6px; padding: 3px 7px;
  transition: color .15s, background .15s;
}
.hist-clear:hover { color: var(--err-ink); background: var(--err-soft); }
.hist-list { flex: 1; overflow: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.hist-item {
  display: block; width: 100%; text-align: left; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg); border-radius: 10px;
  padding: 8px 10px; font-size: 12px;
  transition: border-color .15s, background .15s;
}
.hist-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.hist-item .hist-top { display: flex; align-items: center; gap: 6px; }
.hist-item .hist-top .hist-time { flex: 1; min-width: 0; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-item .hist-meta { display: block; color: var(--muted); margin-top: 2px; font-family: var(--mono); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 删除确认（用户口径：显式确认框，不靠盲击两次）：确认态整条转红，
   原内容让位给「删除这条历史？ [删除] [取消]」确认条 */
.hist-item.del-confirm { border-color: var(--err); background: var(--err-soft); cursor: default; }
.hist-item.del-confirm .hist-top,
.hist-item.del-confirm .hist-meta { display: none; }
.hist-confirm { display: flex; align-items: center; gap: 8px; color: var(--err-ink); font-size: 12px; font-weight: 600; }
.hist-confirm .hist-q { flex: 1; min-width: 0; }
.hist-confirm button { border: 0; cursor: pointer; font-size: 12px; line-height: 1.6; padding: 3px 10px; border-radius: 6px; transition: background .15s, color .15s; }
.hist-yes { background: var(--err); color: var(--bg); font-weight: 600; }
.hist-yes:hover { background: var(--err-ink); color: var(--bg); }
.hist-no { background: transparent; color: var(--muted); }
.hist-confirm .hist-no { border: 1px solid var(--border-strong); }
.hist-no:hover { color: var(--ink); }
.hist-del {
  display: inline-flex; flex-shrink: 0; border: 0; background: transparent; color: var(--muted);
  cursor: pointer; padding: 3px; border-radius: 5px;
  transition: color .15s, background .15s;
}
.hist-del svg { display: block; }
.hist-del:hover { color: var(--err-ink); background: var(--err-soft); }
.hist-del:focus-visible, .hist-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hist-empty { color: var(--muted); font-size: 12px; padding: 10px 6px; }
.hist-note {
  flex-shrink: 0; padding: 8px 12px; font-size: 11.5px; color: var(--muted);
  border-top: 1px dashed var(--border); background: var(--surface-2);
}
/* 清空历史两步确认：arm 态「确认清空」转红 */
.hist-clear.arm { color: var(--err-ink); background: var(--err-soft); font-weight: 600; }
/* 全屏编辑：workbench fixed 覆盖视口（按钮或 Esc 退出） */
.workbench.fs .pane { border-radius: 0; }
/* 行号开关：隐藏行号列，代码列独占（不破坏 --code-line 行高） */
.out.lined.no-ln { grid-template-columns: minmax(0, 1fr); }
.out.lined.no-ln .ln { display: none; }
/* 输出面板里的语言下拉（代码转换） */
.pane-bar .selwrap { padding: 2px 7px; }
.pane-bar .selwrap select { border: 0; outline: none; background: transparent; color: var(--ink); font-size: 12px; min-height: 22px; cursor: pointer; }
/* selwrap 里的数字输入（uuid 数量） */
.pane-bar .selwrap input[type="number"] { border: 0; outline: none; background: transparent; color: var(--ink); font-size: 12px; min-height: 22px; width: 56px; font-family: var(--mono); }

/* ---------- 工作台套件增量（第二批九工具共用；不新增令牌） ---------- */
/* solo 单栏变体（uuid 等生成器类）：单 pane 独占，无分隔条 */
/* solo 单栏变体：自然文档流高度（2026-10-08 用户口径：撤销固定视口高模型）。
   固定高是双栏拖拽对比的需求，solo 套用后衍生出「控件必须收顶栏」「流式内容被
   pane-foot 裁切」「结果行 overlay 化」等一族补丁规则——根因修复后整体退役：
   内容撑开 pane，pane-foot 跟随内容，页面自然滚动，底部控件不再被裁。 */
.workbench.solo {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  height: auto;
}
/* 编辑器/输出类工具在自然流下的内滚兜底：textarea 与输出区给最小工作高度，
   超出部分内部滚动（体验与旧定高模型一致），而不是把页面撑得无限长 */
.workbench.solo .pane textarea { min-height: 340px; }
.workbench.solo .edit-lined, .workbench.solo .edit-stack { min-height: 340px; }
.workbench.solo .out { min-height: 240px; }
.workbench.solo .out.plain .code { height: auto; max-height: 62vh; }
.workbench.solo .pane-body.col > .out { flex: 1 1 auto; }
/* solo 表单家族（cron/jwt-decoder/htpasswd/robots/url-parser/file2base64/client-info）
   pane-body 统一内边距（L 轮用户口径：cron 也差内边距——与 E 原型 .wb-param 同 14/16 口径）；
   只限 .col 纵向表单流——编辑器型 solo（textarea/out 贴边是既有编辑器观感）不受影响 */
.workbench.solo .pane-body.col { padding: 14px 16px; }
/* 全屏态恢复视口定高（.fs 规则在上方，此处后置覆盖 solo 的 height:auto） */
.workbench.solo.fs {
  height: 100vh;
  grid-template-rows: minmax(0, 1fr) auto;
}
/* ── E 原型：参数预览台（makeParamStage，M1.5 布局原型库）——左「参数」右「预览」
   两列（2:3），自然流高度（同 solo 口径：内容撑开，无定高裁切补丁），无分隔条；
   verdict 恒跨全宽第二行。data-pane 语义为 params/stage（core 注释为选择器契约）。 */
.workbench.wb-param {
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  grid-template-rows: auto auto;
  height: auto;
  /* 两卡片间要有距离（M 轮用户口径：特效/flex 等双栏贴着难看）；verdict 横跨
     第二行，row-gap 同时给它留出空气——verdict 隐藏态 display:none 不占位无影响 */
  gap: 12px;
}
/* K 轮用户口径：pane-body 内容贴边顶格粗超——按全站模板口径补统一内边距
   （14px 16px，与编辑器 textarea / .icx-panel 同规格）；四工具
   （gradient/bezier/effects/flex）两栏同时受益，测试的栏宽断言均动态取 inner 不受影响 */
.workbench.wb-param .pane-body { padding: 14px 16px; }
/* 行号输出变体（代码类：html/js-css）：flex 双列，行号槽复用 .edit-ln，
   代码列 flex 独占（.out.plain 的 display:block / height:100% 不适用于双列） */
.out.plain.lnp { display: flex; }
.out.plain.lnp .code { height: auto; flex: 1; min-width: 0; }
/* 行号输入变体：textarea 直排进 .edit-lined（无高亮层；json-formatter 的
   .edit-stack 三明治不受影响——absolute 定位仅命中 .edit-stack textarea） */
.pane .edit-lined > textarea { height: auto; align-self: stretch; }
/* 纯文本输出视图：等宽 + 滚动；wrap-on 文本类换行，缺省代码态不折行 */
.out.plain { display: block; }
.out.plain .code {
  padding: 14px 16px; overflow: auto; height: 100%; box-sizing: border-box;
  font-family: var(--mono); font-size: 13px; line-height: var(--code-line); color: var(--ink);
  white-space: pre;
}
.out.plain.wrap-on .code { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
.out.plain .code:empty::before { content: "（等待输出）"; color: var(--faint); }
/* pane 内嵌一行输入件：datetime-local（timestamp 日期→时间戳方向）与正则 pattern 输入。
   与 .pane textarea 同底同 padding，视觉连续 */
.pane .dt-in, .pane .pat-in {
  border: 0; outline: none; background: var(--surface); color: var(--ink);
  font-family: var(--mono); font-size: 14px; padding: 14px 16px; min-width: 0;
}
.pane .dt-in { flex: 1; }
/* 纵向 pane-body 变体（regex 左栏 = pattern 输入 + 测试文本上下排；右栏 = 高亮 + 明细） */
.pane-body.col { flex-direction: column; }
/* 纵向栏内输出区可收缩滚动（client-info 长报告裁切修复）：flex 子项缺省
   min-height:auto 会被内容撑到自然高 → 被 pane overflow:hidden 裁掉且无滚动条；
   min-height:0 后 .out 收进可用高度，滚动交由 .out.plain .code 的 overflow:auto 承接 */
.pane-body.col > .out { min-height: 0; }
.pane .pat-in { flex: 0 0 auto; width: 100%; box-sizing: border-box; border-bottom: 1px solid var(--border); }
/* aes 口令/密钥输入列：占满 pane-body 高度（用户反馈 10-05：原 .tool-textarea
   卡片 min-height:180px 限高悬浮）。复用 .pane textarea 无边框同底规格，
   与数据输入并排、右侧 1px 分界；≤860 断点经 .with-key 转上下堆叠 */
.pane .pane-key {
  /* 40% 基准 + 300px 上限：双栏半宽（~410px pane）时不再挤死数据输入（原 300px 定基准
     会让 edit-lined 只剩 ~110px 竖排一字一行）；≥1080 视口才给足 300px */
  flex: 0 1 40%; max-width: 300px; min-width: 150px; display: flex;
  border-right: 1px solid var(--border);
}
.pane .pane-key > textarea { height: auto; align-self: stretch; min-height: 0; resize: none; }
/* 顶栏文本输入件（subnet-calc 的 IP/CIDR、rsa-lab 的签名）：selwrap 系同规格 */
.pane-bar .selwrap input[type="text"] {
  border: 0; outline: none; background: transparent; color: var(--ink);
  font-size: 12px; min-height: 22px; width: 250px; font-family: var(--mono);
}
/* 计算报告（subnet-calc / torrent-magnet）：行式「键 值」两列，值列等宽可断行 */
.rep { padding: 14px 16px; }
.rep-row { display: flex; gap: 14px; padding: 6px 0; font-size: 13px; line-height: 1.7; border-bottom: 1px dashed var(--border); }
.rep-row:last-child { border-bottom: 0; }
.rep-k { flex: 0 0 150px; color: var(--muted); font-family: var(--mono); font-size: 12px; padding-top: 1px; }
.rep-v { flex: 1; min-width: 0; font-family: var(--mono); color: var(--ink); word-break: break-all; }
/* text-counter 右栏统计网格：随右栏实际宽度自适应列数（分隔条拖动也重排） */
.stats-grid {
  flex: 1; min-width: 0; overflow: auto; padding: 14px 16px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px;
  align-content: start; box-sizing: border-box;
}
.stats-cell { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.stats-cell .s-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.stats-cell .s-head::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: currentColor; flex: 0 0 auto; }
/* 标题语义色调：全部引用既有令牌（亮暗两套自动跟随）；cat 系走 -ink 文字级分支 */
.stats-cell .s-head.st-accent { color: var(--accent); }
.stats-cell .s-head.st-txt    { color: var(--cat-txt-ink); }
.stats-cell .s-head.st-zh     { color: var(--cat-zh-ink); }
.stats-cell .s-head.st-img    { color: var(--cat-img-ink); }
.stats-cell .s-head.st-typ    { color: var(--tk-typ); }
.stats-cell .s-head.st-err    { color: var(--err); }
.stats-cell .s-head.st-kw     { color: var(--tk-kw); }
.stats-cell .s-head.st-mut    { color: var(--muted); }
.stats-cell .s-num { font-family: var(--mono); font-size: 21px; font-weight: 600; margin-top: 4px; color: var(--ink); }
/* regex-tester：命中高亮（文本节点 + mark.tool-mark，防注入）与捕获明细 */
.rx-hl {
  flex: 0 0 auto; max-height: 46%; overflow: auto; padding: 14px 16px; box-sizing: border-box;
  font-family: var(--mono); font-size: 13px; line-height: 1.75; white-space: pre-wrap; word-break: break-word;
  color: var(--ink); border-bottom: 1px solid var(--border);
}
.rx-hl:empty::before { content: "（等待输入）"; color: var(--faint); }
.rx-groups { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 10px 16px 14px; }
.rx-item { border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); padding: 8px 12px; margin-top: 8px; font-size: 12.5px; }
.rx-item .rx-head { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.rx-item .rx-g { color: var(--muted); margin-top: 3px; font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.rx-none { color: var(--muted); font-size: 12.5px; padding: 4px 0; }


/* ==========================================================================
   列表页 / 详情页 响应式（纪律：只改自有结构；头部/导航/页边距与首页同断点同值）
   ========================================================================== */
@media (max-width: 1100px) {
  :root { --wb-offset: 286px; }
  .flat-grid, .cat-band { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cat-band > .sp1, .cat-band > .sp2, .cat-band > .sp3, .cat-band > .sp4 { grid-column: span 3; }
  .cat-band > .cat-section > .flat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .head-note { display: none; }
  .filter-note { display: none; }
  .kbd-note { display: none; }
  .search-wrap-sm { flex: 0 0 210px; }
  .flat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-band { grid-template-columns: minmax(0, 1fr); }
  .cat-band > .sp1, .cat-band > .sp2, .cat-band > .sp3, .cat-band > .sp4 { grid-column: span 1; }
  .cat-band > .cat-section > .flat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  /* 双栏收单栏：两栏纵向罗列，各自给够用的下限；底栏不再钉等高定高 */
  .workbench { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; height: auto; }
  .wb-split { display: none; }   /* 单列无分隔可拖 */
  .verdict { grid-column: auto; margin-top: 8px; }
  /* .wb-param 特异性（0-2-0）高于本块 .workbench（0-1-0），参数预览台须在此显式收单列 */
  .workbench.wb-param { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .pane-body { min-height: 300px; }
  /* aes 口令列随单栏转上下堆叠（横向 300px 基准在窄屏会挤死数据输入） */
  .pane-body.with-key { flex-direction: column; }
  .pane .pane-key { flex: 0 0 auto; min-width: 0; border-right: 0; border-bottom: 1px solid var(--border); }
  .pane .pane-key > textarea { min-height: 76px; }
  .pane-foot { height: auto; min-height: 52px; padding: 9px 12px; flex-wrap: wrap; row-gap: 6px; }
  /* J 轮：seg 允许换行——多选项 seg（css-flex justify-content 7 档等）窄屏下
     overflow:hidden 会把按钮裁没，比难看更糟；换行 + 端角圆角补偿 */
  .seg { flex-wrap: wrap; overflow: visible; }
  .seg button { border-radius: 0; }
  .seg button:first-child { border-radius: 6px 0 0 6px; }
  .seg button:last-child { border-radius: 0 6px 6px 0; }
}
@media (max-width: 640px) {
  .index-inner { flex-wrap: wrap; row-gap: 8px; }
  .search-wrap-sm { flex: 1 1 100%; }
  .sug { width: 100%; max-width: none; }
}
@media (max-width: 560px) {
  .logo small { display: none; }
  .flat-grid { grid-template-columns: minmax(0, 1fr); }
  .cat-band > .cat-section > .flat-grid { grid-template-columns: minmax(0, 1fr); }
  .page-head { padding: 16px 0 14px; }
  .page-head h1 { font-size: 20px; }
  .search-sm .kbd { display: none; }
  .tool-head { padding: 16px 0 12px; }
  .tool-head h1 { font-size: 22px; }
  .local-badge { margin-left: 0; }
  .pane-body { min-height: 240px; }
  .pane-bar { gap: 8px; padding: 8px 10px; flex-wrap: wrap; row-gap: 6px; }
  .out.lined .code, .pane textarea, .edit-ln, .edit-hl, .treeview { padding-left: 12px; padding-right: 12px; }
  .foot-inner { flex-wrap: wrap; gap: 12px; }
  .foot-links { margin-left: 0; gap: 16px; }
}

/* ==========================================================================
   编辑态 = CodeMirror 5（vendor 化组件 ToolCore.makeEditor，json-formatter 首战）。
   主题只引既有令牌（亮暗两套自动跟随），不新增令牌 —— DriftTests 纪律。
   .edit-cm 与旧 .edit-lined 三明治并存：老工具继续走自研高亮，新工具走 CM。
   ========================================================================== */
.edit-cm { flex: 1; min-width: 0; min-height: 0; display: flex; }
.edit-cm-host { flex: 1; position: relative; min-width: 0; }
.edit-cm-host .CodeMirror {
  position: absolute; inset: 0; height: 100%;
  font-family: var(--mono); font-size: 13px; line-height: var(--code-line);
  color: var(--ink); background: var(--surface);
}
/* 代码区留白对齐旧 textarea 口径（14px 顶距 + 16px 侧距，--code-line 行高三前提） */
.edit-cm-host .CodeMirror-lines { padding: 14px 0; }
.edit-cm-host .CodeMirror pre.CodeMirror-line,
.edit-cm-host .CodeMirror pre.CodeMirror-line-like { padding: 0 16px; }
/* 行号槽：与 .out.lined .ln 同构（surface-2 底 + 右缘细线 + muted 数字） */
.edit-cm-host .CodeMirror-gutters {
  background: var(--surface-2); border-right: 1px solid var(--border);
}
.edit-cm-host .CodeMirror-linenumber {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  padding: 0 8px 0 12px; min-width: 26px;
}
.edit-cm-host .CodeMirror-guttermarker-subtle { color: var(--faint); }
/* 光标 / 选区 / 活动行 / 括号匹配（覆盖 codemirror.css 与 addon 注入的固定色） */
.edit-cm-host .CodeMirror-cursor { border-left: 1.5px solid var(--ink); }
/* 空文档 caret 高度兜底：CM5 fromTextArea + 空文档开屏态，charCoords 对空行零宽锚点的
   量测返回高度 0，updateCursor 据此把 caret 内联写成 height:0px —— 聚焦/点击都不自愈
   （caret 恒不可见，用户感知「点不进输入框」；粘贴与打字其实一直有效），直到发生首次
   内容变更才恢复。inline 0px 压过普通 CSS，只能 !important 反压；量测链建立后原生高度
   与 --code-line 一致（全工具统一 22px），此规则恒等价、无副作用。 */
.edit-cm-host .CodeMirror-empty .CodeMirror-cursor { height: var(--code-line) !important; }
.edit-cm-host .CodeMirror-selected,
.edit-cm-host .CodeMirror-focused .CodeMirror-selected { background: var(--sel-soft); }
.edit-cm-host .CodeMirror-activeline-background { background: var(--surface-2); }
.edit-cm-host .cm-matchingbracket { color: var(--accent-deep); background: var(--accent-soft); font-weight: 600; }
.edit-cm-host .cm-nonmatchingbracket { color: var(--err); }
/* 语法色：与冻结视图同源令牌。CM javascript(json) 模式键名字符串带 cm-string cm-property
   双 class —— property 规则必须后置，同特异性下源序后者胜，键名才能赢回 accent-deep；
   否则被 cm-string 染绿（用户感知为「编辑时属性高亮丢失」）。 */
.edit-cm-host .cm-string { color: var(--tk-str); }
.edit-cm-host .cm-property { color: var(--accent-deep); }
.edit-cm-host .cm-number { color: var(--tk-num); }
.edit-cm-host .cm-atom { color: var(--tk-bool); }
.edit-cm-host .cm-comment { color: var(--tk-com); font-style: italic; }
.edit-cm-host .cm-keyword { color: var(--tk-kw); }
.edit-cm-host .cm-def { color: var(--tk-typ); }
.edit-cm-host .cm-variable { color: var(--ink); }
.edit-cm-host .cm-operator { color: var(--ink); }
/* 错误行背景（工具经 cm.addLineClass 挂 .cm-err-line）与占位文案 */
.edit-cm-host .cm-err-line { background: var(--err-soft); }
.edit-cm-host .CodeMirror-placeholder { color: var(--muted); font-style: italic; }
.edit-cm-host .CodeMirror-scrollbar-filler { background: var(--surface-2); }

/* ================= cron-tool（N 轮重排：solo → 双栏编辑台，与 regex 同构：
   左栏 = 表达式输入 + 字段解析；右栏 = 校验徽标 + 推算列表） ================= */
/* 输入复用 .pat-in 通栏贴边式（与 regex pattern 同规格），无专属卡片壳 */
/* 右栏结果统一内边距壳：双栏 pane-body 无内边距，补 12/16（对齐 wb-param 口径） */
.cron-out { padding: 12px 16px 14px; }
/* 字段解析（J 轮新增 / K 轮去框）：逐段释义是辅助信息，纯排版足够；
   双栏下补内边距贴齐 pat-in 的 16px 水平轴 */
.cron-fields { padding: 12px 16px 14px; }
.cron-fields[hidden] { display: none; }
.cron-fields-h { font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.cron-frow { display: flex; align-items: baseline; gap: 10px; padding: 2px 0; font-size: 12.5px; }
.cron-flab { flex: 0 0 24px; color: var(--muted); }
.cron-fraw {
  font: 500 12px/1.6 var(--mono); color: var(--accent);
  background: var(--accent-soft); border-radius: 5px; padding: 0 6px;
}
.cron-ftxt { color: var(--ink); }
.cron-badgerow { margin-bottom: 8px; }
/* 校验徽标（K 轮去框）：绿 pill 改纯文字行——结论信息不需要底色胶囊 */
.cron-badge {
  display: inline-block;
  font-size: 12.5px; font-weight: 600;
  color: var(--ok);
}
.cron-list {
  list-style: none; margin: 0; padding: 0;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); overflow: hidden;
}
.cron-list li {
  display: flex; align-items: baseline; gap: 10px;
  padding: 7px 14px;
  font: 500 13px/1.5 var(--mono);
  border-bottom: 1px solid var(--border);
}
.cron-list li:last-child { border-bottom: none; }
.cron-list li:nth-child(1) { background: var(--accent-soft); }
.cron-t { color: var(--ink); font-weight: 600; }
.cron-w { color: var(--muted); font-size: 12px; }
/* 右栏结果流：校验徽标 → 时区提示 → 推算列表 */
.cron-tz { margin: 0 2px 10px; font-size: 12px; color: var(--muted); }

/* ================= excel-json（solo 表单型：拖拽框 + Sheet 选择） ================= */
.excel-drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 26px 16px; margin-bottom: 12px;
  border: 1.5px dashed var(--border-strong); border-radius: 14px;
  background: var(--surface-2); cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.excel-drop:hover, .excel-drop:focus-visible, .excel-drop.is-over {
  border-color: var(--accent); background: var(--accent-soft); outline: none;
}
.excel-drop-ico { color: var(--accent); }
.excel-drop-ico .bico { transform: rotate(180deg); width: 18px; height: 18px; }
.excel-drop-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.excel-drop-hint { font-size: 12px; color: var(--muted); }
.excel-file-input {
  position: absolute; width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}
.excel-sheetrow {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px; flex-wrap: wrap;
}
.excel-sheetrow label { font-size: 13px; color: var(--muted); }
.excel-sheetrow select {
  font-size: 13px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 4px 8px;
}
.excel-sheetinfo { font-size: 12px; color: var(--faint); }

/* ================= color-convert（双栏：色块 + 格式 + 对比度报告） ================= */
/* flex:1 铺满 pane——曾缺失导致滚动条贴内容右缘而非 pane 右缘（用户反馈 10-08） */
.ccv-list {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px; overflow: auto; height: 100%;
  flex: 1; min-width: 0;
  box-sizing: border-box;
}
.ccv-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.ccv-sw {
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border-strong);
}
.ccv-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ccv-main { font-family: var(--mono, monospace); font-size: 13px; color: var(--ink); }
.ccv-sub { font-size: 12px; color: var(--muted); }

/* ================= file2base64（solo：拖放框 + 解码块） ================= */
.tool-note { font-size: 12px; color: var(--muted); }
.b64-drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 26px 16px;
  border: 1.5px dashed var(--border-strong); border-radius: 14px;
  background: var(--surface-2); cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.b64-drop:hover, .b64-drop:focus-visible, .b64-drop.is-over {
  border-color: var(--accent); background: var(--accent-soft); outline: none;
}
.b64-drop-main { font-size: 14px; font-weight: 600; color: var(--ink); }
.b64-drop-sub { font-size: 12px; color: var(--muted); }
.b64-dec { display: flex; flex-direction: column; gap: 8px; }

/* ================= china-color（solo：搜索 + 色卡网格滚动区 + 固定套色推荐） ================= */
/* 滚动收口在 .cc-body（pane-body 上段）：网格自身绝不做滚动容器——
   Chromium 下 grid 滚动容器（overflow:auto）会把 auto 行轨道压扁，
   481 卡时行高全塌成 2px 细线（2026-10-08 实测踩坑，overflow 一撤即愈）。
   套色推荐面板固定在下段（.cc-pal），网格怎么滚推荐都不丢（用户口径 10-08）。 */
.cc-split { padding: 0 12px 12px; }
.cc-body { overflow-y: auto; min-height: 0; flex: 1; max-height: min(560px, 62vh); }
/* J 轮用户口径：中间色块区固定高度内部滚动——solo 自然流 pane 高度跟随内容，
   flex:1 无上限致 400+ 色全展开、推荐面板要滚到底才见；封顶后推荐面板常驻可见 */
.workbench.fs .cc-body { max-height: none; }
.cc-body > * { flex-shrink: 0; }
/* 搜索框 2 行定稿（10-08 二次修订）：压掉 .tool-textarea 全局 min-height:180px */
.cc-search { margin-bottom: 0; }
/* 特异性须压过 solo 自然流的 textarea 兜底（.workbench.solo .pane textarea，0-3-1）：
   搜索框是 2 行小输入，不吃 340px 编辑器内滚兜底 */
.workbench.solo .pane .cc-search .tool-textarea { min-height: 0; height: auto; resize: none; overflow: hidden; }
.cc-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 10px; padding: 2px; margin-top: 14px;
}
.cc-card {
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: var(--surface); cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform .12s ease, border-color .12s ease;
}
.cc-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.cc-card:focus-visible { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.cc-card.sel { border-color: var(--accent); outline: 2px solid var(--accent); }
.cc-sw {
  height: 64px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
}
.cc-name { font-size: 14px; font-weight: 600; }
.cc-py { font-size: 11px; }
.cc-hex { font-family: var(--mono, monospace); font-size: 12px; color: var(--ink); padding: 6px 8px; }
.cc-empty { font-size: 13px; color: var(--muted); padding: 20px 4px; }
/* 套色推荐：固定底段，五方案 × 推荐真实传统色色票（点击选中该色卡） */
.cc-pal {
  flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-2); padding: 10px 12px; margin-top: 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.cc-pal[hidden] { display: none; }
.cc-pal-head { font-size: 13px; font-weight: 600; color: var(--ink); }
.cc-pal-hex { font-family: var(--mono, monospace); font-weight: 400; color: var(--muted); }
.cc-pal-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cc-pal-label { flex: 0 0 60px; font-size: 12px; color: var(--muted); }
.cc-pal-chips { display: flex; gap: 6px; flex: 1; min-width: 0; }
/* 色票：横向铺满，色名内嵌（YIQ 自动黑/白字），点击选中对应传统色卡 */
.cc-chip {
  flex: 1; min-width: 0; height: 28px; border-radius: 7px; padding: 0 6px;
  border: 1px solid var(--border-strong); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .12s ease, box-shadow .12s ease;
}
.cc-chip-name {
  font-size: 11px; line-height: 1; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cc-chip:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.cc-chip:focus-visible { outline: 2px solid var(--accent-soft); }

/* ================= css-gradient（双栏：渐变条 + 色标列表 + 预设） ================= */
.cgr-lab { font-size: 12px; color: var(--muted); }
/* 轨道内缩（J 轮）：手柄 translate(-50%) 在 0%/100% 处半悬条外——
   barwrap 左右各留 9px，手柄越界落在留白里，不再顶栏边也不裁切 */
.cgr-barwrap { padding: 2px 9px; margin-bottom: 12px; }
/* 节头（J 轮）：色标/预设分区标题行 */
.cgr-sec-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 2px 0 8px;
}
.cgr-sec-title { font-size: 12px; font-weight: 600; color: var(--muted); }
.cgr-sec-head .tool-btn { padding: 2px 10px; font-size: 12px; border-radius: 7px; }
.cgr-bar {
  position: relative; height: 44px; border-radius: 10px;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
  cursor: copy; touch-action: none;
}
.cgr-handle {
  position: absolute; top: 50%; width: 18px; height: 18px;
  transform: translate(-50%, -50%);
  border-radius: 50%; border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--border-strong);
  cursor: grab; touch-action: none;
}
.cgr-handle:active { cursor: grabbing; }
.cgr-stops { display: flex; flex-direction: column; gap: 6px; overflow: auto; min-height: 0; margin-bottom: 12px; }
.cgr-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.cgr-row input[type="color"] {
  width: 34px; height: 26px; padding: 0; border: 1px solid var(--border);
  border-radius: 6px; background: var(--surface); cursor: pointer;
}
/* 位置输入（K 轮）：定宽 96px——flex:1 拉到 300 多像素只装个「100」，空旷即粗超；
   删除钮推到行尾，色块-输入-删除三件套紧凑成组 */
.cgr-row input[type="number"] {
  flex: 0 0 96px; min-width: 0; padding: 4px 8px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--ink);
}
.cgr-del {
  flex: 0 0 auto; margin-left: auto; padding: 3px 10px; font-size: 12px;
  border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--surface); color: var(--muted); cursor: pointer;
}
.cgr-del:hover:not(:disabled) { color: var(--err-ink); border-color: var(--err-ink); }
.cgr-del:disabled { opacity: .45; cursor: not-allowed; }
/* 预设（K 轮）：固定 3 列——auto-fill 在当前栏宽下排 5+1 孤块吊行；
   当前 6 个预设恰好 2×3 无孤块 */
.cgr-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cgr-preset {
  width: auto; height: 32px; border-radius: 8px;
  border: 1px solid var(--border-strong); cursor: pointer; padding: 0;
}
.cgr-preset:hover { border-color: var(--accent); }
.cgr-prev {
  flex: 1; min-height: 120px; border-radius: 12px;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
}

/* ================= css-flex（双栏：属性行 + 演示区） ================= */
.cfx-ctrls { display: flex; flex-direction: column; gap: 10px; overflow: auto; min-height: 0; }
.cfx-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cfx-lab { flex: 0 0 118px; font-family: var(--mono, monospace); font-size: 12px; color: var(--muted); }
.cfx-gapval { font-size: 12px; color: var(--muted); min-width: 38px; text-align: right; }
.cfx-demo {
  flex: 1; min-height: 140px; padding: 14px; overflow: auto;
  border-radius: 12px; border: 1px dashed var(--border-strong);
  background: var(--surface-2);
}
/* 尺寸用 min-width/min-height 而非 flex-basis：column 方向 flex-basis 作用于高度，
   会让子项塌成细长条（用户反馈「设计是不是有问题」的实锤） */
.cfx-item {
  min-width: 64px; min-height: 52px; padding: 6px 10px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; font-weight: 600; font-size: 15px;
  background: var(--accent-soft); color: var(--ink);
  border: 1px solid var(--accent);
}

/* ================= css-bezier（双栏：SVG 曲线 + 数值 + 演示小球） ================= */
.cbz-canvas {
  /* J 轮自适应撑满后，高 pane 下画布被拉到近 500px 见方（K 轮用户截图：粗超）——
     保留自适应（窄栏照旧撑满）但封顶 400px 见方并居中 */
  width: 100%; max-width: 400px; aspect-ratio: 1;
  margin: 0 auto; display: block;
  border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2);
  touch-action: none;
}
.cbz-grid { stroke: var(--border-strong); stroke-dasharray: 4 4; stroke-width: 1; }
.cbz-arm { stroke: var(--muted); stroke-width: 1.2; }
.cbz-curve { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; }
.cbz-end { fill: var(--ink); }
.cbz-pt {
  fill: var(--accent); stroke: var(--bg); stroke-width: 2;
  cursor: grab;
}
.cbz-pt:active { cursor: grabbing; }
.cbz-nums { display: flex; flex-wrap: wrap; gap: 8px; }
.cbz-numw { display: flex; align-items: center; gap: 4px; }
.cbz-numlab { font-family: var(--mono, monospace); font-size: 12px; color: var(--muted); }
.cbz-numw input {
  width: 72px; padding: 4px 8px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--ink);
}
.cbz-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.cbz-preset {
  padding: 4px 12px; font-size: 12px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink); cursor: pointer;
}
.cbz-preset:hover { border-color: var(--accent); background: var(--accent-soft); }
/* 演示舞台（K 轮收形）：不再 flex:1 撑满整个 pane（球悬浮在 300px 空白里），
   定高 128px + 可视轨道线，球沿轨道跑动有参照 */
.cbz-track {
  position: relative;
  flex: 0 0 auto; height: 128px; display: flex; align-items: center;
  padding: 0 8px; border-radius: 12px;
  border: 1px dashed var(--border-strong); background: var(--surface-2);
}
.cbz-track::before {
  content: ""; position: absolute; left: 8px; right: 8px; top: 50%;
  height: 2px; margin-top: -1px;
  background: color-mix(in srgb, var(--border-strong) 70%, var(--muted));
  border-radius: 2px;
}
.cbz-ball {
  position: relative;   /* 压在轨道线上方 */
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
  box-shadow: var(--shadow-card);
  will-change: transform;
}

/* ================= css-effects（双栏：模板参数 + 预览舞台 + 代码） ================= */
.ce-groups { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.ce-group { display: flex; flex-direction: column; gap: 10px; }
/* 预设方案（J 轮）：参数区下方常驻（不随 ce-groups 内滚），chips 与 seg 同语言 */
.ce-presets { flex-shrink: 0; padding-top: 12px; border-top: 1px solid var(--border); }
.ce-presets-h { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.ce-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ce-chip {
  padding: 4px 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 12.5px; color: var(--ink); cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.ce-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.ce-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ce-lab { flex: 0 0 96px; font-size: 12px; color: var(--muted); }
.ce-val { font-size: 12px; color: var(--muted); min-width: 46px; text-align: right; font-family: var(--mono, monospace); }
.ce-row input[type="range"] { flex: 1; min-width: 80px; }
.ce-row input[type="text"] {
  flex: 1; min-width: 0; padding: 4px 8px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--ink);
}
.ce-row input[type="color"] {
  width: 34px; height: 26px; padding: 0; border: 1px solid var(--border);
  border-radius: 6px; background: var(--surface); cursor: pointer;
}
.ce-stage {
  flex: 1; min-height: 150px; border-radius: 12px;
  border: 1px dashed var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 12px;
}
.ce-scene { background: linear-gradient(135deg, #38bdf8, #818cf8 45%, #f472b6); }  /* 预览场景色：演示毛玻璃内容，非主题令牌 */
.ce-dark { background: #0b1220; }   /* 预览场景色：霓虹/故障字需暗底，非主题令牌 */
.ce-glass {
  width: min(78%, 320px); padding: 18px; color: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: var(--shadow-card);
}
.ce-gt { font-weight: 600; font-size: 14px; }
.ce-gl { font-size: 12px; margin-top: 4px; opacity: .8; font-family: var(--mono, monospace); }
.ce-neon { font-size: 44px; font-weight: 700; letter-spacing: 2px; white-space: nowrap; }
.ce-glitch { position: relative; font-size: 44px; font-weight: 700; color: #f2f5fa; white-space: nowrap; }
.ce-glitch::before,
.ce-glitch::after {
  content: attr(data-text);
  position: absolute; left: 0; top: 0; width: 100%;
  pointer-events: none;
}
.ce-glitch::before {
  color: var(--ce-ga, #ff3b5c);
  transform: translateX(calc(-1 * var(--ce-goff, 4px)));
  clip-path: inset(0 0 56% 0);
  animation: ce-ga 2.4s infinite steps(2, end);
}
.ce-glitch::after {
  color: var(--ce-gb, #00e5ff);
  transform: translateX(var(--ce-goff, 4px));
  clip-path: inset(56% 0 0 0);
  animation: ce-gb 1.8s infinite steps(2, end);
}
@keyframes ce-ga {
  0%, 100% { clip-path: inset(0 0 56% 0); }
  40% { clip-path: inset(18% 0 42% 0); }
  70% { clip-path: inset(8% 0 64% 0); }
}
@keyframes ce-gb {
  0%, 100% { clip-path: inset(56% 0 0 0); }
  40% { clip-path: inset(64% 0 8% 0); }
  70% { clip-path: inset(30% 0 30% 0); }
}
.ce-blob { width: 160px; height: 160px; background: var(--accent); box-shadow: var(--shadow-card); }

/* ================= svg-optimizer（双栏：源码 + 选项 / 对比 + 预览 + 代码） ================= */
/* 选项区两列网格（曾纵排 6 行占 164px，用户口径「界面设计一定是这样？」） */
/* 选项参数卡（J 轮）：清洗选项+精度收进卡片，与全站参数卡同语言 */
.svo-optcard {
  flex-shrink: 0; margin-top: 10px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); padding: 10px 12px;
}
.svo-opthead { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.svo-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.svo-opt { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); cursor: pointer; min-width: 0; }
.svo-opt input[type="checkbox"] { accent-color: var(--accent); margin: 0; flex-shrink: 0; }
.svo-opt input[type="number"] {
  width: 64px; padding: 4px 8px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--ink);
}
.svo-prec { grid-column: 1 / -1; justify-content: space-between; }
.svo-stats { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.svo-stat {
  font-size: 12px; color: var(--muted); font-family: var(--mono, monospace);
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.svo-saved { color: var(--ok); border-color: var(--ok); }
.svo-prev {
  max-width: 100%; max-height: 160px; min-height: 60px;
  border-radius: 12px; border: 1px dashed var(--border-strong);
  background: var(--surface-2); padding: 8px; box-sizing: border-box;
}


/* ================= 批次六 M1：图像工具共享组件（imgd-） ================= */
/* 三个图像工具共用的拖放区 / 对比预览；专属控件走各自前缀（icp-/ihd-/icv-） */
.imgd-drop {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 38px 16px 30px;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.imgd-drop:hover, .imgd-drop:focus-visible, .imgd-drop.is-over {
  border-color: var(--accent); background: var(--accent-soft); outline: none;
  box-shadow: var(--shadow-md);
}
.imgd-ico {
  width: 44px; height: 44px;
  color: var(--accent);
  opacity: .9;
}
.imgd-drop:hover .imgd-ico, .imgd-drop:focus-visible .imgd-ico, .imgd-drop.is-over .imgd-ico {
  opacity: 1;
}
.imgd-drop-main { font-size: 14px; font-weight: 600; color: var(--ink); }
.imgd-drop-sub { font-size: 12px; color: var(--muted); }
.imgd-compare {
  position: relative;   /* makeBusy 宿主：单张转换处理中盖两图并排区 */
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  min-height: 0;
}
.imgd-fig {
  margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.imgd-fig img {
  width: 100%; height: 220px; object-fit: contain;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2);
  box-sizing: border-box;
}
.imgd-cap {
  font-size: 12px; color: var(--muted); text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ================= C 原型「文件舞台」骨架（fst-，core makeFileStage） ================= */
/* 脱离 pane 三段式的独立形态：页头操作行 + hero 拖放区 + 自由结果区 + 汇总行。 */
.fst { display: flex; flex-direction: column; gap: 12px; }
.fst-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.fst-head .acts { display: inline-flex; align-items: center; gap: 8px; }
/* C 舞台页头 seg 对齐顶栏口径（与 pane-bar 同规格，节奏统一） */
.fst-head .acts .seg button { padding: 3px 10px; font-size: 12px; }
.fst-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 108px; padding: 22px 16px;
  border: 1.5px dashed var(--accent-line); border-radius: var(--radius);
  background: var(--accent-soft); cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, min-height .2s ease, padding .2s ease;
}
.fst-drop:hover, .fst-drop:focus-visible, .fst-drop.is-over {
  border-color: var(--accent); outline: none;
  box-shadow: var(--shadow-md);
}
/* 有图后收窄成「继续添加」细条（工具切 .is-compact） */
.fst-drop.is-compact {
  min-height: 0; padding: 12px 16px;
  flex-direction: row; justify-content: flex-start; gap: 10px;
}
.fst-drop.is-compact .imgd-ico { width: 22px; height: 22px; }
.fst-drop.is-compact .imgd-drop-main { font-size: 13px; }
.fst-drop.is-compact .imgd-drop-sub { display: none; }
.fst-body { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.fst-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding-top: 2px;
}
.fst .stat { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* 结果区内参数卡吸顶：滚到结果网格任意处都可调参（左右分栏优势的吸收点） */
.fst .icx-panel {
  position: sticky; top: 8px; z-index: 30;
  background: var(--bg);
}
/* 全屏态：fixed 铺 --bg 底，Esc 退出（makeFs 切 .fs） */
.fst.fs {
  position: fixed; inset: 0; z-index: 60;
  background: var(--bg); padding: 16px; overflow: auto;
  border-radius: 0;
}
@media (max-width: 860px) {
  .fst-head { flex-direction: column; align-items: stretch; }
  .fst-head .acts { flex-wrap: wrap; }
}

/* ================= 图像工具左右两栏共享骨架（img-split-，2026-10-10） ================= */
/* 适用：**「参数 | 预览」型**图像工具（watermark / compress / hd / convert）。
   左列＝操作与参数（窄、可吸顶），右列＝预览与结果（宽、自适应）。
   ★ 刻意不设 align-items:start —— 保持默认 stretch，左栏外层容器才有整行高，
     其内的 .icx-panel 才能 sticky 常驻（子项若被 start 收成内容高，吸顶无行程）。
   ★ 例外：image-crop 是「媒体 | 媒体」等宽两栏（左右都是画布，不需要窄参数列），
     不套用本骨架，见 .crp-cols。 */
.img-split { display: grid; grid-template-columns: minmax(296px, 360px) minmax(0, 1fr); gap: 18px; }
/* 等宽变体：左右都是媒体面（image-crop 的「原图 | 结果」），而不是「窄参数 | 宽预览」 */
.img-split.is-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.img-split-side, .img-split-main { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.img-split-cap { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
/* 预览框：长宽比由 --ar 决定（工具按图片实际比例写内联变量），未指定回落 4:3；
   竖图由 max-height 封顶——此时框比图宽，内容居中留边。换图前后外框尺寸稳定不跳动。 */
.img-split-frame {
  position: relative;
  width: 100%; margin: 0 auto;
  aspect-ratio: var(--ar, 4 / 3);
  max-height: min(560px, 62vh);
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius); border: 1px solid var(--border);
  overflow: hidden;
  background:
    repeating-conic-gradient(
      color-mix(in srgb, var(--border) 42%, transparent) 0% 25%,
      var(--surface-2) 0% 50%)
    0 0 / 16px 16px;
}
.img-split-frame > img, .img-split-frame > canvas {
  display: block; max-width: 100%; max-height: 100%; width: auto; height: auto;
}
.img-split-empty {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 220px; padding: 24px 20px;
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  font-size: 13px; color: var(--muted);
}
/* 两栏内的工作台画框（hd 的对比舞台 / compress 单图舞台）在宽右栏里加高，
   不再是 solo 时代的 340px 矮框；lightbox 内的 .icx-frame 不受影响（不在 .img-split-main 内） */
.img-split-main .icx-frame { height: min(540px, 60vh); }
@media (max-width: 900px) {
  .img-split { grid-template-columns: minmax(0, 1fr); }
}

/* 结果指标条：原图 ⇢ 转换后 的尺寸/体积对照（image-convert 右栏底部）。
   放右栏底部而非页面底部——紧贴它所描述的预览，且不会被页面后续区块挤走。 */
.img-metrics {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.img-metrics-grp { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.img-metrics-lab { font-size: 11.5px; color: var(--faint); letter-spacing: .02em; }
.img-metrics-val {
  font-size: 14.5px; font-weight: 600; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.img-metrics-sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.img-metrics-arrow { flex: 0 0 auto; color: var(--muted); font-size: 15px; }
.img-metrics-delta {
  margin-left: auto; flex: 0 0 auto;
  padding: 5px 13px; border-radius: 999px;
  background: var(--ok-soft); color: var(--ok);
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.img-metrics-delta.is-worse { background: var(--warn-soft); color: var(--warn-ink); }

/* ================= 批次六 UI 轮：结果舞台 + 参数面板（icx-，compress/hd 共用） ================= */
/* 参数面板卡：控件不再裸奔，收进圆角卡 */
.icx-panel {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.icx-panel-title {
  font-size: 12px; font-weight: 600; color: var(--muted);
  letter-spacing: .02em;
}
.icx-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.icx-lab { flex: 0 0 44px; font-size: 12px; color: var(--muted); }
/* hint 有最小需求宽度：窄视口装不下时整条换行到下一行（flex-grow 占满），
   绝不在行内被压成一列竖字（I 轮用户截图：响应式撑坏真因） */
.icx-hint { flex: 1 1 220px; min-width: 0; font-size: 12px; color: var(--muted); }
.icx-val {
  flex: 0 0 auto; min-width: 40px;
  padding: 2px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-deep);
  font-size: 12px; font-weight: 600; text-align: center;
  font-variant-numeric: tabular-nums;
}
.icx-row input[type="number"] {
  width: 90px; flex: 0 0 auto;
  padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: 9px;
  background: var(--bg); color: var(--ink); font: inherit;
}
.icx-row input[type="number"]:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
/* 自定义滑杆：accent 圆钮 + 已填充轨道（--qfill 由工具内联驱动，读得出当前值位置） */
.icx-row input[type="range"] {
  flex: 1 1 auto; height: 18px;
  -webkit-appearance: none; appearance: none;
  background: transparent; cursor: pointer;
}
.icx-row input[type="range"]::-webkit-slider-runnable-track {
  height: 5px; border-radius: 999px;
  background: linear-gradient(to right, var(--accent) var(--qfill, 0%), var(--border-strong) var(--qfill, 0%));
}
.icx-row input[type="range"]::-moz-range-track {
  height: 5px; border-radius: 999px; background: var(--border-strong);
}
.icx-row input[type="range"]::-moz-range-progress {
  height: 5px; border-radius: 999px; background: var(--accent);
}
.icx-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; margin-top: -5.5px;
  border-radius: 50%; border: 2.5px solid var(--accent);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease;
}
.icx-row input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.15); }
.icx-row input[type="range"]:focus-visible {
  outline: none;
}
.icx-row input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* 参数行快捷档位 chips：与 seg 同语言（soft 底 + accent 环），迷你胶囊 */
.icx-chips { display: inline-flex; gap: 4px; flex: 0 0 auto; }
.icx-chip {
  font: inherit; font-size: 11px; line-height: 1; padding: 4px 9px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface-2); color: var(--muted); cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.icx-chip:hover { color: var(--accent-deep); border-color: var(--accent); }
.icx-chip[aria-pressed="true"] {
  background: var(--accent-soft); color: var(--accent-deep); font-weight: 600;
  border-color: var(--accent);
}

/* 数字输入组：边框收在组上，px 单位内嵌；原生 spinner 隐藏（滚轮/方向键仍可微调） */
.icx-num {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border-strong); border-radius: 9px;
  background: var(--bg); transition: border-color .15s, box-shadow .15s;
}
.icx-num:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.icx-num input[type="number"] {
  width: 50px; border: 0; background: transparent;
  padding: 4px 2px 4px 9px; border-radius: 0;
  font-size: 13px;
  -moz-appearance: textfield; appearance: textfield;
}
.icx-num input[type="number"]::-webkit-outer-spin-button,
.icx-num input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.icx-num input[type="number"]:focus { outline: none; box-shadow: none; border: 0; }
.icx-unit { padding: 0 9px 0 2px; font-size: 12px; color: var(--muted); }

/* 结果舞台：画框 + 拖拽分割线对比（Squoosh 式） */
.icx-stage { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.icx-frame {
  position: relative; height: 340px; flex-shrink: 0;
  border-radius: var(--radius); border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface-2);
}
/* 透明底棋盘格：仅当输出格式保留透明通道（PNG/WebP）时启用（is-alpha 由工具切换）——
   JPEG 无透明通道，棋盘格纯属视觉噪音 */
.icx-frame.is-alpha {
  background:
    repeating-conic-gradient(
      color-mix(in srgb, var(--border) 42%, transparent) 0% 25%,
      var(--surface-2) 0% 50%)
    0 0 / 20px 20px;
}
.icx-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
}
.icx-clip {
  position: absolute; inset: 0;
  will-change: clip-path;
}
.icx-badge {
  position: absolute; top: 10px; margin: 0;
  max-width: calc(50% - 20px);
}
.icx-badge figcaption {
  padding: 4px 10px; border-radius: 999px;
  background: var(--nav-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 12px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.icx-ba { left: 10px; }
.icx-bb { right: 10px; }
.icx-bb figcaption { border-color: var(--accent-line); }
.icx-handle {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 0; cursor: ew-resize; touch-action: none;
}
.icx-handle::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: -1px;
  width: 2px; background: var(--bg);
  box-shadow: var(--shadow-hairline), var(--shadow-md);
}
.icx-grip {
  position: absolute; top: 50%; left: 0;
  transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg); color: var(--accent);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: transform .12s ease;
}
.icx-handle:hover .icx-grip, .icx-handle:focus-visible .icx-grip {
  transform: translate(-50%, -50%) scale(1.1);
}
.icx-handle:focus-visible { outline: none; }
.icx-handle:focus-visible .icx-grip {
  box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-card);
}

/* 结果行：画框内底部悬浮条（省幅/放大徽章 + 对比条 + 换一张），
   overlay 而非文档流——solo pane-body 高度有限，流式排会溢出被 pane-foot 裁掉 */
.icx-result {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border-radius: 12px;
  background: var(--nav-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.icx-save {
  flex: 0 0 auto;
  padding: 6px 14px; border-radius: 999px;
  background: var(--ok-soft); color: var(--ok);
  font-size: 15px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.icx-save.is-worse { background: var(--warn-soft); color: var(--warn-ink); }
.icx-bars {
  flex: 1 1 auto;
  display: flex; flex-direction: column; gap: 5px;
}
.icx-bar {
  display: block; height: 6px; border-radius: 999px;
  transition: width .3s cubic-bezier(.16, 1, .3, 1);
}
.icx-bar-a { background: var(--border-strong); width: 100%; }
.icx-bar-b { background: var(--accent); width: 0; }
.icx-change {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--ink);
  font-size: 13px; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.icx-change:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- image-convert（icv-） ---------- */
.icv-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.icv-lab { flex: 0 0 56px; font-size: 12px; color: var(--muted); }

/* ================= 批次六 UI 轮 2：image-compress 批量队列（icq-） ================= */
/* 全局统计：三格 metric 卡（大数字；节省格数字用 accent 强调，底保持中性——accent-soft 底配字红线） */
.icq-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.icq-stat-cell {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-2);
}
.icq-stat-v {
  font-size: 20px; font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums; line-height: 1.2;
}
.icq-stat-v.is-save { color: var(--accent); }
.icq-stat-v.is-worse { color: var(--warn-ink); }
.icq-stat-l { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* 卡片网格：参考 imgzip 队列，密度自适应 */
.icq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.icq-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s ease, border-color .15s ease;
}
.icq-card:hover { box-shadow: var(--shadow-card); border-color: var(--border-strong); }
.icq-thumb {
  position: relative; height: 130px;
  border-radius: 9px; overflow: hidden;
  background:
    repeating-conic-gradient(
      color-mix(in srgb, var(--border) 42%, transparent) 0% 25%,
      var(--surface-2) 0% 50%)
    0 0 / 16px 16px;
}
.icq-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.icq-badge-wrap { position: absolute; top: 8px; right: 8px; }
.icq-badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  background: var(--nav-bg); border: 1px solid var(--border);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-size: 11px; font-weight: 600; color: var(--muted);
}
.icq-badge.is-done { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.icq-badge.is-working { color: var(--accent); border-color: var(--accent-line); }
.icq-badge.is-stale { color: var(--warn-ink); border-color: color-mix(in srgb, var(--warn-ink) 45%, transparent); }
.icq-badge.is-fail { color: var(--err); border-color: color-mix(in srgb, var(--err) 45%, transparent); }
.icq-name {
  font-size: 13px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.icq-dim { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.icq-vol {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 12px; font-variant-numeric: tabular-nums;
}
.icq-va { color: var(--muted); text-decoration: line-through; }
.icq-arrow { color: var(--muted); }
.icq-vb { color: var(--ink); font-weight: 600; }
.icq-track {
  height: 5px; border-radius: 999px; background: var(--border);
  overflow: hidden;
}
.icq-bar {
  display: block; height: 100%; width: 0;
  border-radius: 999px; background: var(--ok);
  transition: width .3s cubic-bezier(.16, 1, .3, 1);
}
.icq-bar.is-working { background: var(--accent); animation: icq-pulse 1.1s ease-in-out infinite; }
.icq-bar.is-worse { background: var(--warn); }
@keyframes icq-pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
.icq-acts { display: flex; gap: 6px; }
/* 卡片操作钮：全站 tool-btn 同语言（元素自带 .tool-btn 基类，border/bg/hover 全继承），
   仅按卡片密度微缩尺寸——不再另起配色（I 轮用户口径：预览/重压/下载与全站一致） */
.icq-btn {
  flex: 1 1 auto; min-width: 0;
  padding: 5px 0; border-radius: 8px;
  font-size: 12.5px;
}
.icq-btn:disabled { opacity: .45; cursor: not-allowed; }

/* 处理中遮罩（makeBusy）：挂 position:relative 宿主内，盖住内容给「正在处理」反馈——
   大图解码 / pica 首载 / MozJPEG wasm 首编译可达数秒，无反馈被当成功能坏了（I 轮用户口径） */
.icx-busy {
  position: absolute; inset: 0; z-index: 6;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.icx-busy[hidden] { display: none; }
.icx-busy-ring {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--accent-soft); border-top-color: var(--accent);
  animation: icx-spin .8s linear infinite;
}
.icx-busy-txt { font-size: 12.5px; color: var(--muted); }
@keyframes icx-spin { to { transform: rotate(360deg); } }

/* 队列空态提示 */
.icq-empty {
  padding: 26px 16px; text-align: center;
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  font-size: 13px; color: var(--muted);
}

/* 拖放区紧凑态（有图后）：主文案隐藏，只留一条「继续添加」视觉 */
.imgd-drop.is-compact { padding: 14px 16px; gap: 2px; }
.imgd-drop.is-compact .imgd-ico { width: 22px; height: 22px; }
.imgd-drop.is-compact .imgd-drop-main { font-size: 13px; }
.imgd-drop.is-compact .imgd-drop-sub { display: none; }

/* lightbox：卡片预览 → 全屏拖拽对比 */
.icx-lightbox {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 4vh 4vw;
  background: var(--scrim);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.icx-lightbox-in {
  display: flex; flex-direction: column; gap: 10px;
  width: min(1080px, 100%); max-height: 92vh;
}
.icx-lightbox .icx-frame { height: min(66vh, 620px); flex-shrink: 0; }
.icx-lightbox .icx-result {
  position: static;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 14px;
  box-shadow: var(--shadow-card);
}
/* 画框下方文档流变体（image-hd 结果行，G 轮用户口径：overlay 悬在画框内会遮住图片底部）——
   C 舞台 body 自然流不会被裁，直接排画框下面当一张结果卡 */
.icx-stage > .icx-result {
  position: static;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.icx-lightbox-close {
  align-self: flex-end;
  padding: 6px 16px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--bg) 35%, transparent);
  background: color-mix(in srgb, var(--ink) 55%, transparent); color: var(--bg);
  font-size: 13px; cursor: pointer;
  transition: background .15s ease;
}
.icx-lightbox-close:hover { background: color-mix(in srgb, var(--ink) 80%, transparent); }

/* ============ 首页 2026-10-09 改版：推荐位 + 紧凑分类导航 ============
   替代旧「分区瀑布」（dev 拆 5 后首页分区爆炸的根治方案）。
   推荐位：两列编号文字链接（IsFeatured 过渡，M2 用量统计落地后切真实排序）；
   分类导航：一行 chip，真实落点 = 分类落地页 /tools/{code}。 */
/* ---------- M2.5 首页「我的」区（最近使用 + 收藏，tools-home.js 客户端渲染） ---------- */
.mine { margin-top: 46px; }
.mine-row { display: flex; align-items: baseline; gap: 16px; padding: 11px 2px; }
.mine-row[hidden] { display: none; }   /* display:flex 会压掉 hidden 的 UA display:none，须显式对冲 */
.mine-row + .mine-row { border-top: 1px solid var(--border); }
.mine-label { flex-shrink: 0; width: 64px; font-size: 13px; font-weight: 500; color: var(--muted); }
.mine-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.m-chip {
  padding: 5px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 500;
  transition: border-color .15s, background .15s;
}
.m-chip:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--accent-soft); }
.mine-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.m-link { font-size: 14px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.m-link:hover { color: var(--accent-deep); text-decoration: underline; }
.m-chip:focus-visible, .m-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.featured { margin-top: 46px; }
.featured-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 44px;
}
.featured-list li { border-bottom: 1px solid var(--border); }
.featured-list li:nth-last-child(-n+2) { border-bottom: none; }
.f-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 2px; text-decoration: none; color: var(--ink);
}
.f-link .no {
  font-family: var(--mono); font-size: 12px; color: var(--faint);
  width: 20px; text-align: right; flex-shrink: 0;
}
.f-link .t-name { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-link .cat-tag {
  margin-left: auto; flex-shrink: 0;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  padding: 1px 8px; border-radius: 999px; background: var(--cat-soft, var(--surface-2));
}
.f-link:hover .t-name { color: var(--accent-deep); }
.f-link:hover .no { color: var(--cat, var(--accent-deep)); }
.f-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.home-cats {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px;
  padding-top: 22px; border-top: 1px solid var(--border);
}
.hcat {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 500;
  transition: border-color .15s, background .15s;
}
.hcat svg { color: var(--cat, var(--muted)); flex-shrink: 0; }
.hcat .hbadge { font-family: var(--mono); font-size: 10px; color: var(--faint); letter-spacing: .1em; }
.hcat:hover { border-color: color-mix(in srgb, var(--cat, var(--accent)) 45%, var(--border)); background: var(--cat-soft, var(--surface-2)); }
.hcat:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 720px) {
  .featured-list { grid-template-columns: minmax(0, 1fr); }
  .featured-list li:nth-last-child(-n+2) { border-bottom: 1px solid var(--border); }
  .featured-list li:last-child { border-bottom: none; }
}

/* ================= 批次六 M2：二维码生成/解码（qr- / qrd-，前缀已查重 2026-10-09） ================= */
/* 生成（E 原型右栏）：预览画布框 + 空态占位 */
.qr-in {
  width: 100%; box-sizing: border-box; min-height: 110px; resize: vertical;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 13px; line-height: 1.6;
}
.qr-in:focus { outline: none; border-color: var(--accent); }
.qr-colors { display: inline-flex; align-items: center; gap: 6px; }
.qr-cg-lab { font-size: 12px; color: var(--muted); }
.qr-colors input[type="color"] {
  width: 34px; height: 26px; padding: 0; border: 1px solid var(--border);
  border-radius: 6px; background: var(--surface); cursor: pointer;
}
.qr-frame {
  display: flex; align-items: center; justify-content: center;
  align-self: flex-start;   /* col 流内不横拉满宽：画布框尺寸随内容走 */
  max-width: 100%;
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2);
}
/* qrcode（E 原型参数预览台）：左参数栏收窄到与图像工具同款列宽——
   「参数收入左侧，右侧留给二维码」（2026-10-11 用户口径）。
   0-3-0 特异性高于 .workbench.wb-param（0-2-0），故须自带窄屏单列覆盖（否则会盖掉 860 断点的折叠）。 */
.workbench.wb-param.qr-param { grid-template-columns: minmax(296px, 360px) minmax(0, 1fr); }
@media (max-width: 900px) {
  .workbench.wb-param.qr-param { grid-template-columns: minmax(0, 1fr); }
}
.qr-frame[hidden] { display: none; }
#qr-canvas {
  display: block; max-width: 100%; height: auto;
  image-rendering: pixelated;   /* 整数模块像素放大后保持锐边 */
}
.qr-empty {
  display: flex; align-items: center; justify-content: center;
  min-height: 220px; border: 1px dashed var(--border); border-radius: var(--radius);
  color: var(--faint); font-size: 13px;
}
.qr-empty[hidden] { display: none; }

/* 解码（C 原型 body 自由区）：原图 + 结果卡两栏——
   列宽/断点已迁到共享骨架 .img-split（2026-10-11），此处只留 busy 遮罩锚点定位。 */
.qrd-grid {
  position: relative;   /* busy 遮罩 absolute 锚点（F 轮教训：复用 overlay 必查定位祖先） */
}
.qrd-grid[hidden] { display: none; }
.qrd-fig { margin: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.qrd-fig img {
  display: block; max-width: 100%; max-height: 320px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2);
}
.qrd-out {
  min-width: 0;
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.qrd-out-head { display: flex; align-items: center; gap: 8px; }
.qrd-out-title { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; margin-right: auto; }
.qrd-txt {
  margin: 0; flex: 1 1 auto; min-height: 96px;
  white-space: pre-wrap; word-break: break-all; overflow-wrap: anywhere;
  font-family: var(--mono); font-size: 13px; line-height: 1.7; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px;
}
@media (max-width: 860px) {
  .qrd-fig { align-items: center; }
}

/* ---- 中心 Logo 行（批六 M2 增补；qr-logo- 前缀 grep 查重无冲突） ---- */
.qr-logo { display: inline-flex; align-items: center; gap: 6px; }
.qr-logo-file {
  position: absolute; width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}
.qr-logo-btn[hidden] { display: none; }
.qr-logo-chip {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 200px; padding: 3px 8px 3px 10px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); font-size: 12px; color: var(--ink);
}
.qr-logo-chip[hidden] { display: none; }
.qr-logo-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-logo-rm {
  border: 0; background: none; padding: 0 2px;
  font: inherit; font-size: 12px; color: var(--muted);
  cursor: pointer; border-radius: 4px;
}
.qr-logo-rm:hover { color: var(--err-ink); }

/* ============ M5 命令面板（Ctrl+K，tools-cmdk.js 组装） ============ */
/* 层级：z-index 140 > 抽屉 130 > 全屏工作台 120；遮罩用 --scrim（同抽屉口径） */
.cmdk { position: fixed; inset: 0; z-index: 140; }
.cmdk[hidden] { display: none; }
.cmdk-back { position: absolute; inset: 0; background: var(--scrim); }
.cmdk-panel {
  position: relative; width: 560px; max-width: calc(100vw - 32px);
  margin: 12vh auto 0; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.cmdk-in {
  width: 100%; border: 0; outline: 0; background: transparent;
  padding: 15px 18px; font: inherit; font-size: 15.5px; color: var(--ink);
  border-bottom: 1px solid var(--border);
}
.cmdk-in::placeholder { color: var(--faint); }
.cmdk-list { list-style: none; margin: 0; padding: 6px; max-height: 46vh; overflow-y: auto; }
.cmdk-cap { padding: 8px 12px 4px; font-size: 11.5px; letter-spacing: .05em; color: var(--faint); }
.cmdk-it {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px; cursor: pointer;
  font-size: 14px; color: var(--ink);
}
.cmdk-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); flex-shrink: 0; }
.cmdk-it.is-active { background: var(--accent-soft); }
.cmdk-it.is-active .cmdk-dot { background: var(--accent); }
.cmdk-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-code { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--faint); }
.cmdk-act .cmdk-code { color: var(--muted); }
.cmdk-foot {
  display: flex; gap: 16px; padding: 9px 14px;
  border-top: 1px solid var(--border);
  color: var(--faint); font-size: 12px;
}
.cmdk-fitem { display: inline-flex; align-items: center; gap: 5px; }
body.cmdk-lock { overflow: hidden; }
@media (max-width: 920px) {
  .cmdk-panel { margin-top: 8vh; }
  .cmdk-code { display: none; }
}

/* ============ M3 评分与评论（详情页 .fb-*，tools-feedback.js 交互） ============ */
/* 头部评分汇总行：与 .t-usage 同层同口径（0 票服务端不渲染） */
.tool-head .t-rating { margin-top: 7px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tool-head .t-rating-star { color: var(--accent); margin-right: 3px; }
.tool-head .t-rating b { color: var(--accent-deep); font-weight: 600; }

.fb { margin-top: 32px; }
.fb h2 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 14px; }

/* 评分行：引导语 + 五星控件 */
.fb-rate { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.fb-lead { font-size: 13.5px; color: var(--muted); }
.fb-stars { display: inline-flex; gap: 2px; }
.fb-star {
  border: 0; background: transparent; cursor: pointer; padding: 2px 3px;
  font-size: 22px; line-height: 1; color: var(--border-strong);
  transition: color .12s, transform .12s;
}
.fb-star:hover, .fb-star.is-hover { color: var(--accent); transform: scale(1.08); }
.fb-star.is-on { color: var(--accent); }
.fb-star.is-done { cursor: default; }
.fb-star.is-done:hover { transform: none; }
.fb-star:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.fb-msg { font-size: 12.5px; color: var(--muted); margin: 0; }
.fb-msg.is-ok { color: var(--ok-ink); }
.fb-msg.is-err { color: var(--err-ink); }

/* 评论表单 */
/* 宽屏两栏：左＝评分+表单卡（固定宽），右＝评论列表（吃满剩余宽度）——
   2026-10-10 改版：原表单 max-width 620px 在宽屏右侧留出整片空白，收进左卡并把列表移到右栏。 */
.fb-body {
  display: grid;
  grid-template-columns: minmax(270px, 340px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.fb-side {
  display: flex; flex-direction: column; gap: 16px;
  padding: 16px 18px 18px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2);
}
.fb-main { display: flex; flex-direction: column; min-width: 0; }
.fb-list-head {
  display: flex; align-items: baseline; gap: 10px;
  padding-bottom: 11px; border-bottom: 1px solid var(--border);
}
.fb-list-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.fb-list-count { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.fb-empty {
  margin: 0; padding: 20px 2px;
  font-size: 13.5px; color: var(--muted); line-height: 1.75;
}
.fb-form { display: flex; flex-direction: column; gap: 10px; }
.fb-nick, .fb-content {
  width: 100%; font: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 13px; outline: 0; resize: vertical;
}
.fb-nick::placeholder, .fb-content::placeholder { color: var(--faint); }
.fb-nick:focus, .fb-content:focus { border-color: var(--accent); background: var(--bg); }
.fb-content { min-height: 76px; line-height: 1.65; }
.fb-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fb-count { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.fb-submit {
  border: 0; cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--bg); background: var(--accent); border-radius: 9px; padding: 9px 20px;
  transition: background .15s;
}
.fb-submit:hover { background: var(--accent-deep); }
.fb-submit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fb-submit:disabled { background: var(--border-strong); cursor: default; }

/* 已审评论列表（右栏；列表头已带分隔线，这里收紧顶距） */
.fb-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.fb-item { border-bottom: 1px solid var(--border); padding: 13px 2px; }
.fb-item:last-child { border-bottom: none; }
.fb-item-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 5px; }
.fb-item-nick { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.fb-item-time { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.fb-item-content { margin: 0; font-size: 14px; line-height: 1.75; color: var(--muted); white-space: pre-wrap; }

/* 窄屏回落单列（表单在上、评论在下） */
@media (max-width: 900px) {
  .fb-body { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 640px) {
  .fb-star { font-size: 26px; padding: 4px 5px; }
}

/* ================= 批六 M3：image-crop（crp-，前缀查重 2026-10-10） ================= */
/* 两栏（2026-10-10 用户口径）：左「原图与裁剪框」/ 右「裁剪结果」。
   栅格与画框已迁到共享骨架 .img-split.is-even / .img-split-frame（见图像工具共享骨架节）；
   本区块只留 crop 私有件：编辑层（wrap/遮罩/选框）、空态覆盖、结果图与元信息。
   遮罩用四条 shade（不用 box-shadow 全屏投影——那需要 overflow:hidden，
   会把越界的 8 个手柄一起裁掉，边缘选框看起来缺角）。 */
.crp-empty {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 20px; font-size: 13px; color: var(--muted);
}
.crp-wrap { position: relative; line-height: 0; }
.crp-img {
  display: block; width: 100%; height: 100%;
  border-radius: calc(var(--radius) - 1px);
  user-select: none; -webkit-user-drag: none;
}
.crp-shade { position: absolute; inset: 0; overflow: hidden; border-radius: var(--radius); pointer-events: none; }
.crp-sh { position: absolute; background: color-mix(in srgb, var(--ink) 52%, transparent); }
.crp-sh-t { left: 0; right: 0; top: 0; }
.crp-sh-b { left: 0; right: 0; bottom: 0; }
.crp-sh-l { left: 0; }
.crp-sh-r { right: 0; }
.crp-box {
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  border: 1.5px solid var(--bg);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 38%, transparent);
  cursor: move; touch-action: none;
}
.crp-grid { position: absolute; background: color-mix(in srgb, var(--bg) 45%, transparent); pointer-events: none; }
.crp-gv { top: 0; bottom: 0; width: 1px; }
.crp-gh { left: 0; right: 0; height: 1px; }
.crp-handle {
  position: absolute; width: 12px; height: 12px;
  background: var(--bg); border: 1.5px solid var(--accent); border-radius: 3px;
  box-shadow: var(--shadow-sm);
}
.crp-handle[data-dir="nw"] { left: -6px; top: -6px; cursor: nwse-resize; }
.crp-handle[data-dir="n"] { left: 50%; top: -6px; margin-left: -6px; cursor: ns-resize; }
.crp-handle[data-dir="ne"] { right: -6px; top: -6px; cursor: nesw-resize; }
.crp-handle[data-dir="e"] { right: -6px; top: 50%; margin-top: -6px; cursor: ew-resize; }
.crp-handle[data-dir="se"] { right: -6px; bottom: -6px; cursor: nwse-resize; }
.crp-handle[data-dir="s"] { left: 50%; bottom: -6px; margin-left: -6px; cursor: ns-resize; }
.crp-handle[data-dir="sw"] { left: -6px; bottom: -6px; cursor: nesw-resize; }
.crp-handle[data-dir="w"] { left: -6px; top: 50%; margin-top: -6px; cursor: ew-resize; }
.crp-size { font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
/* 结果图：contain 于右框内（框比例 = 原图比例，裁剪结果按自身比例居中显示）——
   max-width/height 由 .img-split-frame > img 供给 */
.crp-out-img { border-radius: 6px; }
.crp-out-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ================= 批六 M3：image-watermark（wmk-，前缀查重 2026-10-10） ================= */
.wmk-text-input {
  flex: 1 1 260px; min-width: 0;
  padding: 6px 11px; border: 1px solid var(--border-strong); border-radius: 9px;
  background: var(--bg); color: var(--ink); font: inherit; font-size: 13.5px;
}
.wmk-text-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.wmk-swatches { display: inline-flex; gap: 5px; flex: 0 0 auto; }
.wmk-swatch {
  width: 22px; height: 22px; padding: 0;
  border: 1px solid var(--border-strong); border-radius: 6px;
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform .12s ease, border-color .15s;
}
.wmk-swatch:hover { border-color: var(--accent); transform: scale(1.08); }
.icx-row input[type="color"] {
  width: 34px; height: 27px; padding: 2px; flex: 0 0 auto;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--bg); cursor: pointer;
}
.wmk-grid { display: grid; grid-template-columns: repeat(3, 28px); gap: 3px; }
.wmk-grid button {
  position: relative; width: 28px; height: 24px; padding: 0;
  border: 1px solid var(--border-strong); border-radius: 5px;
  background: var(--surface-2); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.wmk-grid button::before {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 5px; height: 5px; border-radius: 50%; background: var(--muted);
}
.wmk-grid button:hover { border-color: var(--accent); }
.wmk-grid button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.wmk-grid button[aria-pressed="true"]::before { background: var(--accent); }
.wmk-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--ink); }
.wmk-check input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.wmk-check-txt { user-select: none; }
.wmk-stage { min-width: 0; }
/* 两栏（2026-10-10 用户口径）：左设置参数 / 右图片预览。
   2026-10-11 迁移到共享骨架 .img-split —— 列宽/断点/预览框与 compress/hd/convert 同源，
   本文件不再保留 wmk 私有的列宽与画框规则（ID #wmk-cols / #wmk-frame 保留，测试依赖）。
   左栏套 .wmk-col-params 容器：栅格子项被拉伸到整行高，参数卡才有 sticky 行程。 */
.wmk-col-params { min-width: 0; }

/* ================= 批六 M3：ico-maker（ico-，前缀查重 2026-10-10） ================= */
.ico-src {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius);
  background: var(--surface-2);
}
.ico-src-img {
  width: 52px; height: 52px; flex: 0 0 auto;
  object-fit: contain; border-radius: 8px;
  border: 1px solid var(--border);
  background:
    repeating-conic-gradient(
      color-mix(in srgb, var(--border) 42%, transparent) 0% 25%,
      var(--surface-2) 0% 50%)
    0 0 / 12px 12px;
}
.ico-src-meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 0; }
.ico-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 12px;
}
.ico-cell {
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  padding: 12px 10px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.ico-cell-box {
  display: flex; align-items: center; justify-content: center;
  width: 76px; height: 76px; border-radius: 10px;
  background:
    repeating-conic-gradient(
      color-mix(in srgb, var(--border) 42%, transparent) 0% 25%,
      var(--surface-2) 0% 50%)
    0 0 / 14px 14px;
}
.ico-cell-img { max-width: 64px; max-height: 64px; image-rendering: pixelated; }
.ico-cell-meta { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ico-cell-size { font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.ico-cell-vol { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ico-btn { width: 100%; padding: 5px 0; border-radius: 8px; font-size: 12.5px; }

/* ================= 批六 M3：image-pick（ipk-，前缀查重 2026-10-10） ================= */
.ipk-stage { display: flex; justify-content: center; padding: 8px 0 2px; }
.ipk-wrap { position: relative; line-height: 0; border-radius: var(--radius); }
.ipk-canvas {
  display: block; border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: crosshair;
  user-select: none; -webkit-user-drag: none;
}
.ipk-cross {
  position: absolute; width: 16px; height: 16px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.ipk-cross::before, .ipk-cross::after {
  content: ""; position: absolute; background: var(--bg);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 55%, transparent);
}
.ipk-cross::before { left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; }
.ipk-cross::after { top: 50%; left: 0; right: 0; height: 2px; margin-top: -1px; }
.ipk-loupe {
  position: absolute; padding: 3px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); box-shadow: var(--shadow-card);
  pointer-events: none; line-height: 0;
}
.ipk-loupe canvas { display: block; border-radius: 7px; }
.ipk-readout {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  background: var(--surface-2);
}
.ipk-chip {
  width: 22px; height: 22px; flex: 0 0 auto;
  border-radius: 6px; border: 1px solid var(--border-strong);
  background: var(--border);
}
.ipk-read-text {
  font-size: 13px; color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ipk-board { display: flex; flex-direction: column; gap: 9px; }
.ipk-board-head { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.ipk-board-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ipk-sw {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 12px 6px 7px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.ipk-sw:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.ipk-sw-chip { width: 20px; height: 20px; flex: 0 0 auto; border-radius: 5px; border: 1px solid var(--border-strong); }
.ipk-sw-txt { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.ipk-sw-hex {
  font-size: 13px; color: var(--ink); font-weight: 600;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
}
.ipk-sw-rgb { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ================= 批六 M3：placeholder（phd-，前缀查重 2026-10-10） ================= */
.phd-x { font-size: 13px; color: var(--muted); }
.phd-swatch {
  width: 22px; height: 22px; padding: 0;
  border: 1px solid var(--border-strong); border-radius: 6px;
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform .12s ease, border-color .15s;
}
.phd-swatch:hover { border-color: var(--accent); transform: scale(1.08); }
.phd-text-input {
  flex: 1 1 220px; min-width: 0;
  padding: 6px 11px; border: 1px solid var(--border-strong); border-radius: 9px;
  background: var(--bg); color: var(--ink); font: inherit; font-size: 13.5px;
}
.phd-text-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.phd-frame {
  display: flex; align-items: center; justify-content: center;
  padding: 14px; min-height: 180px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface-2);
}
.phd-canvas, .phd-svg {
  display: block; max-width: 100%; max-height: 420px; width: auto; height: auto;
  border-radius: 8px; box-shadow: var(--shadow-sm);
}
.phd-empty {
  padding: 26px 16px; text-align: center;
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  font-size: 13px; color: var(--muted);
}

/* ================= 批六 M3：gif-maker（gmk-，前缀查重 2026-10-10） ================= */
/* 帧队列卡片复用 icq-*（队列语言与压缩工具同源），仅补序号角标与结果区 */
.gmk-out { display: flex; flex-direction: column; gap: 8px; }
.gmk-frame {
  position: relative;   /* makeBusy 宿主 */
  display: flex; align-items: center; justify-content: center;
  padding: 14px; min-height: 160px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface-2);
}
.gmk-out-img {
  max-width: 100%; max-height: 380px; width: auto; height: auto;
  border-radius: 8px; box-shadow: var(--shadow-card);
  display: block;
}
.gmk-out-meta {
  font-size: 12.5px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ================= 批次九：趣味工具（2026-10-11） =================
   前缀分配（落笔前全站 grep 查重：均 0 命中）：
   sw- 秒表 / rct- 反应测试 / mz- 迷宫 / gp- 网格纸 / rp- 抽签 / kc- 按键值。
   本批 7 个工具里 5 个是「自治交互件」（无输入→输出主链路），故大量复用既有骨架：
   solo 工作台 + pane-bar + 「更多」pop；这里只补各自的舞台与读数件。
   字号一律用 clamp() 跟随视口：秒表/骰子这类「大字读数」在窄屏不能顶出容器。 */

/* ---------- 共用小件：pop 内的数字输入与复选行（本批 4 个工具都用） ---------- */
.sw-num, .mz-num {
  width: 62px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface); color: var(--ink);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7;
  padding: 3px 6px; min-height: 24px; outline: none;
}
.mz-num-wide { width: 110px; }
.sw-num:focus, .mz-num:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.kc-check, .mz-check, .rp-check {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--ink); white-space: nowrap;
}

/* ================= 秒表 / 倒计时（sw-） ================= */
.sw-body { gap: 12px; }
.sw-display {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 22px 16px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
}
.sw-time {
  font-family: var(--mono); font-size: clamp(34px, 7vw, 62px); line-height: 1.05;
  color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.sw-display[data-running="true"] .sw-time { color: var(--accent-deep); }
.sw-sub { font-size: 12.5px; color: var(--muted); }
.sw-done {
  padding: 10px 14px; border-radius: var(--radius);
  background: var(--warn-soft); color: var(--warn-ink);
  font-size: 13px; font-weight: 600;
}
.sw-dur { display: inline-flex; align-items: center; gap: 4px; }
.sw-dur-u { font-size: 11.5px; color: var(--muted); }
.sw-laphead {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--muted);
}
.sw-laphead > button { margin-left: auto; }
.sw-lapnote { color: var(--faint); }
.sw-laps { display: flex; flex-direction: column; gap: 4px; }
.sw-lap {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1fr); gap: 10px;
  align-items: center; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.sw-lap-i { color: var(--accent-deep); font-weight: 600; }
.sw-lap-s { color: var(--ink); }
.sw-lap-t { color: var(--muted); text-align: right; }
.sw-lapempty { font-size: 12.5px; color: var(--faint); }

/* ================= 反应速度测试（rct-） ================= */
.rct-body { gap: 12px; }
.rct-stage {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: clamp(220px, 38vh, 380px); padding: 20px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); cursor: pointer; user-select: none;
  outline: none; transition: background .12s, border-color .12s;
}
.rct-stage:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }
.rct-stage[data-state="waiting"] { background: var(--warn-soft); border-color: var(--warn); }
.rct-stage[data-state="ready"] { background: var(--ok-soft); border-color: var(--ok); }
.rct-stage[data-state="early"] { background: var(--err-soft); border-color: var(--err); }
.rct-time {
  font-family: var(--mono); font-size: clamp(30px, 6vw, 54px); line-height: 1.1;
  color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums;
}
.rct-msg { font-size: 13px; color: var(--muted); text-align: center; }
.rct-stage[data-state="ready"] .rct-time,
.rct-stage[data-state="ready"] .rct-msg { color: var(--ok-ink); }
.rct-stage[data-state="waiting"] .rct-msg { color: var(--warn-ink); }
.rct-stage[data-state="early"] .rct-time,
.rct-stage[data-state="early"] .rct-msg { color: var(--err-ink); }
.rct-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.rct-stat {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface);
}
.rct-stat-n {
  font-family: var(--mono); font-size: 15px; font-weight: 600;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.rct-stat-l { margin-top: 2px; font-size: 11.5px; color: var(--muted); }

/* ================= 迷宫生成（mz-） ================= */
.mz-body { gap: 12px; }
.mz-stage {
  display: flex; justify-content: center; align-items: flex-start;
  padding: 8px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); overflow: auto;
}
.mz-stage canvas { display: block; max-width: 100%; height: auto; border-radius: 6px; }

/* ================= 网格纸（gp-） ================= */
.gp-body { gap: 12px; }
.gp-stage {
  display: flex; justify-content: center; align-items: flex-start;
  padding: 8px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); overflow: auto;
}
/* 高度驱动、宽度按 viewBox 比例自适应；max-width 兜住窄屏（SVG 自带 meet 不变形） */
.gp-stage svg {
  height: min(66vh, 540px); width: auto; max-width: 100%;
  border-radius: 6px; box-shadow: var(--shadow-sm);
}
.gp-sheet { fill: var(--surface); }
.gp-tick { fill: var(--muted); font-size: 9px; font-family: var(--mono); }

/* ================= 随机点名 / 抽签（rp-） ================= */
.rp-body { gap: 12px; }
.rp-stage {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: clamp(180px, 30vh, 300px); padding: 16px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}
.rp-big {
  font-size: clamp(30px, 6vw, 56px); line-height: 1.15; font-weight: 600;
  color: var(--ink); text-align: center; word-break: break-all;
}
.rp-stage[data-rolling="true"] .rp-big { color: var(--muted); }
/* 骰面：3×3 格，点数 = 面值（≤6 面时用点阵，>6 面回落大号数字） */
.rp-die {
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  gap: 6px; width: 118px; height: 118px; padding: 12px; box-sizing: border-box;
  border: 1px solid var(--border-strong); border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.rp-pip {
  width: 18px; height: 18px; border-radius: 50%; background: transparent;
  align-self: center; justify-self: center;
}
.rp-pip.is-on { background: var(--ink); }
.rp-sub { font-size: 12.5px; color: var(--muted); text-align: center; }
.rp-names, .rp-picked { display: flex; flex-direction: column; gap: 6px; }
/* ★ 显式对冲：top 级 [hidden]{display:none!important} 已兜住，这里再写一遍是本批约定
   （作者 display 与 UA hidden 的博弈历史见 MEMORY：作者规则会压掉 UA 的 hidden） */
.rp-names[hidden], .rp-picked[hidden], .rp-die[hidden] { display: none !important; }
.rp-names-head, .rp-picked-head {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--muted);
}
.rp-names-count, .rp-picked-count { color: var(--faint); }
.rp-picked-head > button { margin-left: auto; }
.rp-textarea {
  width: 100%; min-height: 96px; resize: vertical;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink);
  font-family: var(--mono); font-size: 13px; line-height: 1.7; padding: 10px 12px; outline: none;
}
.rp-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rp-names-hint { font-size: 11.5px; color: var(--faint); }
.rp-picked-box { display: flex; flex-wrap: wrap; gap: 6px; }
.rp-pick {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--ink); font-size: 12.5px;
}
.rp-pick-i { font-family: var(--mono); font-size: 11px; color: var(--accent-deep); }
.rp-picked-empty { font-size: 12.5px; color: var(--faint); }

/* ================= 键盘按键值（kc-） ================= */
.kc-body { gap: 12px; }
.kc-stage {
  display: flex; align-items: center; justify-content: center;
  min-height: 104px; padding: 16px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); outline: none; cursor: text;
  transition: border-color .12s, box-shadow .12s;
}
.kc-stage.is-focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.kc-stage.is-hot { border-style: solid; border-color: var(--accent); }
.kc-hint { font-size: 13px; color: var(--faint); }
.kc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kc-cell {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); min-width: 0;
}
.kc-cell-wide { grid-column: 1 / -1; }
.kc-k { display: block; margin-bottom: 2px; font-size: 11px; color: var(--muted); }
.kc-v {
  display: block; font-family: var(--mono); font-size: 15px; color: var(--ink);
  word-break: break-all;
}
.kc-hhead {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 12.5px; color: var(--muted);
}
.kc-hnote { color: var(--faint); }
.kc-hist { display: flex; flex-direction: column; gap: 4px; }
.kc-hrow {
  display: grid; grid-template-columns: 84px minmax(0, 1fr) 68px 116px; gap: 8px;
  align-items: center; text-align: left; width: 100%;
  padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); cursor: pointer; transition: border-color .12s, background .12s;
}
.kc-hrow:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.kc-hk { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--accent-deep); }
.kc-hc {
  font-family: var(--mono); font-size: 12px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kc-hn { font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right; }
.kc-hm { font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-hm.is-on { color: var(--accent-deep); }
.kc-hempty { font-size: 12.5px; color: var(--faint); }

/* ---------- 窄屏收敛：三列/四列读数在手机上压成两列 ---------- */
@media (max-width: 720px) {
  .kc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rct-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kc-hrow { grid-template-columns: 68px minmax(0, 1fr) 60px; }
  .kc-hm { display: none; }
}

/* ================= 批次十：文件/沙箱工具（2026-10-11） =================
   前缀分配（落笔前全站 grep 查重：均 0 命中）：
   zip- zip-tool / jsp- js-playground / des- crypto-des / smc- sm-crypto /
   pdf- pdf-pages / fnt- font-viewer / sqp- sql-playground。
   本批大量复用既有骨架：文件类走 makeFileStage（fst-*），代码/参数类走 makeWorkbench，
   并沿用批次十新增的「文件」分类令牌 --cat-file。 */

/* ---------- 共用小件：舞台内的复选行与「移除」小钮 ---------- */
.zip-check, .jsp-check {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--ink); white-space: nowrap;
}

/* ================= zip-tool（zip-） ================= */
.zip-drop-ico { width: 30px; height: 30px; color: var(--accent-deep); }
.zip-drop-t { font-size: 14px; font-weight: 600; color: var(--ink); }
.zip-drop-h { font-size: 12px; color: var(--muted); text-align: center; }
.zip-pick { display: flex; gap: 8px; margin-top: 4px; }
/* ★ 作者 display:flex 会压掉 UA 的 [hidden]，须显式对冲（项目既有约定） */
.zip-pick[hidden] { display: none !important; }
.zip-out[hidden], .zip-packlist[hidden], .zip-list[hidden], #btn-zip-pack[hidden] { display: none !important; }

.zip-out, .zip-list, .zip-packlist {
  display: flex; flex-direction: column; gap: 8px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 12px 14px;
}
.zip-out-head, .zip-list-head {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--muted);
}
.zip-out-head > button, .zip-list-head > button { margin-left: auto; }
.zip-out-meta { font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.zip-count { color: var(--faint); font-variant-numeric: tabular-nums; }
.zip-list-body { display: flex; flex-direction: column; gap: 3px; max-height: 320px; overflow: auto; }
/* 条目行：名称 | 原始 | 压缩后 | 压缩率 | 操作（网格保证数值列对齐） */
.zip-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 84px 84px 60px 66px;
  gap: 8px; align-items: center;
  padding: 5px 8px; border-radius: 7px;
  font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.zip-row:not(.is-dir):hover { background: var(--surface-2); }
.zip-row.is-dir { color: var(--muted); }
.zip-rname {
  font-family: var(--mono); color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.zip-row.is-dir .zip-rname { color: var(--muted); }
.zip-rsize, .zip-rpacked, .zip-rpct { font-family: var(--mono); color: var(--muted); text-align: right; }
.zip-rpct { color: var(--ok-ink); }
.zip-rm {
  border: 0; background: transparent; color: var(--faint); cursor: pointer;
  font-size: 11.5px; border-radius: 6px; padding: 2px 8px;
}
.zip-rm:hover { color: var(--err-ink); background: var(--err-soft); }
.zip-empty { font-size: 12.5px; color: var(--faint); padding: 4px 2px; }

/* ================= js-playground（jsp-） ================= */
.jsp-head {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
  font-size: 12.5px; color: var(--muted);
}
.jsp-head > button:first-of-type { margin-left: auto; }
.jsp-count { color: var(--faint); font-variant-numeric: tabular-nums; }
.jsp-console {
  flex: 1; min-height: 240px; overflow: auto;
  display: flex; flex-direction: column; gap: 2px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7;
}
.jsp-line { display: flex; gap: 8px; align-items: baseline; padding: 1px 0; }
.jsp-k {
  flex: 0 0 auto; min-width: 46px; text-align: right;
  font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--faint);
}
.jsp-t { flex: 1; min-width: 0; white-space: pre-wrap; word-break: break-word; color: var(--ink); }
/* 通道分级（与项目「日志分级」口径同源）：log 常规 / info 蓝 / warn 琥珀 / error 红 / return 强调 */
.jsp-line.k-info .jsp-t { color: var(--accent-deep); }
.jsp-line.k-warn .jsp-t { color: var(--warn-ink); }
.jsp-line.k-error .jsp-t { color: var(--err-ink); }
.jsp-line.k-error .jsp-k { color: var(--err-ink); }
.jsp-line.k-table .jsp-t { color: var(--muted); }
.jsp-line.k-return {
  border-top: 1px dashed var(--border); margin-top: 4px; padding-top: 5px;
}
.jsp-line.k-return .jsp-t { color: var(--ok-ink); font-weight: 600; }
.jsp-empty { font-size: 12.5px; color: var(--faint); }
.jsp-status {
  padding-top: 8px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.jsp-status::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px;
  border-radius: 50%; background: var(--accent);
}

/* ---------- 批次十窄屏收敛：条目表去掉「压缩后」列（窄屏保名称+原始大小） ---------- */
@media (max-width: 720px) {
  .zip-row { grid-template-columns: minmax(0, 1fr) 76px 66px; }
  .zip-rpacked, .zip-rpct { display: none; }
}

/* ================= M2：crypto-des / sm-crypto（des- / smc-） =================
   两者都是「密钥列 + 数据输入」的双栏加密台，与既有 aes-crypto 同族：
   复用 .pane-key（左侧密钥列 40%/≤300px）与 .rep（计算报告两列）。 */

/* ---------- crypto-des：密钥列里的 IV 段 ---------- */
.pane .pane-key.col-dir { flex-direction: column; }
.des-iv { display: flex; border-top: 1px solid var(--border); min-height: 0; }
.des-iv[hidden] { display: none !important; }
.pane .pane-key .des-iv > textarea {
  height: auto; align-self: stretch; min-height: 0; resize: none;
  font-size: 12px;
}
.des-rep, .smc-rep { border-top: 1px solid var(--border); }
.des-rep .rep-row:first-child, .smc-rep .rep-row:first-child { border-top: 0; }

/* ---------- sm-crypto：密钥列（SM4 密钥/IV + SM2 公私钥） ---------- */
.pane-body.smc-body { align-items: stretch; }
.smc-iv { display: flex; border-top: 1px solid var(--border); min-height: 0; }
.smc-iv[hidden] { display: none !important; }
.pane .pane-key .smc-iv > textarea {
  height: auto; align-self: stretch; min-height: 0; resize: none; font-size: 12px;
}
/* SM2 公私钥区：三段纵向（标签 + 公钥 + 标签 + 私钥），占满密钥列 */
.smc-sm2 {
  display: flex; flex-direction: column; gap: 4px;
  border-top: 1px solid var(--border); padding: 8px 0 0; min-height: 0; overflow: auto;
}
.smc-sm2[hidden] { display: none !important; }
.smc-lbl {
  font-size: 11.5px; color: var(--muted); padding: 0 12px;
}
.pane .pane-key .smc-sm2 > textarea {
  height: auto; min-height: 62px; resize: none; font-size: 11.5px;
  border: 1px solid var(--border); border-radius: 7px; margin: 0 10px; padding: 6px 8px;
  background: var(--surface-2); color: var(--ink); outline: none;
}
.pane .pane-key .smc-sm2 > textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
/* SM2 签名行：右栏输出区上方的独占一行输入 */
.smc-sig {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px 0;
}
.smc-sig[hidden] { display: none !important; }
.pane .smc-sig > textarea {
  flex: 1; min-width: 0; min-height: 46px; resize: vertical;
  border: 1px solid var(--border); border-radius: 7px; padding: 6px 8px;
  background: var(--surface-2); color: var(--ink); outline: none;
  font-family: var(--mono); font-size: 11.5px;
}
.pane .smc-sig > textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- 窄屏：密钥列转上/下堆叠（沿用既有 .with-key 断点口径） ---------- */
@media (max-width: 860px) {
  .pane .pane-key .des-iv > textarea,
  .pane .pane-key .smc-iv > textarea { min-height: 56px; }
  .pane .pane-key .smc-sm2 > textarea { min-height: 52px; }
  .smc-sig { flex-direction: column; gap: 4px; }
}

/* ================= M3：pdf-pages / font-viewer（pdf- / fnt-） =================
   两者都走文件舞台（fst-*），条目表复用 zip-tool 的 .zip-row / .zip-list 语言
   （本批内三种文件工具观感一致，不再各造一套表格）。此处只补各自专属块。 */

/* ---------- pdf-pages：条目行多一列（上移/下移/移除三个动作） ---------- */
.pdf-row.zip-row { grid-template-columns: minmax(0, 1fr) 84px 64px auto auto; }
.pdf-row .zip-rm { white-space: nowrap; }
/* 结果区与条目区同宽同语言，但结论行要更醒目 */
#pdf-result { font-variant-numeric: tabular-nums; }

/* ---------- font-viewer：信息表（键值两列） ---------- */
.fnt-info { display: flex; flex-direction: column; }
.fnt-kv {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px;
  padding: 6px 2px; border-bottom: 1px dashed var(--border);
  font-size: 12.5px; line-height: 1.7;
}
.fnt-kv:last-child { border-bottom: 0; }
.fnt-k { color: var(--muted); }
.fnt-v {
  color: var(--ink); font-family: var(--mono); word-break: break-all; white-space: pre-wrap;
}

/* 字形放大 + 说明：左 svg 右文字（窄屏改纵向） */
.fnt-glyphrow { display: flex; align-items: center; gap: 16px; }
#fnt-glyph {
  flex: 0 0 auto; width: 160px; height: 160px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); color: var(--ink);
}
.fnt-glyphmeta {
  flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted);
  font-family: var(--mono); word-break: break-all;
}

/* 字符表：等宽方格（自动填充，行高由字号撑） */
.fnt-chars {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px;
  max-height: 260px; overflow: auto; padding: 2px;
}
.fnt-cell {
  aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 7px; background: var(--surface);
  color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
  overflow: hidden;
}
.fnt-cell:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.fnt-cell:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* 试排画布：宽度铺满，高度由 viewBox 比例决定；★ 用 accent 描边的虚线做基线/降部参考 */
#fnt-sample {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); color: var(--ink);
}
#fnt-missing { color: var(--warn-ink); font-variant-numeric: tabular-nums; }

/* ---------- 窄屏 ---------- */
@media (max-width: 720px) {
  .fnt-kv { grid-template-columns: 1fr; gap: 2px; }
  .fnt-k { font-size: 11.5px; }
  .fnt-glyphrow { flex-direction: column; align-items: flex-start; }
  .pdf-row.zip-row { grid-template-columns: minmax(0, 1fr) 64px auto; }
  .pdf-row .zip-rsize { display: none; }
}

/* ================= M4：sql-playground（sqp-） =================
   双栏：左 SQL 编辑 + 表清单，右结果表格。表格是本工具的主角，
   故自建一套 .sqp-table（不用列表页的卡片语言）：等宽数值、表头吸顶、横向可滚、
   NULL 弱化、数字右对齐 —— 与数据库客户端的阅读习惯一致。 */

.sqp-tables {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.sqp-tables-head {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12.5px; color: var(--muted);
}
.sqp-count { color: var(--faint); font-variant-numeric: tabular-nums; }
.sqp-table-list { display: flex; flex-wrap: wrap; gap: 6px; }
.sqp-table {
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--ink); font-family: var(--mono); font-size: 11.5px;
  padding: 3px 10px; cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.sqp-table:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); }
.sqp-empty { font-size: 12.5px; color: var(--faint); padding: 4px 2px; }

/* 结果区 */
.sqp-res-head {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
  font-size: 12.5px; color: var(--muted);
}
.sqp-res-head > button { margin-left: auto; }
.sqp-result { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.sqp-set { display: flex; flex-direction: column; gap: 4px; }
.sqp-set-cap { font-size: 11.5px; color: var(--faint); }
.sqp-set-note { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sqp-note { font-size: 12.5px; color: var(--ok-ink); }
.sqp-table-wrap { overflow: auto; max-height: 52vh; border: 1px solid var(--border); border-radius: var(--radius); }

table.sqp-table {
  border-collapse: collapse; width: 100%;
  font-family: var(--mono); font-size: 12px; line-height: 1.6;
}
.sqp-th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-2); color: var(--muted);
  text-align: left; font-weight: 600; white-space: nowrap;
  padding: 6px 10px; border-bottom: 1px solid var(--border-strong);
}
.sqp-th-i { width: 44px; text-align: right; color: var(--faint); }
.sqp-td {
  padding: 5px 10px; border-bottom: 1px solid var(--border);
  color: var(--ink); white-space: pre; max-width: 320px; overflow: hidden; text-overflow: ellipsis;
}
.sqp-td-i { text-align: right; color: var(--faint); font-variant-numeric: tabular-nums; }
.sqp-td.is-num { text-align: right; font-variant-numeric: tabular-nums; }
.sqp-td.is-null { color: var(--faint); font-style: italic; }
.sqp-td.is-blob { color: var(--muted); font-style: italic; }
tbody tr:hover .sqp-td { background: var(--surface-2); }

/* 报错块：SQLite 原始消息要完整可见（可选中复制去搜索） */
.sqp-err {
  border: 1px solid var(--err); border-radius: var(--radius); background: var(--err-soft);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 4px;
}
.sqp-err-t { font-size: 12.5px; font-weight: 600; color: var(--err-ink); }
.sqp-err-m { font-family: var(--mono); font-size: 12px; color: var(--err-ink); white-space: pre-wrap; word-break: break-word; }
.sqp-status {
  padding-top: 8px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--muted);
}
.sqp-status::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px;
  border-radius: 50%; background: var(--accent);
}

/* 窄屏：表清单与结果表都要能横向滚，别把列压成一字一行 */
@media (max-width: 860px) {
  .sqp-table-wrap { max-height: 42vh; }
  .sqp-td { max-width: 200px; }
}
