/* 发卡商城样式：手写，不依赖任何外部样式库、字体或图片。买家页面和管理后台共用。 */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --line: #e3e6ef;
  --text: #1c2135;
  --muted: #667089;
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-soft: #eef0ff;
  --ok: #0b8f62;
  --ok-soft: #e6f7f0;
  --warn: #a8690a;
  --warn-soft: #fff5dd;
  --bad: #d02c20;
  --bad-soft: #fdecea;
  --info: #1b66c9;
  --info-soft: #e9f2ff;
  /* 公告栏可选的颜色：文字/边框色和底色 */
  --c-blue: #1b66c9;
  --c-blue-soft: #e9f2ff;
  --c-green: #0b8f62;
  --c-green-soft: #e6f7f0;
  --c-orange: #c2570c;
  --c-orange-soft: #fff0e3;
  --c-red: #d02c20;
  --c-red-soft: #fdecea;
  --c-purple: #7c3aed;
  --c-purple-soft: #f3edff;
  --c-pink: #c0267a;
  --c-pink-soft: #fdebf4;
  --c-gray: #667089;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 25, 50, .05), 0 8px 24px rgba(20, 25, 50, .06);
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1220;
    --surface: #181c2e;
    --surface-2: #1f2438;
    --line: #2c3252;
    --text: #e8eaf4;
    --muted: #9aa3bd;
    --brand: #8d87ff;
    --brand-2: #b28dff;
    --brand-soft: #262a55;
    --ok: #45d19f;
    --ok-soft: #12352b;
    --warn: #f0b849;
    --warn-soft: #3a2f12;
    --bad: #ff8078;
    --bad-soft: #3d1b1b;
    --info: #78b2ff;
    --info-soft: #152a45;
    --c-blue: #78b2ff;
    --c-blue-soft: #152a45;
    --c-green: #45d19f;
    --c-green-soft: #12352b;
    --c-orange: #ffa25a;
    --c-orange-soft: #3a2614;
    --c-red: #ff8078;
    --c-red-soft: #3d1b1b;
    --c-purple: #b28dff;
    --c-purple-soft: #2a1f4a;
    --c-pink: #ff86c2;
    --c-pink-soft: #3a1830;
    --c-gray: #9aa3bd;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}

h1, h2 { margin: 0 0 .6em; line-height: 1.3; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.08rem; }
.card h2:not(:first-child) { margin-top: 1.4em; }
p { margin: 0 0 1em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: .82em; }
code, .mono { font-family: var(--mono); font-size: .93em; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.main { flex: 1; padding-top: 28px; padding-bottom: 48px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.wrap-any { overflow-wrap: anywhere; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.center { justify-content: center; }
.inline { display: inline; }

/* ---------- 顶部与页脚 ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  font-size: 1rem;
}
.nav { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; justify-content: flex-end; }
.nav a { color: var(--text); }
.nav a:hover { color: var(--brand); text-decoration: none; }
.nav-user { display: inline-flex; flex-direction: column; line-height: 1.2; font-weight: 600; }
.nav-user small { color: var(--muted); font-weight: 400; }
.lang { display: inline-flex; align-items: center; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-size: .86rem; line-height: 1.6; white-space: nowrap; }
.nav a.lang:hover, .lang:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }

.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.foot-in { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; padding-top: 18px; padding-bottom: 18px; }
.foot a { color: var(--muted); }

/* ---------- 按钮与表单 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.primary { border-color: transparent; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 6px 16px rgba(79, 70, 229, .28); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { border-color: transparent; color: #fff; background: var(--bad); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.small { min-height: 32px; padding: 0 12px; font-size: .88rem; border-radius: 8px; }
.btn.block { width: 100%; min-height: 46px; font-size: 1.02rem; }
.link { padding: 0; border: 0; background: none; color: var(--brand); font: inherit; cursor: pointer; }
.link:hover { text-decoration: underline; }

.field { display: block; margin: 0 0 16px; padding: 0; border: 0; min-width: 0; }
.field > label, .field > legend, .field > .label { display: block; margin-bottom: 6px; padding: 0; font-weight: 600; font-size: .93rem; }
.hint { display: block; margin-top: 6px; color: var(--muted); font-size: .85rem; }
p.hint { margin-bottom: .6em; }

input[type=text], input[type=password], input[type=number], input[type=search], input[type=url], input[type=file], select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input.mono, textarea.mono { font-family: var(--mono); }
input.short { width: 90px; }

.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }

.joined { display: flex; gap: 8px; }
.joined input { flex: 1; min-width: 0; }
.joined .btn { flex: none; min-height: 42px; }

.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.stepper button { width: 44px; border: 0; background: var(--surface-2); color: var(--text); font-size: 1.2rem; cursor: pointer; }
.stepper button:hover { background: var(--brand-soft); }
.stepper input { width: 84px; border: 0; border-radius: 0; text-align: center; font-weight: 700; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { box-shadow: none; }

.choice { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice input { margin-top: 5px; accent-color: var(--brand); }
.choice span { font-weight: 600; }
.choice small { display: block; color: var(--muted); font-weight: 400; }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 16px; }

/* ---------- 提示、标签、状态 ---------- */

.alert { margin: 0 0 16px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }
.alert.ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.alert.bad { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.alert.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.alert.info { color: var(--info); background: var(--info-soft); border-color: transparent; }
.alert a { color: inherit; text-decoration: underline; }

.badge, .state { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.badge.ok { color: var(--ok); background: var(--ok-soft); }
.badge.off { color: var(--bad); background: var(--bad-soft); }
.state { color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); }
.state-pending { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.state-paid { color: var(--info); background: var(--info-soft); border-color: transparent; }
.state-delivered { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.state-refunded { color: var(--bad); background: var(--bad-soft); border-color: transparent; }

.empty { margin: 0; padding: 36px 12px; text-align: center; color: var(--muted); }

/* ---------- 卡片与布局 ---------- */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 24px; }
.main > .card, .adm-main > .card, .split { margin-bottom: 20px; }
.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.form-wide { max-width: 760px; }
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.split.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.crumb { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; color: var(--muted); font-size: .92rem; }
.head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.head-row h1, .head-row h2, .head-row p { margin: 0; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px 24px; margin: 20px 0 0; }
.card > .facts:first-child { margin-top: 0; }
.facts div { min-width: 0; }
.facts dt { color: var(--muted); font-size: .84rem; }
.facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }

.points { margin: 0 0 1em; padding-left: 1.2em; color: var(--muted); }
.points li { margin-bottom: 4px; }

/* ---------- 首页 ---------- */

.hero {
  margin-bottom: 20px;
  padding: 40px 32px;
  border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(900px 300px at 100% 0%, rgba(255, 255, 255, .22), transparent 60%),
    linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #c026d3 110%);
  box-shadow: 0 18px 40px rgba(79, 70, 229, .25);
}
.hero h1 { font-size: 2rem; margin-bottom: .3em; }
.hero p { margin-bottom: 18px; opacity: .92; font-size: 1.05rem; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.hero-tags li { padding: 4px 14px; border-radius: 999px; background: rgba(255, 255, 255, .18); font-size: .9rem; }

.board { margin-bottom: 20px; padding: 16px 18px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.board-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 1rem; color: var(--brand); }
.board-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 14px; }
.board-links:last-child { margin-bottom: 0; }
.board-link { display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; border: 1.5px solid var(--tone); border-radius: 10px; color: var(--tone); background: var(--surface); font-weight: 600; text-decoration: none; transition: background-color .15s; }
.board-link:hover, .board-link:focus-visible { background: var(--tone-soft); text-decoration: none; }
.board-block { padding: 12px 16px; border: 1px solid transparent; border-left: 4px solid var(--tone); border-radius: 10px; background: var(--tone-soft); line-height: 1.8; overflow-wrap: anywhere; }
.board-block + .board-block { margin-top: 10px; }
.board-block.center { text-align: center; }
.board-block.tone-plain { padding: 2px 4px; border: 0; background: none; }
.tone-blue { --tone: var(--c-blue); --tone-soft: var(--c-blue-soft); }
.tone-green { --tone: var(--c-green); --tone-soft: var(--c-green-soft); }
.tone-orange { --tone: var(--c-orange); --tone-soft: var(--c-orange-soft); }
.tone-red { --tone: var(--c-red); --tone-soft: var(--c-red-soft); }
.tone-purple { --tone: var(--c-purple); --tone-soft: var(--c-purple-soft); }
.tone-pink { --tone: var(--c-pink); --tone-soft: var(--c-pink-soft); }
.tone-gray, .tone-plain { --tone: var(--c-gray); --tone-soft: var(--surface-2); }
.tc-red { color: var(--c-red); }
.tc-orange { color: var(--c-orange); }
.tc-green { color: var(--c-green); }
.tc-blue { color: var(--c-blue); }
.tc-purple { color: var(--c-purple); }
.tc-pink { color: var(--c-pink); }
.tc-gray { color: var(--c-gray); }

.board-edit { display: grid; gap: 8px; margin: 4px 0 18px; }
.board-row { display: grid; grid-template-columns: 2em minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr) 7.5em; gap: 8px; align-items: center; }
.board-row.block { grid-template-columns: 2em 8.5em minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.board-row.head { color: var(--muted); font-size: .85rem; }
.board-row .no { color: var(--muted); text-align: center; }
.board-row.block .no { padding-top: 10px; }
.board-opts { display: grid; gap: 8px; }
.board-opts .check { margin: 0; }

.shelf-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 34px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.chip:hover { border-color: var(--brand); }
.chip.on { border-color: transparent; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.search { max-width: 240px; border-radius: 999px !important; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.product { display: flex; gap: 14px; padding: 16px; color: var(--text); transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease; }
.product:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--brand); box-shadow: 0 12px 28px rgba(79, 70, 229, .16); }
.tile { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; color: #fff; font-size: 1.4rem; font-weight: 700; }
.tile.big { width: 84px; height: 84px; border-radius: 20px; font-size: 2.1rem; }
.hue-0 { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.hue-1 { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.hue-2 { background: linear-gradient(135deg, #10b981, #0ea5e9); }
.hue-3 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.hue-4 { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.hue-5 { background: linear-gradient(135deg, #14b8a6, #22c55e); }
.hue-6 { background: linear-gradient(135deg, #f97316, #ec4899); }
.hue-7 { background: linear-gradient(135deg, #3b82f6, #14b8a6); }
.product-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.product-name { overflow-wrap: anywhere; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
img.tile { object-fit: cover; background: var(--line); }
.product-sum { color: var(--muted); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; margin-top: auto; padding-top: 8px; }
.product-foot .badge { white-space: nowrap; }
.price { color: var(--brand); font-weight: 800; font-size: 1.15rem; white-space: nowrap; }
.price small { color: var(--muted); font-weight: 500; font-size: .78rem; }
.price.large { margin: 8px 0 0; font-size: 1.9rem; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 28px; }
.steps div { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 16px; border: 1px dashed var(--line); border-radius: var(--radius); }
.steps b { grid-row: span 2; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--brand); background: var(--brand-soft); }
.steps span { color: var(--muted); font-size: .88rem; }

/* ---------- 商品页 ---------- */

.product-head { display: flex; gap: 18px; align-items: center; margin-bottom: 20px; }
.product-head > div { min-width: 0; }
.product-head h1 { margin-bottom: .2em; overflow-wrap: anywhere; }
.product-head p { margin: 0; }
.pic-edit { display: flex; gap: 16px; align-items: flex-start; }
.pic-pick { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.pic-pick .hint { margin-top: 0; }
.hint.bad { color: var(--bad); }
.total { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; margin: 4px 0 14px; padding-top: 14px; border-top: 1px dashed var(--line); color: var(--muted); }
.total strong { color: var(--brand); font-size: 1.7rem; }

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

.order-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.order-head h1 { margin-bottom: .2em; }
.order-head p { margin: 0; overflow-wrap: anywhere; }
.order-head .state { font-size: .92rem; padding: 4px 14px; }

.pay { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; padding: 20px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); }
.pay-label { margin: 0 0 4px; color: var(--muted); font-size: .88rem; }
.pay-amount { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 16px; }
.pay-amount strong { color: var(--brand); font-size: 2.2rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pay-addr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.pay-addr code { padding: 6px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); overflow-wrap: anywhere; }
.pay-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 200px; text-align: center; color: var(--muted); }
.qr { width: 184px; height: 184px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.countdown { margin: 0 0 6px; font-weight: 600; }
.countdown strong { color: var(--bad); font-variant-numeric: tabular-nums; font-size: 1.15rem; }
.order-actions { margin-top: 14px; text-align: right; }

.deliver .btn { margin-bottom: 12px; }
.reveal-form { max-width: 380px; margin-bottom: 12px; }
.cards { width: 100%; min-height: 160px; padding: 14px; border-radius: 10px; background: var(--surface-2); white-space: pre; overflow: auto; }
.cards-box .row { margin: 10px 0; }

.secret { padding: 16px; border-radius: 10px; border: 1px dashed var(--brand); background: var(--brand-soft); text-align: center; font-size: 1.2rem; font-weight: 700; letter-spacing: .04em; overflow-wrap: anywhere; user-select: all; }

/* ---------- 账号 ---------- */

.balance-num { margin: 0 0 18px; font-size: 2.3rem; font-weight: 800; line-height: 1.1; color: var(--brand); font-variant-numeric: tabular-nums; }
.balance-num small { color: var(--muted); font-size: .9rem; font-weight: 500; }
.plus { color: var(--ok); font-weight: 600; }
.minus { color: var(--bad); font-weight: 600; }

.prose ol, .prose ul { padding-left: 1.3em; }
.prose li { margin-bottom: 6px; }

/* ---------- 表格与分页 ---------- */

.table-wrap { overflow-x: auto; margin: 0 -8px; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; font-size: .84rem; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr.quiet td { color: var(--muted); }
.table tfoot td { border-top: 2px solid var(--line); border-bottom: 0; font-weight: 700; }
.sub { display: block; margin-top: 2px; color: var(--muted); font-size: .82rem; }
.acts { white-space: nowrap; text-align: right; }
.acts > * { margin-left: 10px; }

.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 16px; color: var(--muted); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.tabs a:hover { text-decoration: none; border-color: var(--brand); }
.tabs a.on { border-color: transparent; color: #fff; background: var(--brand); }

/* ---------- 管理后台 ---------- */

body.adm { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
.side { position: sticky; top: 0; display: flex; flex-direction: column; gap: 18px; min-height: 100vh; padding: 20px 14px; border-right: 1px solid var(--line); background: var(--surface); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { padding: 9px 12px; border-radius: 10px; color: var(--text); }
.side-nav a:hover { text-decoration: none; background: var(--surface-2); }
.side-nav a.on { color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.side-out { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.side-lang { margin-top: auto; padding: 0 12px; }
.side-lang + .side-out { margin-top: 0; }
.adm-main { padding: 28px 28px 48px; min-width: 0; }
.adm-main.solo { grid-column: 1 / -1; padding-top: 12vh; }
.solo-lang { max-width: 460px; margin: -8vh auto 8vh; text-align: right; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
a.stat:hover { text-decoration: none; border-color: var(--brand); }
.stat span { color: var(--muted); font-size: .86rem; }
.stat strong { font-size: 1.7rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat.hot { border-color: var(--bad); }
.stat.hot strong { color: var(--bad); }

.fold { margin-bottom: 6px; }
.fold summary { color: var(--brand); cursor: pointer; }
.fold form { margin-top: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); min-width: 260px; }
.code input { max-width: 180px; letter-spacing: .2em; font-family: var(--mono); }
.code label { display: block; font-weight: 600; font-size: .93rem; }
.code label input { display: block; margin-top: 6px; }

/* ---------- 小屏幕 ---------- */

@media (max-width: 860px) {
  .split, .split.even { grid-template-columns: minmax(0, 1fr); }
  .pay { grid-template-columns: minmax(0, 1fr); }
  .pay-qr { max-width: none; }
  body.adm { display: block; }
  .side { position: static; min-height: 0; flex-direction: column; gap: 10px; padding: 12px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-out { margin-top: 0; padding: 8px 0 0; }
  .side-lang { margin-top: 0; padding: 0; }
  .solo-lang { margin-top: 0; }
  .adm-main { padding: 18px 14px 40px; }
  .table td { white-space: nowrap; }
  .table td.wrap-any { white-space: normal; min-width: 14em; }
  .board-row, .board-row.block { grid-template-columns: minmax(0, 1fr); gap: 6px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
  .board-row.head { display: none; }
  .board-row .no, .board-row.block .no { padding-top: 0; text-align: left; font-weight: 600; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 14px; }
  .pad { padding: 18px; }
  .hero { padding: 28px 20px; }
  .hero h1 { font-size: 1.55rem; }
  .nav { gap: 2px 12px; font-size: .93rem; }
  .brand-name { display: none; }
  .search { max-width: none; }
  .pay-amount strong { font-size: 1.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
