/* 签售销量统计 · 前端样式
   米白底 / 深墨绿主色 / 炭黑文字；退单与错误用红色。系统字体，不依赖任何外部资源。
   结构：1 变量 2 基础 3 布局 4 按钮表单 5 通用组件 6 买家页 7 后台页 8 采集状态页 9 宽屏 10 动效偏好 */

/* ---------- 1 变量 ---------- */
:root {
  color-scheme: light;
  --paper: #f7f6f2;
  --paper-2: #efeee7;
  --surface: #fffefa;
  --ink: #202b27;
  --ink-2: #3f4b45;
  --muted: #66716a;
  --faint: #9aa39b;
  --accent: #254e40;
  --accent-2: #1a3a2f;
  --accent-soft: #e7eee3;
  --accent-line: #cad7c4;
  --line: #e1e1d7;
  --line-2: #ecece3;
  --danger: #a33d39;
  --danger-soft: #f8ebe6;
  --danger-line: #e8c9c1;
  --warn: #84560a;
  --warn-soft: #fbf1d8;
  --warn-line: #ecd79f;
  --ok: #2e7552;
  --focus: #4d8a6e;
  --radius-s: 10px;
  --radius: 16px;
  --radius-l: 22px;
  --shadow-s: 0 1px 2px rgb(37 78 64 / .06);
  --shadow-m: 0 1px 2px rgb(37 78 64 / .05), 0 10px 26px -10px rgb(37 78 64 / .2);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --z-sticky: 20;
  --z-float: 30;
  --z-toast: 60;
}

/* ---------- 2 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: radial-gradient(100% 100% at 100% 0, #edf2e7 0, rgb(237 242 231 / 0) 68%) top left / 100vw 520px no-repeat, var(--paper);
  color: var(--ink);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
h1, h2, h3, p, dl, dd, ul, ol, figure, fieldset { margin: 0; padding: 0; }
h1, h2, .event-name, .detail-title, .admin-card-title { word-break: auto-phrase; }
ul, ol { list-style: none; }
h1 { font-size: 26px; line-height: 1.25; font-weight: 700; letter-spacing: -.02em; text-wrap: balance; }
h2 { font-size: 17px; line-height: 1.4; font-weight: 650; letter-spacing: -.01em; }
a { color: var(--accent); text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button, a, input, select, summary, label { -webkit-tap-highlight-color: transparent; }
code, .mono { font-family: var(--mono); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hint { font-size: 13px; line-height: 1.7; color: var(--muted); }
.muted { color: var(--muted); }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: var(--z-toast); padding: 10px 16px; border-radius: 8px; background: var(--accent); color: #fff; }
.skip-link:focus { top: 12px; }

/* 网格子项允许收缩，避免长文本把页面撑出横向滚动条 */
.stack, .field, .controls, .form-section, .event-form, .event-list, .admin-events, .channels-stack, .channel-list, .account-list, .cred-list, .channel-body, .account-main, .event-card, .admin-card, .channel-card, .session-card, .credentials, .section-head, .record-form, .merge-box { grid-template-columns: minmax(0, 1fr); }
.admin-card, .event-card, .channel-card { min-width: 0; }

/* ---------- 3 布局 ---------- */
.shell {
  width: 100%; max-width: 480px; margin: 0 auto;
  padding: 0 20px calc(40px + env(safe-area-inset-bottom));
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
}
main { flex: 1; min-width: 0; outline: none; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding-top: env(safe-area-inset-top); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.brand-logo { width: 32px; height: 32px; }
.back-link { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin-left: -8px; padding-right: 14px; color: var(--ink-2); font-size: 15px; font-weight: 600; }
.back-link .icon { width: 22px; height: 22px; }
.logout { margin: 0; }
.topbar-end { display: flex; align-items: center; gap: 4px; flex: none; }
.quota-chip { display: inline-flex; align-items: baseline; gap: 3px; padding: 4px 11px; border: 1px solid var(--accent-line); border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; white-space: nowrap; }
.quota-chip b { font-size: 15px; font-weight: 750; font-variant-numeric: tabular-nums; }
.quota-chip.is-empty { border-color: var(--warn-line); background: var(--warn-soft); color: var(--warn); }
.auth-page .quota-chip { display: none; }
.btn-text { min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--muted); font-size: 14px; }
.btn-text:hover { color: var(--accent); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 16px; }
.page-head > :first-child { min-width: 0; }
.page-sub { margin-top: 2px; font-size: 13px; line-height: 1.55; color: var(--muted); overflow-wrap: anywhere; }
.back-inline { display: inline-flex; align-items: center; gap: 2px; min-height: 40px; margin: 0 0 0 -6px; padding-right: 10px; color: var(--muted); font-size: 14px; font-weight: 600; }
.back-inline .icon { width: 18px; height: 18px; }
.count-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 9px; border-radius: 8px; background: var(--paper-2); color: var(--ink-2); font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.section-head { display: grid; gap: 2px; margin-bottom: 12px; }
.stack { display: grid; gap: 18px; }

.tabs { display: flex; gap: 4px; padding: 4px; margin: 2px 0 18px; border-radius: 13px; background: var(--paper-2); }
.tabs a { flex: 1; min-height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 10px; color: var(--muted); font-size: 14px; font-weight: 600; transition: background .18s, color .18s; }
.tabs a:hover { color: var(--accent); }
.tabs a[aria-current] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-s); }

/* ---------- 4 按钮与表单 ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border: 1px solid transparent; border-radius: 13px;
  font-size: 15px; font-weight: 650; line-height: 1; white-space: nowrap; text-align: center;
  transition: background .16s, border-color .16s, color .16s, transform .12s var(--ease), box-shadow .16s;
}
.btn:active:not(:disabled) { transform: scale(.975); }
.btn:disabled { opacity: .5; }
.btn-primary { background: var(--accent); color: #fffefa; box-shadow: inset 0 1px 0 rgb(255 255 255 / .14), 0 1px 2px rgb(24 55 40 / .28); }
.btn-secondary { background: var(--surface); color: var(--accent); border-color: var(--accent-line); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger-line); }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-sm { min-height: 38px; padding: 0 14px; border-radius: 11px; font-size: 14px; }
.btn-sm::before { content: ""; position: absolute; inset: -4px; }
.btn-icon { width: 40px; padding: 0; }
.btn-lg { min-height: 54px; font-size: 16px; border-radius: 15px; }
.btn-block { width: 100%; }
.btn .icon { width: 18px; height: 18px; }
.btn-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--accent); font-size: 14px; font-weight: 600; }
.btn-link.is-danger { color: var(--danger); }
.btn-link .icon { width: 17px; height: 17px; }
.is-done { background: var(--accent-soft) !important; color: var(--accent) !important; border-color: var(--accent-line) !important; }

.field { display: grid; gap: 8px; min-width: 0; }
.label { font-size: 13px; font-weight: 650; color: var(--ink-2); }
input, select, textarea {
  display: block; width: 100%; min-width: 0; min-height: 50px; padding: 0 14px;
  border: 1px solid #ccd4c8; border-radius: 13px; background: var(--surface);
  font-size: 16px; line-height: 1.4;
  -webkit-appearance: none; appearance: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { min-height: 136px; padding: 12px 14px; font-family: var(--mono); font-size: 15px; resize: vertical; }
textarea.is-short { min-height: 88px; font-family: var(--font); }
input::placeholder, textarea::placeholder { color: #7f8982; font-size: 15px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgb(37 78 64 / .12); }
input[readonly] { background: var(--paper-2); }
input[type="datetime-local"], input[type="datetime-local"]::-webkit-date-and-time-value { text-align: left; }
select {
  padding-right: 42px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366716a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 18px;
}
select.needs-choice { border-color: var(--warn); box-shadow: 0 0 0 4px rgb(132 86 10 / .12); }
.input-wrap { position: relative; display: block; }
.input-wrap input { padding-right: 52px; }
.input-eye { position: absolute; top: 3px; right: 3px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 11px; background: none; color: var(--muted); }
.input-eye:hover { color: var(--accent); }
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; }
.input-group .btn { flex: none; min-height: 50px; padding: 0 16px; }
.input-unit { position: relative; display: block; }
.input-unit input { padding-right: 52px; font-variant-numeric: tabular-nums; }
.input-unit em { position: absolute; top: 50%; right: 16px; transform: translateY(-50%); font-style: normal; font-size: 14px; color: var(--muted); pointer-events: none; }
.field-error { margin-top: 10px; font-size: 14px; font-weight: 500; color: var(--danger); }

/* 带文字的勾选框：全局 input 样式会隐藏原生外观，这里单独恢复 */
.check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); cursor: pointer; }
.check input { flex: 0 0 20px; width: 20px; height: 20px; min-height: 20px; margin: 1px 0 0; padding: 0; -webkit-appearance: checkbox; appearance: auto; accent-color: var(--accent); }
.check.is-danger input { accent-color: var(--danger); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; font-weight: 550; color: var(--ink-2); cursor: pointer; user-select: none; -webkit-user-select: none; }
.switch input { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; }
.switch-track { position: relative; flex: none; width: 42px; height: 26px; border-radius: 13px; background: #d3d9cd; transition: background .2s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .28); transition: transform .22s var(--ease); }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--focus); outline-offset: 2px; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 0; border-radius: 14px; background: var(--paper-2); }
.segmented label { position: relative; display: block; }
.segmented input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.segmented span { display: flex; align-items: center; justify-content: center; min-height: 42px; border-radius: 11px; color: var(--muted); font-size: 14px; font-weight: 650; transition: background .18s, color .18s, box-shadow .18s; }
.segmented input:checked + span { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-s); }
.segmented input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- 5 通用组件 ---------- */
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: #b2b9b1; }
.status.is-live i { background: var(--ok); box-shadow: 0 0 0 3px rgb(46 117 82 / .16); }
.status.is-bad { color: var(--danger); }
.status.is-bad i { background: var(--danger); box-shadow: 0 0 0 3px rgb(163 61 57 / .14); }
.status.is-off { color: var(--muted); }
.chip { display: inline-flex; align-items: center; max-width: 100%; padding: 2px 9px; border-radius: 7px; background: var(--paper-2); color: var(--ink-2); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.tag { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 5px; border: 1px solid transparent; font-size: 12px; font-weight: 650; line-height: 1.6; white-space: nowrap; }
.tag-refund { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-line); }
.tag-merged { color: #715013; background: #f6edd2; border-color: #e8d8a6; }
.tag-manual { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.is-refund .tag-merged { color: inherit; }

.notice { margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--accent-line); border-radius: 13px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.notice.error { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger); }
.notice.warn { border-color: var(--warn-line); background: var(--warn-soft); color: var(--warn); }

.card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-s); }
.empty-state { display: grid; justify-items: center; gap: 6px; margin: 18px 0; padding: 34px 24px; border: 1px dashed var(--accent-line); border-radius: var(--radius); background: rgb(231 238 227 / .4); text-align: center; color: var(--muted); font-size: 14px; }
.empty-state .icon-lg { width: 34px; height: 34px; margin-bottom: 4px; color: var(--accent); opacity: .75; }
.empty-state h2 { color: var(--ink); font-size: 16px; }
.state-panel { display: grid; justify-items: center; gap: 10px; margin: 28px 0; padding: 44px 24px 36px; border: 1px dashed var(--accent-line); border-radius: var(--radius-l); background: rgb(231 238 227 / .4); text-align: center; }
.state-panel .icon { width: 40px; height: 40px; color: var(--accent); opacity: .8; }
.state-panel h1, .state-panel h2 { font-size: 18px; letter-spacing: -.01em; }
.state-panel .btn { margin-top: 8px; }

.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: var(--z-toast); max-width: min(420px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 13px; background: var(--ink); color: #f7f6f2; font-size: 14px; font-weight: 550; box-shadow: 0 10px 30px rgb(32 43 39 / .3); opacity: 0; transform: translate(-50%, 14px); pointer-events: none; transition: opacity .2s, transform .24s var(--ease); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--danger); }
.to-top { position: fixed; right: 16px; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: var(--z-float); width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--accent-line); border-radius: 50%; background: rgb(255 254 250 / .94); color: var(--accent); box-shadow: var(--shadow-m); opacity: 0; transform: translateY(10px); visibility: hidden; pointer-events: none; transition: opacity .2s, transform .24s var(--ease), visibility 0s .24s; }
.to-top.is-visible { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition-delay: 0s; }
body:has(.form-actions) .to-top { bottom: calc(88px + env(safe-area-inset-bottom)); }
.skeleton-inline { display: inline-block; width: 150px; height: 14px; vertical-align: middle; }
.skeleton { display: block; height: 16px; border-radius: 6px; background: linear-gradient(90deg, var(--paper-2) 25%, #f7f6f0 37%, var(--paper-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(46 117 82 / .4); } 70%, 100% { box-shadow: 0 0 0 7px rgb(46 117 82 / 0); } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 6 买家页 ---------- */
.auth-page main { display: flex; flex-direction: column; justify-content: flex-start; padding: clamp(28px, 10vh, 100px) 0 6vh; }
.auth-head { margin-bottom: 22px; }
.auth-head h1 { font-size: 32px; letter-spacing: -.035em; }
.auth-card { padding: 22px 20px 20px; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); box-shadow: var(--shadow-m); }
.auth-card .notice { margin: 0; }
.auth-links { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.auth-links a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; }
.auth-links a:only-child { margin-left: auto; }

.join { margin: 0; }
.join-box { display: flex; align-items: center; gap: 8px; padding: 5px 5px 5px 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow-s); transition: border-color .15s, box-shadow .15s; }
.join-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgb(37 78 64 / .12); }
.join-box .icon { color: var(--faint); }
.join-box input { flex: 1; min-height: 44px; padding: 0 4px; border: 0; border-radius: 0; background: none; box-shadow: none; }
.join-box .btn { flex: none; }

.event-list { display: grid; gap: 12px; margin-top: 20px; }
.event-card { display: grid; gap: 10px; padding: 16px 16px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-s); color: var(--ink); transition: transform .15s var(--ease), box-shadow .2s, border-color .2s; }
.event-card:active { transform: scale(.99); }
.event-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.event-time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.event-name { overflow-wrap: anywhere; text-wrap: balance; }
.event-card-bottom { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--accent-line); }
.event-label { font-size: 13px; color: var(--muted); }
.event-total { margin-left: auto; color: var(--accent); font-size: 30px; line-height: 1; font-weight: 700; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.event-card .chevron { width: 20px; height: 20px; color: var(--faint); }
.event-note { font-size: 13px; color: var(--muted); }
.event-card.is-ended { background: transparent; box-shadow: none; border-color: var(--line-2); }
.event-card.is-ended .event-total { color: var(--ink-2); }

.detail-head { margin: 4px 0 0; }
.detail-title { font-size: 22px; line-height: 1.35; letter-spacing: -.015em; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0 16px; }
.summary { position: relative; padding: 18px 18px 6px; border: 1px solid var(--accent-line); border-radius: var(--radius-l); background: radial-gradient(120% 130% at 100% 0, #dbe7d4 0, rgb(219 231 212 / 0) 58%), linear-gradient(180deg, #edf2e8, #e5ece0); box-shadow: var(--shadow-m); }
.summary-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.summary-label { display: block; font-size: 13px; font-weight: 650; color: #4b6153; letter-spacing: .02em; }
.summary-figure { min-width: 0; }
.summary-total { display: inline-block; margin-top: 2px; color: var(--accent); font-size: 56px; line-height: 1.08; font-weight: 700; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.summary-delta { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 8px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; vertical-align: 10px; animation: pop .35s var(--ease); }
.summary-delta.is-up { color: var(--ok); background: rgb(46 117 82 / .12); }
.summary-delta.is-down { color: var(--danger); background: var(--danger-soft); }
.btn-refresh { flex: none; min-height: 44px; padding: 0 16px; }
.is-loading .btn-refresh .icon, .btn-refresh.is-loading .icon { animation: spin .8s linear infinite; }
.summary-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 2px; border-top: 1px dashed var(--accent-line); }
.summary-meta .btn-link { flex: none; min-height: 44px; color: #3d5a4a; font-size: 13px; }
.summary-updated { display: flex; align-items: flex-start; gap: 8px; min-width: 0; font-size: 13px; color: #4b6153; font-variant-numeric: tabular-nums; }
.summary-updated .nw { white-space: nowrap; }
.live-dot { flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--faint); }
.live-dot.is-live { background: var(--ok); animation: pulse 2s ease-out infinite; }
.live-dot.is-error { background: var(--danger); }

.alert { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; padding: 11px 14px; border: 1px solid var(--danger-line); border-radius: 13px; background: var(--danger-soft); color: var(--danger); font-size: 14px; font-weight: 550; }
.alert .icon { width: 18px; height: 18px; }
.alert .btn-link { margin-left: auto; min-height: 32px; color: var(--danger); text-decoration: underline; text-underline-offset: 3px; }
.alert.is-warn { border-color: var(--warn-line); background: var(--warn-soft); color: var(--warn); }

.mini-bar { position: fixed; inset: 0 0 auto 0; z-index: var(--z-sticky); padding-top: env(safe-area-inset-top); background: rgb(247 246 242 / .96); border-bottom: 1px solid var(--line); transform: translateY(-105%); visibility: hidden; transition: transform .28s var(--ease), visibility 0s .28s; }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) { .mini-bar { background: rgb(247 246 242 / .84); -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px); } }
.mini-bar.is-visible { transform: none; visibility: visible; transition-delay: 0s; }
.mini-inner { display: flex; align-items: center; gap: 12px; max-width: 480px; margin: 0 auto; padding: 7px 20px; }
.mini-figure { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.mini-figure b { color: var(--accent); font-size: 26px; line-height: 1.1; font-weight: 700; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.mini-figure span { font-size: 13px; color: var(--muted); }
.mini-meta { margin-left: auto; font-size: 12px; line-height: 1.35; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.mini-bar .btn { min-height: 40px; padding: 0 12px; }

.controls { display: grid; gap: 2px; margin-top: 14px; }
.controls-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.info-panel { margin: 10px 0 0; padding: 12px 14px; border-radius: 13px; background: var(--paper-2); color: var(--ink-2); font-size: 13px; line-height: 1.8; }

.records-wrap { position: relative; margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; scroll-margin-top: 76px; transition: opacity .2s; }
.records-wrap[aria-busy="true"] { opacity: .55; }
/* 明细表头上的“数据暂未更新”：只在后端标记采集暂未更新时出现，不占整页 */
.wrap-note { padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--paper-2); color: var(--warn); font-size: 13px; font-weight: 650; }
.records-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.records-table th { padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--paper-2); color: var(--muted); font-size: 12px; font-weight: 650; text-align: left; letter-spacing: .02em; }
.records-table th small { margin-left: 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
.rec td { height: 52px; padding: 7px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.rec:last-child td { border-bottom: 0; }
.col-seq { width: 56px; }
th.col-seq, td.col-seq { padding-right: 4px; }
td.col-seq { color: var(--muted); font-size: 13px; }
.col-qty { width: 100px; text-align: right !important; }
td.col-qty { position: relative; }
/* 数量条：数字自己带圆角底色，贴着单元格右侧，宽度至少按 --w（detail.js 开方缩放）；数字位数再多也由底色包住、向左长，不换行、不探出底条 */
td.col-qty b { position: absolute; top: 50%; right: 8px; box-sizing: border-box; min-width: max(44px, calc(var(--w, 0%) * .84)); height: 32px; padding: 0 6px; transform: translateY(-50%); border-radius: 9px; background: rgb(37 78 64 / .1); color: var(--accent); font-size: 19px; font-weight: 700; line-height: 32px; letter-spacing: -.02em; text-align: right; white-space: nowrap; }
td.col-time { color: var(--ink-2); font-size: 15px; letter-spacing: .01em; }
.t-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; }
.t-stamp { white-space: nowrap; }
.t-date { margin-right: 7px; font-size: 12px; color: var(--muted); }
.rec.is-refund td { color: var(--danger); }
.rec.is-refund td.col-qty b { background: rgb(163 61 57 / .12); }
.rec.is-refund .col-qty b, .rec.is-refund .t-date { color: var(--danger); }
.rec.is-refund td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.rec.is-top-draw:not(.is-refund) { background-color: var(--accent-soft); }
.rec.is-top-draw:not(.is-refund) td { color: var(--accent-2); }
.rec.is-top-draw:not(.is-refund) .col-qty b { color: var(--accent-2); font-weight: 800; }
.rec.is-top-draw:not(.is-refund) td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.rec.is-top-draw:not(.is-refund) td.col-qty b { background: rgb(37 78 64 / .16); }
.skeleton-row td { height: 52px; }
.records-wrap .empty-state { margin: 0; border: 0; border-radius: 0; background: none; padding: 38px 24px; }

.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 16px 0 6px; }
.pager .btn:first-child { justify-self: start; }
.pager .btn:last-child { justify-self: end; }
.pager-info { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.newer { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; margin-top: 10px; border: 1px solid var(--accent-line); border-radius: 13px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 650; }

/* ---------- 7 后台页 ---------- */
.filters { display: flex; gap: 6px; margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter { flex: none; display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink-2); font-size: 14px; font-weight: 600; transition: background .16s, color .16s, border-color .16s; }
.filter b { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.filter.is-active { border-color: var(--accent); background: var(--accent); color: #fffefa; }
.filter.is-active b { color: rgb(255 254 250 / .75); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.toolbar .filters { flex: 1; min-width: 0; margin: 0; }
.toolbar > .btn { flex: none; }
.list-meta { margin: 0 0 10px; }

.event-search { display: grid; gap: 10px; margin: 0 0 12px; }
.search-line { display: flex; align-items: center; gap: 10px; }
.search-line input { flex: 1; min-width: 0; }
.search-line .btn, .search-line .btn-link { flex: none; }
.search-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.search-filters select { min-width: 0; }
.search-filters select:only-of-type { grid-column: 1 / -1; }
.event-search + .filters { flex-wrap: wrap; overflow-x: visible; }
@media (min-width: 761px) {
  .event-search.has-filters { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
  .event-search.has-filters .search-filters { grid-template-columns: repeat(2, 190px); }
}
.folder-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* 批量移入文件夹：平时只有一行“全选 / 已选”，勾选场次后才展开选择文件夹和移动按钮 */
.folder-move { display: flex; align-items: center; flex-wrap: wrap; gap: 0 14px; margin-bottom: 14px; padding: 2px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.folder-move .check { min-height: 44px; padding: 0; align-items: center; }
.folder-move .hint { flex: 1; }
.folder-move-controls { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 12px; }
.folder-move-controls select { flex: 1 1 100%; min-width: 0; width: auto; }
.folder-move-controls .btn { flex: 1 1 auto; }
@media (min-width: 761px) {
  .folder-move-controls select { flex: 1 1 220px; }
  .folder-move-controls .btn { flex: 0 0 auto; }
}
.js .folder-move:not(.has-selection) .folder-move-controls { display: none; }
.admin-folder { width: fit-content; font-size: 13px; color: var(--accent); }
.event-select { margin-left: auto; min-height: 36px; padding: 0; font-size: 13px; }
.admin-card-head { flex-wrap: wrap; }
@media (max-width: 759px) { .filters-fill .filter { flex: 1 1 auto; justify-content: center; padding: 0 8px; } }

.admin-events { display: grid; gap: 14px; }
.admin-card { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-s); }
.admin-card.is-attention { border-color: var(--danger-line); }
.admin-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.admin-card-meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.admin-card-title { overflow-wrap: anywhere; text-wrap: balance; }
.admin-card-title a { color: inherit; }
.admin-card-figure { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px dashed var(--accent-line); }
.figure-meta { min-width: 0; font-size: 13px; line-height: 1.7; color: var(--muted); }
.figure-meta b { color: var(--ink-2); font-weight: 650; }
.figure-num { flex: none; display: grid; justify-items: end; gap: 3px; }
.figure-num span { font-size: 12px; line-height: 1; color: var(--muted); }
.figure-num strong { color: var(--accent); font-size: 30px; line-height: 1; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.keybox { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; border-radius: 13px; background: var(--paper-2); }
.keybox-label { flex: none; font-size: 12px; font-weight: 650; color: var(--muted); }
.keybox-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ink-2); }

/* 卡片底部工具条：常用入口直接放出来，次要的收进面板 */
.card-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tool { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; padding: 0 8px; border: 1px solid var(--accent-line); border-radius: 12px; background: var(--surface); color: var(--accent); font-size: 14px; font-weight: 650; white-space: nowrap; transition: background .16s, border-color .16s; }
.tool .icon { width: 15px; height: 15px; transition: transform .2s var(--ease); }
.tool[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent); }
.tool[aria-expanded="true"] .icon { transform: rotate(180deg); }
.tool-count { min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--paper-2); color: var(--ink-2); font-size: 12px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
html:not(.js) button.tool { display: none; }
.js .card-panel { display: none; }
.js .card-panel.is-open { display: block; animation: rise .22s var(--ease); }
.card-panel .channel-list { margin-top: 0; }
.card-panel .channel-row:first-child { border-top: 0; padding-top: 4px; }

.channel-list { display: grid; gap: 0; margin-top: 4px; }
.channel-row { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.channel-row .dot { flex: none; width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: #b2b9b1; }
.channel-row.is-ok .dot { background: var(--ok); }
.channel-row.is-error .dot { background: var(--danger); }
.channel-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.channel-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 14px; }
.channel-title b { font-weight: 650; }
.channel-sub, .channel-meta { font-size: 13px; color: var(--muted); }
.channel-error { font-size: 13px; font-weight: 550; color: var(--danger); }
.channel-link { flex: none; align-self: flex-start; display: grid; place-items: center; width: 40px; height: 40px; margin: -6px -8px 0 0; border-radius: 11px; color: var(--accent); }
.channel-link:hover { background: var(--accent-soft); }

/* 面板里的操作列表 */
.menu-list { display: grid; border: 1px solid var(--line-2); border-radius: 13px; background: var(--paper); overflow: hidden; }
.menu-row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border-top: 1px solid var(--line-2); color: var(--ink); font-size: 15px; font-weight: 600; }
.menu-row:first-child { border-top: 0; }
.menu-row .icon { width: 18px; height: 18px; margin-left: auto; color: var(--faint); }
.menu-val { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--muted); }
.menu-val + .icon { margin-left: 0; }
.menu-row.is-danger { color: var(--danger); }
.end-confirm { border-top: 1px solid var(--line-2); }
.menu-list > .end-confirm:first-child { border-top: 0; }
.end-confirm > summary { display: flex; align-items: center; min-height: 48px; padding: 0 14px; color: var(--danger); font-size: 15px; font-weight: 600; cursor: pointer; list-style: none; }
.end-confirm > summary::-webkit-details-marker { display: none; }
.end-confirm form { display: grid; gap: 10px; padding: 2px 14px 14px; }
details.disclosure > summary { display: flex; align-items: center; gap: 6px; min-height: 40px; color: var(--ink-2); font-size: 14px; font-weight: 600; cursor: pointer; list-style: none; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::after { content: ""; width: 18px; height: 18px; margin-left: auto; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat; transition: transform .2s var(--ease); }
details.disclosure[open] > summary::after { transform: rotate(180deg); }

/* 管理记录：紧凑列表，手机上一屏能看到多条 */
.stat-strip { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 14px; padding: 14px 16px; border: 1px solid var(--accent-line); border-radius: var(--radius); background: linear-gradient(180deg, #edf2e8, #e6ede1); }
.stat-label { display: block; font-size: 13px; font-weight: 650; color: #4b6153; }
.stat-num { display: block; color: var(--accent); font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-note { max-width: 17em; font-size: 12px; line-height: 1.6; color: #4b6153; text-align: right; text-wrap: balance; }
.rec-list { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-s); overflow: hidden; }
.rr {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 1px; align-items: center;
  grid-template-areas: "time qty" "chan qty" "tags act" "note note";
  padding: 12px 14px; border-top: 1px solid var(--line-2);
}
.rr:first-child { border-top: 0; }
.rr-time { grid-area: time; font-size: 15px; font-variant-numeric: tabular-nums; }
.rr-time .d { margin-right: 5px; font-size: 12px; color: var(--muted); }
.rr-time b { font-weight: 650; }
.rr-chan { grid-area: chan; min-width: 0; font-size: 13px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.rr-qty { grid-area: qty; align-self: center; min-width: 2.2em; color: var(--accent); font-size: 24px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; text-align: right; font-variant-numeric: tabular-nums; }
.rr-tags { grid-area: tags; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 5px; }
.rr-note { grid-area: note; margin-top: 4px; font-size: 13px; line-height: 1.6; color: var(--ink-2); overflow-wrap: anywhere; }
.rr-actions { grid-area: act; justify-self: end; display: flex; gap: 2px; margin-top: 3px; }
.rr-actions a { position: relative; display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; border-radius: 9px; font-size: 14px; font-weight: 600; }
.rr-actions a::before { content: ""; position: absolute; inset: -6px -2px; }
.rr-actions a.is-danger { color: var(--danger); }
.rec-list.is-single .rr { grid-template-areas: "time qty" "tags act" "note note"; }
.rr.is-refund { box-shadow: inset 3px 0 0 var(--danger); }
.rr.is-refund .rr-qty { color: var(--danger); }

/* 表单页 */
.event-form { display: grid; gap: 26px; padding-bottom: 96px; }
.record-form { display: grid; gap: 14px; padding-bottom: 96px; }
.form-section { display: grid; gap: 14px; }
.merge-box { display: grid; gap: 4px; padding: 6px 14px 14px; border: 1px solid var(--line-2); border-radius: 13px; background: var(--paper); }
.merge-box .switch { justify-content: space-between; width: 100%; flex-direction: row-reverse; padding-top: 4px; }
.merge-box .hint { margin-bottom: 6px; }
.merge-box .coverage-field { margin-top: 4px; }
.form-meta { font-size: 13px; line-height: 1.6; color: var(--muted); }
.history-list { display: grid; gap: 2px; }
.channels-stack { display: grid; gap: 14px; }
.channel-card { display: grid; gap: 16px; min-width: 0; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-s); }
.channel-card.is-new { animation: rise .3s var(--ease); }
.channel-card-head { display: flex; align-items: center; gap: 10px; }
.channel-no { font-size: 14px; font-weight: 650; color: var(--ink-2); }
.platform-chip { padding: 2px 9px; border: 1px solid var(--accent-line); border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .05em; }
.platform-chip.is-unknown { border-color: var(--warn-line); background: var(--warn-soft); color: var(--warn); letter-spacing: 0; }
.channel-card-head .btn-link { margin-left: auto; min-height: 36px; }
.source-status { min-height: 0; margin-top: -6px; font-size: 13px; font-weight: 550; color: var(--muted); }
.source-status:empty { display: none; }
.source-status[data-kind="ok"] { color: var(--ok); }
.source-status[data-kind="error"] { color: var(--danger); }
.channel-card[data-ready="0"] select[name="selector"] { color: var(--muted); }
.k4-expand { margin-top: 12px; }
.form-actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sticky); padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--paper) 62%, rgb(247 246 242 / 0)); pointer-events: none; }
.form-actions > * { pointer-events: auto; display: flex; width: 100%; max-width: 440px; margin: 0 auto; }

.credentials { display: grid; gap: 14px; margin: 16px 0; padding: 18px; border: 1px solid var(--accent-line); border-radius: var(--radius); background: linear-gradient(180deg, #edf2e8, #e6ede1); box-shadow: var(--shadow-m); animation: rise .35s var(--ease); }
.credentials-head { display: flex; align-items: center; gap: 8px; color: var(--accent); }
.credentials-head h2 { font-size: 17px; }
.cred-list { display: grid; gap: 8px; }
.cred-list > div { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border-radius: 13px; background: var(--surface); border: 1px solid var(--accent-line); }
.cred-list dt { flex: none; width: 34px; font-size: 13px; font-weight: 650; color: var(--muted); }
.cred-list dd { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.cred-list code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; color: var(--ink); }
.list-tools { margin: 22px 0 6px; }
.search { position: relative; display: block; }
.search .icon { position: absolute; top: 50%; left: 14px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input { padding-left: 42px; }
.account-list { display: grid; }
.account-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.account-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.account-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.account-name { font-size: 14px; font-weight: 600; letter-spacing: .01em; overflow-wrap: anywhere; }
.account-events { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.account-events .chip { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-row.is-disabled .account-name { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.account-action { flex: none; margin: 0; }
.account-actions { display: flex; flex-direction: column; gap: 8px; flex: none; }
.account-count { margin-top: 10px; font-size: 13px; color: var(--muted); }
.account-list > .empty-state { margin: 8px 0; }

.setting-note { margin-top: -8px; }
.row-link { display: flex; align-items: center; justify-content: space-between; min-height: 56px; margin-top: 12px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-s); }
.row-link .icon { color: var(--faint); }
.retention { margin-top: 16px; display: grid; gap: 4px; }
.retention h2 { margin-bottom: 4px; }
.retention strong { font-variant-numeric: tabular-nums; }
.session-card { display: grid; gap: 6px; margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-s); }
.session-card form { display: grid; gap: 14px; padding-top: 6px; }
.text-danger { color: var(--danger); font-weight: 650; }

/* 一行一项的列表（文件夹等）与会员卡片 */
.list-card { display: grid; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-s); overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line-2); }
.list-row:first-child { border-top: 0; }
.list-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.list-title { color: var(--ink); font-size: 16px; font-weight: 650; overflow-wrap: anywhere; }
a.list-title { color: var(--accent); }
.list-row .folder-actions { flex: none; flex-wrap: nowrap; gap: 8px; }
.member-list { display: grid; gap: 12px; }
.member-card { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-s); }
.member-card.is-disabled .member-head .status { flex: none; white-space: nowrap; }
.member-name { color: var(--muted); }
.member-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.member-name { min-width: 0; font-size: 16px; font-weight: 650; overflow-wrap: anywhere; }
.member-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.member-quota { font-size: 14px; color: var(--ink-2); }
.member-quota strong { margin: 0 3px; color: var(--accent); font-size: 26px; line-height: 1; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.member-quota.is-empty strong { color: var(--warn); }
.member-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tool.is-danger { color: var(--danger); border-color: var(--danger-line); }
.section-title { margin: 24px 0 10px; font-size: 16px; }
.log-list { display: grid; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.log-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-2); font-size: 14px; }
.log-row:first-child { border-top: 0; }
.log-row .hint { overflow-wrap: anywhere; }
.log-num { color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hint a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 8 采集状态页 ---------- */
.health-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.health-period { display: flex; gap: 2px; padding: 4px; border-radius: 10px; background: var(--paper-2); }
.health-period a { padding: 7px 13px; border-radius: 7px; color: var(--muted); font-size: 13px; }
.health-period a[aria-current] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-s); font-weight: 650; }
.health-actions { display: flex; align-items: center; gap: 10px; }
.health-actions .switch { min-height: 40px; font-size: 13px; }
.health-overview { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 22px; padding: 18px; border: 1px solid var(--accent-line); border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); }
.health-overview.tone-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.health-overview.tone-bad { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.health-overview.tone-idle { background: var(--paper-2); border-color: var(--line); color: var(--muted); }
.health-overview h2 { font-size: 18px; }
.health-overview p { margin-top: 5px; font-size: 13px; }
.health-stamp { margin-left: auto; font-size: 12px; text-align: right; white-space: nowrap; }
.health-stamp small { display: block; font-size: 11px; opacity: .8; }
.health-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.platform-health { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.platform-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.platform-heading h2 { font-size: 24px; line-height: 1.1; letter-spacing: -.03em; }
.platform-heading p { margin-top: 5px; font-size: 12px; color: var(--muted); }
.health-badge { display: inline-flex; padding: 3px 9px; border-radius: 7px; font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.health-badge.tone-ok { background: var(--accent-soft); color: var(--ok); }
.health-badge.tone-warn { background: var(--warn-soft); color: var(--warn); }
.health-badge.tone-bad { background: var(--danger-soft); color: var(--danger); }
.health-badge.tone-idle { background: var(--paper-2); color: var(--muted); }
.platform-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0; }
.platform-metrics > div { padding: 12px 14px; border-radius: 10px; background: var(--paper); }
.platform-metrics span { display: block; font-size: 12px; color: var(--muted); }
.platform-metrics strong { display: block; margin-top: 1px; font-size: 20px; font-variant-numeric: tabular-nums; }
.health-rate { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 15px; border-top: 1px solid var(--line-2); }
.health-rate > span { font-size: 12px; color: var(--muted); }
.health-rate > strong { color: var(--accent); font-size: 31px; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.tone-bad .health-rate > strong { color: var(--danger); }
.tone-warn .health-rate > strong { color: var(--warn); }
.tone-idle .health-rate > strong { color: var(--muted); }
.health-rate small { padding-left: 2px; font-size: 16px; }
.health-sample { margin: 1px 0 18px; font-size: 12px; color: var(--muted); }
.health-history-head { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); }
.health-history { display: flex; gap: 2px; height: 34px; margin: 8px 0 16px; }
.health-bar { position: relative; flex: 1; min-width: 0; padding: 0; border: 0; border-radius: 2px; background: var(--line); }
.health-bar.tone-ok { background: #4d9970; }
.health-bar.tone-bad { background: #c35a4f; }
.health-bar:focus-visible { z-index: 1; outline-width: 2px; outline-offset: 2px; }
.health-times { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: 12px; color: var(--muted); }
.health-times b { font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.health-channels { margin-top: 18px; border-top: 1px solid var(--line-2); }
.health-channels summary { display: flex; justify-content: space-between; min-height: 44px; align-items: center; color: var(--accent); font-size: 13px; cursor: pointer; }
.health-channel { padding: 12px 0; border-top: 1px solid var(--line-2); }
.health-channel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.health-channel-head b { min-width: 0; font-size: 13px; font-weight: 600; line-height: 1.6; }
.health-channel > p { margin-top: 3px; font-size: 12px; color: var(--muted); }
.health-channel > p.field-error { color: var(--danger); }
.health-footnote { margin: 18px 0 24px; font-size: 12px; color: var(--muted); }
.health-infrastructure { display: grid; gap: 18px; margin-bottom: 24px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.health-infrastructure > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.health-infrastructure h2 { font-size: 15px; }
.health-infrastructure p { margin-top: 7px; font-size: 13px; }
.health-infrastructure .hint { font-size: 12px; }

/* ---------- 9 宽屏与窄屏 ---------- */
@media (max-width: 350px) {
  .is-member .brand span { display: none; }
  .shell { padding-inline: 16px; }
  h1 { font-size: 24px; }
  .summary-total { font-size: 46px; }
  .btn-refresh span { display: none; }
  .btn-refresh { padding: 0 12px; }
  .mini-inner { padding-inline: 16px; }
  .rec td, .records-table th { padding-inline: 10px; }
  .col-qty { width: 84px; }
  .t-date { display: block; margin: 0; }
  .card-tools { gap: 6px; }
  .tool { padding: 0 4px; font-size: 13px; }
  .filters { gap: 4px; }
  .filters-fill .filter { gap: 4px; padding: 0 6px; font-size: 13px; }
  .stat-note { display: none; }
}
@media (max-width: 420px) {
  .platform-health { padding: 18px; }
  .health-stamp { display: none; }
  .health-overview { padding: 16px; }
  .health-rate > strong { font-size: 28px; }
  .health-period a { padding: 7px 10px; }
  .health-history { gap: 1px; }
}
@media (min-width: 480px) { .member-tools { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 640px) {
  body:not(.is-admin, .is-member) .shell { padding-top: 12px; }
  .auth-head h1 { font-size: 36px; }
}
@media (min-width: 760px) {
  :is(.is-admin, .is-member) .shell { max-width: 1000px; padding-inline: 32px; }
  :is(.is-admin, .is-member) .tabs { width: fit-content; min-width: 320px; }
  :is(.is-admin, .is-member) .admin-events { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 18px; }
  :is(.is-admin, .is-member) :is(.event-form, .settings-form, .page-narrow) { max-width: 560px; }
  :is(.is-admin, .is-member) .account-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
  :is(.is-admin, .is-member) .credentials { max-width: 560px; }
  .member-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
  .member-tools { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .form-actions { position: sticky; left: auto; right: auto; padding-inline: 0; }
  .form-actions > * { max-width: none; }
  .event-form, .record-form { padding-bottom: 24px; }
  .mini-inner { padding-inline: 0; }
  .health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .health-infrastructure { grid-template-columns: 1fr 2fr; gap: 32px; align-items: start; }
  .health-infrastructure > div:first-child { align-items: flex-start; }
  .health-page .shell { max-width: 1100px; }
  .rr {
    grid-template-columns: 150px minmax(0, .9fr) minmax(0, 1.3fr) 76px 104px; column-gap: 16px; padding: 12px 18px;
    grid-template-areas: "time chan tags qty act" ". . note qty act";
  }
  .rec-list.is-single .rr { grid-template-columns: 150px minmax(0, 1fr) 76px 104px; grid-template-areas: "time tags qty act" ". note qty act"; }
  .rr-tags { margin-top: 0; }
  .rr-actions { margin-top: 0; }
}
/* 触屏按下反馈：手机上没有 hover，按下时给一点底色 */
.tool:active, .menu-row:active, .rr-actions a:active { background: var(--accent-soft); }
.filter:not(.is-active):active { background: var(--accent-soft); }
@media (hover: hover) {
  .btn-primary:hover:not(:disabled) { background: var(--accent-2); }
  .btn-secondary:hover:not(:disabled) { background: var(--accent-soft); }
  .btn-danger:hover:not(:disabled) { background: var(--danger-soft); }
  .tool:hover { background: var(--accent-soft); }
  .event-card:hover { border-color: #b4c5ae; box-shadow: var(--shadow-m); transform: translateY(-1px); }
  .filter:not(.is-active):hover { background: var(--accent-soft); }
  .row-link:hover, .menu-row:hover { border-color: #b4c5ae; background: var(--accent-soft); }
  .rr-actions a:hover { background: var(--accent-soft); }
  .rr-actions a.is-danger:hover { background: var(--danger-soft); }
  .btn-link:hover { text-decoration: underline; text-underline-offset: 3px; }
}

/* ---------- 10 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
