/* HerdPrint 交互演示 · 样式
   改配色改这里的 :root 变量；改组件看对应分节注释。*/

  /* ============================================================
     色板取自 App 的 Assets.xcassets（light appearance）
     chrome  #F7F6F3   sidebar #F1F0EC   canvas #E8E7E3
     ink     #1E1D1C   accent  #5E5790
     ============================================================ */
  :root {
    --chrome: rgb(247, 246, 243);
    --sidebar: rgb(241, 240, 236);
    --canvas: rgb(232, 231, 227);
    --paper: #ffffff;
    --ink: rgb(30, 29, 28);
    --ink-2: rgba(30, 29, 28, .58);
    --ink-3: rgba(30, 29, 28, .36);
    --sep: rgba(30, 29, 28, .09);
    --control-fill: #ffffff;
    --control-border: rgba(30, 29, 28, .14);
    --seg-track: rgba(30, 29, 28, .055);
    --seg-thumb: #ffffff;
    --accent: rgb(94, 87, 144);
    --accent-soft: rgba(94, 87, 144, .10);
    --sel: rgba(94, 87, 144, .13);
    --warning: rgb(212, 151, 56);
    --ui-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --mono: "SF Mono", ui-monospace, "Menlo", "Monaco", "Courier New", monospace;
  }

  * { box-sizing: border-box; }

  /* 给读屏与检索器的页面说明，视觉上不占位 */
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  html, body {
    height: 100%;
    margin: 0;
  }

  html { background-color: #FFFBF2; }

  body {
    display: flex;
    align-items: center;
    justify-content: center;
    /* 与 asugar.app 主页同一套底色与光斑 */
    background-color: #FFFBF2;
    background-image:
      radial-gradient(ellipse 1400px 800px at 0% 0%, rgba(255, 210, 120, .42), transparent 60%),
      radial-gradient(ellipse 1200px 700px at 100% 80%, rgba(255, 120, 180, .18), transparent 60%),
      radial-gradient(ellipse 1000px 600px at 50% 110%, rgba(120, 200, 255, .16), transparent 60%);
    font-family: var(--ui-font);
    -webkit-font-smoothing: antialiased;
    color: var(--ink);
    overflow: auto;
  }

  button {
    font-family: inherit;
    color: inherit;
    border: 0;
    background: none;
    padding: 0;
    cursor: default;
  }

  .ic { display: block; width: 18px; height: 18px; color: inherit; flex: none; }


  /* ============================ 舞台与语言栏 ============================ */
  .stage {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 14px;
  }
  .back-link {
    position: absolute;
    top: 0;
    right: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(255, 255, 255, .7);
    color: #3d3b37;
    box-shadow:
      0 0 0 .5px rgba(0, 0, 0, .07),
      0 4px 12px rgba(30, 29, 28, .09);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background .1s linear, color .1s linear, transform .08s ease-out;
  }
  .back-link:hover { background: #ffffff; color: var(--accent); }
  .back-link:active { transform: scale(.95); }
  .back-link svg { width: 15px; height: 15px; }
  /* 与语言栏等宽的左侧区域：放返回按钮，同时让窗口在视口里严格居中 */
  .side-left {
    position: relative;
    flex: none;
    width: 104px;
    align-self: stretch;
  }

  .lang-rail {
    flex: none;
    width: 104px;
    padding: 7px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .62);
    box-shadow:
      0 0 0 .5px rgba(0, 0, 0, .06),
      0 8px 22px rgba(30, 29, 28, .09);
    backdrop-filter: blur(12px) saturate(1.15);
    -webkit-backdrop-filter: blur(12px) saturate(1.15);
    display: flex;
    flex-direction: column;
    gap: 1px;
  }
  .lang-rail-title {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px 6px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .9px;
    color: #8b8983;
    text-transform: uppercase;
  }
  .lang-rail-title svg { width: 9px; height: 9px; }
  #lang-list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1px;
  }
  .lang-item {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 6px;
    border-radius: 6px;
    font-size: 11.5px;
    line-height: 1;
    color: #3d3b37;
    text-align: left;
    transition: background .1s linear, color .1s linear, box-shadow .1s linear;
  }
  .lang-item:hover { background: rgba(30, 29, 28, .05); }
  .lang-item.is-on {
    background: #ffffff;
    color: #413B75;
    font-weight: 500;
    box-shadow:
      inset 0 0 0 1px rgba(94, 87, 144, .32),
      0 1px 2px rgba(30, 29, 28, .06);
  }
  .lang-item .lang-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .lang-item .lang-tag {
    flex: none;
    font-family: var(--mono);
    font-size: 8.5px;
    letter-spacing: .3px;
    color: #adaba5;
  }
  .lang-item.is-on .lang-tag { color: #6a63a0; }

  @media (max-width: 1364px) {
    .lang-rail { width: 64px; }
    .side-left { width: 64px; }
    .lang-rail { padding: 6px; gap: 2px; }
    .lang-rail-title { justify-content: center; padding: 1px 0 5px; }
    .lang-rail-title span { display: none; }
    #lang-list { align-items: center; gap: 2px; }
    .lang-item {
      width: 42px;
      height: 26px;
      padding: 0;
      justify-content: center;
      gap: 0;
      border-radius: 7px;
    }
    .lang-item .lang-name { display: none; }
    .lang-item .lang-tag { display: block; font-size: 9px; letter-spacing: .3px; }
  }

  @media (max-width: 1275px) {
    .stage {
      flex-direction: column;
      align-items: center;
      gap: 10px;
    }
    .side-left {
      position: fixed;
      top: auto;
      bottom: 14px;
      left: 14px;
      width: 34px;
      height: 34px;
      z-index: 40;
    }
    .lang-rail {
      width: auto;
      flex-direction: row;
      align-items: center;
      padding: 5px 7px;
      gap: 3px;
      border-radius: 9px;
    }
    .lang-rail-title { padding: 0 6px 0 2px; }
    .lang-rail-title span { display: none; }
    #lang-list { flex-direction: row; align-items: center; gap: 3px; }
    .lang-item {
      width: 42px;
      height: 24px;
      padding: 0;
      justify-content: center;
      gap: 0;
      border-radius: 6px;
    }
    .lang-item .lang-name { display: none; }
    .lang-item .lang-tag { display: block; font-size: 9px; letter-spacing: .3px; }
  }

  /* ============================ 窗口 ============================ */
  .window {
    position: relative;
    flex: none;
    width: 1120px;
    height: 720px;
    border-radius: 10px;
    background: var(--chrome);
    box-shadow:
      0 0 0 .5px rgba(0, 0, 0, .22),
      0 30px 70px rgba(0, 0, 0, .28),
      0 12px 24px rgba(0, 0, 0, .14);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    user-select: none;
  }

  /* ============================ 标题栏 ============================ */
  .titlebar {
    position: relative;
    height: 52px;
    flex: none;
    background: var(--chrome);
    border-bottom: 1px solid var(--sep);
  }

  .traffic {
    position: absolute;
    left: 20px;
    top: 9px;
    display: flex;
    gap: 8px;
  }
  .traffic i {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: block;
    box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .12);
  }
  .traffic i:nth-child(1) { background: #ff5f57; }
  .traffic i:nth-child(2) { background: #febc2e; }
  .traffic i:nth-child(3) { background: #28c840; }

  .title-block {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    line-height: 1;
  }
  .title-block .app-name {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -.05px;
  }
  .title-block .app-summary {
    margin-top: 3px;
    font-size: 11px;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
  }

  .tb-btn {
    position: absolute;
    top: 5px;
    width: 26px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    color: var(--ink-2);
  }
  .tb-btn:hover { background: rgba(30, 29, 28, .06); color: var(--ink); }
  .tb-btn.is-on { background: rgba(30, 29, 28, .07); color: var(--ink); }
  .tb-btn svg { width: 15px; height: 15px; }
  #btn-sidebar { left: 78px; }
  #btn-inspector { right: 16px; }

  /* ============================ 主体 ============================ */
  .body {
    flex: 1;
    display: flex;
    min-height: 0;
    position: relative;
  }

  .vdiv {
    width: 1px;
    flex: none;
    background: var(--sep);
    position: relative;
  }
  .vdiv.draggable::after {
    content: "";
    position: absolute;
    left: -4px;
    right: -4px;
    top: 0;
    bottom: 0;
    cursor: col-resize;
  }

  /* ============================ 侧栏 ============================ */
  .sidebar {
    width: 244px;
    flex: none;
    background: var(--sidebar);
    display: flex;
    flex-direction: column;
    min-height: 0;
    container-type: inline-size;
  }

  .sidebar-head {
    padding: 16px 8px 8px 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
  }
  .count-label {
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: .5px;
    color: var(--ink-3);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .count-label .doc-ic { display: none; width: 11px; height: 11px; }
  @container (max-width: 232px) {
    .count-label .doc-ic { display: block; }
    .count-label .lbl-long { display: none; }
  }
  .head-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .icon-btn {
    width: 24px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    color: var(--ink-3);
  }
  .icon-btn:hover { background: rgba(30, 29, 28, .06); color: var(--ink-2); }
  .icon-btn.is-on { background: var(--accent-soft); color: var(--accent); }
  .icon-btn svg { width: 14px; height: 14px; }
  .cal-badge { position: relative; }
  .cal-badge .plus {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 1.5px var(--sidebar);
  }
  .cal-badge.is-on .plus { box-shadow: 0 0 0 1.5px #eeedf4; }
  .cal-badge .plus::before,
  .cal-badge .plus::after {
    content: "";
    position: absolute;
    background: var(--sidebar);
    border-radius: 1px;
  }
  .cal-badge .plus::before { left: 1.4px; top: 3px; width: 4.2px; height: 1px; }
  .cal-badge .plus::after { left: 3px; top: 1.4px; width: 1px; height: 4.2px; }

  .list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 8px;
  }
  .list { scrollbar-width: thin; }
  .list::-webkit-scrollbar { width: 9px; }
  .list::-webkit-scrollbar-thumb {
    background: rgba(30, 29, 28, .22);
    border-radius: 5px;
    border: 2px solid var(--sidebar);
  }
  .list::-webkit-scrollbar-track { background: transparent; }

  .rows { display: flex; flex-direction: column; gap: 1px; }

  .row {
    position: relative;
    height: 44px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 10px;
    transition: background .09s linear;
    cursor: default;
  }
  .row:hover { background: rgba(30, 29, 28, .045); }
  .row.is-sel { background: var(--sel); }
  .row.is-sel:hover { background: linear-gradient(rgba(94, 87, 144, .05), rgba(94, 87, 144, .05)), var(--sel); }

  .thumb {
    width: 26px;
    height: 34px;
    flex: none;
    border-radius: 1.5px;
    overflow: hidden;
    background: #fff;
    box-shadow: inset 0 0 0 .5px rgba(30, 29, 28, .13);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .thumb svg { width: 100%; height: 100%; display: block; }

  .row-text { flex: 1; min-width: 0; }
  .row-name {
    font-size: 12.5px;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
  }
  .row.is-sel .row-name { font-weight: 500; }
  .row-detail {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--ink-3);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .row.is-sel .row-detail { color: var(--ink-2); }
  .row.is-alone .row-detail { color: var(--accent); }

  .row-del {
    position: absolute;
    right: 8px;
    top: 9px;
    width: 26px;
    height: 26px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    color: var(--ink-3);
    background: linear-gradient(to right, rgba(241, 240, 236, 0), var(--sidebar) 30%);
  }
  .row:hover .row-del { display: flex; }
  .row.is-sel:hover .row-del { background: linear-gradient(to right, rgba(230, 229, 232, 0), rgb(230, 229, 232) 30%); }
  .row-del:hover { color: var(--ink); }
  .row-del svg { width: 12px; height: 12px; }

  .group-head {
    display: flex;
    align-items: center;
    gap: 2px;
    padding-left: 2px;
    padding-right: 10px;
    height: 24px;
    margin-top: 6px;
  }
  .group-head:first-child { margin-top: 2px; }
  .group-toggle {
    width: 22px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-3);
  }
  .group-toggle svg {
    width: 8px;
    height: 8px;
    transition: transform .12s ease-out;
    transform: rotate(90deg);
  }
  .group-head.is-collapsed .group-toggle svg { transform: rotate(0deg); }
  .group-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--ink-3);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .35px;
  }
  .group-label .dot-sep { color: var(--ink-3); font-weight: 400; }
  .group-label .g-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .group-label svg { width: 10px; height: 10px; flex: none; }

  .add-files {
    position: relative;
    height: 44px;
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 18px;
    color: var(--ink-2);
    font-size: 12.5px;
    border-top: 1px solid var(--sep);
  }
  .add-files:hover { background: rgba(255, 255, 255, .65); }
  .add-files svg.plus { width: 12px; height: 12px; }
  .add-files .chev {
    margin-left: auto;
    width: 8px;
    height: 8px;
    color: var(--ink-3);
  }

  /* ============================ 画布 ============================ */
  .canvas {
    position: relative;
    flex: 1;
    min-width: 0;
    background: var(--canvas);
    overflow: hidden;
  }

  .paper-scroll {
    position: absolute;
    inset: 0;
    display: flex;
    overflow: auto;
  }

  .paper {
    position: relative;
    background: var(--paper);
    overflow: hidden;
    margin: auto;
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, .06),
      0 1px 2px rgba(0, 0, 0, .10),
      0 12px 15px rgba(30, 29, 28, .20);
    flex: none;
  }
  .paper-inner { position: absolute; inset: 0; overflow: hidden; }

  .inv {
    position: absolute;
    background: #fff;
    overflow: hidden;
  }
  .inv .doc { width: 100%; height: 100%; display: block; }
  .inv.is-sel::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1.5px solid var(--accent);
    box-shadow: 0 0 3px rgba(94, 87, 144, .45);
    pointer-events: none;
  }
  .inv-badge {
    position: absolute;
    top: 0;
    right: 0;
    height: 18px;
    padding: 0 5px;
    background: var(--accent);
    color: #fff;
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 600;
    line-height: 18px;
    z-index: 3;
  }

  .safe-margin {
    position: absolute;
    border: 1px dashed rgba(30, 29, 28, .13);
    border-radius: 1.5px;
    pointer-events: none;
  }

  .group-mark {
    position: absolute;
    font-size: 7.5pt;
    color: #6b6b6b;
    white-space: nowrap;
    pointer-events: none;
    line-height: 1;
  }

  .page-footer {
    position: absolute;
    font-size: 7.5pt;
    color: #6b6b6b;
    pointer-events: none;
    line-height: 1;
    transform: translate(-50%, 0);
  }

  .paper-wm { position: absolute; inset: 0; pointer-events: none; }

  /* ============================ 工具条（rail） ============================ */
  .rail {
    position: absolute;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    gap: 2px;
  }
  .rail-left { left: 0; width: 36px; }
  .rail-right { right: 0; width: 40px; }

  .rail-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-2);
    border-radius: 5px;
  }
  .rail-right .rail-btn { width: 32px; height: 32px; }
  .rail-btn svg { width: 18px; height: 18px; }
  .rail-right .rail-btn svg { width: 20px; height: 20px; }
  .rail-btn:hover { color: var(--ink); }
  .rail-btn.is-active { color: var(--accent); }
  .rail-btn.is-disabled { color: rgba(30, 29, 28, .16); }
  .rail-sep {
    width: 18px;
    height: 1px;
    background: var(--sep);
    margin: 3px 0;
    flex: none;
  }

  .sel-name {
    position: absolute;
    right: 12px;
    bottom: 10px;
    max-width: 440px;
    text-align: right;
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--ink-3);
    pointer-events: none;
    line-height: 1.35;
  }

  /* ============================ 检查器 ============================ */
  .inspector {
    width: 268px;
    flex: none;
    background: var(--chrome);
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .insp-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 22px 12px;
  }
  .insp-scroll { scrollbar-width: thin; }
  .insp-scroll::-webkit-scrollbar { width: 9px; }
  .insp-scroll::-webkit-scrollbar-thumb {
    background: rgba(30, 29, 28, .2);
    border-radius: 5px;
    border: 2px solid var(--chrome);
  }

  .section + .section { margin-top: 18px; }
  .section-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
  }
  .section-title {
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: .5px;
    color: var(--ink-3);
  }
  .section-trail {
    margin-left: auto;
    font-size: 11.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
  }

  .file-name {
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px;
  }

  .kv {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--ink-2);
  }
  .kv b {
    color: var(--ink);
    font-family: var(--mono);
    font-size: 11.5px;
    font-weight: 600;
  }

  .scale-ends {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10.5px;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
  }
  .link-btn {
    color: var(--accent);
    font-size: 10.5px;
  }
  .link-btn:hover { text-decoration: underline; }
  .link-btn.is-off { color: var(--ink-3); pointer-events: none; }

  .menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 26px;
    padding: 0 9px;
    background: var(--control-fill);
    border: 1px solid var(--control-border);
    border-radius: 5px;
    font-size: 12.5px;
    color: var(--ink);
    text-align: left;
  }
  .menu-btn:hover { border-color: rgba(30, 29, 28, .24); }
  .menu-btn span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .menu-btn svg { width: 8px; height: 8px; color: var(--ink-3); }

  .layout-group { display: flex; flex-direction: column; gap: 8px; }
  .layout-group .menu-btn { width: 100%; }

  .seg {
    display: flex;
    padding: 2px;
    height: 24px;
    background: var(--seg-track);
    border-radius: 6px;
    gap: 0;
  }
  .seg-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11.5px;
    color: var(--ink-2);
    border-radius: 4.5px;
    white-space: nowrap;
    padding: 0 4px;
  }
  .seg-item.is-sel {
    color: var(--ink);
    font-weight: 500;
    background: var(--seg-thumb);
    box-shadow: 0 1px 1.5px rgba(30, 29, 28, .14);
  }
  .seg-item:not(.is-sel):hover { color: var(--ink); }

  .tall-seg { height: 24px; }

  .insp-foot {
    flex: none;
    padding: 0 22px 16px;
    background: var(--chrome);
  }

  .usage-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 7px;
  }
  .usage-grid {
    display: grid;
    grid-template-columns: repeat(8, 15px);
    gap: 5px 6px;
    margin-bottom: 7px;
  }
  .cell {
    width: 15px;
    height: 21px;
    border-radius: 1.5px;
    border: 1px dashed var(--control-border);
  }
  .cell.used {
    background: rgba(94, 87, 144, .16);
    border: 1px solid rgba(94, 87, 144, .35);
  }
  .usage-note {
    font-size: 10.5px;
    color: var(--ink-3);
    line-height: 1.4;
    margin-bottom: 10px;
  }

  .btn-primary {
    width: 100%;
    height: 32px;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
  }
  .btn-primary:hover { background: rgb(103, 96, 155); }
  .btn-primary:active { background: rgba(94, 87, 144, .82); }
  .btn-primary.is-off {
    background: var(--control-fill);
    color: var(--ink-3);
    pointer-events: none;
  }
  .section.is-dim { opacity: .55; pointer-events: none; }

  .btn-secondary {
    position: relative;
    width: 100%;
    height: 30px;
    margin-top: 10px;
    border-radius: 6px;
    background: var(--control-fill);
    border: 1px solid var(--control-border);
    color: var(--ink-2);
    font-size: 12.5px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .btn-secondary:hover { background: #fcfcfa; }
  .btn-secondary .chev {
    position: absolute;
    right: 12px;
    width: 8px;
    height: 8px;
    color: var(--ink-3);
  }

  /* ------- 配置面板（布局 / 水印） ------- */
  .config-head {
    flex: none;
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--sep);
  }
  .back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    color: var(--accent);
  }
  .back-btn svg { width: 9px; height: 9px; }
  .back-btn:hover { text-decoration: underline; }

  .config-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 18px;
  }
  .config-body { scrollbar-width: thin; }
  .config-body::-webkit-scrollbar { width: 9px; }
  .config-body::-webkit-scrollbar-thumb {
    background: rgba(30, 29, 28, .2);
    border-radius: 5px;
    border: 2px solid var(--chrome);
  }

  .cfg-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
  }
  .cfg-title { font-size: 13px; font-weight: 600; }
  .cfg-title-row .paper-name {
    margin-left: auto;
    font-size: 11.5px;
    color: var(--ink-2);
  }

  .cfg-label {
    font-size: 11.5px;
    color: var(--ink-2);
    margin-bottom: 5px;
  }
  .cfg-block + .cfg-block { margin-top: 12px; }
  .cfg-hint {
    font-size: 10.5px;
    color: var(--ink-2);
    line-height: 1.4;
    margin-top: 5px;
  }
  .cfg-hint.dim { color: var(--ink-3); }

  .layout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 8px;
  }
  .layout-card {
    min-height: 56px;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: var(--control-fill);
    border: 1px solid var(--control-border);
    border-radius: 6px;
    color: var(--ink);
  }
  .layout-card svg { width: 20px; height: 20px; }
  .layout-card span {
    font-size: 11.5px;
    text-align: center;
    line-height: 1.15;
  }
  .layout-card:hover { border-color: rgba(30, 29, 28, .28); }
  .layout-card.is-sel {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
  }

  .switch {
    width: 26px;
    height: 15px;
    border-radius: 8px;
    background: var(--control-border);
    position: relative;
    flex: none;
    transition: background .09s linear;
  }
  .switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 1px rgba(0, 0, 0, .12);
    transition: transform .09s linear;
  }
  .switch.on { background: var(--accent); }
  .switch.on::after { transform: translateX(11px); }

  .wm-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--ink-2);
    margin-bottom: 6px;
  }
  .wm-row .switch { margin-left: auto; }

  .text-field {
    width: 100%;
    height: 24px;
    padding: 0 7px;
    font-family: inherit;
    font-size: 12px;
    color: var(--ink);
    background: var(--control-fill);
    border: 1px solid var(--control-border);
    border-radius: 4px;
    outline: none;
    user-select: text;
  }
  .text-field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(94, 87, 144, .16); }

  .num-row {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
  }
  .num-field {
    width: 58px;
    height: 22px;
    padding: 0 5px;
    text-align: right;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink);
    background: var(--control-fill);
    border: 1px solid var(--control-border);
    border-radius: 4px;
    outline: none;
    user-select: text;
  }
  .num-field:focus { border-color: var(--accent); }
  .unit { font-family: var(--mono); font-size: 11px; color: var(--ink-2); width: 18px; }

  .wm-ends {
    display: flex;
    justify-content: space-between;
    font-family: var(--mono);
    font-size: 10px;
    color: var(--ink-3);
    margin-top: 1px;
  }

  .divider { height: 1px; background: var(--sep); margin: 12px 0; }

  /* ============================ 状态栏 ============================ */
  .statusbar {
    position: relative;
    height: 36px;
    flex: none;
    background: var(--chrome);
    border-top: 1px solid var(--sep);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 8px;
  }

  .pro-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 6px;
    border-radius: 5px;
  }
  .pro-btn:hover { background: rgba(30, 29, 28, .05); }
  .pro-btn svg { width: 13px; height: 13px; color: var(--accent); }
  .pro-btn .pro-word { font-size: 11.5px; font-weight: 500; color: var(--ink-2); }
  .pro-btn .pro-detail { font-size: 10.5px; font-weight: 500; color: var(--accent); margin-left: 4px; }

  .status-div { width: 1px; height: 15px; background: var(--sep); flex: none; }
  .status-summary {
    font-size: 11.5px;
    color: var(--ink-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .pager {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .pager .num {
    font-family: var(--mono);
    font-size: 11.5px;
    font-weight: 500;
    min-width: 42px;
    text-align: center;
  }
  .step-btn {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-2);
    border-radius: 4px;
  }
  .step-btn:hover { background: rgba(30, 29, 28, .06); }
  .step-btn svg { width: 11px; height: 11px; }
  .step-btn.is-off { color: rgba(30, 29, 28, .2); }
  .step-btn.is-off:hover { background: none; }

  .status-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .status-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    color: var(--ink);
    padding: 0 2px;
  }
  .status-toggle:hover .switch { box-shadow: 0 0 0 3px rgba(30, 29, 28, .05); }
  .fit-btn { font-size: 11.5px; color: var(--ink-2); padding: 0 2px; }
  .fit-btn:hover { color: var(--ink); }
  .zoom-num {
    font-family: var(--mono);
    font-size: 11.5px;
    font-weight: 500;
    width: 38px;
    text-align: center;
  }
  .statusbar.is-empty .pager,
  .statusbar.is-empty .status-right { display: none; }

  /* ============================ 菜单 ============================ */
  .menu {
    position: absolute;
    z-index: 80;
    padding: 5px;
    background: var(--chrome);
    border: 1px solid var(--control-border);
    border-radius: 9px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .08);
    display: none;
    min-width: 160px;
  }
  .menu.open { display: block; }
  .menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 32px;
    padding: 8px 10px;
    border-radius: 5px;
    font-size: 12.5px;
    color: var(--ink);
    text-align: left;
    white-space: nowrap;
  }
  .menu-item:hover { background: rgba(94, 87, 144, .12); }
  .menu-item .key {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--ink-3);
  }
  .menu-item .tick { width: 12px; height: 12px; color: var(--accent); visibility: hidden; }
  .menu-item.is-checked .tick { visibility: visible; }
  .menu-sep { height: 1px; background: var(--sep); margin: 4px 6px; }



  /* ===== 列表：金额列 / 分组小计 / 待处理计数 ===== */
  .row-amount {
    flex: none;
    min-width: 62px;
    text-align: right;
    font-family: var(--mono);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    transition: margin-right .09s linear;
  }
  .row:hover .row-amount { margin-right: 26px; }
  .row-amount.is-review { color: var(--ink-3); font-weight: 400; }
  .row-amount.is-unread { color: var(--ink-3); font-weight: 400; }
  .row-amount.is-manual { position: relative; }
  .row-amount.is-manual::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 1px;
    height: 1.5px;
    background: rgb(201, 145, 40);
    border-radius: 1px;
  }
  .row-amount.is-changed::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 1px;
    height: 1.5px;
    background: var(--accent);
    border-radius: 1px;
  }
  .group-total {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
  }
  .head-pending {
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 500;
    min-width: 13px;
    height: 20px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
  }
  .head-pending:hover { background: rgba(30, 29, 28, .06); }
  .head-pending.is-on { background: rgba(94, 87, 144, .14); color: var(--accent); }
  .head-pending.is-done { color: var(--ink-3); }

  .pending-empty {
    padding: 28px 18px 0;
    text-align: center;
    color: var(--ink-2);
    font-size: 11.5px;
    line-height: 1.5;
  }
  .pending-empty .check {
    width: 18px; height: 18px;
    margin: 0 auto 6px;
    color: var(--accent);
  }
  .pending-empty button {
    margin-top: 8px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--accent);
  }

  /* ===== 纸上：日期框 / 金额框 / 遮盖 ===== */
  .date-box {
    position: absolute;
    border: 1.5px solid currentColor;
    background: var(--box-fill, rgba(94, 87, 144, .12));
    cursor: default;
    z-index: 6;
  }
  .date-box.is-confirmed { border-width: 2px; }
  .date-box .box-tag {
    position: absolute;
    left: -1px;
    top: -18px;
    height: 16px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 600;
    color: #fff;
    background: currentColor;
    white-space: nowrap;
  }
  .amount-box {
    position: absolute;
    border: 1.5px solid rgb(217, 158, 0);
    background: rgba(217, 158, 0, .16);
    cursor: default;
    z-index: 7;
  }
  .amount-box .box-tag {
    position: absolute;
    left: -1px;
    top: -18px;
    height: 16px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 600;
    color: #fff;
    background: rgb(217, 158, 0);
    white-space: nowrap;
  }
  .mask-block {
    position: absolute;
    background: #111111;
    z-index: 8;
  }
  .mask-word {
    position: absolute;
    border: 1px solid rgba(94, 87, 144, .8);
    background: rgba(94, 87, 144, .14);
    z-index: 7;
    cursor: default;
  }
  .mask-word:hover { background: rgba(94, 87, 144, .22); }

  /* ===== 纸下胶囊条 ===== */
  .canvas-bar {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    gap: 10px;
    height: 34px;
    padding: 0 12px;
    border-radius: 17px;
    background: rgba(252, 251, 249, .88);
    backdrop-filter: blur(14px) saturate(1.3);
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    box-shadow: 0 1px 0 rgba(30,29,28,.06), 0 3px 8px rgba(30,29,28,.18), 0 0 0 .5px rgba(30,29,28,.12);
    font-size: 12px;
    color: var(--ink-2);
    z-index: 20;
    white-space: nowrap;
    max-width: calc(100% - 24px);
    overflow: hidden;
  }
  .canvas-bar > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .canvas-bar.show { display: flex; }
  .canvas-bar .bar-link { color: var(--accent); font-size: 12px; }
  .canvas-bar .bar-link:hover { text-decoration: underline; }
  .canvas-bar .swatch { width: 7px; height: 7px; border-radius: 50%; flex: none; }
  .canvas-bar .mono { font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: var(--ink); }
  .canvas-bar .spin {
    width: 12px; height: 12px; flex: none;
    border: 1.5px solid rgba(30,29,28,.18);
    border-top-color: rgba(30,29,28,.55);
    border-radius: 50%;
    animation: bar-spin .7s linear infinite;
  }
  @keyframes bar-spin { to { transform: rotate(360deg); } }

  /* ===== 状态栏进度 ===== */
  .status-progress {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-3);
    white-space: nowrap;
  }
  .status-progress .spin {
    width: 11px; height: 11px;
    border: 1.5px solid rgba(30,29,28,.16);
    border-top-color: rgba(30,29,28,.5);
    border-radius: 50%;
    animation: bar-spin .7s linear infinite;
  }

  /* ===== 汇总页（纸上） ===== */
  .summary-sheet { position: absolute; inset: 0; background: #fff; }
  .summary-sheet .s-title { font-weight: 600; color: var(--ink); }
  .summary-sheet .s-sub { color: var(--ink-2); }
  .summary-sheet .s-row { display: flex; align-items: center; color: var(--ink); border-bottom: .5px solid rgba(30,29,28,.12); }
  .summary-sheet .s-dot { border-radius: 50%; flex: none; }
  .summary-sheet .s-name { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .summary-sheet .s-count { text-align: right; font-variant-numeric: tabular-nums; }
  .summary-sheet .s-amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
  .summary-sheet .s-head { display: flex; align-items: center; color: var(--ink-2); font-weight: 600; border-bottom: .8px solid rgba(30,29,28,.5); }
  .summary-sheet .s-total { display: flex; align-items: baseline; border-top: .8px solid rgba(30,29,28,.5); }

  /* ===== 弹窗（金额汇总 / 金额录入） ===== */
  .sheet-layer {
    position: absolute;
    inset: 0;
    z-index: 140;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(30, 29, 28, .12);
  }
  .sheet-layer.show { display: flex; }
  .sheet-card {
    background: var(--chrome);
    border-radius: 10px;
    box-shadow: 0 0 0 .5px rgba(0,0,0,.16), 0 24px 60px rgba(0,0,0,.28), 0 6px 16px rgba(0,0,0,.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .sheet-head {
    flex: none;
    height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: var(--control-fill);
    border-bottom: 1px solid var(--sep);
  }
  .sheet-head .t { font-size: 13px; font-weight: 600; }
  .sheet-head .s { font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
  .sheet-body { flex: 1; min-height: 0; padding: 16px 26px 20px; display: flex; flex-direction: column; }
  .sum-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--sep);
  }
  .sum-row .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
  .sum-row .gname {
    width: 96px;
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--ink-2);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .sum-row .gcount { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
  .sum-row .pending-tag {
    font-family: var(--mono);
    font-size: 10px;
    color: rgb(150, 105, 20);
    background: rgba(212, 151, 56, .16);
    border-radius: 3px;
    padding: 1px 5px;
  }
  .sum-row .sub { margin-left: auto; font-family: var(--mono); font-size: 12.5px; font-weight: 600; }
  .sum-total { padding-top: 14px; border-top: 1px solid var(--sep); margin-top: 10px; }
  .sum-total .line { display: flex; align-items: baseline; gap: 8px; }
  .sum-total .label { font-size: 11.5px; color: var(--ink-2); }
  .sum-total .value { margin-left: auto; font-family: var(--mono); font-size: 20px; font-weight: 600; }
  .sum-gap { margin-top: 4px; font-size: 10.5px; color: var(--ink-3); }
  .sheet-foot { display: flex; align-items: center; gap: 8px; padding-top: 14px; }
  .sheet-foot .hint { font-size: 10.5px; color: var(--ink-3); }
  .sheet-foot .done {
    margin-left: auto;
    width: 96px;
    height: 32px;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .sheet-foot .done:hover { background: rgb(103, 96, 155); }

  .entry-label { font-size: 11.5px; color: var(--ink-2); margin-bottom: 6px; }
  .entry-field {
    width: 100%;
    height: 30px;
    padding: 0 9px;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--control-border);
    border-radius: 5px;
    outline: none;
    user-select: text;
  }
  .entry-field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(94,87,144,.16); }
  .entry-hint { font-size: 10.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.4; }
  .entry-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
  .entry-actions .ghost {
    height: 28px; padding: 0 12px;
    border-radius: 5px;
    border: 1px solid var(--control-border);
    background: #fff;
    font-size: 12px;
    color: var(--ink-2);
  }
  .entry-actions .primary {
    height: 28px; padding: 0 14px;
    border-radius: 5px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
  }
  .entry-actions .primary:hover { background: rgb(103, 96, 155); }

  /* ===== 自定义版式编辑器 ===== */
  .custom-panel {
    position: absolute;
    right: 12px;
    top: 12px;
    width: 148px;
    padding: 10px;
    background: rgba(252, 251, 249, .94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 9px;
    box-shadow: 0 0 0 .5px rgba(0,0,0,.14), 0 8px 24px rgba(0,0,0,.14);
    z-index: 24;
    display: none;
    flex-direction: column;
    gap: 6px;
  }
  .custom-panel.show { display: flex; }
  .custom-panel .cp-head {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--accent);
  }
  .custom-panel .cp-head svg { width: 12px; height: 12px; }
  .custom-panel .cp-hint {
    font-size: 10px;
    line-height: 1.35;
    color: var(--ink-3);
  }
  .custom-panel hr { border: 0; height: 1px; background: var(--sep); margin: 2px 0; }
  .cp-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 7px;
    border-radius: 5px;
    font-size: 11px;
    color: var(--ink);
    text-align: left;
  }
  .cp-btn:hover { background: rgba(30, 29, 28, .06); }
  .cp-btn svg { width: 11px; height: 11px; color: var(--ink-2); flex: none; }
  .cp-btn.is-primary { background: var(--accent); color: #fff; justify-content: center; font-weight: 500; }
  .cp-btn.is-primary:hover { background: rgb(103, 96, 155); }
  .cp-btn.is-primary svg { color: #fff; }
  .cp-list { display: flex; flex-direction: column; gap: 4px; }
  .cp-list .cp-btn { height: 30px; font-size: 11.5px; }
  .cp-list .cp-btn svg { width: 12px; height: 12px; }
  .cp-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10.5px;
    color: var(--ink-3);
    margin-bottom: 10px;
  }
  .cp-status b { color: var(--ink); font-weight: 600; }
  .cp-btn.is-off { color: var(--ink-3); pointer-events: none; }
  .cp-btn.is-off svg { color: var(--ink-3); }

  .region {
    position: absolute;
    border: 1px dashed rgba(94, 87, 144, .55);
    background: rgba(94, 87, 144, .03);
    z-index: 4;
  }
  .region.is-sel {
    border: 1.5px solid var(--accent);
    background: rgba(94, 87, 144, .07);
    box-shadow: 0 0 0 3px rgba(94, 87, 144, .12);
  }
  .region .r-label {
    position: absolute;
    left: 4px;
    top: 4px;
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 600;
    color: var(--accent);
    background: rgba(255, 255, 255, .85);
    padding: 1px 4px;
    border-radius: 3px;
  }


  /* ===== 遮盖面板 / 小按钮 ===== */
  .chip {
    height: 26px;
    padding: 0 9px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid var(--control-border);
    font-size: 11.5px;
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }
  .chip:hover { border-color: rgba(30,29,28,.26); }
  .chip.is-on { border-color: var(--accent); box-shadow: inset 0 0 0 .5px var(--accent); }
  .chip.icon { padding: 0; }
  .mask-hint { font-size: 11.5px; color: var(--ink-2); line-height: 1.42; }
  .mask-hint.dim { color: var(--ink-3); font-size: 10.5px; }
  .mask-count {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--ink);
    margin-bottom: 6px;
  }
  .mask-count .link-btn { margin-left: auto; }
  .mask-item {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    border-radius: 5px;
  }
  .mask-item.is-sel { background: var(--accent-soft); }
  .mask-item > button:first-child {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ink);
    padding-left: 4px;
  }
  .mask-item.is-sel > button:first-child { color: var(--accent); }
  .mask-item .sq { width: 10px; height: 10px; }
  .mask-item .del { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; color: var(--ink-3); }
  .mask-item .del svg { width: 11px; height: 11px; }
  .mask-item .del:hover { color: var(--ink); }
  .mask-clear {
    margin-top: 6px;
    font-size: 11.5px;
    color: rgb(170, 48, 48);
    padding: 2px 0;
  }
  .mask-reading { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); margin-top: 10px; }
  .mask-reading .spin,
  .mask-words .spin {
    width: 12px; height: 12px; flex: none;
    border: 1.5px solid rgba(30,29,28,.18);
    border-top-color: rgba(30,29,28,.55);
    border-radius: 50%;
    animation: bar-spin .7s linear infinite;
  }
  .mask-words { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; }
  .mask-word-row {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 26px;
    padding: 0 4px;
    border-radius: 5px;
    cursor: default;
  }
  .mask-word-row:hover { background: rgba(30, 29, 28, .05); }
  .mask-word-row .cbx {
    width: 13px; height: 13px;
    border-radius: 3px;
    border: 1px solid rgba(30,29,28,.28);
    background: #fff;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
  }
  .mask-word-row .cbx.on { background: var(--accent); border-color: var(--accent); }
  .mask-word-row .cbx svg { width: 9px; height: 9px; }
  .mask-word-row .wt {
    flex: 1;
    font-size: 11.5px;
    color: var(--ink);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .mask-word-row .wk {
    font-family: var(--mono);
    font-size: 9.5px;
    color: var(--ink-3);
    flex: none;
  }

  .inspector.is-dim { opacity: .5; pointer-events: none; }

  .ruler {
    position: absolute;
    z-index: 3;
    display: none;
    pointer-events: none;
    border-radius: 2px;
    background-color: rgba(240, 239, 235, .88);
    box-shadow: 0 0 0 .5px rgba(30,29,28,.10);
  }
  .ruler.show { display: block; }
  #ruler-h {
    height: 13px;
    background-image: repeating-linear-gradient(to right, rgba(30,29,28,.30) 0 1px, transparent 1px 10px);
    background-repeat: repeat-x;
    background-size: 10px 4px;
    background-position: left bottom;
  }
  #ruler-v {
    width: 13px;
    background-image: repeating-linear-gradient(to bottom, rgba(30,29,28,.30) 0 1px, transparent 1px 10px);
    background-repeat: repeat-y;
    background-size: 4px 10px;
    background-position: right top;
  }

  /* ===== 自绘滑块（跨引擎一致，不依赖私有伪元素） ===== */
  .mslider {
    position: relative;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: default;
    outline: none;
    touch-action: none;
  }
  .mslider-track {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 2px;
    background: rgba(30, 29, 28, .12);
    overflow: hidden;
  }
  .mslider-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--p, 50%);
    background: var(--track-fill, var(--accent));
    border-radius: 2px;
  }
  .mslider-thumb {
    position: absolute;
    left: var(--p, 50%);
    width: 20px;
    height: 20px;
    margin-left: -10px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .28), 0 0 0 .5px rgba(0, 0, 0, .08);
    pointer-events: none;
  }
  .mslider:focus-visible .mslider-thumb {
    box-shadow: 0 0 0 3px rgba(94, 87, 144, .28), 0 1px 2px rgba(0, 0, 0, .28);
  }

  /* ===== 定位闪烁 ===== */
  @keyframes row-flash {
    0%   { background: rgba(94, 87, 144, .22); box-shadow: inset 0 0 0 1.5px rgba(94, 87, 144, .65); }
    55%  { background: rgba(94, 87, 144, .12); box-shadow: inset 0 0 0 1.5px rgba(94, 87, 144, .45); }
    100% { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(94, 87, 144, 0); }
  }
  .row.is-flash { animation: row-flash 1.15s ease-out; }

  /* ===== 导出面板 ===== */
  .opt-rows { display: flex; flex-direction: column; gap: 10px; }
  .opt-row { display: flex; align-items: center; gap: 12px; min-height: 30px; }
  .opt-label {
    width: 92px;
    flex: none;
    text-align: right;
    font-size: 12px;
    color: var(--ink-2);
  }
  .opt-seg {
    display: flex;
    padding: 2px;
    background: var(--seg-track);
    border-radius: 7px;
    flex: none;
  }
  .opt-seg .seg-item { padding: 0 12px; height: 24px; border-radius: 5px; flex: none; }
  .opt-seg .seg-item.is-off { color: var(--ink-3); pointer-events: none; }
  .opt-path {
    flex: 1;
    min-width: 0;
    height: 28px;
    padding: 0 9px;
    font-size: 12px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--control-border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .opt-choose {
    height: 30px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid var(--control-border);
    background: #fff;
    font-size: 12.5px;
    color: var(--ink-2);
    flex: none;
  }
  .opt-choose:hover { border-color: rgba(30,29,28,.24); }
  .opt-hint {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--ink-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .export-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 58px;
    padding: 0 14px;
    background: #fff;
    border-radius: 7px;
  }
  .export-summary .mini-paper {
    width: 34px;
    height: 42px;
    flex: none;
    background: #fff;
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0,0,0,.08);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 5px;
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 600;
    color: var(--accent);
  }
  .export-summary .s-text { font-size: 12.5px; font-weight: 500; }
  .export-summary .s-detail { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
  .export-summary .s-right { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
  .sheet-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
  .sheet-actions .ghost {
    height: 30px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid var(--control-border);
    background: #fff;
    font-size: 12.5px;
    color: var(--ink-2);
  }
  .sheet-actions .ghost:hover { border-color: rgba(30,29,28,.24); }
  .sheet-actions .primary {
    height: 30px;
    padding: 0 14px;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-size: 12.5px;
    font-weight: 500;
  }
  .sheet-actions .primary:hover { background: rgb(103, 96, 155); }

  /* ===== 下载引导 ===== */
  .guide-card {
    width: 560px;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(180deg, #FBF9FF 0%, #F5F2FC 46%, #F7F6F3 100%);
    box-shadow: 0 0 0 .5px rgba(0,0,0,.14), 0 30px 70px rgba(28, 22, 60, .3), 0 8px 20px rgba(0,0,0,.12);
    display: flex;
    flex-direction: column;
    position: relative;
  }
  .guide-glow {
    position: absolute;
    left: 50%;
    top: -120px;
    width: 420px;
    height: 260px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(94, 87, 144, .4), rgba(94, 87, 144, 0) 70%);
    pointer-events: none;
  }
  .guide-inner {
    position: relative;
    padding: 30px 38px 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .guide-icon {
    width: 84px;
    height: 84px;
    border-radius: 20px;
    box-shadow: 0 10px 24px rgba(40, 30, 90, .26), 0 0 0 .5px rgba(0,0,0,.08);
    background: #fff;
    overflow: hidden;
  }
  .guide-icon img { width: 100%; height: 100%; display: block; }
  .guide-title {
    margin-top: 16px;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -.3px;
    color: #1E1D1C;
  }
  .guide-sub {
    margin-top: 5px;
    font-size: 12px;
    color: var(--accent);
    font-weight: 500;
  }
  .guide-body {
    margin-top: 14px;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--ink-2);
    max-width: 430px;
  }
  .guide-features {
    margin-top: 18px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 14px;
    text-align: left;
  }
  .guide-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--ink-2);
    background: rgba(255, 255, 255, .7);
    border: 1px solid rgba(94, 87, 144, .14);
    border-radius: 8px;
    padding: 7px 10px;
  }
  .guide-feature svg { width: 13px; height: 13px; color: var(--accent); flex: none; }
  .guide-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
  }
  .store-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 320px;
    height: 42px;
    border-radius: 10px;
    background: #17161A;
    color: #fff;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .22);
    transition: transform .08s ease-out, background .08s linear;
  }
  .store-btn:hover { background: #24222A; }
  .store-btn:active { transform: scale(.985); }
  .store-btn svg { width: 15px; height: 15px; }
  .guide-later {
    font-size: 12px;
    color: var(--ink-3);
    padding: 4px 8px;
    border-radius: 5px;
  }
  .guide-later:hover { color: var(--ink-2); background: rgba(30,29,28,.05); }
  .guide-web-link {
    font-size: 11px;
    color: var(--ink-3);
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 4px;
  }
  .guide-web-link:hover { color: var(--accent); text-decoration: underline; }
  .guide-foot {
    margin-top: 14px;
    font-size: 10.5px;
    color: var(--ink-3);
  }
  /* ============================ Toast ============================ */
  .toast-host {
    position: absolute;
    left: 50%;
    bottom: 50px;
    transform: translateX(-50%);
    z-index: 170;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
  }
  .toast {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 32px;
    max-width: 520px;
    padding-left: 14px;
    padding-right: 6px;
    border-radius: 16px;
    background: rgba(252, 251, 249, .86);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    box-shadow: 0 3px 8px rgba(30, 29, 28, .2), 0 0 0 .5px rgba(30, 29, 28, .14);
    pointer-events: auto;
    animation: toast-in .16s ease-out;
  }
  @keyframes toast-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
  }
  .toast .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
  .toast.warn .dot { background: var(--warning); }
  .toast .msg {
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .toast .vsep { width: 1px; height: 14px; background: var(--sep); flex: none; }
  .toast .dismiss {
    font-size: 12px;
    color: var(--ink-2);
    height: 28px;
    padding: 0 8px;
    flex: none;
  }
  .toast .dismiss:hover { color: var(--ink); }

  /* 空状态 */
  .empty-state {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 26px;
    z-index: 2;
  }
  .empty-state.show { display: flex; }
  .empty-sheet {
    width: 132px;
    height: 187px;
    padding: 9px;
    background: rgba(255, 255, 255, .5);
    border: 1px solid rgba(30, 29, 28, .13);
    display: flex;
    flex-direction: column;
    gap: 7px;
  }
  .empty-slot {
    flex: 1;
    border: 1px dashed rgba(30, 29, 28, .17);
    border-radius: 2px;
  }
  .empty-title { font-size: 16.5px; font-weight: 600; text-align: center; }
  .empty-sub { font-size: 12.5px; color: var(--ink-2); text-align: center; margin-top: 8px; }
  .empty-actions { display: flex; align-items: center; gap: 8px; }
  .empty-choose {
    height: 30px;
    padding: 0 12px;
    border-radius: 6px;
    background: var(--control-fill);
    border: 1px solid var(--control-border);
    font-size: 12.5px;
    color: var(--ink-2);
  }
  .empty-mail { font-size: 12.5px; color: var(--accent); }
