/* ============================================================
   校园集市 · 运营台
   视觉：深色「控制台」科技风
   - 底色：深空蓝黑 + 细网格 + 青色/品牌橙微光
   - 数据：等宽数字、发光描边、状态色
   - 动效：只保留进入与反馈，prefers-reduced-motion 全关
   ============================================================ */

:root {
  /* 基础色板 */
  --bg: #060a13;
  --bg-2: #0a101d;
  --panel: #0d1626;
  --panel-2: #111c2f;
  --panel-3: #16233a;
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.26);
  --ink: #e8eef8;
  --muted: #9fb0c6;
  --subtle: #6f7f95;

  /* 品牌与科技强调色 */
  --brand: #f4520a;
  --brand-2: #ff8a3d;
  --brand-soft: rgba(244, 82, 10, 0.14);
  --cyan: #38bdf8;
  --cyan-2: #7dd3fc;
  --cyan-soft: rgba(56, 189, 248, 0.14);

  /* 状态色（深色底上提高亮度保证对比度） */
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.13);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.13);
  --red: #fb7185;
  --red-soft: rgba(251, 113, 133, 0.13);
  --blue: #60a5fa;
  --blue-soft: rgba(96, 165, 250, 0.13);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, 0.14);

  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 18px 44px -26px rgba(0, 0, 0, 0.9);
  --shadow-lg: 0 26px 60px -28px rgba(0, 0, 0, 0.95);
  --glow-brand: 0 0 0 1px rgba(244, 82, 10, 0.35), 0 12px 34px -14px rgba(244, 82, 10, 0.55);
  --glow-cyan: 0 0 0 1px rgba(56, 189, 248, 0.28), 0 12px 34px -16px rgba(56, 189, 248, 0.4);
  --brand-grad: linear-gradient(135deg, #ff8a3d 0%, #f4520a 52%, #d64307 100%);
  --cyan-grad: linear-gradient(135deg, #7dd3fc 0%, #38bdf8 55%, #0ea5e9 100%);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* 背景：细网格 + 青/橙微光，营造「指挥台」纵深 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 8% -10%, rgba(56, 189, 248, 0.12), transparent 62%),
    radial-gradient(820px 520px at 96% 112%, rgba(244, 82, 10, 0.12), transparent 60%),
    radial-gradient(600px 420px at 50% 50%, rgba(56, 189, 248, 0.04), transparent 70%),
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: auto, auto, auto, 44px 44px, 44px 44px;
}

::selection { background: rgba(244, 82, 10, 0.32); color: #fff; }

a { color: var(--cyan-2); text-decoration: none; }
a:hover { color: #fff; }
code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cyan-2);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.16);
  padding: 1px 6px;
  border-radius: 6px;
}

.shell { display: flex; min-height: 100vh; }

/* ---------------- 侧边栏 ---------------- */

.side {
  width: 240px;
  flex: 0 0 240px;
  background: linear-gradient(180deg, rgba(10, 16, 29, 0.98) 0%, rgba(7, 11, 20, 0.99) 100%);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  box-shadow: inset -1px 0 0 rgba(56, 189, 248, 0.05), 12px 0 44px -34px rgba(56, 189, 248, 0.35);
}

.brand { display: flex; align-items: center; gap: 11px; color: #fff; padding: 2px 8px 18px; }
.brand:hover { color: #fff; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--brand-grad);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 10px 24px -8px rgba(244, 82, 10, 0.7);
  object-fit: contain;
}
img.brand-mark { background: transparent; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 10px 24px -8px rgba(244, 82, 10, 0.7); padding: 0; }
.brand-text { display: flex; flex-direction: column; font-weight: 700; font-size: 15px; line-height: 1.2; letter-spacing: .2px; }
.brand-text em {
  font-style: normal; font-weight: 500; font-size: 10.5px;
  color: var(--cyan); letter-spacing: 2.4px; margin-top: 3px;
}

.nav { flex: 1; overflow-y: auto; padding-right: 2px; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.22); border-radius: 4px; }
.nav-sheet { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.side-current, .nav-toggle { display: none; }

.nav-group { margin-bottom: 10px; }
.nav-group-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10.5px; letter-spacing: 1.8px; color: var(--subtle);
  padding: 8px 12px; text-transform: uppercase; cursor: pointer;
  border-radius: 8px; user-select: none; width: 100%;
  background: transparent; border: 0; font-family: inherit;
  transition: background .15s, color .15s;
}
.nav-group-title:hover { background: rgba(148, 163, 184, 0.08); color: var(--muted); }
.nav-group-arrow { font-size: 13px; line-height: 1; color: var(--subtle); transition: transform .18s ease; }
.nav-group.is-open .nav-group-arrow { transform: rotate(180deg); color: var(--cyan); }
.nav-group-items { display: block; }
.nav-group:not(.is-open) .nav-group-items { display: none; }

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  color: var(--muted); font-size: 13.5px; margin-bottom: 2px;
  border: 1px solid transparent;
  transition: background .15s, color .15s, transform .15s, border-color .15s;
}
.nav-link::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: rgba(148, 163, 184, 0.35); flex: 0 0 auto;
  transition: background .15s, box-shadow .15s;
}
.nav-link:hover { background: rgba(148, 163, 184, 0.08); color: #fff; transform: translateX(2px); }
.nav-link.is-active {
  background: var(--brand-grad);
  color: #fff; font-weight: 700;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: var(--glow-brand);
}
.nav-link.is-active::before { background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18); }

.side-foot { border-top: 1px solid var(--line); padding-top: 12px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 0 6px 10px; }
.side-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.24), rgba(56, 189, 248, 0.06));
  color: var(--cyan-2); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
  border: 1px solid rgba(56, 189, 248, 0.28);
}
.side-user-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.side-user-text strong { color: #fff; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.side-user-text span { color: var(--subtle); font-size: 11px; letter-spacing: .4px; }
.logout-form { margin: 0; }
.logout-btn {
  width: 100%; padding: 8px; border-radius: 10px; cursor: pointer;
  background: rgba(148, 163, 184, 0.06); color: var(--muted);
  border: 1px solid var(--line); font-size: 12.5px; font-family: inherit;
  transition: color .15s, border-color .15s, background .15s;
}
.logout-btn:hover { color: var(--cyan-2); border-color: rgba(56, 189, 248, 0.4); background: var(--cyan-soft); }

/* ---------------- 主区 ---------------- */

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 22px 34px 16px;
  background: rgba(6, 10, 19, 0.72);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
/* 顶栏下沿的「能量线」 */
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.55) 30%, rgba(244, 82, 10, 0.5) 70%, transparent);
  opacity: .8;
}
.topbar h1 {
  margin: 0; font-size: 21px; letter-spacing: .3px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
}
.topbar h1::before {
  content: ""; width: 4px; height: 18px; border-radius: 2px;
  background: var(--cyan-grad); box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
  flex: 0 0 auto;
}
.topbar p { margin: 5px 0 0 14px; color: var(--subtle); font-size: 13px; }
.topbar-meta {
  color: var(--muted); font-size: 12px; padding: 6px 14px; white-space: nowrap;
  border-radius: 999px; background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--line);
  display: inline-flex; align-items: center; gap: 7px;
}
.topbar-meta::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 8px var(--green);
}
.content { padding: 24px 34px 46px; }

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

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0) 40%), var(--panel);
  border-radius: var(--radius); padding: 22px 24px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  margin-bottom: 18px;
  position: relative;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
/* 卡片上沿的「光刃」 */
.card::before {
  content: ""; position: absolute; left: 20px; right: 20px; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.6), rgba(244, 82, 10, 0.45), transparent);
  opacity: .75; pointer-events: none;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.32);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.card-head h2 { margin: 0; font-size: 16px; letter-spacing: .2px; display: flex; align-items: center; gap: 8px; }
.card-head h2::before {
  content: ""; width: 3px; height: 14px; border-radius: 2px;
  background: var(--cyan-grad); box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}
.card-hint { margin: 4px 0 0 11px; color: var(--subtle); font-size: 12.5px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- 统计卡 ---------------- */

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border-radius: var(--radius); padding: 18px 20px 18px 24px;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  position: relative; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--cyan); color: var(--cyan);
  box-shadow: 0 0 12px currentColor;
}
.stat--brand::before { background: var(--brand); color: var(--brand); }
.stat--blue::before { background: var(--blue); color: var(--blue); }
.stat--amber::before { background: var(--amber); color: var(--amber); }
.stat--green::before { background: var(--green); color: var(--green); }
.stat::after {
  content: ""; position: absolute; right: -34px; top: -34px; width: 110px; height: 110px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 35% 35%, rgba(56, 189, 248, 0.22), transparent 68%);
}
.stat--brand::after { background: radial-gradient(circle at 35% 35%, rgba(244, 82, 10, 0.26), transparent 68%); }
.stat--blue::after { background: radial-gradient(circle at 35% 35%, rgba(96, 165, 250, 0.26), transparent 68%); }
.stat--amber::after { background: radial-gradient(circle at 35% 35%, rgba(251, 191, 36, 0.24), transparent 68%); }
.stat--green::after { background: radial-gradient(circle at 35% 35%, rgba(52, 211, 153, 0.24), transparent 68%); }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: rgba(56, 189, 248, 0.35); }
.stat-label { color: var(--subtle); font-size: 12.5px; letter-spacing: .3px; }
.stat-value {
  font-size: 27px; font-weight: 800; margin: 6px 0 2px; letter-spacing: -.6px;
  font-variant-numeric: tabular-nums; font-family: var(--mono);
}
.stat-hint { color: var(--subtle); font-size: 11.5px; }
.stat--brand .stat-value { color: var(--brand-2); }
.stat--blue .stat-value { color: var(--blue); }
.stat--amber .stat-value { color: var(--amber); }
.stat--green .stat-value { color: var(--green); }

/* ---------------- 统计页 ---------------- */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-2 > .card { margin-bottom: 0; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.grid-3 > .card { margin-bottom: 0; }
@media (max-width: 1180px) { .grid-3 { grid-template-columns: 1fr; } }

/* 竖向柱状图（统计页）：30 天横排，比横向条省 2/3 纵向空间 */
.col-chart { display: flex; align-items: flex-end; gap: 2px; height: 150px; padding-top: 10px; }
.col-bar-wrap { flex: 1; display: flex; align-items: flex-end; height: 100%; min-width: 0; cursor: pointer; }
.col-bar {
  width: 100%; height: 100%; border-radius: 4px 4px 2px 2px;
  background: var(--brand-grad);
  box-shadow: 0 0 10px -2px rgba(244, 82, 10, 0.55);
  transform-origin: bottom; transform: scaleY(0);
  animation: grow-y .55s cubic-bezier(.2, .7, .3, 1) forwards;
  transition: filter .15s;
}
.col-bar.is-empty { background: rgba(148, 163, 184, 0.14); box-shadow: none; }
.col-bar--blue { background: var(--cyan-grad); box-shadow: 0 0 10px -2px rgba(56, 189, 248, 0.55); }
.col-bar--green { background: linear-gradient(180deg, #6ee7b7, #10b981); box-shadow: 0 0 10px -2px rgba(52, 211, 153, 0.5); }
.col-bar-wrap:hover .col-bar { filter: brightness(1.25); }
.col-chart-axis {
  display: flex; justify-content: space-between; gap: 8px; margin-top: 8px;
  font-size: 10px; color: var(--subtle); font-family: var(--mono);
}
.col-chart-summary {
  display: flex; justify-content: space-between; gap: 10px; margin-top: 6px;
  font-size: 11.5px; color: var(--subtle);
}
.col-chart-summary strong { color: var(--ink); font-family: var(--mono); font-variant-numeric: tabular-nums; }

.todos { display: flex; flex-wrap: wrap; gap: 12px; }
.todo {
  padding: 12px 18px; border-radius: 13px; background: var(--brand-soft);
  color: var(--brand-2); font-size: 13px; border: 1px solid rgba(244, 82, 10, 0.28);
  transition: background .15s, transform .15s, box-shadow .15s;
}
.todo:hover { background: rgba(244, 82, 10, 0.22); transform: translateY(-1px); box-shadow: 0 0 22px -8px rgba(244, 82, 10, 0.7); }
.todo strong { font-size: 17px; margin-right: 3px; font-family: var(--mono); }
.todo--done { background: var(--green-soft); color: var(--green); border-color: rgba(52, 211, 153, 0.3); }
.todo--danger { background: var(--red-soft); color: var(--red); border-color: rgba(251, 113, 133, 0.32); }
.todo--danger:hover { background: rgba(251, 113, 133, 0.2); }

/* ---------------- 表格 ---------------- */

.table-wrap {
  width: 100%; overflow-x: auto; border-radius: 14px;
  border: 1px solid var(--line); background: var(--panel);
}
.table { width: 100%; border-collapse: collapse; min-width: 720px; }
.table th {
  text-align: left; font-size: 11px; letter-spacing: .9px; color: var(--subtle);
  background: rgba(148, 163, 184, 0.06); padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap; font-weight: 700; text-transform: uppercase;
}
.table td {
  padding: 13px 14px; border-bottom: 1px solid rgba(148, 163, 184, 0.09);
  vertical-align: top; font-size: 13px; color: var(--muted);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s, transform .12s; }
.table tbody tr:hover { background: rgba(56, 189, 248, 0.07); }
.table tbody tr:hover td { color: var(--ink); }
.table td strong { color: var(--ink); }
.muted { color: var(--subtle); font-size: 12px; }

.link {
  font-weight: 600; color: var(--cyan-2);
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-thickness: 1px; text-decoration-color: rgba(125, 211, 252, 0.45);
}
.link:hover { color: #fff; text-decoration-color: currentColor; }

.row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-form { display: inline-block; margin: 0; }
.copy-value { display: block; font-size: 12.5px; color: var(--ink); word-break: break-all; margin-bottom: 5px; }
.copy-value + .btn-sm { min-height: 30px; }

.consign-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-label { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--subtle); white-space: nowrap; }
.input--xs { width: 68px; padding: 5px 8px; font-size: 12px; border-radius: 9px; }
.input--sm { width: 132px; padding: 6px 8px; font-size: 12px; border-radius: 9px; }
.input-inline { width: 92px; padding: 6px 8px; font-size: 12px; text-align: right; }
.thumb--xs { width: 46px; height: 46px; border-radius: 10px; }
.image-strip .link { display: inline-block; }

/* 取书码 */
.qr-box {
  display: flex; align-items: center; justify-content: center;
  width: fit-content; max-width: 100%;
  padding: 16px; margin: 12px auto;
  background: #fff; border: 1px solid rgba(56, 189, 248, 0.35); border-radius: 16px;
  box-shadow: 0 0 28px -10px rgba(56, 189, 248, 0.55);
}
.qr-box svg { display: block; width: 200px; height: 200px; }

/* ---------------- 徽章 ---------------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; line-height: 1.7; white-space: nowrap;
  background: rgba(148, 163, 184, 0.1); color: var(--muted);
  border: 1px solid var(--line);
}
.badge--green { background: var(--green-soft); color: var(--green); border-color: rgba(52, 211, 153, 0.32); }
.badge--amber { background: var(--amber-soft); color: var(--amber); border-color: rgba(251, 191, 36, 0.32); }
.badge--red { background: var(--red-soft); color: var(--red); border-color: rgba(251, 113, 133, 0.32); }
.badge--blue { background: var(--blue-soft); color: var(--blue); border-color: rgba(96, 165, 250, 0.32); }
.badge--gray { background: rgba(148, 163, 184, 0.1); color: var(--muted); }
.badge--brand { background: var(--brand-soft); color: var(--brand-2); border-color: rgba(244, 82, 10, 0.32); }
.pill {
  padding: 4px 12px; border-radius: 999px; background: var(--cyan-soft);
  color: var(--cyan-2); font-size: 12px; font-weight: 700;
  border: 1px solid rgba(56, 189, 248, 0.28);
}

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 11px; border: 1px solid transparent;
  font-size: 13px; font-weight: 700; cursor: pointer; line-height: 1.5;
  color: var(--ink); font-family: inherit;
  transition: transform .06s, background .15s, border-color .15s, box-shadow .15s, color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--brand-grad); color: #fff; position: relative; overflow: hidden;
  box-shadow: 0 10px 26px -12px rgba(244, 82, 10, 0.85);
}
.btn-primary:hover { background: var(--brand-grad); color: #fff; filter: saturate(1.08) brightness(1.05); box-shadow: var(--glow-brand); }
.btn-ghost {
  background: rgba(148, 163, 184, 0.07); border-color: var(--line-strong); color: var(--muted);
}
.btn-ghost:hover { border-color: rgba(56, 189, 248, 0.5); color: #fff; background: var(--cyan-soft); box-shadow: var(--glow-cyan); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: rgba(251, 113, 133, 0.32); }
.btn-danger:hover { background: rgba(251, 113, 133, 0.22); color: #fff; box-shadow: 0 0 0 1px rgba(251, 113, 133, 0.4), 0 10px 26px -14px rgba(251, 113, 133, 0.8); }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 9px; }
.btn-block { width: 100%; padding: 11px; font-size: 14px; }

.btn-primary::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 45%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: translateX(-130%) skewX(-12deg); pointer-events: none;
}
.btn-primary:hover::after { animation: shine .85s ease; }

.btn:focus-visible,
.nav-link:focus-visible,
.nav-group-title:focus-visible,
.pg-btn:focus-visible,
a:focus-visible,
.input:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ---------------- 站内弹层 ---------------- */

.modal {
  position: fixed; inset: 0; z-index: 90;
  display: none; align-items: center; justify-content: center;
  padding: 20px; background: rgba(3, 6, 12, 0.72); backdrop-filter: blur(4px);
}
.modal.is-open { display: flex; }
.modal-card {
  width: 100%; max-width: 460px; max-height: 88vh; overflow-y: auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0) 40%), var(--panel-2);
  border-radius: 18px; padding: 22px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  box-shadow: var(--shadow-lg), 0 0 40px -18px rgba(56, 189, 248, 0.45);
  position: relative;
}
.modal-card::before {
  content: ""; position: absolute; left: 22px; right: 22px; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.7), rgba(244, 82, 10, 0.5), transparent);
}
.modal-title { margin: 0 0 6px; font-size: 16px; letter-spacing: .2px; }
.modal-text { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; }
.modal-field { margin-bottom: 14px; }
.modal-field .input { width: 100%; }
.modal-error { color: var(--red); font-size: 12px; margin-top: 6px; min-height: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.modal-actions .btn { min-height: 40px; }
@media (max-width: 480px) {
  .modal { padding: 12px; }
  .modal-card { padding: 18px; }
  .modal-actions .btn { flex: 1; }
}

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

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; align-items: center; }
.input {
  width: 100%; padding: 9px 12px; border-radius: 11px; border: 1px solid var(--line-strong);
  background: rgba(6, 10, 19, 0.7); font-size: 13px; color: var(--ink);
  font-family: inherit; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder { color: var(--subtle); }
.input:focus { border-color: rgba(56, 189, 248, 0.65); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16); background: rgba(6, 10, 19, 0.95); }
.filters .input { width: auto; min-width: 180px; }
select.input { cursor: pointer; }
select.input option { background: var(--panel-2); color: var(--ink); }
textarea.input { resize: vertical; line-height: 1.6; }

.form-stack {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px; align-items: start;
}
.form-stack > .field { min-width: 0; margin: 0; }
.form-stack > .field:has(textarea) { grid-column: 1 / -1; }
.form-stack > .btn { grid-column: auto; justify-self: start; }
.form-stack > .form-actions,
.form-stack > small { grid-column: 1 / -1; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: end; }
.form-grid > .form-actions { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.field small { color: var(--subtle); font-size: 11.5px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

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

.flash {
  padding: 10px 15px; border-radius: 12px; margin-bottom: 14px; font-size: 13px; font-weight: 500;
  background: var(--green-soft); color: var(--green); border: 1px solid rgba(52, 211, 153, 0.3);
}
.flash--err { background: var(--red-soft); color: var(--red); border-color: rgba(251, 113, 133, 0.3); }

/* ---------------- 详情 ---------------- */

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 18px; }
.detail-side .card { margin-bottom: 18px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--subtle); font-size: 12.5px; margin: 10px 0; }
.price-line {
  display: flex; align-items: baseline; gap: 10px; padding: 14px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 10px 0 16px;
}
.price-line strong {
  font-size: 28px; color: var(--brand-2); letter-spacing: -.5px;
  font-family: var(--mono); text-shadow: 0 0 18px rgba(244, 82, 10, 0.35);
}
.desc { white-space: pre-wrap; color: var(--muted); font-size: 13.5px; line-height: 1.75; margin-bottom: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tag {
  padding: 3px 10px; border-radius: 999px; font-size: 11.5px;
  background: rgba(56, 189, 248, 0.1); color: var(--cyan-2);
  border: 1px solid rgba(56, 189, 248, 0.2);
}
.image-strip { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.thumb {
  width: 132px; height: 132px; object-fit: cover; border-radius: 14px;
  border: 1px solid var(--line); background: var(--panel-2);
}

.kv {
  display: flex; justify-content: space-between; gap: 14px; padding: 8px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1); font-size: 13px;
}
.kv:last-child { border-bottom: 0; }
.kv > span { color: var(--subtle); flex: 0 0 auto; }
.kv > strong { font-weight: 600; text-align: right; word-break: break-all; color: var(--ink); }
.detail-actions { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.fee-line { padding: 5px 0; border-bottom: 1px solid rgba(148, 163, 184, 0.1); }
.order-line {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 0; border-bottom: 1px solid rgba(148, 163, 184, 0.1); color: var(--muted); font-size: 12.5px;
}
.order-line:last-child { border-bottom: 0; }
.verify-line { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(148, 163, 184, 0.1); }
.tx-line { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(148, 163, 184, 0.1); font-size: 12.5px; }
.amount-in { color: var(--green); font-weight: 700; white-space: nowrap; font-family: var(--mono); }
.amount-out { color: var(--red); font-weight: 700; white-space: nowrap; font-family: var(--mono); }
.prose { color: var(--muted); font-size: 13px; line-height: 1.8; margin: 0; }
.wide { min-width: 180px; }

/* ---------------- 空态 / 分页 ---------------- */

.empty {
  padding: 42px 16px; text-align: center; color: var(--subtle); font-size: 13px;
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.05), rgba(148, 163, 184, 0.02));
  border-radius: 14px; border: 1px dashed var(--line-strong);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.empty::before {
  content: ""; width: 42px; height: 42px; border-radius: 14px;
  background:
    radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.2), transparent 70%),
    linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(244, 82, 10, 0.12));
  border: 1px dashed rgba(56, 189, 248, 0.4);
}

.pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 16px; flex-wrap: wrap; }
.pg-info { color: var(--subtle); font-size: 12.5px; font-family: var(--mono); }
.pg-btns { display: flex; gap: 8px; }
.pg-btn {
  padding: 6px 14px; border-radius: 9px; background: rgba(148, 163, 184, 0.07);
  border: 1px solid var(--line); font-size: 12.5px; color: var(--muted);
}
.pg-btn:hover { border-color: rgba(56, 189, 248, 0.5); color: #fff; background: var(--cyan-soft); }
.pg-btn.is-off { color: var(--subtle); background: rgba(148, 163, 184, 0.04); opacity: .6; }
.detail-code { color: var(--subtle); word-break: break-all; font-size: 11.5px; font-family: var(--mono); }

/* ---------------- 登录 ---------------- */

.login-body {
  min-height: 100vh;
  background:
    radial-gradient(900px 560px at 12% -8%, rgba(56, 189, 248, 0.18), transparent 60%),
    radial-gradient(820px 560px at 92% 110%, rgba(244, 82, 10, 0.2), transparent 58%),
    var(--bg);
  position: relative;
}
.login-body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse at 50% 38%, #000 20%, rgba(0, 0, 0, 0.4) 100%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 38%, #000 20%, rgba(0, 0, 0, 0.4) 100%);
}
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 18px; position: relative; z-index: 1; }
.login-card {
  width: 100%; max-width: 400px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 42%), var(--panel-2);
  border-radius: 22px; padding: 34px 32px 28px;
  box-shadow: var(--shadow-lg), 0 0 60px -24px rgba(56, 189, 248, 0.5);
  border: 1px solid rgba(56, 189, 248, 0.22);
  position: relative;
}
.login-card::before {
  content: ""; position: absolute; left: 28px; right: 28px; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.8), rgba(244, 82, 10, 0.55), transparent);
}
.login-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; color: var(--muted); margin-bottom: 26px; }
.login-card h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.3px; }
.login-sub { margin: 0 0 22px; color: var(--subtle); font-size: 12.5px; line-height: 1.6; }
.login-form { display: flex; flex-direction: column; gap: 15px; }
.login-form .field > span { font-size: 12.5px; }
.login-form input {
  padding: 11px 13px; font-size: 14px;
  background: rgba(6, 10, 19, 0.72); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 11px;
}
.login-form input::placeholder { color: var(--subtle); }
.login-form input:focus { outline: none; border-color: rgba(56, 189, 248, 0.65); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16); }
.login-note { margin: 20px 0 0; color: var(--subtle); font-size: 11.5px; line-height: 1.7; }
.login-foot { color: rgba(148, 163, 184, 0.6); font-size: 11.5px; margin: 18px 0 0; letter-spacing: .5px; font-family: var(--mono); }

/* ---------------- Toast ---------------- */

.toasts {
  position: fixed; top: 18px; right: 18px; z-index: 120;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
}
.toast {
  position: relative; overflow: hidden;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 34px 14px 14px; border-radius: 13px;
  font-size: 13px; font-weight: 500; line-height: 1.55; color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)), #132033;
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 44px -20px rgba(0, 0, 0, 0.95);
  animation: toast-in .28s cubic-bezier(.2, .8, .3, 1) both;
}
.toast--ok { border-color: rgba(52, 211, 153, 0.45); box-shadow: 0 0 30px -14px rgba(52, 211, 153, 0.7); }
.toast--ok .toast-text { color: #a7f3d0; }
.toast--err { border-color: rgba(251, 113, 133, 0.5); box-shadow: 0 0 30px -14px rgba(251, 113, 133, 0.7); }
.toast--err .toast-text { color: #fecdd3; }
.toast.is-leaving { opacity: 0; transform: translateX(20px); transition: opacity .22s, transform .22s; }
.toast-close {
  position: absolute; top: 6px; right: 8px;
  border: 0; background: transparent; color: inherit; cursor: pointer;
  font-size: 16px; line-height: 1; opacity: .75; padding: 2px 4px;
}
.toast-close:hover { opacity: 1; }
.toast-bar {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: var(--green); transform-origin: left; animation: toast-bar 6s linear forwards;
}
.toast--err .toast-bar { background: var(--red); animation: none; transform: scaleX(0); }
@keyframes toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------------- 批量操作 ---------------- */

.bulk-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 14px; padding: 12px 16px;
  background: linear-gradient(135deg, rgba(244, 82, 10, 0.16), rgba(13, 22, 38, 0.9));
  border: 1px solid rgba(244, 82, 10, 0.32); border-radius: 14px;
  box-shadow: 0 0 30px -16px rgba(244, 82, 10, 0.7);
}
.bulk-bar[hidden] { display: none; }
.bulk-bar .bulk-count { font-size: 13px; color: var(--ink); }
.bulk-bar .bulk-count strong { color: var(--brand-2); font-size: 15px; font-family: var(--mono); }
.bulk-bar .btn { margin-left: auto; }
.bulk-bar .btn + .btn { margin-left: 0; }

/* 行选中高亮 */
.table tbody tr.is-selected { background: rgba(244, 82, 10, 0.12); }
.table tbody tr.is-selected:hover { background: rgba(244, 82, 10, 0.18); }
.table td:first-child { position: relative; }
.row-check { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.col-check { width: 42px; }
.col-check .row-check { display: block; margin: 0 auto; }

/* 迷你趋势图 */
.mini-chart { display: flex; align-items: flex-end; gap: 6px; height: 74px; padding-top: 8px; }
.mini-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.mini-bar {
  width: 100%; max-width: 26px; min-height: 3px; border-radius: 6px 6px 3px 3px;
  background: var(--cyan-grad);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
  transform-origin: bottom; transform: scaleY(0);
  animation: grow-y .7s cubic-bezier(.2, .7, .3, 1) forwards;
}
.mini-bar--blue { background: linear-gradient(180deg, #93c5fd, #3b82f6); box-shadow: 0 0 14px rgba(96, 165, 250, 0.5); }
.mini-bar--green { background: linear-gradient(180deg, #6ee7b7, #10b981); box-shadow: 0 0 14px rgba(52, 211, 153, 0.5); }
.mini-bar--brand { background: var(--brand-grad); box-shadow: 0 0 14px rgba(244, 82, 10, 0.5); }
.mini-col:nth-child(1) .mini-bar { animation-delay: .05s; }
.mini-col:nth-child(2) .mini-bar { animation-delay: .1s; }
.mini-col:nth-child(3) .mini-bar { animation-delay: .15s; }
.mini-col:nth-child(4) .mini-bar { animation-delay: .2s; }
.mini-col:nth-child(5) .mini-bar { animation-delay: .25s; }
.mini-col:nth-child(6) .mini-bar { animation-delay: .3s; }
.mini-col:nth-child(7) .mini-bar { animation-delay: .35s; }
.mini-value { font-size: 11px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; font-family: var(--mono); }
.mini-label { font-size: 10px; color: var(--subtle); font-variant-numeric: tabular-nums; }

/* ---------------- 动效 ---------------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes pop {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to { opacity: 1; transform: none; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(28px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@keyframes shine {
  from { transform: translateX(-130%) skewX(-12deg); }
  to { transform: translateX(240%) skewX(-12deg); }
}
@keyframes grow-y {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(251, 113, 133, .4); }
  70% { box-shadow: 0 0 0 9px rgba(251, 113, 133, 0); }
  100% { box-shadow: 0 0 0 0 rgba(251, 113, 133, 0); }
}
@keyframes bar-shimmer {
  from { background-position: -200px 0; }
  to { background-position: 200px 0; }
}

/* 进入动画：用 backwards，动画结束后交还样式，hover 才不会失效 */
.content > .stats,
.content > .card,
.content > .grid-2,
.content > .grid-3,
.content > .filters,
.content > .bulk-bar {
  animation: rise .5s cubic-bezier(.2, .7, .3, 1) backwards;
}
.content > *:nth-child(2) { animation-delay: .05s; }
.content > *:nth-child(3) { animation-delay: .1s; }
.content > *:nth-child(4) { animation-delay: .15s; }
.content > *:nth-child(5) { animation-delay: .2s; }
.content > *:nth-child(6) { animation-delay: .25s; }

/* 危险待办：呼吸红圈 */
.todo--danger { animation: pulse-ring 2.4s infinite; }

/* 弹层动画 */
.modal { animation: fade-in .16s ease both; }
.modal.is-open .modal-card { animation: pop .26s cubic-bezier(.2, .9, .3, 1.15) both; }

/* 表格排序 */
.th-sort {
  display: inline-flex; align-items: center; gap: 5px;
  color: inherit; text-decoration: none; font-weight: 700;
}
.th-sort:hover { color: var(--cyan-2); text-decoration: none; }
.th-sort.is-active { color: var(--cyan-2); }
.th-caret { font-size: 9px; opacity: .55; }
.th-sort.is-active .th-caret { opacity: 1; color: var(--cyan); }
.table th:first-child { border-top-left-radius: 14px; }
.table th:last-child { border-top-right-radius: 14px; }

/* 侧边导航 */
.nav-link { transition: background .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.nav-group-items { animation: fade-in .18s ease; }

/* 滚动条 */
.content::-webkit-scrollbar { width: 10px; }
.content::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.22); border-radius: 999px; border: 2px solid var(--bg); }
.nav::-webkit-scrollbar { width: 6px; }

/* ---------------- 响应式 ---------------- */

@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side {
    position: sticky; top: 0; z-index: 40;
    width: 100%; height: 52px; flex: 0 0 auto;
    display: grid; grid-template-columns: auto auto;
    justify-content: space-between;
    align-items: center; gap: 10px;
    padding: 0 12px;
    box-shadow: 0 10px 24px -18px rgba(0, 0, 0, 0.85);
  }
  .brand { padding: 0; gap: 8px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
  .brand-text { display: none; }

  /* 移动端顶栏已显示页面标题，侧栏不再重复 */
  .side-current { display: none; }

  .nav-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    height: 32px; padding: 0 11px; border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08); color: #fff;
    font-size: 12.5px; font-family: inherit; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .nav-toggle-icon { display: flex; flex-direction: column; justify-content: center; gap: 3px; width: 14px; height: 12px; }
  .nav-toggle-icon i { display: block; height: 1.5px; border-radius: 2px; background: currentColor; transition: transform .18s ease, opacity .18s ease; }
  .side.is-menu-open .nav-toggle-icon i:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
  .side.is-menu-open .nav-toggle-icon i:nth-child(2) { opacity: 0; }
  .side.is-menu-open .nav-toggle-icon i:nth-child(3) { transform: translateY(-4.5px) rotate(-45deg); }

  .nav-sheet {
    position: fixed; left: 0; right: 0; top: 52px; bottom: 0; z-index: 35;
    display: none; flex-direction: column;
    padding: 14px 12px calc(18px + env(safe-area-inset-bottom));
    background: rgba(9, 14, 24, 0.98);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
  .side.is-menu-open .nav-sheet { display: flex; }

  .nav { display: block; width: 100%; overflow: visible; padding: 0; }
  .nav-group { display: block; margin: 0 0 14px; }
  .nav-group-title {
    display: flex; padding: 0 2px 8px;
    font-size: 11px; letter-spacing: 1px; color: var(--subtle);
    text-transform: none; cursor: default; width: 100%;
    background: transparent; border: 0; font-family: inherit;
  }
  .nav-group-title:hover { background: transparent; color: var(--subtle); }
  .nav-group-title .nav-group-arrow { display: none; }
  .nav .nav-group .nav-group-items { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .nav-link {
    display: block; margin: 0; padding: 11px 12px;
    border-radius: 12px; font-size: 13px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background: rgba(148, 163, 184, 0.08);
  }
  .nav-link::before { display: none; }
  .nav-link:hover { background: rgba(148, 163, 184, 0.16); transform: none; }
  .nav-link.is-active {
    background: var(--brand-grad); color: #fff; box-shadow: var(--glow-brand);
  }

  .side-foot {
    margin: auto 0 0; padding: 14px 0 0;
    display: flex; align-items: center; gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  .side-user { padding: 0; gap: 8px; flex: 1; min-width: 0; }
  .side-avatar { width: 30px; height: 30px; font-size: 13px; }
  .side-user-text { display: flex; }
  .logout-form { flex: 0 0 auto; }
  .logout-btn {
    width: auto; padding: 8px 14px; font-size: 12.5px;
    border-radius: 10px; border-color: rgba(255, 255, 255, 0.14);
  }

  .topbar { padding: 14px 16px 10px; position: static; }
  .topbar h1 { font-size: 18px; }
  .topbar h1::before { height: 15px; }
  .topbar p { font-size: 12px; margin-left: 10px; }
  .topbar-meta { display: none; }
  .content { padding: 14px 14px 24px; }

  .card { padding: 16px; border-radius: 16px; margin-bottom: 14px; }
  .card-head { flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
  .card-head h2 { font-size: 15px; }
  .card-hint { font-size: 11.5px; }
  .card-actions { width: 100%; flex-wrap: wrap; }

  .stats { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
  .stat { padding: 12px 14px; border-radius: 14px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 11px; }
  .stat-hint { font-size: 10.5px; }

  .table-wrap {
    overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px;
    background:
      linear-gradient(to right, var(--panel) 30%, rgba(13, 22, 38, 0)) left center,
      linear-gradient(to left, var(--panel) 30%, rgba(13, 22, 38, 0)) right center,
      radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, 0.5), transparent) left center,
      radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.5), transparent) right center,
      var(--panel);
    background-repeat: no-repeat;
    background-size: 36px 100%, 36px 100%, 14px 100%, 14px 100%, auto;
    background-attachment: local, local, scroll, scroll, local;
  }
  .table-wrap::-webkit-scrollbar { height: 6px; }
  .table-wrap::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.3); border-radius: 999px; }
  .table-wrap::-webkit-scrollbar-track { background: transparent; }
  .table { min-width: 560px; }
  .table th { padding: 10px; font-size: 11px; }
  .table td { padding: 10px; font-size: 12px; }
  .row-actions { flex-wrap: wrap; gap: 4px; }
  .btn-sm { min-height: 36px; padding: 5px 9px; font-size: 11.5px; }

  .input { font-size: 16px; padding: 10px 12px; }
  textarea.input { font-size: 16px; }
  .btn { min-height: 44px; padding: 10px 16px; font-size: 13px; }
  .filters .input { min-width: 0; width: 100%; }
  .filters { display: grid; grid-template-columns: 1fr; }
  .filters .btn { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .form-stack { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }

  .detail-grid { grid-template-columns: 1fr; }
  .detail-meta { gap: 4px 12px; font-size: 12px; }
  .price-line strong { font-size: 24px; }
  .kv { flex-direction: column; gap: 2px; padding: 7px 0; }
  .kv > strong { text-align: left; }
  .image-strip { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .thumb { flex-shrink: 0; width: 108px; height: 108px; }

  .pagination { flex-direction: column; align-items: stretch; gap: 8px; }
  .pg-btns { width: 100%; }
  .pg-btn { flex: 1; text-align: center; padding: 9px 10px; }

  .empty { padding: 28px 14px; font-size: 12.5px; }
  .prose { font-size: 12.5px; }
  .flash { font-size: 12.5px; padding: 10px 12px; }

  .login-card { padding: 24px 20px; border-radius: 18px; }
  .login-card h1 { font-size: 20px; }
  .login-sub { font-size: 12px; }
  .login-note { font-size: 11px; }
}

@media (max-width: 480px) {
  .card { padding: 14px; }
  .topbar h1 { font-size: 17px; }
  .content { padding: 12px 12px 20px; }
  .stats { gap: 8px; }
  .stat { padding: 10px 12px; }
  .stat-value { font-size: 18px; }
  .brand-text { display: none; }
  .login-card { padding: 20px 16px; }
  .pg-btn { padding: 8px 8px; font-size: 12px; }
  .row-actions .btn { flex: 1 1 auto; }
}

/* 窄屏表格卡片化 */
@media (max-width: 640px) {
  .table { min-width: 0; }
  .table thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tbody tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .table tbody tr:last-child { border-bottom: 0; }
  .table td {
    border: 0; padding: 4px 0; font-size: 13px;
    display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
  }
  .table td::before {
    content: attr(data-label);
    color: var(--subtle); font-size: 11.5px; flex: 0 0 auto; padding-top: 2px;
  }
  .table td[colspan]::before { content: none; }
  .table td > .row-actions { justify-content: flex-end; }
  .table td > .copy-value { margin-bottom: 0; }
}

@media (max-width: 640px) {
  .toasts { top: 64px; right: 12px; left: 12px; max-width: none; }
  .bulk-bar { align-items: stretch; flex-direction: column; }
  .bulk-bar .btn { margin-left: 0; width: 100%; }
}

/* ---------------- 概览：业务速览卡 ---------------- */

.biz-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.biz-card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px 18px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.biz-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: var(--shadow-lg), var(--glow-cyan);
}
.biz-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.biz-name { font-size: 14px; font-weight: 700; letter-spacing: .3px; }
.biz-tag {
  font-size: 10.5px; color: var(--cyan-2); letter-spacing: .4px;
  padding: 2px 8px; border-radius: 999px;
  background: var(--cyan-soft); border: 1px solid rgba(56, 189, 248, 0.28);
}
.biz-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.biz-metric { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.biz-metric strong {
  font-size: 19px; font-weight: 800; font-family: var(--mono);
  letter-spacing: -.4px; font-variant-numeric: tabular-nums;
}
.biz-metric strong.is-warn { color: var(--amber); }
.biz-metric span { font-size: 11px; color: var(--subtle); }
.biz-more { margin-top: auto; font-size: 11.5px; color: var(--cyan-2); }

/* ---------------- 概览：待办看板 ---------------- */

.todo-board { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.todo-group {
  border: 1px solid var(--line); border-radius: 14px; padding: 12px;
  background: rgba(148, 163, 184, 0.04);
}
.todo-group-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; font-weight: 700; color: var(--muted);
  margin-bottom: 8px; letter-spacing: .3px;
}
.todo-group-count {
  font-family: var(--mono); font-size: 11px; color: var(--brand-2);
  background: var(--brand-soft); border: 1px solid rgba(244, 82, 10, 0.3);
  border-radius: 999px; padding: 1px 8px;
}
.todo-list { display: flex; flex-direction: column; gap: 6px; }
.todo-line {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 10px; background: var(--panel); border: 1px solid var(--line);
  color: var(--ink); font-size: 13px;
  transition: border-color .15s, background .15s, transform .15s;
}
a.todo-line:hover {
  border-color: rgba(56, 189, 248, 0.5);
  background: var(--cyan-soft); transform: translateX(2px);
}
.todo-num {
  font-family: var(--mono); font-weight: 800; font-size: 14px;
  color: var(--brand-2); min-width: 22px; text-align: right;
}
.todo-num--danger { color: var(--red); }
.todo-label { flex: 1; min-width: 0; }
.todo-arrow { color: var(--subtle); }

@media (max-width: 1180px) {
  .biz-grid { grid-template-columns: repeat(2, 1fr); }
  .todo-board { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .biz-grid { grid-template-columns: 1fr; }
  .biz-metrics { grid-template-columns: repeat(3, 1fr); }
}

/* ---------------- 状态速筛标签 ---------------- */

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  color: var(--muted); background: rgba(148, 163, 184, 0.07);
  border: 1px solid var(--line);
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.tab:hover {
  color: #fff; border-color: rgba(56, 189, 248, 0.5);
  background: var(--cyan-soft); transform: translateY(-1px);
}
.tab.is-active {
  color: #fff; background: var(--brand-grad);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 20px -10px rgba(244, 82, 10, 0.7);
}
.tab-count {
  font-size: 11px; font-family: var(--mono); padding: 1px 7px;
  border-radius: 999px; background: rgba(148, 163, 184, 0.18); color: inherit;
}
.tab.is-active .tab-count { background: rgba(255, 255, 255, 0.22); }

/* 数字列：金额 / 数量右对齐等宽，便于上下比较 */
.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); }
td.num, th.num { text-align: right; }

/* 列表主体单元格：缩略图 + 标题/副标题 */
.cell-product { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-product .thumb { width: 46px; height: 46px; border-radius: 10px; flex: 0 0 auto; }
.cell-product .cell-main { min-width: 0; }
.cell-product .cell-main .link { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- 预设理由管理 ---------------- */

.preset-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.preset-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 8px 12px; border-radius: 10px;
  background: rgba(148, 163, 184, 0.06); border: 1px solid var(--line);
}
.preset-text { color: var(--ink); font-size: 13px; word-break: break-all; }
.preset-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.preset-add .input { flex: 1; min-width: 200px; }
.preset-add .btn { flex: 0 0 auto; }

@media (max-width: 640px) {
  .preset-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .preset-row .row-actions { justify-content: flex-end; }
  .preset-add .input { min-width: 0; }
}

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