/* ==========================================================================
   北辰书坊 · 设计系统
   基调：纸本 / 编辑排版 / 朱砂点染。无圆角堆砌、无玻璃拟态、无渐变滥用。
   ========================================================================== */

:root {
  /* 纸与墨 */
  --paper:      oklch(0.9755 0.0065 84);
  --paper-warm: oklch(0.9585 0.0105 78);
  --plate:      #fffdf9;
  --ink:        oklch(0.2520 0.0140 62);
  --ink-2:      oklch(0.4350 0.0120 62);
  --ink-3:      oklch(0.6050 0.0100 66);
  --ink-4:      oklch(0.7250 0.0080 70);

  /* 线 */
  --rule:       oklch(0.8780 0.0105 76);
  --rule-soft:  oklch(0.9180 0.0080 78);
  --rule-ink:   oklch(0.2520 0.0140 62 / 0.85);

  /* 点色 */
  --seal:       oklch(0.5150 0.1680 29);
  --seal-deep:  oklch(0.4300 0.1500 28);
  --seal-wash:  oklch(0.9420 0.0280 32);
  --moss:       oklch(0.4700 0.0560 156);
  --moss-wash:  oklch(0.9450 0.0200 155);
  --amber:      oklch(0.6350 0.1050 72);
  --amber-wash: oklch(0.9510 0.0330 78);

  /* 阴影：克制，只给浮层 */
  --lift-1: 0 1px 1px oklch(0.25 0.01 60 / 0.05);
  --lift-2: 0 2px 4px oklch(0.25 0.01 60 / 0.05), 0 14px 34px oklch(0.25 0.01 60 / 0.07);
  --lift-3: 0 6px 12px oklch(0.25 0.01 60 / 0.07), 0 32px 64px oklch(0.25 0.01 60 / 0.13);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.62, 0.02, 0.28, 1);

  --font-serif: "Songti SC", "Source Han Serif SC", "Noto Serif SC", "STZhongsong", "SimSun", "Times New Roman", serif;
  --font-sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", -apple-system, "Segoe UI", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", Consolas, "SFMono-Regular", "JetBrains Mono", monospace;

  --maxw: 1240px;
  --gut: clamp(18px, 4vw, 56px);
}

* { box-sizing: border-box; }

/* 关键：类选择器里写死的 display 会盖掉浏览器默认的 [hidden]{display:none}，
   导致 hidden 元素照样渲染（后台登录框与控制台会同时出现在页面上）。 */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 纸纹：极淡的斜向纤维，仅在纸面上，不影响可读性 */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.5;
  background-image:
    repeating-linear-gradient(78deg, oklch(0.252 0.014 62 / 0.016) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(-12deg, oklch(0.252 0.014 62 / 0.012) 0 1px, transparent 1px 11px);
}

h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.25; margin: 0; letter-spacing: 0.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--seal-wash); }

/* ---------------------------------------------------------------- 骨架 */

.shell { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gut); }

/* 报头 */
.masthead { border-bottom: 1px solid var(--rule); background: color-mix(in oklab, var(--paper) 88%, transparent); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 40; }
.masthead__in { display: flex; align-items: center; gap: clamp(16px, 3vw, 44px); height: 68px; }
.brand { display: flex; align-items: baseline; gap: 10px; flex: none; }
.brand__mark {
  width: 26px; height: 26px; flex: none; border: 1.5px solid var(--seal); color: var(--seal);
  font-family: var(--font-serif); font-size: 15px; line-height: 23px; text-align: center;
  border-radius: 2px; align-self: center;
}
.brand__name { font-family: var(--font-serif); font-size: 20px; letter-spacing: 0.06em; white-space: nowrap; }
.brand__sub { font-size: 11px; color: var(--ink-4); letter-spacing: 0.22em; text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav a {
  padding: 6px 13px; font-size: 13.5px; color: var(--ink-2); border-radius: 2px;
  transition: color .22s var(--ease), background-color .22s var(--ease);
}
.nav a:hover { color: var(--ink); background: var(--paper-warm); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav a[aria-current="page"]::after { content: ""; display: block; height: 1.5px; background: var(--seal); margin-top: 2px; }

/* 积分牌 */
.wallet { display: flex; align-items: center; gap: 10px; padding-left: clamp(10px, 2vw, 22px); border-left: 1px solid var(--rule); flex: none; }
.wallet__num { font-family: var(--font-mono); font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.wallet__lab { font-size: 10.5px; color: var(--ink-4); letter-spacing: 0.16em; }

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

.btn {
  --bg: transparent; --fg: var(--ink); --bd: var(--rule);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px; border: 1px solid var(--bd); background: var(--bg); color: var(--fg);
  border-radius: 2px; font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .42; cursor: not-allowed; transform: none; }
.btn:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; }
.btn--solid { --bg: var(--ink); --fg: var(--paper); --bd: var(--ink); }
.btn--solid:hover { --bg: oklch(0.32 0.014 62); }
.btn--seal { --bg: var(--seal); --fg: #fff; --bd: var(--seal); }
.btn--seal:hover { --bg: var(--seal-deep); }
.btn--quiet { --bd: transparent; --fg: var(--ink-2); padding-inline: 10px; }
.btn--quiet:hover { --fg: var(--ink); background: var(--paper-warm); }
.btn--sm { padding: 5px 11px; font-size: 12.5px; }
.btn--xs { padding: 3px 9px; font-size: 12px; }
.btn--block { width: 100%; }

/* ---------------------------------------------------------------- 排版件 */

.label { font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-4); font-weight: 500; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }

/* 朱砂标签 */
.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 2px;
  font-size: 11.5px; letter-spacing: 0.04em; background: var(--paper-warm); color: var(--ink-2); border: 1px solid var(--rule-soft);
}
.tag--seal { background: var(--seal-wash); color: var(--seal-deep); border-color: color-mix(in oklab, var(--seal) 22%, transparent); }
.tag--moss { background: var(--moss-wash); color: var(--moss); border-color: color-mix(in oklab, var(--moss) 22%, transparent); }
.tag--amber { background: var(--amber-wash); color: oklch(0.45 0.09 70); border-color: color-mix(in oklab, var(--amber) 30%, transparent); }

/* ---------------------------------------------------------------- 首屏 */

/* 注意：这里只能用 padding-block。写成 padding 简写会把 .wrap 的左右内边距清成 0，
   桌面端因 max-width 自动居中看不出来，窄屏会直接贴边。 */
.hero { padding-block: clamp(44px, 7vw, 88px) clamp(34px, 5vw, 58px); position: relative; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(28px, 6vw, 78px); align-items: end; }
.hero__eyebrow { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.hero__eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.hero h1 {
  font-size: clamp(38px, 7.2vw, 76px); letter-spacing: 0.02em; line-height: 1.06; font-weight: 600;
}
.hero h1 em { font-style: normal; color: var(--seal); }
.hero__lede { margin-top: 22px; max-width: 40ch; color: var(--ink-2); font-size: 15.5px; line-height: 1.85; }
.hero__note { margin-top: 26px; display: flex; gap: 26px; flex-wrap: wrap; }
.hero__note dl { margin: 0; }
.hero__note dt { font-size: 10.5px; letter-spacing: 0.18em; color: var(--ink-4); text-transform: uppercase; }
.hero__note dd { margin: 2px 0 0; font-family: var(--font-mono); font-size: 19px; font-variant-numeric: tabular-nums; }

/* 今日推荐 */
.pick { border: 1px solid var(--rule); background: var(--plate); padding: 20px; display: grid; grid-template-columns: 108px 1fr; gap: 18px; border-radius: 2px; box-shadow: var(--lift-1); }
.pick__img { aspect-ratio: 3/4; background: #fff; display: grid; place-items: center; border: 1px solid var(--rule-soft); }
.pick__img img, .pick__img .ph { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.pick__body { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-width: 0; }
.pick__title { font-family: var(--font-serif); font-size: 19px; }

/* ---------------------------------------------------------------- 书目 */

/* 同上：只用 padding-block，避免覆盖 .wrap 的左右内边距 */
.section { padding-block: clamp(28px, 4vw, 46px) clamp(56px, 8vw, 92px); }
.section__head { display: flex; align-items: baseline; gap: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--rule-ink); margin-bottom: 26px; flex-wrap: wrap; }
.section__head h2 { font-size: clamp(22px, 3vw, 30px); letter-spacing: 0.06em; }
.section__head .count { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-3); }
.section__head .spacer { flex: 1; }

.filters { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.filters button {
  background: none; border: 0; cursor: pointer; padding: 4px 11px; border-radius: 2px;
  font-size: 13px; color: var(--ink-3); transition: color .2s var(--ease), background-color .2s var(--ease);
}
.filters button:hover { color: var(--ink); background: var(--paper-warm); }
.filters button[aria-pressed="true"] { color: var(--seal); background: var(--seal-wash); font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: clamp(20px, 2.6vw, 34px); }

/* 书牌 */
.book { display: flex; flex-direction: column; gap: 14px; }
.book__frame {
  position: relative; aspect-ratio: 3/4; background: var(--plate); border: 1px solid var(--rule);
  border-radius: 2px; overflow: hidden; transition: box-shadow .34s var(--ease), border-color .34s var(--ease), transform .34s var(--ease);
}
.book__frame img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.book:hover .book__frame { transform: translateY(-3px); box-shadow: var(--lift-2); border-color: var(--rule-soft); }
.book__ribbon {
  position: absolute; top: 0; left: 0; background: var(--ink); color: var(--paper);
  font-size: 11px; letter-spacing: 0.1em; padding: 3px 9px;
}
.book__ribbon--seal { background: var(--seal); }
.book__ribbon--amber { background: var(--amber); color: oklch(0.25 0.05 60); }
.book__meta { display: flex; flex-direction: column; gap: 3px; }
.book__title { font-family: var(--font-serif); font-size: 16.5px; line-height: 1.4; }
.book__author { font-size: 12.5px; color: var(--ink-3); }
.book__foot { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; padding-top: 9px; border-top: 1px solid var(--rule-soft); }
.book__price { font-family: var(--font-mono); font-size: 16px; font-variant-numeric: tabular-nums; color: var(--seal-deep); }
.book__price small { font-size: 11px; color: var(--ink-4); margin-left: 2px; font-family: var(--font-sans); }
.book__stock { margin-left: auto; font-size: 11.5px; color: var(--ink-4); }
.book .btn { margin-top: 4px; }

/* 无封面占位：用活字排版撑住版面 */
.ph {
  display: grid; place-items: center; background: var(--paper-warm); color: var(--ink-3);
  font-family: var(--font-serif); letter-spacing: 0.3em; writing-mode: vertical-rl;
  padding: 14px; border: 1px dashed var(--rule); text-orientation: upright; font-size: 14px;
}

/* 空状态 */
.empty { border: 1px solid var(--rule); border-radius: 2px; padding: 54px 26px; text-align: center; background: var(--plate); }
.empty h3 { font-size: 19px; margin-bottom: 8px; }
.empty p { color: var(--ink-3); font-size: 13.5px; }

/* ---------------------------------------------------------------- 订单 */

.orders { border-top: 1px solid var(--rule-ink); }
.order {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 18px; align-items: center;
  padding: 16px 0; border-bottom: 1px solid var(--rule-soft);
}
.order__thumb { width: 64px; aspect-ratio: 3/4; border: 1px solid var(--rule); background: #fff; display: grid; place-items: center; overflow: hidden; }
.order__thumb img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.order__no { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); letter-spacing: 0.02em; }
.order__title { font-family: var(--font-serif); font-size: 16px; margin: 1px 0 3px; }
.order__facts { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.order__right { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.order__pts { font-family: var(--font-mono); font-size: 15px; }
.deliver { margin-top: 8px; font-size: 12px; color: var(--ink-2); display: flex; gap: 8px; flex-wrap: wrap; }
.deliver b { font-family: var(--font-mono); font-weight: 500; }

/* 时间线 */
.timeline { margin: 8px 0 0; padding: 0 0 0 14px; list-style: none; border-left: 1px solid var(--rule); }
.timeline li { font-size: 12px; color: var(--ink-3); position: relative; padding: 2px 0; }
.timeline li::before { content: ""; position: absolute; left: -18px; top: 10px; width: 5px; height: 5px; border-radius: 50%; background: var(--rule); }
.timeline li:first-child::before { background: var(--seal); }

/* ---------------------------------------------------------------- 表单 */

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12px; color: var(--ink-3); letter-spacing: 0.04em; }
.input, select.input, textarea.input {
  width: 100%; padding: 9px 0; border: 0; border-bottom: 1px solid var(--rule);
  background: transparent; border-radius: 0; outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
textarea.input { border: 1px solid var(--rule); padding: 9px 11px; border-radius: 2px; resize: vertical; min-height: 72px; }
select.input { cursor: pointer; }
.input:focus { border-bottom-color: var(--ink); box-shadow: 0 1px 0 0 var(--ink); }
textarea.input:focus { border-color: var(--ink); box-shadow: none; }
.input::placeholder { color: var(--ink-4); }
.hint { font-size: 11.5px; color: var(--ink-4); line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 22px 26px; }

/* 单选卡（充值套餐） */
.package-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.package {
  border: 1px solid var(--rule); background: var(--plate); border-radius: 2px; padding: 13px 14px;
  cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 3px;
  transition: border-color .22s var(--ease), background-color .22s var(--ease), transform .22s var(--ease);
}
.package:hover { transform: translateY(-2px); }
.package[aria-pressed="true"] { border-color: var(--seal); background: var(--seal-wash); }
.package__yuan { font-family: var(--font-serif); font-size: 21px; }
.package__pts { font-size: 12.5px; color: var(--ink-2); }
.package__bonus { font-size: 11px; color: var(--seal-deep); }

/* ---------------------------------------------------------------- 浮层 */

.scrim {
  position: fixed; inset: 0; z-index: 90; background: oklch(0.25 0.014 62 / 0.34);
  backdrop-filter: blur(2px); display: grid; place-items: center; padding: 20px;
  animation: fade .26s var(--ease);
}
.dialog {
  width: min(560px, 100%); max-height: min(88vh, 860px); overflow: auto; background: var(--paper);
  border: 1px solid var(--rule); border-radius: 2px; box-shadow: var(--lift-3);
  animation: rise .34s var(--ease);
}
.dialog__head { display: flex; align-items: flex-start; gap: 16px; padding: 20px 24px 14px; border-bottom: 1px solid var(--rule); }
.dialog__head h3 { font-size: 19px; letter-spacing: 0.03em; }
.dialog__body { padding: 22px 24px; display: flex; flex-direction: column; gap: 20px; }
.dialog__foot { padding: 16px 24px 20px; display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--rule); background: var(--plate); }
.dialog__x { margin-left: auto; background: none; border: 0; cursor: pointer; color: var(--ink-4); font-size: 20px; line-height: 1; padding: 2px 4px; }
.dialog__x:hover { color: var(--ink); }

@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: none } }

/* 结算清单 */
.summary { border: 1px solid var(--rule); border-radius: 2px; background: var(--plate); }
.summary__row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 15px; font-size: 13.5px; border-bottom: 1px solid var(--rule-soft); }
.summary__row:last-child { border-bottom: 0; }
.summary__row strong { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.summary__row--total { background: var(--paper-warm); font-weight: 600; }

/* 步骤条 */
.steps { display: flex; align-items: center; gap: 8px; padding: 12px 24px; border-bottom: 1px solid var(--rule); background: var(--plate); }
.steps span { font-size: 12px; color: var(--ink-4); display: flex; align-items: center; gap: 7px; }
.steps span.on { color: var(--ink); font-weight: 600; }
.steps span.done { color: var(--moss); }
.steps i { width: 17px; height: 17px; border-radius: 50%; border: 1px solid currentColor; display: grid; place-items: center; font-size: 10px; font-style: normal; }
.steps hr { flex: 1; border: 0; height: 1px; background: var(--rule); margin: 0; }

/* 通知 */
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 120; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast {
  background: var(--ink); color: var(--paper); padding: 11px 16px; border-radius: 2px; font-size: 13.5px;
  box-shadow: var(--lift-3); max-width: 380px; animation: rise .3s var(--ease);
}
.toast--ok { background: var(--moss); }
.toast--warn { background: var(--amber); color: oklch(0.25 0.05 60); }
.toast--err { background: var(--seal-deep); }
.toast b { font-family: var(--font-mono); }

/* 订单号大字（下单成功） */
.receipt { text-align: center; padding: 14px 0 6px; }
.receipt__seal {
  width: 62px; height: 62px; margin: 0 auto 16px; border: 2px solid var(--seal); color: var(--seal);
  border-radius: 50%; display: grid; place-items: center; font-family: var(--font-serif); font-size: 15px;
  letter-spacing: 0.08em; line-height: 1.15; transform: rotate(-8deg);
}
.receipt__no { font-family: var(--font-mono); font-size: clamp(19px, 4vw, 26px); letter-spacing: 0.06em; margin: 6px 0 4px; }

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

.foot { border-top: 1px solid var(--rule); margin-top: auto; padding: 30px 0 42px; }
.foot__in { display: flex; gap: 24px; flex-wrap: wrap; align-items: baseline; justify-content: space-between; font-size: 12px; color: var(--ink-4); }

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

.admin { display: grid; grid-template-columns: 214px minmax(0, 1fr); min-height: 100vh; }
.side { border-right: 1px solid var(--rule); background: var(--plate); display: flex; flex-direction: column; }
.side__brand { padding: 20px 18px; border-bottom: 1px solid var(--rule); }
.side__brand .brand__name { font-size: 13.5px; letter-spacing: 0.02em; white-space: nowrap; }
.side__nav { padding: 14px 0; display: flex; flex-direction: column; }
.side__nav button {
  background: none; border: 0; text-align: left; cursor: pointer; padding: 10px 18px; font-size: 13.5px;
  color: var(--ink-2); border-left: 2px solid transparent; transition: color .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease);
}
.side__nav button:hover { background: var(--paper-warm); color: var(--ink); }
.side__nav button[aria-current="true"] { border-left-color: var(--seal); color: var(--ink); font-weight: 600; background: var(--seal-wash); }
.side__foot { margin-top: auto; padding: 18px 18px; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

.main { padding: 26px var(--gut) 70px; min-width: 0; }
.main__head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--rule-ink); margin-bottom: 24px; }
.main__head h1 { font-size: 25px; letter-spacing: 0.05em; }
.main__head .spacer { flex: 1; }

/* 账本式指标条（不用四宫格大数字卡） */
.ledger-strip { display: flex; flex-wrap: wrap; border: 1px solid var(--rule); border-radius: 2px; background: var(--plate); overflow: hidden; }
.ledger-strip div { flex: 1 1 128px; padding: 13px 16px; border-right: 1px solid var(--rule-soft); }
.ledger-strip div:last-child { border-right: 0; }
.ledger-strip dt { font-size: 10.5px; letter-spacing: 0.14em; color: var(--ink-4); text-transform: uppercase; }
.ledger-strip dd { margin: 3px 0 0; font-family: var(--font-mono); font-size: 21px; font-variant-numeric: tabular-nums; }
.ledger-strip dd.seal { color: var(--seal-deep); }
.ledger-strip dd.moss { color: var(--moss); }

/* 表格 */
.table-wrap { border: 1px solid var(--rule); border-radius: 2px; background: var(--plate); overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: left; font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-4);
  font-weight: 500; padding: 11px 14px; border-bottom: 1px solid var(--rule-ink); white-space: nowrap;
}
table.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr { transition: background-color .18s var(--ease); }
table.tbl tbody tr:hover { background: var(--paper-warm); }
table.tbl .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }
.cell-book { display: flex; align-items: center; gap: 11px; min-width: 220px; }
.cell-book__img { width: 38px; aspect-ratio: 3/4; border: 1px solid var(--rule); background: #fff; flex: none; display: grid; place-items: center; overflow: hidden; }
.cell-book__img img { width: 100%; height: 100%; object-fit: contain; }
.cell-book__ph { font-family: var(--font-serif); font-size: 11px; color: var(--ink-4); }
.row-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.stock-ctl { display: flex; align-items: center; gap: 6px; }
.stock-ctl input {
  width: 62px; text-align: center; font-family: var(--font-mono); padding: 4px 6px;
  border: 1px solid var(--rule); border-radius: 2px; background: transparent; outline: none;
}
.stock-ctl input:focus { border-color: var(--ink); }

/* 状态点 */
.dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); }
.dot.on::before { background: var(--moss); }
.dot.off::before { background: var(--ink-4); }
.dot.warn::before { background: var(--amber); }
.dot.bad::before { background: var(--seal); }

.panel { border: 1px solid var(--rule); border-radius: 2px; background: var(--plate); padding: 20px 22px; }
.panel + .panel { margin-top: 20px; }
.panel__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--rule-soft); }
.panel__head h3 { font-size: 17px; letter-spacing: 0.04em; }
.panel__head .spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.category-list { display: flex; flex-direction: column; gap: 2px; }
.category-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--rule-soft); }
.category-row input { flex: 1; min-width: 0; }

/* 后台登录 */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate__box { width: min(400px, 100%); border: 1px solid var(--rule); background: var(--plate); border-radius: 2px; padding: 34px 32px; box-shadow: var(--lift-2); }

/* 小屏 */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; align-items: start; }
  .admin { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--rule); }
  .side__nav { flex-direction: row; overflow-x: auto; padding: 0; }
  .side__nav button { border-left: 0; border-bottom: 2px solid transparent; white-space: nowrap; }
  .side__nav button[aria-current="true"] { border-left: 0; border-bottom-color: var(--seal); }
}
@media (max-width: 720px) {
  .masthead__in { height: auto; flex-wrap: wrap; padding-block: 10px; gap: 8px; }
  .nav { margin-left: 0; order: 3; width: 100%; overflow-x: auto; }
  .wallet { margin-left: auto; }
  .order { grid-template-columns: 52px minmax(0, 1fr); }
  .order__right { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
  .dialog__body, .dialog__head, .dialog__foot { padding-inline: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .book:hover .book__frame, .package:hover, .btn:hover { transform: none; }
}
