:root {
  --bg: #f6f6fb;
  --card: #ffffff;
  --text: #1c1b22;
  --muted: #6b6a7a;
  --line: #e5e4ef;
  --purple: #6c4cf1;
  --purple-dark: #5738d6;
  --green: #14855f;
  --red: #c03434;
  --shadow: 0 10px 30px rgba(28, 27, 34, 0.07);
}

/* 第 85 轮：签名页和另外三站共用同一套色板（与 AI 页相同）。
   变量名保留 --purple，管理后台（body.admin）仍用原来的紫色，不受影响。 */
body:not(.admin) {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #14161a;
  --muted: #6b7280;
  --line: #e2e5ea;
  --purple: #0a84ff;
  --purple-dark: #0071e3;
  --shadow: 0 8px 24px rgba(16, 20, 28, .06);
  --ease: cubic-bezier(.22, 1, .36, 1);
  /* 另外三页都是平底色（没有顶部光晕），这一页也不留紫色渐变。 */
  background: var(--bg);
}
html[data-theme="dark"] body:not(.admin) {
  --bg: #101216;
  --card: #171a20;
  --text: #eef1f6;
  --muted: #9aa3b2;
  --line: #262b34;
  --purple: #4aa3ff;
  --purple-dark: #7cbcff;
  --shadow: 0 12px 32px rgba(0, 0, 0, .45);
  background: var(--bg);
}

html, body {
  margin: 0;
  padding: 0;
  scrollbar-gutter: stable;
  background: radial-gradient(1200px 500px at 20% -10%, #ece7ff 0%, transparent 60%), var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  min-height: 100%;
}

a { color: var(--purple); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  max-width: 920px;
  margin: 0 auto;
}

.brand { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* 第 81 轮：四站统一的页脚 */
.site-foot {
  max-width: 920px; margin: 28px auto 0; padding: 0 22px;
  text-align: center; font-size: 12px; color: var(--muted);
}
/* 第 82 轮：logo 换成站点统一的自有图标；第 83 轮起四页统一到 28×28、圆角 9，
   并去掉原来那圈紫色柔光——另外三页的 logo 都没有光晕，留着会显得这一页的图标是另一种样式。 */
.logo {
  width: 28px; height: 28px;
  display: block;
  border-radius: 9px;
  flex: 0 0 auto;
  object-fit: cover;
  background: #0e0f3a;
}
.brand strong { font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; }
.badge {
  margin-left: 6px;
  font-size: 11px;
  color: var(--purple);
  background: color-mix(in srgb, var(--purple) 12%, var(--card));
  border-radius: 999px;
  padding: 2px 8px;
  vertical-align: 2px;
}

.topbar nav { display: flex; gap: 18px; font-size: 14px; }

/* 签名页的顶栏和另外三站对齐成同一条带子，按钮组占满中间；
   管理后台（body.admin）有自己的更宽顶栏，不受这条影响。
   第 83b 轮：高度改 min-height，导航组可折行——西语/俄语/阿语文案更长，920 列里一行放不下。 */
/* 第 85 轮：顶栏与另外三站同款——整宽吸顶的玻璃带 + 920 内列，品牌/导航/控件三组。 */
body:not(.admin) .topbar {
  position: sticky; top: 0; z-index: 20;
  max-width: none; margin: 0; padding: 0;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
body:not(.admin) .topbar-in {
  display: flex; align-items: center; gap: 12px;
  max-width: 920px; margin: 0 auto; min-height: 56px; padding: 8px 20px;
}

/* 第 78 轮：顶部跨站导航。四个站点是同一件事的四步（生成 → 签名 → 看源码 → 查重），
 * 用和工具站同一套胶囊按钮串起来；当前页不置灰、只换成紫色描边，一眼知道自己在哪。
 * 比纯文字链接重一点，但它是「去哪」而不是「这次发生了什么」，所以压在主内容之外。 */
nav.site-nav { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap;
  row-gap: 6px; flex: 1 1 auto; min-width: 0; }
.site-nav-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  color: var(--text);
  font-size: 13px; font-weight: 600; line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(28, 27, 34, .04);
  transition: border-color .15s, color .15s, background .15s;
}
.site-nav-btn i { font-style: normal; font-size: 14px; line-height: 1; }
.site-nav-btn:hover { border-color: var(--purple); color: var(--purple); text-decoration: none; }
.site-nav-btn:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.site-nav-btn.on {
  border-color: var(--purple);
  color: var(--purple);
  background: color-mix(in srgb, var(--purple) 10%, var(--card));
  box-shadow: none;
}
@media (max-width: 899px) {
  body:not(.admin) .topbar-in { flex-wrap: wrap; row-gap: 10px; }
}
/* 第 83b 轮：非中文文案更长，顶栏改成有意的两行——品牌 + 语言/主题一行，导航独占第二行居中。
 * 中文仍然是一行。 */
html:not([lang^="zh"]) body:not(.admin) .topbar-in { flex-wrap: wrap; row-gap: 8px; }
html:not([lang^="zh"]) nav.site-nav { flex: 1 1 100%; order: 3; }
html:not([lang^="zh"]) .nav-tools { order: 2; }

main {
  max-width: 920px;
  margin: 0 auto;
  padding: 10px 20px 40px;
}

/* The console is a sidebar plus a card column. The wide cap keeps the ten-column signing table
   (900px floor) clear of sideways scrolling at a 1280 laptop while leaving the nav its own lane. */
main.admin { max-width: 1240px; }
body.admin .topbar { max-width: 1240px; }

/* 第 85 轮：页头与另外三页同款——左对齐的一行标题 + 一行说明。 */
.page-head { margin: 22px 0 14px; padding: 0 2px; }
.page-head h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
}
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
code {
  background: color-mix(in srgb, var(--purple) 8%, var(--card));
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.92em;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
/* 管理后台沿用原来的圆角与间距，签名页的对齐不回写进后台。 */
body.admin .card { border-radius: 20px; margin-bottom: 18px; }

.drop {
  border: 2px dashed color-mix(in srgb, var(--purple) 32%, var(--card));
  border-radius: 16px;
  padding: 30px 18px;
  text-align: center;
  cursor: pointer;
  background: color-mix(in srgb, var(--purple) 4%, var(--card));
  transition: border-color .15s, background .15s, transform .15s;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.drop:hover, .drop:focus-visible, .drop.over {
  border-color: var(--purple);
  background: color-mix(in srgb, var(--purple) 9%, var(--card));
  outline: none;
}
.drop-icon { font-size: 30px; color: var(--purple); }
.drop-title { font-weight: 600; }
.drop-hint { color: var(--muted); font-size: 13px; }

.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--purple) 4%, var(--card));
  border-radius: 12px;
}
.file-name { font-weight: 600; word-break: break-all; }
.file-meta { color: var(--muted); font-size: 13px; word-break: break-all; }

.field { display: block; margin-top: 16px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .admin input[type="text"], .admin input[type="password"], .admin input[type="search"],
.admin input[type="number"], .admin input[type="datetime-local"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
}
.field input:focus, .field select:focus, .admin input:focus {
  outline: 2px solid color-mix(in srgb, var(--purple) 24%, transparent);
  border-color: var(--purple);
}
.field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  resize: vertical;
}
.field textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--purple) 24%, transparent);
  border-color: var(--purple);
}
/* The key box pairs a text field with one button; the button keeps its own height instead of
   stretching to the row, so it reads as an action next to the field rather than part of it. */
.field .row > .ghost { flex: 0 0 auto; }

.primary, .ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  padding: 13px 20px;
  border: 0;
  cursor: pointer;
  min-height: 48px;
}
.primary {
  background: linear-gradient(180deg, var(--purple), var(--purple-dark));
  color: #fff;
  width: 100%;
  margin-top: 18px;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--purple) 28%, transparent);
}
.primary:hover { filter: brightness(1.05); }
.primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.primary.link { text-decoration: none; }
.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  min-height: 38px;
  padding: 8px 14px;
  font-size: 14px;
}

.error {
  margin-top: 16px;
  border: 1px solid #f2c7c7;
  background: #fdf1f1;
  color: var(--red);
  border-radius: 12px;
  padding: 12px 14px;
}
.error p { margin: 4px 0 0; font-size: 14px; }

.result-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.result-head h2 { margin: 0; font-size: 20px; }
.result-head p { margin: 2px 0 0; }
/* Taking the signed file has two ways now — copy the address, or download it — shown as two buttons
   side by side, copy first. They split the row instead of each stretching to full width, so the pair
   still reads as one choice on a phone. */
.result-actions { display: flex; gap: 10px; margin-top: 18px; }
.result-actions > .primary, .result-actions > .ghost { width: auto; margin: 0; flex: 1 1 0; white-space: nowrap; }
.ok-icon {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: #e5f7ef; color: var(--green);
  font-size: 22px; font-weight: 700;
}
.note { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
/* The download address is something the visitor may copy by hand, so it wraps anywhere and reads
   as a machine string — not as body copy. */
.addr { word-break: break-all; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

.docs h2 { font-size: 18px; margin: 0 0 8px; }
.docs p { color: var(--muted); font-size: 14px; }
pre {
  background: #1d1b27;
  color: #e9e6ff;
  padding: 14px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
}
pre code { background: none; padding: 0; color: inherit; }

/* 第 90 轮：异步「提交任务 + 查进度」是一套流程，用同一块浅底色圈在一起。 */
.api-group {
  margin-top: 18px;
  padding: 2px 14px 14px;
  border: 1px solid color-mix(in srgb, var(--purple) 20%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--purple) 7%, var(--card));
}
.api-group .field:first-child { margin-top: 14px; }

.hidden { display: none !important; }

@media (max-width: 520px) {
  body.admin .topbar { padding: 12px 16px; }
  body:not(.admin) .topbar-in { padding: 8px 16px; }
  main { padding: 0 14px 30px; }
  .card { padding: 16px; border-radius: 14px; }
  body.admin .card { border-radius: 18px; }
}

/* Admin */
/* The console grew to ten cards; one long column meant scrolling past everything to reach 最近签名.
   The nav stays put while the cards scroll, and each group states what its cards are for. The rail is
   sized to its longest label (自建签名证书) rather than to a round number: every pixel it takes comes
   out of the signing table's lane, and that table has a floor the pager depends on. */
.admin-shell { display: grid; grid-template-columns: 152px minmax(0, 1fr); gap: 12px; align-items: start; }
.admin-side { position: sticky; top: 18px; display: flex; flex-direction: column; gap: 12px; }
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.side-group { margin: 10px 8px 2px; font-size: 11px; letter-spacing: .06em; color: var(--muted); }
.side-group:first-child { margin-top: 2px; }
.side-nav a { padding: 7px 10px; border-radius: 10px; color: var(--text); font-size: 14px; }
.side-nav a:hover { background: #f1edff; color: var(--purple-dark); text-decoration: none; }
/* Round 68: the rail is a tab strip now, so only the cards of the section you are in are on screen.
   Buttons rather than links because switching a section is a view change, not a navigation — no URL,
   no anchor, nothing for the browser to remember for itself. */
.side-nav .tab {
  display: block;
  width: 100%;
  padding: 8px 10px;
  text-align: left;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
.side-nav .tab:hover { background: #f1edff; }
.side-nav .tab.on { background: #efeaff; color: var(--purple-dark); font-weight: 600; }
/* The list under the tabs names this section's cards; it is rebuilt on every switch, so it is
   deliberately quieter than the tabs themselves. */
.side-sub {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 10px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.sub-link {
  padding: 6px 10px;
  text-align: left;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.sub-link:hover { background: #f1edff; color: var(--purple-dark); }
.side-sub .side-group { margin: 6px 8px 2px; }
.side-actions { display: flex; gap: 8px; }
.side-actions .ghost { flex: 1 1 auto; }
.admin-main { min-width: 0; }
.admin-main .card:last-child { margin-bottom: 0; }
/* An anchor jump must not park the card title under the top edge. */
.card[id] { scroll-margin-top: 16px; }
/* The login form is a two-field card, not a dashboard: keep it narrow instead of stretching it to
   the console's new width. */
/* 第 97 轮：登录卡整体收窄到 262（含内边距，输入框约 220），两个框与「进入」按钮等宽居中；
   之前卡宽近 300、输入框从边到边，看起来是一条很长的白条。max-width 默认量的是内容盒，
   所以这里显式 border-box，免得 20px 内边距把卡片又撑宽 40。 */
#loginCard { box-sizing: border-box; max-width: 262px; margin: 18px auto 0; }
#loginForm .field input,
#loginForm .primary { box-sizing: border-box; width: 100%; }
.admin-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.admin-head h2 { margin: 0; font-size: 18px; }
.admin-head .muted { margin-left: auto; text-align: right; }
/* 「保存设置」 and friends sit in a header or a row, where the full-width primary rule (which exists
   for the login form) would stretch them across the card. */
.admin-head .primary, .admin-head .ghost, .row > .primary, .row > .ghost { width: auto; margin: 0; flex: 0 0 auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; }
.stats > div { background: #f8f7fd; border-radius: 12px; padding: 12px; }
.stats span { display: block; font-size: 12px; color: var(--muted); }
.stats strong { font-size: 20px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
/* 第 96 轮：设置类表单（发件箱、生成 API Key）也按内容定宽——每个框给 200px 的基准，
   不再把整行平均分掉、把「端口」这种短数字框拉成三分之一屏。超长字段单独放宽（见下面 300/260）。 */
.row > input[type="text"], .row > input[type="number"] { flex: 0 1 200px; }
.row > .inline { flex: 0 1 200px; }
/* 定宽必须按 border-box 算：默认的 content-box 会把 12/14 的内边距加到宽度外面，
   让输入框比自己的 200px 基准宽 30px，还会压到右边那个格子上。 */
.row > input, .row > .field.inline > input, .row > .field.inline > select { box-sizing: border-box; }
.row > .field.inline:has(#smtpHost) { flex: 0 1 300px; }
.row > .field.inline:has(#smtpTestTo) { flex: 0 1 260px; }
.row > .field.inline:has(#smtpUser),
.row > .field.inline:has(#smtpFrom),
.row > .field.inline:has(#smtpPassword) { flex: 0 1 240px; }
.field.inline { margin-top: 0; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-top: 10px; }
.check input[type="checkbox"]:disabled { opacity: .4; cursor: not-allowed; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
td code { font-size: 12px; }
td.actions { white-space: nowrap; }
td.dim { color: var(--muted); white-space: nowrap; }
/* Seven columns inside one card: the short numeric cells must never stack vertically, so they
   opt out of wrapping and the 备注 column absorbs the remaining width. */
td.nowrap { white-space: nowrap; }
/* Seven columns cannot fit a phone-width card. Scroll the table instead of letting the action
   buttons get clipped off the right edge, and keep the rename handle wide enough to read. */
.table-scroll { overflow-x: auto; }
table.keys { min-width: 760px; }
table.keys th:first-child, table.keys td:first-child { min-width: 140px; }
/* The request queue's 用途 is a sentence, so it is the one column allowed to take the remaining
   width — everything else there is short and must not stack. Round 74 folded 邮箱/网络地址 into
   one 申请人 column and 邮件 into 状态's sub line, so the eight-column table became six and the
   floor dropped from 1000px to a width the card actually has at a 1024 laptop. */
table.requests { min-width: 760px; }
table.bans { min-width: 640px; }
td.msg { min-width: 190px; }
/* 用途 in the queue gives up the extra 40px the ban table's 事由 keeps: in six columns it is the
   only cell that may wrap, and it has to, or 操作 gets pushed out of the card. */
table.requests td.msg { min-width: 120px; }
table.requests td.who { min-width: 168px; }
.requests .who-mail { word-break: break-all; }
/* 状态的第二行要放下「10-28 20:15 · sign_xxxxxxxx…」这一整串；窄一格它就会把密钥前缀折成
   两行，而那一行本来就是用来一眼认出这次发的哪把钥匙。sign_ 前缀比旧的 hs_ 多两个字符。 */
table.requests td.state { min-width: 200px; }
/* 地址旁边的小动作（封禁 / 改时长）：不是一条工具条按钮，而是一个依附于 IP 的轻链接，
   悬停才显形，红色只留给「已封禁后要改时长」这种破坏性动作。 */
.act-mini {
  margin-left: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.act-mini:hover { color: var(--purple-dark); text-decoration: underline; }
.act-mini.danger { color: var(--red); }
.mailtag { display: inline-block; margin-left: 7px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.mailtag::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  margin-right: 4px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 2px;
  opacity: .85;
}
.mailtag.ok { color: var(--green); }
.mailtag.bad { color: var(--red); }
.sub.err { color: var(--red); }
/* Round 74: 行内动作改成一条轻量工具条——六颗描边按钮曾经把每行撑成三行高。
   现在主操作（通过并分发 / 重发密钥）用浅紫底表示「这一步是正事」，其余（拒绝 / 封禁 / 删除）
   退成无边框文字按钮，只在悬停时透出底色；删除永远是红字，且按钮不会换行。 */
table.requests td.actions { white-space: nowrap; }
.requests td.actions .act {
  display: inline-flex; align-items: center; height: 28px; padding: 0 9px;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); font-size: 12.5px; cursor: pointer; white-space: nowrap;
  transition: background .12s ease, color .12s ease;
}
.requests td.actions .act + .act { margin-left: 2px; }
.requests td.actions .act:hover { background: #f2efff; color: var(--purple-dark); }
.requests td.actions .act-main { background: #efeaff; color: var(--purple-dark); font-weight: 600; }
.requests td.actions .act-main:hover { background: #e3dbff; }
.requests td.actions .act-danger { color: var(--red); }
.requests td.actions .act-danger:hover { background: #fdf0f0; color: var(--red); }
/* One labelled form on a line: the manual ban needs a name over each field (a bare input row would
   leave "which number is the duration" to guesswork) but three stacked blocks would look like three
   separate settings. */
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 14px; }
.inline-form .field { flex: 1 1 160px; margin: 0; }
.inline-form button { flex: 0 0 auto; margin: 0; }
.sub { color: var(--muted); font-size: 12px; word-break: break-all; }
.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 12px;
  line-height: 1.7;
  white-space: nowrap;
  background: #f0eff7;
  color: var(--muted);
}
.pill + .pill { margin-left: 4px; }
.st-active { background: #e6f5ee; color: var(--green); }
.st-expired, .st-exhausted { background: #fbf1de; color: #9a6207; }
.st-banned { background: #fbeda; color: var(--red); }
.st-off { background: #eef0f3; color: #5b6472; }
.st-pin { background: #edeef4; color: #4a4f63; border: 1px solid #d3d6e4; }
/* The key name is the rename handle and the prefix is the copy handle, so both have to look
   pressable without being links. */
.linklike { color: var(--purple); cursor: pointer; }
.linklike:hover { text-decoration: underline; }
.bad { color: var(--red); }
.muted { color: var(--muted); }
/* The manual-copy fallback field: the secret is long and must stay on one selectable line. */
.field-copy { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; user-select: all; }
/* Address book: one row per person, the way a mail client shows them. The email is the copy
   handle, so it is the element that reacts to the pointer. */
.contact-list { display: flex; flex-direction: column; margin-top: 6px; }
.contact { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.contact:last-child { border-bottom: 0; }
.contact-id { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.contact-id strong { font-size: 14px; }
.contact-id .sub { word-break: break-all; }
/* Round 63: the node row's certificate line. It is a child of `.contact-id`, not of `.contact`, so
   the narrow-screen rule below that hides `.contact > .muted` cannot hide it — on an iPhone or iPad
   the certificate status and its expiry are the point of the list. */
.contact-id .cert-line { color: var(--muted); font-size: 12px; }
/* The node and certificate rows carry their read-outs inside `.contact-id`, so they are two-column
   rows: leaving the third cell in the grid would park the buttons beside the name instead of at the
   right edge. */
#nodeList .contact, #identityPool .contact { grid-template-columns: minmax(0, 1fr) auto; }
.contact-id .sub:hover { color: var(--purple); text-decoration: underline; }
.contact-actions { display: flex; gap: 6px; }
.contact-actions .ghost { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.contact-empty { margin: 10px 0 0; font-size: 13px; }
/* Round 68: the book's explanatory paragraph moved with the card into the dialog opened by
   【联系人地址簿】, so the code inside it is sized from the dialog, not from a card id. */
#contactsModal code { font-size: 12px; }
#contactsModal .modal-box { max-height: 82vh; overflow: auto; }
/* Round 71: the import and ban forms live in dialogs now; the card-context margins above become
   dead space next to the dialog heading, and the wide dialogs need the same scroll cap. */
#identityImportModal .modal-box,
#banAddModal .modal-box { max-height: 82vh; overflow: auto; }
#identityImportModal .import-block { margin-top: 0; }
#banAddModal .inline-form { margin-top: 0; }
/* The queue filter row sits directly under the batch bar, not a section below. */
/* Round 74: 筛选变成一块浅底小面板——上面一排等宽的控件，下面一行只放「筛出几条」和「清空筛选」。
   控件高度压到 34px、字号 13px，六格才能在窄屏排成整齐的两行而不是参差的长短条。 */
.req-filters {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px;
  border-radius: 12px;
  background: #f8f7fd;
}
/* 第 96 轮：筛选控件按内容定宽，不再把这张卡片的宽度平均分给每一格。六格（时间 / 邮箱 /
   网络地址 / 用途 / 状态 / 邮件）在宽卡片上排成一行；放不下时整组换行，剩下的空白留在右侧，
   比把「状态：不限」这种短下拉拉成一条空条子好看得多。 */
.req-filter-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.req-filter-fields select,
.req-filter-fields input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 0;
  height: 34px;
  padding: 5px 10px;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
}
.req-filter-fields select:focus,
.req-filter-fields input:focus { outline: 2px solid #d9d0ff; border-color: var(--purple); }
/* 尺寸写在基础样式之后：否则同权重的 width/min-width 会把手里的定宽再拉回 100%。 */
.req-filter-fields > select { flex: 0 0 112px; width: 112px; }
.req-filter-fields > input { flex: 0 1 148px; width: 148px; min-width: 124px; }
@media (max-width: 620px) {
  .req-filter-fields > select,
  .req-filter-fields > input { flex: 1 1 calc(50% - 4px); width: auto; min-width: 0; }
}
.req-filter-foot { display: flex; align-items: center; gap: 10px; }
.req-filter-foot .muted { margin-right: auto; font-size: 12px; }
#reqFilterCount { align-self: center; }
/* 小号描边按钮：批处理条与筛选面板里的按钮都用它，比默认 38px 高的一档更收得住。 */
.ghost.sm { min-height: 30px; padding: 4px 10px; font-size: 12.5px; border-radius: 9px; }
/* Access control: every gate is a visible state row. A pinned one still shows its live value,
   which is what the dimmed checkbox used to hide. */
.gate { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.gate .check { margin: 0; flex: 1 1 260px; color: var(--text); }
.gate p.muted { flex-basis: 100%; margin: 2px 0 0; font-size: 12px; }
/* The IP budget is the fourth control and the only one with a value: 96px fits a seven-digit
   limit without stretching the row, and disabled reads like the pinned gates. */
.gate input.num { flex: 0 0 auto; width: 96px; margin: 0; }
.gate input.num:disabled { opacity: .4; cursor: not-allowed; }
/* Round 75 signing channel: the card is read top-down as 渠道 → 连接 → 状态 → 告警. Each block gets
   a small left-aligned caption (.chan-label) instead of a paragraph explaining itself, so the eye
   finds the same three anchors on every render. */
.chan-pick { margin-top: 4px; }
.chan-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12.5px; letter-spacing: .02em; }
.chan-connect { margin-top: 16px; }
/* 连接是两格输入：地址与令牌按内容定宽并排靠左——地址够放 https + 端口 + 路径（最长 420），
   令牌够放一串密钥（最长 260），剩下的空白留在卡片右侧，不再各自拉满半张卡。
   「清空令牌」是整行的复选，不挤第三格。 */
.chan-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 0; }
.chan-fields .field { margin: 0; min-width: 0; }
.chan-fields .field input { box-sizing: border-box; }
.chan-fields .field:nth-child(1) { flex: 0 1 420px; }
.chan-fields .field:nth-child(2) { flex: 0 1 260px; }
.chan-fields .check { flex: 1 0 100%; margin: 0; }
.chan-fields input:disabled { opacity: .4; cursor: not-allowed; }
@media (max-width: 720px) {
  .chan-fields .field { flex: 1 1 100%; }
}
/* 状态是读数不是散文：左列标签、右列值，两列网格上下对齐。浅底让它和上面的可编辑字段分开。 */
.chan-state {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 24px;
  margin-top: 16px; padding: 10px 14px;
  background: #f8f7fd; border-radius: 12px;
}
.kv { display: flex; align-items: baseline; gap: 10px; min-width: 0; padding: 4px 0; font-size: 13px; }
.kv > span { flex: 0 0 68px; color: var(--muted); font-size: 12.5px; }
.kv b { font-weight: 600; overflow-wrap: anywhere; }
.kv .sub { margin-top: 2px; word-break: normal; overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .chan-state { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
/* 告警离开读数表：它说的是「这一屏现在存不了/签不了」，颜色要压过读数。 */
.chan-alert {
  margin: 10px 0 0; padding: 8px 12px; font-size: 13px; line-height: 1.6;
  color: var(--red); background: #fdf0f0; border-radius: 10px; overflow-wrap: anywhere;
}
.chan-alert code { background: #f7e3e3; }
/* Round 69: the same notation question, answered where it is asked — directly under the address
   fields. Quieter than the read-out because it repeats on every render; `anywhere` for narrow cards. */
.chan-hint { margin: 8px 0 0; font-size: 12.5px; line-height: 1.6; overflow-wrap: anywhere; }
.chan-hint code { font-size: 12px; }
.chan-hint strong { color: var(--text); font-weight: 600; }
/* Round 65: the two signing cards show state, not prose. What they explain now lives behind the
   title's 「?」, so the title carries a hint handle, the channel choice is one segmented control
   (the selected segment is already the 使用中 read-out), and each card gets one small header per
   list inside it instead of a paragraph introducing the list. */
.admin-head h2 { display: flex; align-items: center; gap: 8px; }
.hint {
  width: 22px; height: 22px; padding: 0;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: #fff; color: var(--muted);
  font-size: 12px; font-weight: 700; line-height: 1; cursor: pointer;
}
.hint:hover, .hint:focus-visible { color: var(--purple); border-color: var(--purple); outline: none; }
.seg-row { display: flex; flex-wrap: wrap; gap: 8px; }
/* Round 76 quick switch: one row of node chips between 连接 and 状态 — the same ghost button the
   node list rows use, so the click target stays familiar; hidden entirely when the list has no
   other node (the container stays in the DOM for loadSignerNodes to fill). */
.chan-quick { margin-top: 16px; }
.chan-quick:empty { display: none; }
.quick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-row .ghost { margin: 0; }
.chan-quick .muted { margin: 6px 0 0; font-size: 12.5px; line-height: 1.6; }
.seg {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--text); font-size: 14px; cursor: pointer;
}
.seg input { margin: 0; }
.seg.on { border-color: var(--purple); background: #f4f0ff; color: var(--purple-dark); font-weight: 600; }
.seg input:disabled { cursor: not-allowed; }
/* 测试连通与节点自检是这张卡的收尾动作，靠右排一行；它们不改任何设置，所以不用主按钮。 */
.chan-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.sub-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line);
}
.sub-head h3 { margin: 0; font-size: 15px; }
.sub-head .ghost { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.list-note { margin: 8px 0 0; font-size: 13px; }
/* The certificate card's one-line read-out: badge, scope, expiry — and the 详情 handle that opens
   the labelled rows which used to fill the card. */
.status-line {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; background: #f8f7fd; border-radius: 12px;
}
.status-text { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.status-text strong { font-size: 14px; }
.status-line .ghost { min-height: 32px; padding: 4px 12px; font-size: 13px; }
/* The import box is a dashed frame, not another card: it is the one part of this card the operator
   visits once a year, and it has to stay out of the way of the two read-outs above it. */
.import-block { margin-top: 14px; padding: 14px; border: 1px dashed var(--line); border-radius: 14px; }
.import-block > .field:first-child { margin-top: 0; }
.import-block .row { margin-top: 10px; }
/* A signing that landed on the public signer because the node failed has to stand out in the
   后端 column; the amber of the key statuses would read as "expiring" here. */
.st-warn { background: #fdf3e3; color: #8a5a00; }
td .st-warn { margin-left: 6px; }
/* Nine data columns plus the 26px selection box. The floor stays at 900px — that number is what
   keeps 详情 on screen at a 1280-wide laptop, and the round-35 regression fails if it grows: the
   selection column has to buy its 26px out of the flexible cells, not out of the viewport. */
table.logs { min-width: 900px; }
/* Ten cells' gutters cost 80px of the row at 4px a side, which is width the console's sidebar has
   already taken out of this table's lane. Giving it back leaves enough slack that the CJK cells can
   render a few pixels wider (the same 1280 browser resolved them 6px wider on one run than another,
   depending on which fallback font it picked) without the table sliding under 详情. */
table.logs th, table.logs td { padding-left: 2px; padding-right: 2px; }
/* Round 36: the filter strip and the pager/batch strip. Both wrap instead of pushing the table
   sideways, and the checkbox column is a fixed 26px so the data columns keep their widths. */
.logfilters { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.logfilters input, .logfilters select { margin: 0; width: auto; flex: 0 1 auto; }
.logfilters input[type="date"] { width: 138px; }
.logfilters input[id^="f_"]:not([type="date"]) { min-width: 104px; }
.logpager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
/* Round 91: the same strip appears above the table too, so it keeps the gap to the filters. */
.logpager.logpager-top { margin-top: 0; margin-bottom: 8px; }
.logpager .selcount { color: var(--purple); font-size: 13px; min-width: 64px; }
table.logs th.sel, table.logs td.sel { width: 26px; text-align: center; padding: 2px 4px; }
table.logs td.sel input { margin: 0; }
/* Round 70: the request queue takes the same select column, so the two tables read alike. The bar
   sits above the table and wraps at 390px instead of squeezing the four buttons into one line. */
table.requests th.sel, table.requests td.sel { width: 26px; text-align: center; padding: 2px 4px; }
table.requests td.sel input { margin: 0; }
.batch-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; }
.batch-bar .muted { margin-right: auto; }
/* Round 74: 申请队列的批处理条挪到表格下面，用一条细分隔线收口，像队列自己的底部工具条。 */
.req-batch { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); gap: 8px; }
table.logs span[data-action="copy-key"] { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
.detail { display: grid; gap: 6px; max-height: 58vh; overflow: auto; }
.drow { display: flex; gap: 10px; font-size: 13px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.drow span { color: var(--muted); flex: 0 0 92px; }
.drow b { font-weight: 600; word-break: break-all; text-align: left; }
/* Every line of the detail dialog copies, so the value is the click target — but a dialog made
   entirely of purple links reads like navigation. Keep the colour, keep the affordance. */
.drow .linklike { color: inherit; }

/* 第 77 轮：AI 生成明细里「用户评价」四条单独成块。
 * 上面那些行是「这次签名发生了什么」（IP、密钥、描述词、产物），评价是「用户怎么看它」；
 * 一组淡紫底 + 左侧竖线，视线一眼就能落到这四行上，也不用再靠字重去分。 */
.detail-rate {
  display: grid; gap: 6px;
  margin-top: 4px; padding: 10px 12px 2px;
  border: 1px solid color-mix(in srgb, var(--purple) 24%, var(--line));
  border-left: 3px solid var(--purple);
  border-radius: 10px;
  background: color-mix(in srgb, var(--purple) 7%, #fff);
}
.detail-rate .detail-rate-title {
  margin: 0 0 2px; font-size: 12px; font-weight: 700;
  color: var(--purple); letter-spacing: .04em;
}
.detail-rate .drow { border-bottom-color: color-mix(in srgb, var(--purple) 15%, var(--line)); }
.detail-rate .drow:last-child { border-bottom: 0; padding-bottom: 4px; }

dialog {
  border: 0;
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 24px 60px rgba(29, 27, 39, .28);
  width: min(420px, 92vw);
}
dialog::backdrop { background: rgba(29, 27, 39, .45); }
dialog.wide { width: min(680px, 94vw); }
.modal-box { padding: 20px; }
.modal-box h3 { margin: 0 0 10px; font-size: 17px; }
.modal-box p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
/* Round 68: 弹窗里的 <code> 曾经是「一整块虚线紫卡片」，那是给独立取值用的；联系人地址簿把接口
   说明写进了句子（「<code>GET</code> 列出全部，<code>POST</code> 新增」），块级样式把一句话拆成了
   四行。今天没有任何弹窗再用 code 当整块，所以统一退回全局的内联 chip，只补长值断行。 */
.modal-box code { word-break: break-all; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.modal-actions .primary, .modal-actions .ghost { width: auto; margin: 0; }
.ghost.danger { color: var(--red); border-color: #f2c7c7; }

/* Round 52: a receipt that leaves on its own. Fixed bottom-center so it never shifts the form it
   refers to. It sits outside `<dialog>` in the DOM because the modal's top layer would paint over
   it, which is why submitting a request closes the dialog first. */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 50;
  max-width: min(520px, 92vw);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--card);
  font-size: 14px;
  box-shadow: var(--shadow);
  animation: toast-in 0.18s ease-out;
}
@keyframes toast-in { from { opacity: 0; } to { opacity: 1; } }

/* Round 52: the support section renders another process's page as plain content inside this card.
   Its headings are demoted to h3 so this console keeps one structural voice, its tables reuse the
   console's table style instead of a second set of numbers, and a cell the source marked as a
   warning gets the red this theme already uses for one. */
.sup-title { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.sup-src { color: var(--muted); font-size: 13px; margin: 0 0 12px; word-break: break-all; }
.sup-h { font-size: 14px; font-weight: 600; margin: 18px 0 6px; }
#supportBody p { margin: 6px 0; font-size: 14px; }
.sup-lede { color: var(--muted); }
.sup-warn { color: var(--red); }
.sup-form {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--muted);
}
.sup-form code { word-break: break-all; }

/* Below a laptop the sidebar would eat the table's 900px floor, so it turns into a row of
   section chips above the cards instead of a column beside them. */
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .admin-side { position: static; }
  .side-nav { flex-direction: row; overflow-x: auto; gap: 4px; padding: 8px; }
  .side-group { display: none; }
  .side-nav a { white-space: nowrap; font-size: 13px; padding: 6px 10px; }
  /* Round 68: the four tabs are the row; the card list under them only helps you skip down a long
     column, and on a phone each section is already one card wide. It is a jump aid, not a control —
     nothing in the console is reachable only from here. */
  .side-nav .tab { flex: 0 0 auto; width: auto; white-space: nowrap; font-size: 13px; padding: 6px 10px; }
  .side-sub { display: none; }
  .contact { grid-template-columns: minmax(0, 1fr) auto; }
  .contact > .muted { display: none; }
}

#nodeList .contact-id { overflow-wrap: anywhere; }
/* Round 65: the certificate pool's row carries up to four buttons. Left in the two-column grid on a
   phone they squeezed the name into a per-character column ("备用证 书 · 2027"), so both lists drop
   the action column below the text and let the buttons wrap on their own line. */
@media (max-width: 600px) {
  #nodeList .contact, #identityPool .contact { grid-template-columns: minmax(0, 1fr); }
  #nodeList .contact-actions, #identityPool .contact-actions { justify-content: flex-end; flex-wrap: wrap; }
  /* A wrapped 「详情」 keeps to the right edge instead of starting a new line at the far left. */
  .status-line .ghost { margin-left: auto; }
}

/* =====================================================================
   第 72 轮：整套后台的排版整理
   · 每个分段在卡片列顶上有一行段落标题，切段时跟着换，扫一眼就知道自己在哪
   · 卡片标题与内容之间画一道细线，标题不再是「悬着的文本」
   · 数字块、表头、行悬停统一，表格在长列表里更容易横向追踪
   · AI 生成记录自己的两列：金色星级、被二次编辑过的描述词
   ===================================================================== */

.main-head { padding: 2px 4px 14px; }
.main-head h1 { margin: 0 0 2px; font-size: 20px; letter-spacing: -0.01em; }
.main-head p { margin: 0; color: var(--muted); font-size: 13px; }

/* A rule under every card header: the cards used to read as one continuous block of text. */
.admin-head { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.admin-head + .stats,
.admin-head + .row,
.admin-head + .field,
.admin-head + .logfilters,
.admin-head + .req-filters,
.admin-head + .batch-bar,
.admin-head + .table-scroll { margin-top: 12px; }
/* The login card is a form, not a dashboard section: no rule, and the primary button needs no extra
   gap above it. */
#loginCard .admin-head { border-bottom: 0; padding-bottom: 0; }

.stats > div { padding: 12px 14px; }
.stats strong { font-size: 22px; font-weight: 700; line-height: 1.3; }
/* 「已实现 / 未实现」两块同色，读起来像同一组；只有第一块（总数）用主色作锚点。 */
.ai-stats > div:first-child { background: #f1edff; }

/* The rail's current section gets an accent bar instead of only a bold word. */
.side-nav .tab { border-left: 3px solid transparent; border-radius: 10px; }
.side-nav .tab.on { border-left-color: var(--purple); }

tbody tr:hover td { background: #faf9ff; }

/* AI 生成记录 */
/* 八列里只有描述词需要换行，其余都是短值：地板放在 720px，1024 的笔记本上整张表不用横向滚动，
   描述词自己折成两三行。九列十列的「最近签名」才需要 900px。 */
table.ai-table { min-width: 720px; }
table.ai-table td.ai-desc { max-width: 320px; }
table.ai-table td.ai-desc .linklike { overflow-wrap: anywhere; white-space: normal; }
/* 指令名称是一行短标题：宁可省略也不要在词中间折行（「批量改文/件名」读起来像两个指令）。
   全名在【详情】里，鼠标悬停也有 title。 */
table.ai-table td.ai-name { max-width: 118px; }
table.ai-table td.ai-name .linklike { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stars { color: #e8a317; letter-spacing: .5px; font-size: 13px; white-space: nowrap; }
.stars-off { color: #dddbe8; }
.ai-desc .pill { vertical-align: baseline; }
/* Round 75: 勾选列与批处理条，尺寸与「密钥申请」那张表一致——两张表在同一个后台里，读法应当相同。 */
table.ai-table th.sel, table.ai-table td.sel { width: 26px; text-align: center; padding: 2px 4px; }
table.ai-table td.sel input { margin: 0; }
/* 第 88 轮：AI 生成记录的五格筛选改成「按内容定宽 + 允许换行」。
   第 132 轮：七格改为按比例分列的网格——七格恒在一行，放不下时按比例收窄，不再整格换行；
   窄屏（≤760px）降成两列。下拉左右内边距收到 8px，给「二次编辑：不限」这类长标签留字宽。 */
.ai-filters .req-filter-fields {
  display: grid;
  grid-template-columns: 1.05fr 1.05fr 0.95fr 0.95fr 0.9fr 1fr 0.95fr;
  gap: 6px;
  align-items: center;
}
.ai-filters .req-filter-fields > input,
.ai-filters .req-filter-fields > select {
  flex: none;
  width: 100%;
  min-width: 0;
  max-width: none;
  padding-left: 8px;
  padding-right: 8px;
}
@media (max-width: 760px) {
  .ai-filters .req-filter-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.ai-filter-foot { flex-wrap: wrap; }
.ai-quick { display: flex; gap: 6px; }
.ai-batch { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); gap: 8px; }

@media (max-width: 900px) {
  .main-head { padding: 0 2px 10px; }
  .main-head h1 { font-size: 18px; }
  .main-head p { font-size: 12.5px; }
}

/* =====================================================================
   第 80 轮：语言下拉 + 深浅色
   四个站点同一套控件尺寸；深浅色只吃变量，深色块挂在 html[data-theme="dark"] 上，
   管理后台（不设 data-theme）不受影响。
   ===================================================================== */

.nav-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.lang-sel, .theme-btn {
  height: 32px; flex: 0 0 auto;
  border: 1.5px solid var(--line); border-radius: 9px;
  background: var(--card); color: var(--text); cursor: pointer;
  transition: border-color .15s ease;
}
.lang-sel {
  padding: 0 6px 0 8px; font: inherit; font-size: 13px; line-height: 1.4;
  outline: none;
}
.lang-sel:hover, .lang-sel:focus-visible, .theme-btn:hover { border-color: var(--purple); }
.theme-btn { width: 32px; padding: 0; display: inline-grid; place-items: center; }
.theme-btn:active { transform: scale(.95); }
.theme-dot {
  display: block; width: 15px; height: 15px; border-radius: 50%;
  background: linear-gradient(90deg, #f5a623 0 50%, #7a5cff 50% 100%);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1a1a1c;
  --card: #242426;
  --text: #f2f2f7;
  --muted: #a0a0a8;
  --line: #3a3a3c;
  --purple: #8b74ff;
  --purple-dark: #6f55e6;
  --green: #30d158;
  --red: #ff453a;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
/* body 的浅紫光晕在深色下换成一层更暗的紫，其余一律走变量。管理后台才需要这层光晕，
   签名页和其它三页一样是平底色。 */
html[data-theme="dark"] body.admin {
  background: radial-gradient(1200px 500px at 20% -10%, #241f3d 0%, transparent 60%), var(--bg);
}
html[data-theme="dark"] code { background: color-mix(in srgb, var(--purple) 10%, var(--card)); }
html[data-theme="dark"] .badge { background: color-mix(in srgb, var(--purple) 16%, var(--card)); }
html[data-theme="dark"] .site-nav-btn.on { background: color-mix(in srgb, var(--purple) 16%, var(--card)); }
html[data-theme="dark"] .drop { background: color-mix(in srgb, var(--purple) 6%, var(--card)); border-color: color-mix(in srgb, var(--purple) 26%, var(--card)); }
html[data-theme="dark"] .drop:hover,
html[data-theme="dark"] .drop:focus-visible,
html[data-theme="dark"] .drop.over { background: color-mix(in srgb, var(--purple) 12%, var(--card)); border-color: var(--purple); }
html[data-theme="dark"] .file-info { background: color-mix(in srgb, var(--purple) 6%, var(--card)); }
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field textarea { background: #202024; color: var(--text); }
html[data-theme="dark"] .error { background: #3a2320; border-color: #5a3330; }
html[data-theme="dark"] .ok-icon { background: #17342a; }
html[data-theme="dark"] dialog { background: var(--card); color: var(--text); }
html[data-theme="dark"] dialog::backdrop { background: rgba(0, 0, 0, .6); }
html[data-theme="dark"] .ghost { color: var(--muted); }
html[data-theme="dark"] .ghost.danger { border-color: #6b3434; }

/* 阿拉伯语从右往左；文件链接是机器串，保持从左往右。 */
html[dir="rtl"] body { text-align: right; }
html[dir="rtl"] .addr { direction: ltr; text-align: left; }
html[dir="rtl"] .nav-tools { margin-left: 0; margin-right: auto; }

/* =====================================================================
   第 85 轮：加载遮罩 + 切页淡出 + 按钮忙碌态，四个页面同一套。
   ===================================================================== */
body.page-out { opacity: 0; transition: opacity .16s linear; }
.boot {
  position: fixed; inset: 0; z-index: 999;
  display: grid; place-items: center;
  background: var(--bg);
  transition: opacity .42s var(--ease), visibility .42s var(--ease);
}
.boot.done { opacity: 0; visibility: hidden; }
.boot-orb { position: relative; display: grid; place-items: center; width: 64px; height: 64px; }
.boot-orb::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 18%, var(--purple) 78%, transparent 96%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  animation: boot-spin 1s linear infinite;
}
.boot-orb img {
  display: block; width: 38px; height: 38px; border-radius: 12px;
  animation: boot-breathe 1.8s ease-in-out infinite;
}
@keyframes boot-spin { to { transform: rotate(360deg); } }
@keyframes boot-breathe {
  0%, 100% { transform: scale(1); opacity: .92; }
  50% { transform: scale(1.08); opacity: 1; }
}
/* 签名中的按钮转一个小圆环，和遮罩同一个节奏。 */
.primary.busy::before {
  content: ""; width: 15px; height: 15px; border-radius: 50%; flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, .38);
  border-top-color: #fff;
  animation: boot-spin .8s linear infinite;
}



/* ===================== 第 87 轮：自动学习排版调优 ===================== */
/* 第 91 轮：密钥框再收一档（300 → 260），模型下拉 180，两者只隔 12px；
   标签同时收短到能在一行内放下，不再被省略号截断。窄屏上各自整行。
   第 72 轮：模型下拉 180 → 220，「DeepSeek-V4.1 Flash」不再被截成「DeepSeek-V4.1 Fl」。 */
.learn-fields { align-items: flex-end; justify-content: flex-start; gap: 12px; }
.learn-fields .field:first-child { flex: 0 0 220px; max-width: 220px; }
.learn-fields .field.inline { flex: 0 0 220px; }
.learn-fields input, .learn-fields select { box-sizing: border-box; }
.learn-fields .field span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 620px) {
  .learn-fields .field:first-child,
  .learn-fields .field.inline { flex: 1 1 100%; max-width: none; }
  .learn-fields .field span { white-space: normal; }
}
/* 动作行：自动分析 / 自动应用 两个开关与「立即分析一轮」同排，竖线分隔「分析」与「应用」两件事。 */
.learn-actions { align-items: center; column-gap: 14px; row-gap: 8px; margin-top: 14px; }
.learn-actions .check { margin: 0; color: var(--text); }
.learn-actions .vline { width: 1px; height: 22px; background: var(--line); }
/* 余额输出：成功着绿、失败红字常驻——之前失败只闪一个 toast，页面只剩一个孤零零的「—」。 */
#learnBalanceOut { font-size: 13px; }
#learnBalanceOut.ok { color: #1a7f37; font-weight: 600; }
#learnBalanceOut.err { color: #c62828; }
/* 第 93 轮：网页端密钥授权开关。做成一条浅紫底的说明行，和上面两个输入框分开，读起来是
   「一个授权 + 一句后果」，而不是第三格输入。 */
.learn-webkey {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px;
  margin-top: 12px; padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--purple) 18%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--purple) 5%, #fff);
}
.learn-webkey .check { margin: 0; white-space: nowrap; color: var(--text); }
.learn-webkey > .muted { flex: 1 1 260px; min-width: 0; font-size: 12.5px; line-height: 1.6; }
/* 五格统计在窄卡上自动换行（auto-fit 已有），「最近分析」的两行时间随格子宽度自适应。 */
.learn-stats strong { font-size: 18px; }
.learn-stats strong .sub { font-size: 12px; font-weight: 400; color: var(--muted); }
/* 第 91 轮：筛选改回一条紧凑的工具条——控件各按内容给固定宽度（日期 138、星级/状态 118、
   关键字最多 320），「筛选 / 清空」用 margin-left:auto 推到同一行的最右端；放不下时整组换行，
   不再像上一版那样把五个控件拉满整张卡片、按钮单独占一行留下半行空白。 */
.learn-filters .req-filter-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.learn-filters .req-filter-fields > input[type="date"] { flex: 0 0 138px; width: auto; }
/* 关键字框按「非日期输入」定位，不依赖 id：上一版靠 id 选择器，换一份标记就退回 100% 宽。 */
.learn-filters .req-filter-fields > input:not([type="date"]) {
  flex: 1 1 190px; width: auto; min-width: 170px; max-width: 320px;
}
.learn-filters .req-filter-fields > select { flex: 0 0 118px; width: auto; }
.learn-filter-btns { display: flex; gap: 8px; margin-left: auto; }
.learn-filter-btns .ghost.sm { min-width: 68px; }
@media (max-width: 620px) {
  .learn-filters .req-filter-fields > input[type="date"],
  .learn-filters .req-filter-fields > select { flex: 1 1 0; min-width: 0; }
  .learn-filters .req-filter-fields > input:not([type="date"]) { flex: 1 1 100%; max-width: none; }
  .learn-filter-btns { margin-left: 0; }
}
/* 第 90 轮：结果表固定列宽，问题与解决措施合并成一格两行——之前九列把表格撑出横向滚动，
   右侧「操作」被截掉一截。级别/状态居中，操作从列首左对齐：按钮紧跟在状态后面，
   不再被推到表格最右端、和状态之间留出一大片空白。 */
table.learn-table { table-layout: fixed; min-width: 680px; }
table.learn-table th.l-time, table.learn-table td.l-time { width: 96px; }
table.learn-table th.l-name, table.learn-table td.l-name { width: 148px; }
table.learn-table th.l-level, table.learn-table td.l-level { width: 50px; text-align: center; }
table.learn-table th.l-state, table.learn-table td.l-state { width: 92px; text-align: center; }
table.learn-table th.l-act, table.learn-table td.l-act { width: 156px; text-align: left; }
table.learn-auto-table th.l-act, table.learn-auto-table td.l-act { width: 126px; }
table.learn-table td.l-name, table.learn-table td.l-issue { overflow: hidden; }
table.learn-table td.l-issue { padding-right: 14px; }
table.learn-table .l-name-main,
table.learn-table .l-stars,
table.learn-table .issue-line,
table.learn-table .fix-line { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.learn-table .l-stars { margin-top: 2px; font-size: 11.5px; color: var(--muted); }
table.learn-table .fix-line { margin-top: 2px; color: var(--muted); }
table.learn-table td.actions {
  white-space: nowrap; text-align: left; vertical-align: middle;
  padding-left: 6px; padding-right: 0;
}
table.learn-table td.actions .ghost { min-height: 28px; padding: 3px 8px; font-size: 12px; border-radius: 8px; }
table.learn-table td.actions .ghost + .ghost { margin-left: 4px; }
/* 批量工具条：普通操作一组，删除单独拉开距离并着红。 */
.ai-batch .danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 32%, var(--line)); margin-left: 6px; }
.ai-batch .danger:hover { border-color: var(--red); }
/* 第 91 轮：详情弹窗底部做成一条完整的工具栏（浅底 + 圆角），三个动作按主次分开：
   复制=无边框的文字按钮，重学=白色底紫描边，应用=实心紫底；已应用时换成红描边的「撤销应用」。
   右侧状态行贴边。这样它读起来是「这条记录能做什么」，而不是三个孤零零的小胶囊。 */
.learn-detail-foot {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-top: 14px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: #f8f7fd;
}
.learn-foot-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.learn-detail-foot .learn-btn { min-height: 32px; padding: 5px 12px; font-size: 12.5px; border-radius: 9px; font-weight: 600; }
/* 第 92 轮：复制按钮从「无边框文字」升级成有颜色的浅紫按钮——它仍是次要动作，
   但不再和普通说明文字混在一起；重学白底紫描边、应用实心紫，三级层次不变。 */
.learn-detail-foot .learn-btn.copy {
  color: color-mix(in srgb, var(--purple) 58%, var(--text));
  background: color-mix(in srgb, var(--purple) 10%, #fff);
  border-color: color-mix(in srgb, var(--purple) 26%, var(--line));
  font-weight: 600;
}
.learn-detail-foot .learn-btn.copy:hover {
  color: var(--purple-dark);
  background: color-mix(in srgb, var(--purple) 16%, #fff);
  border-color: color-mix(in srgb, var(--purple) 42%, var(--line));
}
.learn-detail-foot .learn-btn.relearn {
  color: var(--purple); background: #fff;
  border-color: color-mix(in srgb, var(--purple) 32%, var(--line));
}
.learn-detail-foot .learn-btn.relearn:hover { background: color-mix(in srgb, var(--purple) 7%, #fff); }
.learn-detail-foot .learn-btn.apply {
  color: #fff; background: var(--purple); border-color: var(--purple);
  box-shadow: 0 3px 8px color-mix(in srgb, var(--purple) 24%, transparent);
}
.learn-detail-foot .learn-btn.apply:hover { filter: brightness(1.05); }
.learn-detail-foot .learn-btn.apply.undo {
  color: var(--red); background: #fff;
  border-color: color-mix(in srgb, var(--red) 34%, var(--line));
  box-shadow: none;
}
.learn-detail-foot .learn-btn.apply.undo:hover { background: color-mix(in srgb, var(--red) 6%, #fff); filter: none; }
.learn-detail-foot #detailStatus { margin-left: auto; font-size: 12.5px; text-align: right; }
@media (max-width: 560px) {
  .learn-foot-actions { width: 100%; }
  .learn-detail-foot #detailStatus { margin-left: 0; }
}

/* 第 92 轮：540 → 460，输入框跟着收窄；原先 100% 宽加上内边距会顶出弹窗，补了 box-sizing。 */
dialog.relearn { width: min(460px, 92vw); }
.relearn-body { display: grid; gap: 12px; }
.relearn-target {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 10px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--purple) 6%, #fff);
  border: 1px solid color-mix(in srgb, var(--purple) 20%, var(--line));
}
.relearn-target .relearn-name { font-weight: 700; font-size: 14.5px; letter-spacing: -.01em; }
.relearn-lead-line { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.relearn-body .field { margin-top: 0; }
.relearn-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.relearn-label span { display: inline; margin: 0; font-size: 13px; font-weight: 600; color: var(--text); }
.relearn-label .relearn-count { font-size: 12px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.relearn-body textarea { min-height: 92px; font-size: 14px; }
.relearn-hint { margin: 0; color: var(--muted); font-size: 12.5px; }
dialog.relearn .modal-actions { margin-top: 18px; }
dialog.relearn .modal-actions .primary,
dialog.relearn .modal-actions .ghost { min-height: 40px; padding: 8px 18px; font-size: 14px; border-radius: 10px; }
dialog.relearn .modal-actions .primary { width: auto; margin: 0; }

/* =====================================================================
   第 81 轮：设备上传码弹窗排版
   原来乱在三处：dialog.wide 只有 680px，而命令里全是没空格的长路径；
   .modal-box code 的 word-break: break-all 把 /paste-identity.sh 从中间掰开；
   步骤没有层级，码、倒计时、说明、状态挤成一段。这里放宽弹窗、把命令改成
   「整行 + 横向滚动」，步骤做成卡片，码单独放大展示。
   ===================================================================== */
dialog.wide#identityUploadModal { width: min(760px, 95vw); }
#identityUploadModal .modal-box { padding: 22px; }
#identityUploadModal .modal-box > p { margin: 0 0 10px; }

.upload-code {
  margin: 12px 0 0; padding: 16px 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: clamp(24px, 5vw, 34px); font-weight: 700; line-height: 1.1;
  letter-spacing: .3em; text-indent: .3em; text-align: center;
  color: var(--text); user-select: all;
  background: color-mix(in srgb, var(--purple) 7%, var(--card));
  border: 1px dashed color-mix(in srgb, var(--purple) 55%, var(--line));
  border-radius: 14px;
}

.upload-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.upload-count {
  padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums;
}

.step-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.step { padding: 13px 15px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--card); }
.step-head { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; color: var(--text); }
.step-no {
  flex: 0 0 auto; display: inline-grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--purple); color: #fff; font-size: 12px; font-weight: 700;
}
.step p { margin: 7px 0 0; font-size: 13px; line-height: 1.65; color: var(--muted); }

/* 命令一行到底、横向滚动：拼路径时被折断成两行，正是照着敲会敲错的地方。 */
.code-row { display: flex; gap: 8px; align-items: stretch; margin-top: 9px; }
.code-row code {
  flex: 1 1 auto; min-width: 0; margin: 0; padding: 9px 11px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px; line-height: 1.5;
  white-space: pre; word-break: normal; overflow-wrap: normal; overflow-x: auto;
  background: var(--bg); border: 1px solid var(--line); border-radius: 9px;
  user-select: all;
}
.code-row .js-copy { flex: 0 0 auto; align-self: center; margin: 0; min-height: 34px; padding: 0 13px; font-size: 13px; }

.upload-status { margin: 12px 0 0; min-height: 18px; font-size: 13px; line-height: 1.6; color: var(--muted); }

/* 使用前提：三条都是"什么时候该做什么"，放在码上方当阅读说明，不抢码的位置。 */
.upload-notes {
  margin: 0 0 2px; padding: 11px 14px 11px 32px;
  list-style: decimal; border-left: 3px solid var(--purple); border-radius: 0 10px 10px 0;
  background: color-mix(in srgb, var(--purple) 6%, var(--card));
  font-size: 13px; line-height: 1.75; color: var(--muted);
}
.upload-notes li { margin: 1px 0; }
.upload-notes li::marker { color: var(--purple); font-weight: 700; }

@media (max-width: 560px) {
  dialog.wide#identityUploadModal { width: calc(100vw - 20px); }
  .upload-code { font-size: 24px; letter-spacing: .22em; }
  .code-row { flex-wrap: wrap; }
  .code-row .js-copy { align-self: flex-end; margin-left: auto; }
}

/* =====================================================================
   第 86 轮：申请密钥弹窗
   原来的弹窗是「默认 dialog + 三个裸控件」：标题和第一个字段只隔 10px，
   标签跟输入框几乎贴在一起，按钮行紧贴文本框，整块没有层级。
   这里只做三件事——给弹窗一个 448px 的固定节奏、标题带一句说明、字段与
   按钮拉开层级；输入框统一 44px 高，焦点环沿用页面蓝色。
   ===================================================================== */
dialog.key-dialog { width: min(448px, 92vw); border-radius: 20px; }
.key-dialog .modal-box { padding: 26px 26px 22px; }

.key-head h3 { margin: 0; font-size: 20px; line-height: 1.3; letter-spacing: -.01em; }
.key-head p { margin: 7px 0 0; font-size: 13px; line-height: 1.65; color: var(--muted); }

.key-dialog .field { margin-top: 18px; }
.key-dialog .field span { margin-bottom: 7px; font-size: 13px; font-weight: 600; color: var(--text); }
.key-dialog .field input { box-sizing: border-box; height: 44px; border-radius: 12px; }
.key-dialog .field textarea { min-height: 104px; border-radius: 12px; line-height: 1.6; resize: vertical; }

.key-dialog .error {
  margin-top: 16px; padding: 10px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--red) 8%, var(--card));
  border: 1px solid color-mix(in srgb, var(--red) 30%, var(--line));
}
.key-dialog .error p { margin: 0; font-size: 13px; line-height: 1.6; }

.key-dialog .modal-actions { margin-top: 22px; gap: 10px; }
.key-dialog .modal-actions .ghost,
.key-dialog .modal-actions .primary {
  width: auto; margin: 0; min-height: 42px; padding: 0 20px;
  border-radius: 12px; font-size: 14.5px;
}

@media (max-width: 480px) {
  dialog.key-dialog { width: calc(100vw - 24px); }
  .key-dialog .modal-box { padding: 22px 20px 18px; }
  .key-dialog .modal-actions .ghost,
  .key-dialog .modal-actions .primary { flex: 1 1 0; }
}

/* 第 104 轮：自建签名时的「通讯录联系人」提示行（第三方渠道下这行不出现）。
   邮箱是生效证书名片里的变量，所以用 code 等宽字体单独成块，方便照着抄进通讯录。 */
.hint-line {
  margin: 14px 0 0; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); border-left: 3px solid var(--purple);
  background: color-mix(in srgb, var(--purple) 6%, var(--card));
  color: var(--text); font-size: 13px; line-height: 1.7; word-break: break-word;
}
.hint-line code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px;
  padding: 1px 6px; border-radius: 6px;
  background: color-mix(in srgb, var(--purple) 12%, transparent);
}
/* 第 115 轮：这句提示里的邮箱改成可点的按钮（点一下复制），所以样式兜住 button 的原生外观，
   外观仍与上面的 code chip 一致；虚线边框表示「这里可以点」。 */
.hint-line .mail-chip {
  margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px;
  line-height: 1.5; padding: 2px 8px; border-radius: 6px; cursor: pointer; color: inherit;
  border: 1px dashed color-mix(in srgb, var(--purple) 45%, transparent);
  background: color-mix(in srgb, var(--purple) 12%, transparent);
}
.hint-line .mail-chip:hover { background: color-mix(in srgb, var(--purple) 22%, transparent); }
.hint-line .mail-chip:active { transform: translateY(1px); }

/* ================= 第 122 轮：四页精修 =================
 * 与 AI 页、两个 shortcuts 页共用同一组数字：卡片圆角 16 / 导航胶囊 34 高 / 聚焦环 3px。
 * 只改质感（描边、圆角、投影、留白、聚焦反馈），不改配色与布局；
 * 全部写在文件末尾、且都挂在 body:not(.admin) 上，后台（body.admin）一点不受影响。 */
body:not(.admin) {
  --field-bg: #ffffff;
  --field-line: #d7dde5;
  --shadow-1: 0 1px 2px rgba(16, 20, 28, .04);
  --shadow-2: 0 18px 40px -30px rgba(16, 20, 28, .30);
  --shadow: var(--shadow-1), var(--shadow-2);
}
html[data-theme="dark"] body:not(.admin) {
  --field-bg: #12151b;
  --field-line: #2d333d;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow-2: 0 20px 44px -30px rgba(0, 0, 0, .8);
  --shadow: var(--shadow-1), var(--shadow-2);
}
/* 顶端一层几乎看不出的冷光，让白卡片有浮起来的感觉 */
body:not(.admin) {
  background-color: var(--bg);
  background-image: radial-gradient(1100px 380px at 50% -150px, #e9f0fa 0%, transparent 72%);
}
html[data-theme="dark"] body:not(.admin) {
  background-image: radial-gradient(1100px 380px at 50% -150px, #17212f 0%, transparent 72%);
}

/* ---------- 顶栏 ---------- */
body:not(.admin) .topbar { box-shadow: 0 8px 24px -22px rgba(16, 20, 28, .45); }
/* 导航胶囊：1.5px 描边收到 1px，高度统一 34、圆角 10 */
.site-nav-btn {
  height: 34px; padding: 0 13px; gap: 7px;
  border-width: 1px; border-radius: 10px;
  box-shadow: var(--shadow-1);
  transition: border-color .15s ease, color .15s ease, background .15s ease,
    transform .15s ease, box-shadow .15s ease;
}
.site-nav-btn i { font-size: 14px; }
.site-nav-btn:hover {
  background: color-mix(in srgb, var(--purple) 5%, var(--card));
  transform: translateY(-1px);
}
.site-nav-btn:active { transform: translateY(0); }
.site-nav-btn.on { background: color-mix(in srgb, var(--purple) 8%, var(--card)); box-shadow: none; }
/* 右上角两个控件跟胶囊同高同圆角 */
body:not(.admin) .lang-sel, body:not(.admin) .theme-btn {
  height: 34px; border-width: 1px; border-radius: 10px;
}
body:not(.admin) .theme-btn { width: 34px; }

/* ---------- 页头 ---------- */
/* 四页从顶栏到标题的距离统一成 40px：本页 main 上边距 10，这里补 30 */
body:not(.admin) .page-head { margin: 30px 0 16px; }
body:not(.admin) .page-head h1 { letter-spacing: -.025em; line-height: 1.3; }

/* ---------- 卡片 ---------- */
body:not(.admin) .card {
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow-1), var(--shadow-2);
}

/* ---------- 拖入区 ---------- */
/* 虚线框原来 2px、紫得发亮，像是占位；换成 1.5px 的淡描边 + 更淡的底色，
 * 中间那个 ⇪ 也从「一行大字符」变成一枚 46px 的圆角图标底，一眼知道这里要放文件。 */
body:not(.admin) .drop {
  border-width: 1.5px;
  border-color: color-mix(in srgb, var(--purple) 26%, var(--card));
  background: color-mix(in srgb, var(--purple) 3.5%, var(--card));
  gap: 6px;
  transition: border-color .15s var(--ease), background .15s var(--ease), box-shadow .2s var(--ease);
}
body:not(.admin) .drop:hover,
body:not(.admin) .drop:focus-visible,
body:not(.admin) .drop.over {
  border-color: var(--purple);
  background: color-mix(in srgb, var(--purple) 7%, var(--card));
  box-shadow: 0 14px 34px -26px color-mix(in srgb, var(--purple) 70%, transparent);
}
body:not(.admin) .drop-icon {
  width: 46px; height: 46px; margin: 0 auto 4px;
  display: grid; place-items: center;
  border-radius: 14px; font-size: 22px; line-height: 1;
  background: color-mix(in srgb, var(--purple) 10%, var(--card));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--purple) 16%, transparent);
}

/* ---------- 已选文件 ---------- */
body:not(.admin) .file-info {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--purple) 4%, var(--card));
}

/* ---------- 表单 ---------- */
/* 输入框原来写死 #fff：深色主题下一块刺眼的白。改成主题变量，并统一聚焦环为 3px 柔环。 */
body:not(.admin) .field input,
body:not(.admin) .field select,
body:not(.admin) .field textarea {
  background: var(--field-bg);
  border-color: var(--field-line);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
body:not(.admin) .field input:focus,
body:not(.admin) .field select:focus,
body:not(.admin) .field textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--purple) 14%, transparent);
}

/* ---------- 按钮 ---------- */
body:not(.admin) .primary {
  transition: filter .15s var(--ease), box-shadow .2s var(--ease), transform .15s var(--ease);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--purple) 26%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, .22);
}
body:not(.admin) .primary:hover { transform: translateY(-1px); }
body:not(.admin) .primary:active { transform: translateY(0); }
/* ghost 原来是纯透明 + 灰字，在白卡上像一句灰注释；给一层极浅底，仍保持安静 */
body:not(.admin) .ghost {
  background: color-mix(in srgb, var(--bg) 55%, var(--card));
  color: var(--text);
  transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
body:not(.admin) .ghost:hover { border-color: var(--purple); color: var(--purple); }

/* ---------- 结果 / 提示 ---------- */
body:not(.admin) .ok-icon {
  background: color-mix(in srgb, var(--green) 14%, var(--card));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 24%, transparent);
}
body:not(.admin) .error {
  border-color: color-mix(in srgb, var(--red) 26%, transparent);
  background: color-mix(in srgb, var(--red) 8%, var(--card));
}
/* 示例代码块从紫黑换成中性深色，放在浅色页面里不再像一块旧的深紫补丁 */
body:not(.admin) pre {
  background: #171b24;
  color: #e6edf7;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}

/* ---------- 页脚 ---------- */
body:not(.admin) .site-foot {
  padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
}

/* 窄屏沿用原来的内边距（旧规则在文件前面，需要在这里重述） */
@media (max-width: 520px) {
  body:not(.admin) .card { padding: 16px; }
}

/* ================= 第 123 轮：把对比与层次再推一档 =================
 * 第 122 轮只动了「线」和「影」，整页看过去仍是一片白，肉眼几乎看不出区别。
 * 这一轮动三件看得见的事：底色压深一档、投影加厚、标题与胶囊放大一档。
 * 配色仍是同一个蓝；后台（body.admin）依旧不受影响。 */
body:not(.admin) {
  --bg: #eef1f7;
  --line: #dde2ea;
  --shadow-1: 0 2px 4px rgba(16, 20, 28, .05);
  --shadow-2: 0 26px 50px -34px rgba(16, 20, 28, .45);
}
html[data-theme="dark"] body:not(.admin) {
  --bg: #0d1015;
  --line: #272d38;
  --shadow-1: 0 2px 4px rgba(0, 0, 0, .5);
  --shadow-2: 0 28px 56px -34px rgba(0, 0, 0, .9);
}
body:not(.admin) {
  background-image: radial-gradient(1200px 430px at 50% -170px, #dfe9f8 0%, transparent 76%);
}
html[data-theme="dark"] body:not(.admin) {
  background-image: radial-gradient(1200px 430px at 50% -170px, #182534 0%, transparent 76%);
}

/* 卡片圆角再大一档，配合加厚的落影 */
body:not(.admin) .card { border-radius: 18px; padding: 24px; }
body:not(.admin) .page-head h1 { font-size: 30px; }

/* 导航胶囊 36 高；当前页 14% 蓝底 + 一点外发光 */
.site-nav-btn { height: 36px; padding: 0 14px; border-radius: 11px; font-size: 13.5px; }
.site-nav-btn.on {
  background: color-mix(in srgb, var(--purple) 14%, var(--card));
  box-shadow: 0 4px 14px -8px color-mix(in srgb, var(--purple) 80%, transparent);
}
body:not(.admin) .lang-sel, body:not(.admin) .theme-btn { height: 36px; border-radius: 11px; }
body:not(.admin) .theme-btn { width: 36px; }

/* 拖入区中间那枚图标再大一档，空状态不再是「一片虚线 + 一个字符」 */
body:not(.admin) .drop { padding: 32px 18px; }
body:not(.admin) .drop-icon { width: 52px; height: 52px; border-radius: 16px; font-size: 24px; }

/* 输入框与按钮的圆角跟着卡片一起放大 */
body:not(.admin) .field input,
body:not(.admin) .field select,
body:not(.admin) .field textarea { border-radius: 13px; }
body:not(.admin) .primary { min-height: 52px; border-radius: 13px; }
body:not(.admin) .ghost { border-radius: 12px; }

@media (max-width: 520px) {
  body:not(.admin) .card { padding: 16px; border-radius: 16px; }
  body:not(.admin) .page-head h1 { font-size: 23px; }
  body:not(.admin) .primary { min-height: 48px; }
}

/* ================= 第 124 轮：背景断层修复 + 导航排回一行 =================
 * 1) 断层：原来的 `html, body` 都给了一层紫色渐变，html 有底 → body 自己画的那一整块
 *    在 body 盒子结束处戛然而止，下面露出的画布是 html 那一层，于是页面下半截出现一条横带。
 *    这里把 html 的底去掉，让 body 的背景直接成为画布底色，两者再没有分界；
 *    同时冷光改成 no-repeat + fixed，只画在视口顶端一次。
 * 2) 换行：五个胶囊在 920 列里放不下会折成「4 + 1」，把内边距/间距/字号各收一档；
 *    ≤899 改成有意的两行（品牌 + 控件一行，导航整行居中一行）。 */
html { background: none; }
body:not(.admin) {
  background-repeat: no-repeat;
  background-attachment: fixed;
}
.site-nav { gap: 5px; }
.site-nav-btn { padding: 0 10px; gap: 5px; font-size: 13px; }
@media (max-width: 899px) {
  .topbar-in { flex-wrap: wrap; row-gap: 8px; }
  .site-nav { flex: 1 1 100%; order: 3; }
  .nav-tools { order: 2; }
}

/* ================= 第 125 轮：页脚网址可点复制 =================
 * 页脚那句「部署于 taerji.com · 仅供学习研究」里的域名以前是一段死文字，想抄只能手打。
 * 改成看得出能点的小按钮：常态浅底细描边，悬停转主色，复制成功就地变「✓ 已复制」。
 * 这一页没有全局 button 重置，所以外观（padding / 边框 / 圆角 / 光标）在这里全部兜住；
 * 仍挂在 body:not(.admin) 上，后台页脚一点不受影响。 */
body:not(.admin) .site-foot .foot-copy {
  -webkit-appearance: none; appearance: none;
  font: inherit; line-height: inherit; letter-spacing: inherit;
  margin: 0; padding: 0 6px; vertical-align: baseline;
  color: var(--text);
  background: color-mix(in srgb, var(--line) 40%, var(--card));
  border: 1px solid var(--line); border-radius: 6px;
  box-shadow: none; cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
body:not(.admin) .site-foot .foot-copy:hover {
  color: var(--purple); border-color: color-mix(in srgb, var(--purple) 70%, var(--line));
}
body:not(.admin) .site-foot .foot-copy:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
body:not(.admin) .site-foot .foot-copy.done {
  color: var(--purple);
  border-color: color-mix(in srgb, var(--purple) 70%, var(--line));
  background: color-mix(in srgb, var(--purple) 12%, var(--card));
}

/* ================= 第 126 轮：上传框收矮一档 =================
 * 框里现在只剩一行标题 + 一行提示，原来的 32px 内边距、52px 图标和 170px 的 min-height
 * 让空状态白占掉一大块版面；缩成 18px 内边距、40px 图标、120px 视觉下限，仍由
 * body:not(.admin) 兜住，后台表单不动。 */
body:not(.admin) .drop {
  padding: 18px 16px;
  min-height: 120px;
  gap: 4px;
}
body:not(.admin) .drop-icon {
  width: 40px; height: 40px;
  margin: 0 auto 2px;
  border-radius: 12px;
  font-size: 19px;
}
body:not(.admin) .drop-title { font-size: 15px; }
body:not(.admin) .drop-hint { font-size: 12.5px; }

/* ================= 第 128 轮：签名结果——按钮收矮 =================
 * 结果卡片里只剩「拷贝文件链接 / 下载指令文件」两枚并排按钮，它们原来跟着主按钮吃
 * 52px 的 min-height，并排时又高又空。收到 44px 一档（仍在触控舒适区），字号 15px，
 * 两枚同高同圆角；地址行已从页面去掉，不再是「按钮 + 一片长网址」的组合。
 * 管理后台有自己的结果区，这层 body:not(.admin) 不碰它。 */
body:not(.admin) .result-actions > .primary,
body:not(.admin) .result-actions > .ghost {
  min-height: 44px;
  padding: 8px 16px;
  font-size: 15px;
  border-radius: 12px;
}
