/*!
 * style.css —— 文档批量生成 全站样式
 *
 * 设计语言：纸 + 墨 + 印。
 *   纸张底色承托内容，墨色承载文字，印章红只在"手写的那个位置"出现：
 *   免费标记、未绑定的填空、错误提示。其余交互一律用印蓝。
 *
 * 结构：
 *   1. token / 主题        2. 基础与排版        3. 通用组件
 *   4. 顶栏与导航          5. 工具页布局        6. 表格与预览
 *   7. 浮层 / 弹窗 / 提示  8. 内容页（关于 / 博客 / 隐私）
 *   9. 页脚               10. 响应式
 */

/* ================================================================== *
 * 1. token
 * ================================================================== */
:root {
  color-scheme: light;

  /* 中性色走 Apple 的 #f5f5f7 / #1d1d1f 体系：底色几乎不带色相，
     让蓝色只出现在该被注意的地方（主按钮、链接、已绑定） */
  --canvas: #f5f5f7;
  --canvas-2: #ececef;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --surface-3: #f0f0f3;

  --ink: #1d1d1f;
  --ink-2: #424245;
  --ink-3: #6e6e73;
  --ink-4: #86868b;

  --line: #e6e6eb;
  --line-2: #d6d6dc;
  --line-3: #bcbcc4;

  --brand: #0071e3;
  --brand-strong: #0058b0;
  --brand-text: #0066cc;
  --brand-soft: #eaf3ff;
  --brand-softer: #f4f9ff;

  --seal: #d70015;
  --seal-soft: #fff0f1;
  --seal-line: #f3c6cb;

  --ok: #0a7a37;
  --ok-soft: #e9f7ee;
  --ok-line: #bfe3cc;

  --warn: #a15200;
  --warn-soft: #fff4e6;

  --slot-bound-fg: #0066cc;
  --slot-bound-bg: #e8f2ff;
  --slot-unbound-fg: #d70015;
  --slot-unbound-bg: #fff0f1;
  --slot-const-fg: #0a7a37;
  --slot-const-bg: #e9f7ee;

  --paper: #ffffff;
  --paper-ink: #1d1d1f;

  --focus: #0071e3;

  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 980px;

  --sh-1: 0 1px 2px rgba(0, 0, 0, .04);
  --sh-2: 0 2px 6px rgba(0, 0, 0, .05), 0 12px 28px -14px rgba(0, 0, 0, .16);
  --sh-3: 0 4px 12px rgba(0, 0, 0, .06), 0 32px 64px -24px rgba(0, 0, 0, .22);

  /* 全站统一思源黑体（可变字重 100-900）。
     标题不再换字体族，靠字重、字距与大小拉开层次——这也是 Apple 的做法。
     --font-display 保留成一类别名，避免大量旧规则需要改。 */
  --font-ui: "Source Han Sans SC", "Noto Sans SC", -apple-system, BlinkMacSystemFont,
    "SF Pro Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-ui);
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --ease: cubic-bezier(.32, .72, 0, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;

  /* 深色沿用 Apple 的纯黑 + #1c1c1e 卡片层 */
  --canvas: #000000;
  --canvas-2: #0c0c0e;
  --surface: #1c1c1e;
  --surface-2: #242426;
  --surface-3: #2c2c2e;

  --ink: #f5f5f7;
  --ink-2: #d2d2d7;
  --ink-3: #98989d;
  --ink-4: #6e6e73;

  --line: #2c2c2e;
  --line-2: #3a3a3c;
  --line-3: #48484a;

  --brand: #0a84ff;
  --brand-strong: #409cff;
  --brand-text: #2997ff;
  --brand-soft: rgba(10, 132, 255, .16);
  --brand-softer: rgba(10, 132, 255, .08);

  --seal: #ff453a;
  --seal-soft: rgba(255, 69, 58, .14);
  --seal-line: rgba(255, 69, 58, .34);

  --ok: #30d158;
  --ok-soft: rgba(48, 209, 88, .13);
  --ok-line: rgba(48, 209, 88, .3);

  --warn: #ff9f0a;
  --warn-soft: rgba(255, 159, 10, .13);

  --slot-bound-fg: #7cb7ff;
  --slot-bound-bg: rgba(10, 132, 255, .18);
  --slot-unbound-fg: #ff8f86;
  --slot-unbound-bg: rgba(255, 69, 58, .15);
  --slot-const-fg: #6ee7a0;
  --slot-const-bg: rgba(48, 209, 88, .14);

  --paper: #f5f5f7;
  --paper-ink: #1d1d1f;

  --focus: #409cff;

  --sh-1: 0 1px 2px rgba(0, 0, 0, .5);
  --sh-2: 0 2px 6px rgba(0, 0, 0, .5), 0 16px 32px -16px rgba(0, 0, 0, .8);
  --sh-3: 0 4px 12px rgba(0, 0, 0, .55), 0 32px 64px -24px rgba(0, 0, 0, .85);
}

/* ================================================================== *
 * 2. 基础
 * ================================================================== */
*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0;
}

p { margin: 0; }

a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: rgba(47, 109, 191, .18); }

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 400;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  box-shadow: var(--sh-2);
  transition: top .16s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ================================================================== *
 * 3. 通用组件
 * ================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background .16s var(--ease), border-color .16s var(--ease),
    color .16s var(--ease), transform .12s var(--ease), box-shadow .16s var(--ease);
}
.btn:active { transform: translateY(.5px); }

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), var(--sh-1);
}
.btn-primary:hover { background: var(--brand-strong); text-decoration: none; }
.btn-primary:disabled {
  background: var(--surface-3);
  color: var(--ink-4);
  box-shadow: none;
  cursor: default;
  transform: none;
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--line-2);
  color: var(--ink-2);
}
.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand-text);
  background: var(--brand-softer);
  text-decoration: none;
}
.btn-ghost:disabled { opacity: .45; cursor: default; }

.btn-sm { padding: 6px 11px; font-size: 12.5px; }

.btn-link {
  color: var(--brand-text);
  padding: 8px 4px;
  background: none;
}
.btn-link:hover { text-decoration: underline; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--ink-3);
  cursor: pointer;
  transition: background .16s, color .16s, border-color .16s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }

/* 深色图标默认显示月亮；浅色显示太阳 */
#btn-theme .i-sun { display: none; }
#btn-theme .i-moon { display: block; }
html[data-theme="dark"] #btn-theme .i-sun { display: block; }
html[data-theme="dark"] #btn-theme .i-moon { display: none; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--ok-line);
  border-radius: var(--r-pill);
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: filter .16s;
}
.pill:hover { filter: brightness(.97); }
.pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 16%, transparent);
}

/* 免费印章 */
.free-stamp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1.5px solid var(--seal);
  border-radius: 5px;
  color: var(--seal);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  transform: rotate(-1.6deg);
  white-space: nowrap;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--seal) 8%, transparent);
  opacity: .92;
}
.stamp-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.muted { color: var(--ink-3); font-size: 12px; }
.c-red { color: var(--seal); font-weight: 600; }
.c-blue { color: var(--brand-text); font-weight: 600; }

/* ================================================================== *
 * 4. 顶栏
 * ================================================================== */
.topbar {
  position: relative;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 60px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

.logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  filter: drop-shadow(0 1px 2px rgba(23, 28, 36, .18));
}
.logo svg { display: block; }

.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.005em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub {
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav { display: flex; align-items: center; gap: 2px; margin-left: 6px; }
.nav-link {
  position: relative;
  padding: 6px 10px;
  border-radius: var(--r-xs);
  color: var(--ink-3);
  font-size: 13px;
  text-decoration: none;
  transition: color .16s, background .16s;
}
.nav-link:hover { color: var(--ink); background: var(--surface-3); text-decoration: none; }
.nav-link.is-active { color: var(--ink); font-weight: 600; }
.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--seal);
  opacity: .85;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.btn-help { padding: 6px 12px; }

/* 语言选择 */
.lang-picker { position: relative; }

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 9px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: background .16s, border-color .16s, color .16s;
}
.lang-btn:hover { background: var(--surface-3); border-color: var(--line); color: var(--ink); }
.lang-btn .chev { color: var(--ink-4); }
.lang-cur { font-weight: 600; letter-spacing: .02em; }

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 120;
  min-width: 210px;
  margin: 0;
  padding: 5px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  box-shadow: var(--sh-3);
  animation: menuIn .14s var(--ease);
}
.lang-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: 0;
  border-radius: var(--r-xs);
  color: var(--ink-2);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.lang-menu button:hover { background: var(--surface-3); color: var(--ink); }
.lang-menu button.is-on { color: var(--brand-text); font-weight: 600; }
.lang-menu button.is-on::after { content: "✓"; font-size: 12px; }
.lang-menu .lm-code {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-4);
  letter-spacing: .04em;
}
.lang-menu button.is-on .lm-code { display: none; }

@keyframes menuIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 移动菜单 */
.menu-btn { display: none; }

.mobile-nav {
  position: relative;
  z-index: 55;
  display: none;
  flex-direction: column;
  padding: 8px 14px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--sh-1);
}
.mobile-nav a {
  padding: 10px 8px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 14px;
  text-decoration: none;
}
.mobile-nav a:hover { background: var(--surface-3); text-decoration: none; }

/* ================================================================== *
 * 5. 工具页布局
 * ================================================================== */
.page-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* 工具区占满首屏，教程 / 评价 / 广告位在滚动之后出现 */
.workspace {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 60px);
  min-height: 460px;
  overflow: hidden;
}

.layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 336px minmax(0, 1fr) 428px;
  gap: 14px;
  padding: 14px 18px;
}

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 13px 15px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  min-height: 26px;
  margin-bottom: 11px;
}
.card-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  flex: 0 0 auto;
}
.step {
  display: inline-grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}
.card .meta {
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .head-tools { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.card .head-actions { display: flex; gap: 6px; margin-left: auto; flex: 0 0 auto; }

/* 拖拽区 */
.dropzone {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  padding: 11px 12px;
  background: var(--surface-2);
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r-md);
  cursor: pointer;
  outline: none;
  transition: border-color .18s var(--ease), background .18s var(--ease),
    box-shadow .18s var(--ease);
}
.dropzone:hover,
.dropzone:focus-visible { border-color: var(--brand); background: var(--brand-softer); }
.dropzone.over {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--brand) 8%, transparent);
}
.dropzone.filled {
  border-style: solid;
  border-color: var(--line-2);
  background: var(--surface);
}
.dropzone.filled .dz-icon { background: var(--brand); color: #fff; border-color: transparent; }

.dz-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink-2);
  transition: background .18s, color .18s;
}
.dz-text { display: flex; flex-direction: column; min-width: 0; }
.dz-text strong {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dz-text span { font-size: 11.5px; color: var(--ink-3); }
.dz-badge {
  margin-left: auto;
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.dropzone.filled .dz-badge { display: none; }

/* 行内小控件 */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
  padding-top: 10px;
}

.field-inline {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
}
.field-inline select,
.field-inline input[type="number"] {
  padding: 5px 8px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xs);
  color: var(--ink);
  font-size: 12.5px;
  outline: none;
  transition: border-color .16s;
}
.field-inline select { appearance: none; padding-right: 24px; cursor: pointer; }
.field-inline select:hover { border-color: var(--line-3); }
.field-inline select:focus,
.field-inline input:focus { border-color: var(--brand); }
.field-inline::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 12px;
  width: 5px;
  height: 5px;
  border-right: 1.4px solid var(--ink-3);
  border-bottom: 1.4px solid var(--ink-3);
  transform: rotate(45deg) translateY(-2px);
  pointer-events: none;
}
.field-inline:has(input)::after { display: none; }
.field-inline input[type="number"] { width: 58px; }

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-3);
  cursor: pointer;
  user-select: none;
}
.check-inline input { accent-color: var(--brand); margin: 0; }

/* 空状态 */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  min-height: 120px;
  padding: 24px 18px;
  color: var(--ink-4);
  font-size: 12.5px;
  text-align: center;
  line-height: 1.6;
}
.empty.small { min-height: 84px; }
.empty-art {
  font-size: 22px;
  line-height: 1;
  color: var(--line-3);
  opacity: .8;
}

/* ================================================================== *
 * 6. 表格与文档预览
 * ================================================================== */
.table-wrap,
.map-wrap {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 11px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.map-wrap { margin-top: 0; }

table.sheet {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
table.sheet th,
table.sheet td {
  padding: 6px 10px;
  text-align: left;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
table.sheet th:last-child,
table.sheet td:last-child { border-right: 0; }

table.sheet thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.35;
  border-bottom: 1px solid var(--line-2);
}
table.sheet thead th .col-letter {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: .04em;
  color: var(--ink-4);
}
table.sheet tbody tr:hover td { background: var(--brand-softer); }
table.sheet tbody tr.active td { background: var(--brand-soft); }
table.sheet tbody tr.active td:first-child {
  box-shadow: inset 2px 0 0 var(--brand);
}

.rownum {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 36px;
  background: var(--surface-2);
  color: var(--ink-4);
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-align: right !important;
}
table.sheet thead th.rownum { z-index: 3; }

/* 文档纸 */
.paper-wrap {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 11px;
  padding: 18px 14px;
  overflow: auto;
  background:
    radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--canvas-2) 60%, transparent), transparent 70%),
    var(--canvas-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

.paper {
  max-width: 700px;
  margin: 0 auto;
  padding: 40px 44px;
  background: var(--paper);
  color: var(--paper-ink);
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .04), 0 12px 32px -14px rgba(31, 35, 40, .38),
    0 2px 5px rgba(31, 35, 40, .07);
  font-family: var(--font-display);
  font-size: 10.5pt;
  line-height: 1.8;
  overflow-wrap: break-word;
}
.paper p { margin: 0 0 8pt; }
.paper table { font-size: 10pt; }
.paper table td p { margin: 0; }

.slot {
  cursor: pointer;
  padding: 0 1px;
  border-radius: 3px;
  transition: filter .12s, box-shadow .12s;
}
.slot.unbound {
  color: var(--slot-unbound-fg);
  background: var(--slot-unbound-bg);
  border-bottom: 1px dashed var(--slot-unbound-fg);
}
.slot.bound {
  color: var(--slot-bound-fg);
  background: var(--slot-bound-bg);
}
.slot.const {
  color: var(--slot-const-fg);
  background: var(--slot-const-bg);
}
.slot.u-line { text-decoration: underline; text-underline-offset: 2px; }
.slot:hover { filter: brightness(.96); box-shadow: 0 0 0 1.5px color-mix(in srgb, currentColor 45%, transparent); }

/* 映射表 */
table.map {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  table-layout: fixed;
}
table.map th:nth-child(1) { width: 43%; }
table.map th:nth-child(2) { width: 39%; }
table.map th:nth-child(3) { width: 18%; }

table.map th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-2);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
table.map td {
  padding: 5px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.map tr:last-child td { border-bottom: 0; }
table.map tr.unbound td.pos { background: color-mix(in srgb, var(--warn-soft) 70%, transparent); }
table.map td .idx {
  display: inline-block;
  min-width: 18px;
  margin-right: 5px;
  color: var(--ink-4);
  font-family: var(--font-mono);
  font-size: 10px;
  text-align: right;
}
table.map td.pos {
  color: var(--ink-2);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
table.map td.sample {
  color: var(--brand-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
table.map td.sample.empty { color: var(--ink-4); }
table.map select {
  width: 100%;
  padding: 5px 8px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xs);
  color: var(--ink);
  font-size: 12.5px;
  outline: none;
  cursor: pointer;
}
table.map select:focus { border-color: var(--brand); }
table.map select.set {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line-2));
  background: var(--brand-softer);
  color: var(--brand-text);
  font-weight: 500;
}

/* 底部命令条 */
.actionbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
  padding: 11px 18px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.field { display: flex; align-items: center; gap: 8px; flex: 1 1 380px; }
.field label { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.field input {
  flex: 1 1 auto;
  min-width: 110px;
  padding: 8px 11px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent);
}
.bar-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.btn-generate { padding: 10px 20px; font-size: 13.5px; font-weight: 600; }

.progress { display: flex; align-items: center; gap: 9px; }
.progress .bar {
  width: 140px;
  height: 6px;
  background: var(--surface-3);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.progress .bar i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--brand);
  border-radius: var(--r-pill);
  transition: width .18s var(--ease);
}
#progress-text {
  min-width: 64px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
}

/* 工具页脚条 */
.appfoot {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
  padding: 0 18px 8px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.appfoot-free { display: inline-flex; align-items: center; gap: 6px; color: var(--seal); }
.appfoot-links { display: flex; gap: 14px; margin-left: auto; }
.appfoot-links a { color: var(--ink-3); }
.appfoot-links a:hover { color: var(--ink); }

.tip {
  flex: 0 0 auto;
  margin-top: 10px;
  padding: 8px 11px;
  background: var(--brand-softer);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.65;
}

/* ================================================================== *
 * 7. 浮层 / 弹窗 / 提示
 * ================================================================== */
.popover {
  position: fixed;
  z-index: 300;
  display: flex;
  flex-direction: column;
  min-width: 258px;
  max-width: 380px;
  max-height: 330px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  box-shadow: var(--sh-3);
  animation: menuIn .14s var(--ease);
}
.pop-head {
  padding: 9px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pop-list { padding: 5px; overflow-y: auto; }
.pop-item {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 7px 9px;
  border-radius: var(--r-xs);
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.pop-item:hover { background: var(--brand-soft); color: var(--ink); }
.pop-item .name { font-weight: 500; color: var(--ink); }
.pop-item .letter {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-4);
}
.pop-item .sample {
  max-width: 140px;
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-3);
  font-size: 11px;
}
.pop-item.danger { color: var(--seal); }
.pop-item.danger .name { color: var(--seal); }
.pop-item.danger:hover { background: var(--seal-soft); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: grid;
  place-items: center;
  padding: 20px;
  background: color-mix(in srgb, var(--ink) 46%, transparent);
  backdrop-filter: blur(2px);
  animation: fadeIn .16s var(--ease);
}
.modal-box {
  width: min(560px, 100%);
  max-height: 86vh;
  overflow: auto;
  padding: 26px 28px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  animation: popIn .18s var(--ease);
}
.modal-box h3 { font-size: 17px; margin-bottom: 12px; }
.modal-box h3 + h3 { margin-top: 22px; }
.modal-box ul,
.modal-box ol { margin: 0 0 12px; padding-left: 20px; }
.modal-box li { margin-bottom: 8px; font-size: 13px; color: var(--ink-2); }
.modal-box p { font-size: 13px; color: var(--ink-2); }
.modal-box code {
  padding: 1px 5px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.modal-box .muted { color: var(--ink-3); font-size: 12px; margin-top: 10px; }
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: none; }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  z-index: 400;
  max-width: min(560px, 86vw);
  padding: 10px 16px;
  background: var(--ink);
  color: var(--canvas);
  border-radius: var(--r-sm);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: var(--sh-3);
  transform: translateX(-50%);
  animation: toastIn .2s var(--ease);
}
.toast.err { background: #8f2b22; color: #fff; }
.toast.ok { background: #1a6b50; color: #fff; }
html[data-theme="dark"] .toast { background: #e9edf4; color: #14181f; }
html[data-theme="dark"] .toast.err { background: #c2543f; color: #fff; }
html[data-theme="dark"] .toast.ok { background: #2f8b6c; color: #fff; }

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ================================================================== *
 * 8. 内容页
 * ================================================================== */
.page-content { display: flex; flex-direction: column; min-height: 100vh; }

.wrap {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 0 24px;
}

.hero { padding: 74px 0 56px; }
.hero.narrow { max-width: 820px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--seal);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: .6;
}
.hero h1 {
  font-size: clamp(30px, 5.2vw, 50px);
  line-height: 1.22;
  letter-spacing: -.015em;
  max-width: 22ch;
  text-wrap: balance;
}
.hero .lead {
  max-width: 62ch;
  margin-top: 20px;
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.75;
}
.hero .meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }

.section { padding: 46px 0; border-top: 1px solid var(--line); }
.section-head { margin-bottom: 26px; }
.section-head h2 {
  font-size: clamp(21px, 2.6vw, 27px);
  line-height: 1.3;
}
.section-head p {
  max-width: 62ch;
  margin-top: 10px;
  color: var(--ink-3);
  font-size: 13.5px;
  line-height: 1.7;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.panel {
  padding: 20px 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
}
.panel h3 { font-size: 15.5px; margin-bottom: 8px; }
.panel p { color: var(--ink-3); font-size: 13px; line-height: 1.7; }
.panel .num {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-bottom: 12px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.panel.is-free { border-color: var(--seal-line); background: color-mix(in srgb, var(--seal-soft) 55%, var(--surface)); }
.panel.is-free h3 { color: var(--seal); }

/* 技术栈表 */
.stack {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--sh-1);
}
.stack th {
  padding: 10px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: left;
}
.stack th:first-child { width: 37%; }
.stack td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: top;
}
.stack tr:last-child td { border-bottom: 0; }
.stack td:first-child { color: var(--ink); font-weight: 500; }
.stack td:last-child { color: var(--ink-3); line-height: 1.65; }

.note {
  margin-top: 16px;
  padding: 13px 16px;
  background: var(--surface-2);
  border-left: 2px solid var(--seal);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.7;
}

/* FAQ */
.faq { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.faq details {
  border-bottom: 1px solid var(--line);
  padding: 15px 2px;
}
.faq summary {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  margin-left: auto;
  color: var(--ink-4);
  font-family: var(--font-mono);
  font-size: 15px;
}
.faq details[open] summary::after { content: "−"; }
.faq details p {
  margin: 10px 0 2px;
  padding-left: 0;
  color: var(--ink-3);
  font-size: 13.5px;
  line-height: 1.75;
  max-width: 68ch;
}

/* CTA 带 */
.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: 20px 0 64px;
  padding: 34px 34px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, .13), transparent 60%),
    var(--brand);
  border-radius: var(--r-lg);
  color: #fff;
  box-shadow: var(--sh-2);
}
.cta h2 { font-size: clamp(20px, 2.6vw, 26px); color: #fff; }
.cta p { margin-top: 8px; max-width: 52ch; color: rgba(255, 255, 255, .78); font-size: 13.5px; line-height: 1.7; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cta .btn-primary {
  background: #fff;
  color: var(--brand);
  box-shadow: none;
}
.cta .btn-primary:hover { background: #f2f5fa; }
.cta .btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, .4);
  color: #fff;
}
.cta .btn-ghost:hover { background: rgba(255, 255, 255, .12); border-color: #fff; color: #fff; }

/* 长文 */
.prose { max-width: 70ch; }
.prose p { margin: 0 0 16px; color: var(--ink-2); font-size: 14.5px; line-height: 1.85; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; }
.prose li { margin-bottom: 9px; color: var(--ink-2); font-size: 14px; line-height: 1.8; }
.prose b, .prose strong { color: var(--ink); font-weight: 600; }
.prose code {
  padding: 1px 5px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.prose h3 { font-size: 17px; margin: 26px 0 10px; }

/* 博客列表 */
.posts { display: flex; flex-direction: column; gap: 16px; }
.post {
  padding: 24px 26px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  transition: border-color .2s, box-shadow .2s;
}
.post:hover { border-color: var(--line-2); box-shadow: var(--sh-2); }
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.tag {
  padding: 2px 8px;
  background: var(--brand-soft);
  border-radius: var(--r-pill);
  color: var(--brand-text);
  font-size: 11px;
  font-weight: 500;
}
.post h2 { font-size: clamp(19px, 2.2vw, 23px); line-height: 1.35; }
.post h2 a { color: inherit; }
.post h2 a:hover { text-decoration: none; color: var(--brand-text); }
.post .excerpt { margin-top: 10px; color: var(--ink-3); font-size: 13.5px; line-height: 1.75; max-width: 66ch; }
.post-more { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.post-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--brand-text);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
.post-toggle:hover { text-decoration: underline; }
.post-toggle svg { transition: transform .18s var(--ease); }
.post.is-open .post-toggle svg { transform: rotate(180deg); }

/* 隐私摘要卡 */
.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 34px;
}
.summary-item {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.summary-item .k {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.summary-item .k::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--seal);
}
.summary-item p { color: var(--ink-3); font-size: 12.5px; line-height: 1.7; }

/* ================================================================== *
 * 9. 页脚
 * ================================================================== */
.site-foot {
  padding: 40px 0 30px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.foot-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(120px, 1fr));
  gap: 30px;
}
.foot-brand { display: flex; flex-direction: column; gap: 10px; max-width: 34ch; }
.foot-brand .brand { gap: 9px; }
.foot-brand p { color: var(--ink-3); font-size: 12.5px; line-height: 1.7; }
.foot-col h4 {
  margin-bottom: 10px;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.foot-col a,
.foot-col span {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-3);
  font-size: 12.5px;
}
.foot-col a:hover { color: var(--ink); }
.foot-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 11.5px;
}
.foot-bottom .free-mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--seal);
  font-weight: 500;
}

/* ================================================================== *
 * 10. 响应式
 * ================================================================== */
@media (max-width: 1320px) {
  .layout { grid-template-columns: 312px minmax(0, 1fr) 400px; }
}

@media (max-width: 1180px) {
  .brand-sub { display: none; }
  .nav { margin-left: 2px; }
  .layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(340px, 1fr) minmax(300px, .92fr);
  }
  #card-map { grid-column: 1 / -1; }
}

@media (max-width: 960px) {
  .nav { display: none; }
  .menu-btn { display: inline-grid; }
  .mobile-nav { display: flex; }
  .page-app { height: auto; min-height: 100vh; overflow: visible; }
  .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-auto-rows: auto;
    overflow: visible;
  }
  #card-map { grid-column: auto; }
  .card { min-height: 0; }
  .table-wrap, .paper-wrap, .map-wrap { max-height: 56vh; }
  .appfoot { padding-bottom: 14px; }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}

@media (max-width: 720px) {
  .topbar { gap: 10px; padding: 0 14px; height: 56px; }
  .pill-privacy span:last-child { display: none; }
  .pill-privacy { padding: 6px 8px; }
  .free-stamp { display: none; }
  .btn-help { display: none; }
  .layout { padding: 10px 12px; gap: 10px; }
  .card { padding: 12px 13px 13px; border-radius: var(--r-md); }
  .actionbar { padding: 10px 12px; gap: 12px; }
  .field { flex-basis: 100%; }
  .bar-right { width: 100%; justify-content: space-between; }
  .btn-generate { flex: 1 1 auto; }
  .hero { padding: 44px 0 36px; }
  .hero h1 { font-size: clamp(26px, 7.6vw, 34px); }
  .hero .lead { font-size: 14.5px; }
  .section { padding: 34px 0; }
  .wrap { padding: 0 16px; }
  .cta { padding: 26px 22px; margin-bottom: 44px; }
  .stack th:first-child { width: 44%; }
  .stack th, .stack td { padding: 10px 12px; }
  .paper { padding: 26px 22px; }
  .post { padding: 20px 18px 18px; }
  .appfoot { flex-wrap: wrap; padding: 0 12px 12px; gap: 8px; }
  .appfoot-links { margin-left: 0; width: 100%; }
}

@media (max-width: 520px) {
  .brand-name { font-size: 15px; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .modal-box { padding: 22px 18px 18px; }
  .modal-actions { flex-direction: column-reverse; align-items: stretch; }
  .modal-actions .btn { width: 100%; }
  .progress .bar { width: 96px; }
  .dz-badge { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

@media print {
  .topbar, .actionbar, .appfoot, .site-foot, .nav, .topbar-actions { display: none !important; }
  body { background: #fff; }
  .paper { box-shadow: none; }
}

/* ================================================================== *
 * 11. 页面底部板块：使用教程 / 广告位 / 用户使用感受
 * ================================================================== */
.page-sections {
  border-top: 1px solid var(--line);
  background: var(--canvas-2);
}

.band { padding: 56px 0; }
.band + .band { border-top: 1px solid var(--line); }
.band-voices { background: var(--canvas); }

.band-head { max-width: 720px; margin-bottom: 30px; }
.band-head h2 {
  font-size: clamp(21px, 2.6vw, 28px);
  line-height: 1.32;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.band-lead {
  max-width: 62ch;
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.75;
}
.band-tip {
  margin-top: 22px;
  padding: 12px 14px;
  background: var(--brand-softer);
  border: 1px solid var(--line);
  border-left: 2px solid var(--brand);
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.7;
}
.band-foot {
  margin-top: 22px;
  font-size: 11.5px;
  color: var(--ink-4);
}

/* 步骤卡 */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.step-card {
  padding: 18px 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.step-no {
  display: inline-block;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .12em;
  color: var(--seal);
}
.step-card h3 { font-size: 14.5px; font-weight: 600; }
.step-card p {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.75;
}

/* 用户评价 */
.voices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
}
.voice {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 20px 20px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.voice blockquote {
  margin: 0;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.85;
}
.voice figcaption {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-2);
}
.voice-mark {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
  color: var(--seal);
  opacity: .5;
}
.voice-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.voice-meta strong { font-size: 13px; font-weight: 600; }
.voice-meta span { font-size: 11.5px; color: var(--ink-3); }

/* 广告位：先占高度，避免广告加载后把内容顶下去 */
.ad-wrap {
  display: flex;
  justify-content: center;
  padding: 26px 18px;
}
.ad-slot {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 970px;
  border-radius: var(--r-md);
  overflow: hidden;
}
.ad-leader { min-height: 100px; }
.ad-rect { max-width: 336px; min-height: 280px; }
.ad-slot .adsbygoogle { display: block; width: 100%; }
.ad-note {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  color: var(--ink-4);
  font-size: 11.5px;
  white-space: nowrap;
}
html.ads-off .ad-slot {
  border: 1px dashed var(--line-2);
  background: var(--surface-2);
}
html:not(.ads-off) .ad-note { display: none; }
.ad-tag {
  padding: 1px 7px;
  border: 1px solid var(--line-3);
  border-radius: var(--r-pill);
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--ink-4);
}

@media (max-width: 960px) {
  .workspace { height: auto; min-height: 0; overflow: visible; }
  .band { padding: 44px 0; }
}
@media (max-width: 520px) {
  .band { padding: 36px 0; }
  .ad-leader { min-height: 84px; }
}
/* ================================================================== *
 * 12. 排版修订：思源统一 / 内容字号上调一级 / 换行修正
 *
 * 设计依据（ui-ux-pro-max · Typography / Heading Line Balance）：
 *   · 标题只在「长度有限」时用 balance，并给出宽度上限，不让它越界硬断
 *   · 正文用 pretty，避免末行只剩一两个字的孤字
 *   · 中文断行加 line-break: strict，遵守标点挤压规则
 * ================================================================== */

body {
  word-break: normal;
  line-break: strict;
  text-rendering: optimizeLegibility;
}

/* 正文类容器：末行不留孤字 */
p, li, blockquote, dd,
.hero .lead, .section-head p, .band-lead, .prose, .prose p, .prose li,
.faq details p, .post .excerpt, .post-more p, .step-card p, .voice blockquote,
.panel p, .summary-item p {
  text-wrap: pretty;
}

/* 标题：balance + 宽度上限 + 中文不在词中硬断 */
h1, h2, h3, h4 {
  text-wrap: balance;
  word-break: keep-all;
  overflow-wrap: break-word;
  letter-spacing: -.012em;
}
h1 { letter-spacing: -.024em; }

/* ---------- 首页 / 内容页共用：字号上调一级 ---------- */
.hero h1 { max-width: 24ch; }
.hero .lead { font-size: 17px; line-height: 1.72; max-width: 58ch; }

.section-head h2 { letter-spacing: -.018em; }
.section-head p { font-size: 16px; line-height: 1.78; }

.band-head h2 { letter-spacing: -.018em; }
.band-lead { font-size: 16.5px; line-height: 1.75; max-width: 56ch; }
.band-tip { font-size: 14px; line-height: 1.75; }
.band-foot { font-size: 12.5px; }

.steps { gap: 16px; }
.step-card { padding: 20px 20px 22px; }
.step-card h3 { font-size: 16px; }
.step-card p { font-size: 14.5px; line-height: 1.78; }

.voices { gap: 16px; }
.voice blockquote { font-size: 15px; line-height: 1.85; }
.voice-meta strong { font-size: 14px; }
.voice-meta span { font-size: 12.5px; }

/* ---------- 常见问题 ---------- */
.faq details { padding: 18px 2px; }
.faq summary {
  font-size: 17px;
  line-height: 1.55;
  align-items: flex-start;
  letter-spacing: -.008em;
}
.faq summary::after { flex: 0 0 auto; line-height: 1.35; }
.faq details p {
  margin-top: 10px;
  font-size: 15.5px;
  line-height: 1.82;
  max-width: 64ch;
  color: var(--ink-2);
}

/* ---------- 博客 ---------- */
.posts { gap: 18px; }
.post { padding: 24px 26px; }
.post h2 { font-size: clamp(21px, 2.4vw, 26px); line-height: 1.3; letter-spacing: -.018em; }
.post-meta { font-size: 12.5px; }
.post .excerpt { font-size: 15.5px; line-height: 1.8; max-width: 60ch; color: var(--ink-2); }
.post-toggle { font-size: 14px; }
.post-more p { font-size: 15.5px; line-height: 1.85; }

/* ---------- 长文 / 面板 / 表格 ---------- */
.prose { max-width: 68ch; }
.prose p { font-size: 16.5px; line-height: 1.85; }
.prose li { font-size: 15.5px; line-height: 1.8; }
.prose h3 { font-size: 19px; margin: 30px 0 12px; }

.panel { padding: 22px 22px 24px; }
.panel h3 { font-size: 16.5px; }
.panel p { font-size: 14.5px; line-height: 1.78; }

.summary-item p { font-size: 14.5px; line-height: 1.75; }

.stack th, .stack td { font-size: 14px; line-height: 1.7; }

/* ---------- 工具区：中文文案不再被 nowrap 挤断 ---------- */
.card-head h2 {
  white-space: normal;
  min-width: 0;
  text-wrap: balance;
  letter-spacing: -.01em;
}

/* ---------- Apple 收敛：装饰让位给内容 ---------- */
/* 印章红现在只表示"错误/未绑定"，免费标记改用中性胶囊 + 一枚小红点 */
.free-stamp {
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 600;
  letter-spacing: .06em;
  transform: none;
  box-shadow: none;
}
.free-stamp .stamp-dot { background: var(--seal); }

/* 眉标不再用红色，避免和错误色打架 */
.eyebrow { color: var(--ink-3); }
.eyebrow::before { opacity: .45; }

/* 文件名提示整句可读：允许在分隔符处换行，但不出现"只剩一个词"的末行 */
.dz-text span { text-wrap: pretty; }
/* 拖拽区右侧的装饰徽标在窄卡片里会挤掉提示文字，直接不显示 */
.dz-badge { display: none; }

/* 卡片头部的状态文字：过长时省略，而不是硬切断 */
.card .meta { text-overflow: ellipsis; }

/* 工具区底部命令条：与 Apple 的圆角/留白对齐 */
.actionbar { gap: 14px; padding: 12px 20px; background: var(--surface); }
.field input { border-radius: var(--r-sm); }

/* 长文列居中：卡片比"可读行长"宽时，文字不要贴左边留一大片空白 */
.prose {
  max-width: 68ch;
  margin-inline: auto;
}
/* 博客展开后的正文：略窄一点更好读，分隔线随之成为文章的宽度标记 */
.post-more.prose {
  max-width: 64ch;
  margin-inline: auto;
}
.post .excerpt { max-width: 64ch; }

/* 内容页统一成一列：主标题、卡片、正文共用同一条左边界，读起来才是"一篇文章" */
.page-content main .wrap { max-width: 880px; }
.page-content .prose { max-width: none; margin-inline: 0; }
/* 博客展开正文仍按可读行长居中，卡片比行长宽，居中才不显得偏 */
.post-more.prose { max-width: 66ch; margin-inline: auto; }

/* 摘要卡的小圆点不再用错误红 */
.summary-item .k::before,
.summary-item .k > i { background: var(--brand); }

/* 预览面板只需要竖向滚动；横向滚动条会在卡片顶部留下一条"假边框" */
.paper-wrap { overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; }

/* 标题再宽一点，英文长标题不至于被压成三行 */
.hero h1 { max-width: 26ch; }

/* 预览区改用纯色底：原来的径向渐变在卡片顶部形成一条"假滚动条"似的亮带 */
.paper-wrap {
  background: var(--surface-2);
}
