/* 违禁词检测 · 站点样式
   排版语言参考 blog.oscaryang.cn：暖纸底、赭红强调、细发丝线、窄栏、小字做标注 */

/* ------------------------------ 变量 ------------------------------ */

:root {
  --sans: "HarmonyOS Sans", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --mono: "HarmonyOS Sans", ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --p-bg: #fffdfc;
  --p-bg-soft: #f8f4f1;
  --p-bg-elev: #fffefd;
  --p-line: #ece3dd;
  --p-accent: #b3402c;
  --p-bg-d: #0f0c0b;
  --p-bg-soft-d: #1a1513;
  --p-bg-elev-d: #15110f;
  --p-line-d: #2c231f;
  --p-accent-dark: #e0795f;

  --bg: var(--p-bg);
  --bg-soft: var(--p-bg-soft);
  --bg-elev: var(--p-bg-elev);
  --line: var(--p-line);
  --text: #17171a;
  --text-2: #55545c;
  --faint: #8a8890;
  --accent: var(--p-accent);
  --accent-soft: color-mix(in srgb, var(--accent) 11%, transparent);
  --wash: color-mix(in srgb, var(--accent) 6%, var(--bg-soft));
  --hair: color-mix(in srgb, var(--accent) 30%, var(--line));
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 6px 24px rgba(0, 0, 0, 0.05);
  --radius: 14px;
  --wrap: 880px;

  --high: #b3402c;
  --mid: #c07a1f;
  --low: #6b7f5b;
  --high-soft: color-mix(in srgb, var(--high) 12%, transparent);
  --mid-soft: color-mix(in srgb, var(--mid) 14%, transparent);
  --low-soft: color-mix(in srgb, var(--low) 14%, transparent);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--p-bg-d);
    --bg-soft: var(--p-bg-soft-d);
    --bg-elev: var(--p-bg-elev-d);
    --line: var(--p-line-d);
    --text: #ededf0;
    --text-2: #a8a6ae;
    --faint: #78767e;
    --accent: var(--p-accent-dark);
    --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
    --wash: color-mix(in srgb, var(--accent) 10%, var(--bg-soft));
    --hair: color-mix(in srgb, var(--accent) 26%, var(--line));
    --on-accent: #12100f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.35);
    --high: #e0795f;
    --mid: #d9a15a;
    --low: #93a882;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: var(--p-bg-d);
  --bg-soft: var(--p-bg-soft-d);
  --bg-elev: var(--p-bg-elev-d);
  --line: var(--p-line-d);
  --text: #ededf0;
  --text-2: #a8a6ae;
  --faint: #78767e;
  --accent: var(--p-accent-dark);
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --wash: color-mix(in srgb, var(--accent) 10%, var(--bg-soft));
  --hair: color-mix(in srgb, var(--accent) 26%, var(--line));
  --on-accent: #12100f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.35);
  --high: #e0795f;
  --mid: #d9a15a;
  --low: #93a882;
  color-scheme: dark;
}

/* 配色方案：版式一致，纸色 / 卡片 / 分隔线 / 强调色整体换一套 */
:root[data-palette="clay"] {
  --p-bg: #fffdfc; --p-bg-soft: #f8f4f1; --p-bg-elev: #fffefd; --p-line: #ece3dd;
  --p-bg-d: #0f0c0b; --p-bg-soft-d: #1a1513; --p-bg-elev-d: #15110f; --p-line-d: #2c231f;
  --p-accent: #b3402c; --p-accent-dark: #e0795f;
}
:root[data-palette="ink"] {
  --p-bg: #fdfdff; --p-bg-soft: #f3f4f8; --p-bg-elev: #ffffff; --p-line: #e2e4eb;
  --p-bg-d: #0c0c0f; --p-bg-soft-d: #16171c; --p-bg-elev-d: #121318; --p-line-d: #25262e;
  --p-accent: #2c2c34; --p-accent-dark: #e3e3ea;
}
:root[data-palette="ocean"] {
  --p-bg: #fcfdff; --p-bg-soft: #eff4fa; --p-bg-elev: #ffffff; --p-line: #dde6f0;
  --p-bg-d: #0b0e12; --p-bg-soft-d: #131920; --p-bg-elev-d: #0f141a; --p-line-d: #212b36;
  --p-accent: #2e5f8c; --p-accent-dark: #86b9e0;
}

/* ------------------------------ 基础 ------------------------------ */

*, *::before, *::after { box-sizing: border-box; }

/* 作者样式里的 display 会盖掉 hidden 属性，统一兜住 */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  background: var(--bg);
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: linear-gradient(180deg, var(--wash) 0, transparent 460px);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 200;
  background: var(--text); color: var(--bg); padding: 8px 14px;
  border-radius: 8px; font-size: 13px; transition: top .2s;
}
.skip:focus { top: 12px; }

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

/* ------------------------------ 顶栏 ------------------------------ */

.site-head {
  position: sticky; top: 0; z-index: 60;
  border-bottom: 1px solid transparent;
  transition: background .2s, border-color .2s;
}
.site-head.is-scrolled {
  border-bottom-color: var(--hair);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}

.head-inner {
  max-width: 1080px; margin: 0 auto;
  padding: 0 20px; height: 62px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}

.brand { display: inline-flex; align-items: center; gap: 9px; flex: none; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-size: 14px; font-weight: 700; line-height: 1; flex: none;
}
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }

.nav {
  display: flex; align-items: center; gap: 2px;
  padding: 3px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-elev); box-shadow: 0 1px 2px rgba(0,0,0,.02);
  overflow-x: auto; scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav-link {
  display: inline-flex; align-items: center; height: 32px; padding: 0 13px;
  border-radius: 999px; font-size: 13px; font-weight: 500;
  color: var(--text-2); white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--bg-soft); color: var(--text); }
.nav-link.is-active { background: var(--bg-soft); color: var(--text); }

.head-tools { display: flex; align-items: center; gap: 10px; flex: none; }
.swatches { display: flex; align-items: center; gap: 8px; padding-right: 2px; }
.swatch {
  width: 15px; height: 15px; border-radius: 999px; padding: 0;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.swatch:hover { transform: scale(1.12); }
.swatch[data-palette="clay"] { background: #b3402c; }
.swatch[data-palette="ink"] { background: #2c2c34; }
.swatch[data-palette="ocean"] { background: #2e5f8c; }
.swatch.is-active { box-shadow: 0 0 0 3px var(--accent-soft); }

.icon-btn {
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--bg-elev); color: var(--text-2); cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--hair); }

/* ------------------------------ 主栏 ------------------------------ */

.wrap {
  max-width: var(--wrap); margin: 0 auto;
  padding: 34px 20px 70px;
}

.hero { padding: 20px 0 30px; }

.eyebrow {
  margin: 0 0 14px;
  font-size: 11px; font-weight: 500; letter-spacing: .16em;
  color: var(--faint); text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: 40px; font-weight: 700; line-height: 1.25;
  letter-spacing: -.02em;
}

.lede {
  margin: 0;
  font-size: 16px; line-height: 1.85; color: var(--text-2);
}

.meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-elev);
  font-size: 12px; color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.chip .dot {
  width: 5px; height: 5px; border-radius: 999px;
  background: var(--accent); flex: none;
}

/* ------------------------------ 卡片 ------------------------------ */

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px 24px;
  margin-bottom: 18px;
  scroll-margin-top: 84px;
}

.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 16px;
}
.card-head h2 {
  margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em;
}
.card-sub { margin: 4px 0 0; font-size: 12.5px; color: var(--faint); line-height: 1.6; }
.card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.block-title {
  margin: 24px 0 10px;
  font-size: 12px; font-weight: 600; letter-spacing: .1em;
  color: var(--faint); text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.block-title::before {
  content: ""; width: 14px; height: 1px; background: var(--hair); flex: none;
}
.count-badge {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0;
  padding: 1px 7px; border-radius: 999px;
  background: var(--bg-soft); color: var(--text-2); font-weight: 500;
}

/* ------------------------------ 按钮 ------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 15px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg-elev); color: var(--text-2);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-soft); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn-sm { height: 32px; padding: 0 13px; font-size: 12.5px; }

.btn-primary, .btn-accent {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--accent) 28%, transparent);
}
.btn-primary:hover, .btn-accent:hover {
  background: color-mix(in srgb, var(--accent) 88%, black);
  border-color: color-mix(in srgb, var(--accent) 88%, black);
  color: var(--on-accent);
}
.btn-ghost { background: transparent; }

.link {
  color: var(--accent); font-weight: 500; cursor: pointer;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

/* ------------------------------ 上传区 ------------------------------ */

.drop {
  border: 1px dashed color-mix(in srgb, var(--text) 16%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-soft) 55%, transparent);
  padding: 26px 20px 22px;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s;
}
.drop:hover, .drop:focus-visible {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 4%, var(--bg-soft));
}
.drop.is-over {
  border-color: var(--accent); border-style: solid;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-soft));
}
.drop.is-busy { opacity: .6; pointer-events: none; }
.drop-ico { color: var(--accent); opacity: .8; margin-bottom: 8px; }
.drop-title { margin: 0; font-size: 14.5px; color: var(--text); }
.drop-sub { margin: 7px 0 0; font-size: 12px; color: var(--faint); line-height: 1.7; }
.drop-file {
  margin: 12px 0 0; font-family: var(--mono); font-size: 12px;
  color: var(--accent);
}

.lib-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 14px; font-size: 12px; color: var(--faint);
}
.cat-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: 999px;
  background: var(--bg-soft); color: var(--text-2);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  font-size: 11.5px;
}
.cat-pill b { font-family: var(--mono); font-weight: 500; color: var(--text); }

/* ------------------------------ 编辑器 ------------------------------ */

textarea#input {
  width: 100%; min-height: 190px; resize: vertical;
  padding: 16px 18px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans); font-size: 15px; line-height: 1.85;
  transition: border-color .15s, box-shadow .15s;
}
textarea#input::placeholder { color: var(--faint); opacity: .85; }
textarea#input:focus {
  outline: none; border-color: var(--hair);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.editor-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 12px;
}
.counter { font-size: 12px; color: var(--faint); }
.kbd-hint {
  margin-left: 12px; padding-left: 12px;
  border-left: 1px solid var(--line);
  color: var(--faint); opacity: .85;
}
.editor-actions { display: flex; align-items: center; gap: 8px; }

/* ------------------------------ 结论 ------------------------------ */

.verdict {
  display: flex; align-items: center; gap: 22px;
  padding: 18px 20px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg);
}
.gauge { position: relative; width: 120px; height: 120px; flex: none; }
.gauge svg { transform: rotate(-90deg); }
.gauge-track { fill: none; stroke: color-mix(in srgb, var(--line) 60%, transparent); stroke-width: 8; }
.gauge-fill {
  fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round;
  stroke-dasharray: 314.16; stroke-dashoffset: 314.16;
  transition: stroke-dashoffset .7s cubic-bezier(.22,.61,.36,1), stroke .3s;
}
.gauge-num {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1;
}
.gauge-num b { font-size: 30px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.gauge-num span { margin-top: 5px; font-size: 10.5px; color: var(--faint); letter-spacing: .08em; }

.verdict-text { min-width: 0; }
.grade {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: var(--bg-soft); color: var(--text-2); letter-spacing: .02em;
}
.grade.is-high { background: var(--high-soft); color: var(--high); }
.grade.is-mid { background: var(--mid-soft); color: var(--mid); }
.grade.is-low { background: var(--low-soft); color: var(--low); }
.verdict-line { margin: 10px 0 0; font-size: 15.5px; font-weight: 600; line-height: 1.5; }
.verdict-note { margin: 5px 0 0; font-size: 12.5px; color: var(--faint); line-height: 1.7; }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-top: 14px;
}
.stat {
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); padding: 12px 14px;
}
.stat b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--faint); }

/* ------------------------------ 标注预览 ------------------------------ */

.preview {
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); padding: 16px 18px;
  font-size: 15px; line-height: 2;
  white-space: pre-wrap; word-break: break-word;
  max-height: 340px; overflow: auto;
  font-family: var(--sans);
}
.preview:empty::before {
  content: "暂无内容"; color: var(--faint); font-size: 13px;
}
mark.hit {
  background: var(--high-soft); color: var(--high);
  border-radius: 4px; padding: 1px 2px; margin: 0 -1px;
  border-bottom: 1px solid color-mix(in srgb, var(--high) 45%, transparent);
  font-weight: 600; cursor: help;
}
mark.hit.mid { background: var(--mid-soft); color: var(--mid); border-bottom-color: color-mix(in srgb, var(--mid) 45%, transparent); }
mark.hit.low { background: var(--low-soft); color: var(--low); border-bottom-color: color-mix(in srgb, var(--low) 45%, transparent); }
mark.hit.is-flash { animation: flash 1.1s ease-out; }
@keyframes flash {
  0%, 30% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ------------------------------ 明细表 ------------------------------ */

.table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); }
table.hits { width: 100%; border-collapse: collapse; font-size: 13px; }
table.hits th {
  text-align: left; font-weight: 500; font-size: 11.5px; letter-spacing: .04em;
  color: var(--faint); padding: 10px 14px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.hits td {
  padding: 11px 14px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  vertical-align: middle;
}
table.hits tr:last-child td { border-bottom: none; }
table.hits tbody tr { transition: background .12s; }
table.hits tbody tr:hover { background: color-mix(in srgb, var(--bg-soft) 70%, transparent); }
table.hits .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hit-word { font-weight: 600; word-break: break-word; }
.hit-cat { color: var(--text-2); font-size: 12.5px; }
.lvl {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
  border-radius: 999px; font-size: 11px; font-weight: 500;
}
.lvl.high { background: var(--high-soft); color: var(--high); }
.lvl.mid { background: var(--mid-soft); color: var(--mid); }
.lvl.low { background: var(--low-soft); color: var(--low); }
.row-btn {
  border: none; background: none; cursor: pointer;
  font-size: 12px; color: var(--accent); padding: 2px 4px; border-radius: 6px;
}
.row-btn:hover { background: var(--accent-soft); }
.empty { margin: 0; padding: 26px; text-align: center; color: var(--faint); font-size: 13px; }

/* ------------------------------ 页脚 ------------------------------ */

.site-foot {
  margin-top: 40px; padding-top: 22px;
  border-top: 1px solid var(--line);
  text-align: center; color: var(--faint); font-size: 12px;
}
.site-foot p { margin: 0 0 6px; }
.foot-links { display: flex; justify-content: center; gap: 8px; }
.foot-links a:hover { color: var(--accent); }

/* ------------------------------ 弹窗 ------------------------------ */

.modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-mask {
  position: absolute; inset: 0;
  background: color-mix(in srgb, #000 38%, transparent);
  backdrop-filter: blur(3px);
}
.modal-panel {
  position: relative; width: min(720px, 100%); max-height: 84vh;
  display: flex; flex-direction: column;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.22);
  animation: pop .18s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 12px;
}
.modal-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-tools { display: flex; gap: 8px; padding: 0 20px 10px; }
.modal-tools input, .modal-tools select,
.add-row input, .add-row select {
  height: 34px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--bg); color: var(--text);
  padding: 0 11px; font-size: 13px; font-family: var(--sans);
}
.modal-tools input { flex: 1; }
.modal-tools input:focus, .add-row input:focus { outline: none; border-color: var(--hair); box-shadow: 0 0 0 3px var(--accent-soft); }
.add-row {
  display: grid; grid-template-columns: 1.2fr 1fr 92px auto; gap: 8px;
  padding: 0 20px 12px;
}
.modal-list {
  flex: 1; overflow: auto; min-height: 120px;
  border-top: 1px solid var(--line);
}
.lib-row {
  display: grid; grid-template-columns: 1fr 1fr 62px 30px;
  align-items: center; gap: 10px;
  padding: 9px 20px; font-size: 13px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}
.lib-row:hover { background: color-mix(in srgb, var(--bg-soft) 70%, transparent); }
.lib-row .w { font-weight: 500; word-break: break-word; }
.lib-row .c { color: var(--faint); font-size: 12px; }
.lib-row .del {
  border: none; background: none; cursor: pointer; color: var(--faint);
  font-size: 15px; line-height: 1; padding: 4px; border-radius: 6px;
}
.lib-row .del:hover { color: var(--high); background: var(--high-soft); }
.lib-empty { padding: 30px; text-align: center; color: var(--faint); font-size: 13px; }
.modal-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--faint);
}

/* ------------------------------ 提示条 ------------------------------ */

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 200;
  transform: translate(-50%, 8px);
  max-width: min(420px, calc(100vw - 40px));
  padding: 10px 16px; border-radius: 10px;
  background: var(--text); color: var(--bg);
  font-size: 13px; line-height: 1.5;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
  opacity: 0; transition: opacity .2s, transform .2s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-err { background: var(--high); color: #fff; }

/* ------------------------------ 自适应 ------------------------------ */

@media (max-width: 720px) {
  .head-inner { height: 56px; padding: 0 14px; gap: 8px; }
  .brand-name { display: none; }
  .nav { order: 3; }
  .wrap { padding: 24px 14px 56px; }
  .hero { padding: 10px 0 22px; }
  .hero h1 { font-size: 30px; }
  .lede { font-size: 14.5px; }
  .card { padding: 18px 16px 20px; border-radius: 12px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .verdict { flex-direction: column; align-items: flex-start; gap: 14px; padding: 16px; }
  .gauge { width: 96px; height: 96px; }
  .gauge svg { width: 96px; height: 96px; }
  .gauge-num b { font-size: 24px; }
  .drop { padding: 20px 14px 18px; }
  .kbd-hint { display: none; }
  .add-row { grid-template-columns: 1fr 1fr; }
  .add-row .btn { grid-column: span 2; }
  .lib-row { grid-template-columns: 1fr 58px 30px; padding: 9px 16px; }
  .lib-row .c { display: none; }
  table.hits th:nth-child(5), table.hits td:nth-child(5) { display: none; }
}

@media (max-width: 480px) {
  .swatches { display: none; }
  .hero h1 { font-size: 27px; }
  .stat b { font-size: 19px; }
  .add-row { grid-template-columns: 1fr 1fr; }
  .add-row select { grid-column: span 2; }
  .modal-foot .btn { height: 30px; }
}

@media print {
  .site-head, .drop, .editor-foot, .card-actions, .site-foot { display: none !important; }
  .card { box-shadow: none; border-color: #ddd; break-inside: avoid; }
  body { background: #fff; }
}

/* ------------------------------ 词库概览（只读） ------------------------------ */

.lib-note {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--faint);
}
.lib-note .mono { color: var(--text-2); }

.lib-head {
  display: grid; grid-template-columns: 1.4fr 1fr 56px 110px;
  gap: 10px; padding: 8px 20px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  font-size: 11.5px; color: var(--faint);
}
.lib-row.read { grid-template-columns: 1.4fr 1fr 56px 110px; }
.lib-row.read .u { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }

.login-link { height: 30px; padding: 0 13px; font-size: 12.5px; }

/* ------------------------------ 登录 / 初始化 ------------------------------ */

.auth-shell {
  min-height: calc(100vh - 160px);
  display: grid; place-items: center; padding: 24px 0 60px;
}
.auth-card {
  width: min(400px, 100%);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 30px 28px 26px;
}
.auth-card h1 { margin: 0 0 8px; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.auth-sub { margin: 0 0 22px; font-size: 13px; line-height: 1.75; color: var(--text-2); }
.auth-note { margin: 18px 0 0; font-size: 11.5px; line-height: 1.7; color: var(--faint); }

.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block; margin-bottom: 6px;
  font-size: 12px; color: var(--faint); letter-spacing: .02em;
}
.field input, .field select,
.toolbar input, .toolbar select {
  width: 100%; height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus,
.toolbar input:focus, .toolbar select:focus {
  outline: none; border-color: var(--hair);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.btn-block { width: 100%; height: 40px; margin-top: 6px; }
.form-error {
  margin: 0 0 12px; padding: 9px 12px;
  border-radius: 9px; background: var(--high-soft); color: var(--high);
  font-size: 12.5px; line-height: 1.6;
}

/* ------------------------------ 后台 ------------------------------ */

.admin-body { background-image: linear-gradient(180deg, var(--wash) 0, transparent 320px); }
.admin-wrap { max-width: 960px; padding-top: 26px; }

.admin-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.admin-head h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.lede-small { margin: 6px 0 0; font-size: 13px; color: var(--text-2); }
.admin-user { display: flex; align-items: center; gap: 10px; }
.admin-user .who { font-size: 12.5px; color: var(--text-2); }

.stat-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-bottom: 18px;
}
.stat-row .stat { background: var(--bg-elev); box-shadow: var(--shadow); border-radius: 12px; }
.stat-row .stat b.sm { font-size: 15px; padding-top: 5px; }

.toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-bottom: 12px;
}
.toolbar input[type="search"] { flex: 1 1 200px; max-width: 320px; }
.toolbar select { width: auto; min-width: 130px; }
.toolbar-right { margin-left: auto; display: flex; gap: 8px; }

.add-row { padding: 0 0 12px; grid-template-columns: 1.4fr 1fr 92px auto; }

.admin-table-wrap { max-height: 520px; overflow: auto; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.admin-table th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; font-weight: 500; font-size: 11.5px;
  color: var(--faint); padding: 9px 12px;
  background: var(--bg-soft); border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.admin-table td {
  padding: 9px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  vertical-align: middle;
}
table.admin-table tbody tr:hover { background: color-mix(in srgb, var(--bg-soft) 65%, transparent); }
table.admin-table tr:last-child td { border-bottom: none; }
.cell-word { font-weight: 600; word-break: break-word; }
.cell-cat { color: var(--text-2); font-size: 12.5px; }
.cell-time { font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.cell-ops { white-space: nowrap; }
.col-check { width: 36px; }
.col-check input { accent-color: var(--accent); }
.row-btn.danger { color: var(--faint); }
.row-btn.danger:hover { color: var(--high); background: var(--high-soft); }

.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 12px; font-size: 12px; color: var(--faint);
}

.admin-grid {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px;
}
.admin-grid .card { margin-bottom: 0; }
.stack-form .field { margin-bottom: 12px; }

.log-list { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.log-list li {
  display: grid; grid-template-columns: 88px 84px 1fr;
  gap: 8px; padding: 8px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}
.log-list li:last-child { border-bottom: none; }
.log-time { color: var(--faint); font-size: 11.5px; }
.log-act { color: var(--text); font-weight: 500; }
.log-detail { color: var(--text-2); word-break: break-word; }
.log-empty { display: block !important; color: var(--faint); }

.import-result {
  display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline;
  margin-top: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); font-size: 12.5px; color: var(--text-2);
}
.import-result b { color: var(--text); font-weight: 600; }
.import-result em { font-style: normal; color: var(--accent); font-weight: 600; font-family: var(--mono); }

.modal-sm { width: min(420px, 100%); }
.modal-body { padding: 0 20px; }
.modal-foot.inline {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 6px 0 20px; border-top: none;
}

.btn[disabled] { opacity: .45; cursor: not-allowed; }

@media (max-width: 860px) {
  .admin-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .admin-head h1 { font-size: 24px; }
  .admin-wrap { padding-top: 18px; }
  .toolbar input[type="search"] { max-width: none; }
  .toolbar-right { margin-left: 0; width: 100%; justify-content: flex-end; }
  .lib-head, .lib-row.read { grid-template-columns: 1.3fr 1fr 52px; }
  .lib-head span:last-child, .lib-row.read .u { display: none; }
  .log-list li { grid-template-columns: 78px 1fr; }
  .log-detail { grid-column: 2; }
  .admin-table th:nth-child(5), .admin-table td:nth-child(5) { display: none; }
}
