/* 账号册。设计基调：纸面账本。
   圆角规则：输入/按钮 8px，卡片 12px，胶囊 999px，对话框 14px。
   分层：1 粘性对话栏，20 toast，30 菜单。原生 dialog 用 top layer。 */

:root {
  color-scheme: light;
  --bg: #f5f5f4;
  --surface: #ffffff;
  --surface-2: #fafaf9;
  --ink: #1c1917;
  --muted: #78716c;
  --faint: #a8a29e;
  --line: #e7e5e4;
  --line-strong: #d6d3d1;
  --hover: #f5f5f4;
  --accent: #1c1917;
  --accent-hover: #292524;
  --accent-text: #1c1917;
  --accent-soft: #efeeec;
  --on-accent: #fafaf9;
  --ok: #15803d;
  --ok-bg: #eef7f0;
  --ban: #b42318;
  --ban-bg: #fdf1ef;
  --warn: #b45309;
  --warn-bg: #fdf6ea;
  --expired: #57534e;
  --expired-bg: #f1f0ef;
  --free: #3b5bdb;
  --free-bg: #eef1fc;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 14px;
  --shadow: 0 4px 24px rgb(28 25 23 / 0.14);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #141312;
    --surface: #1d1c1a;
    --surface-2: #232220;
    --ink: #e7e5e4;
    --muted: #a8a29e;
    --faint: #78716c;
    --line: #2e2c29;
    --line-strong: #44403c;
    --hover: #262523;
    --accent: #e7e5e4;
    --accent-hover: #f5f5f4;
    --accent-text: #d6d3d1;
    --accent-soft: #2b2926;
    --on-accent: #1c1917;
    --ok: #6fcf97;
    --ok-bg: #1d2b21;
    --ban: #f08578;
    --ban-bg: #33201d;
    --warn: #e0a45c;
    --warn-bg: #2f2618;
    --expired: #a8a29e;
    --expired-bg: #262523;
    --free: #93aeff;
    --free-bg: #1e2439;
    --shadow: 0 4px 24px rgb(0 0 0 / 0.5);
  }
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

::selection { background: var(--accent-soft); color: var(--ink); }

.wrap {
  width: min(1200px, calc(100% - 36px));
  margin: 0 auto;
  padding: 20px 0 48px;
}

h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.lede, .boot-error p, .foot p, .result-meta, .hint, .intro {
  color: var(--muted);
}

.lede {
  margin: 1px 0 0;
  font-size: 12.5px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.top-actions, .toolbar, .dialog-actions, .account-actions, .identity-top {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.top-actions { align-items: center; }

.btn {
  min-height: 30px;
  padding: 4px 11px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 12.5px;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn.danger {
  background: var(--ban);
  border-color: var(--ban);
  color: #fff;
}

.btn:hover { border-color: var(--line-strong); }

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

button:active { transform: translateY(0.5px); }

/* —— 顶部分区 —— */

.section-switch {
  display: flex;
  gap: 0;
  margin-top: 14px;
  border-bottom: 1px solid var(--line);
}

.section-tab {
  min-height: 32px;
  padding: 4px 2px;
  margin-right: 18px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.section-tab[aria-selected="true"] {
  background: none;
  border-bottom-color: var(--ink);
  color: var(--ink);
}

.section-tab:hover { color: var(--ink); }
.section-tab[aria-selected="true"]:hover { border-bottom-color: var(--ink); }

/* —— 平台概况（紧凑文字条） —— */

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  margin-top: 14px;
}

.summary button {
  display: flex;
  align-items: baseline;
  gap: 7px;
  border: 0;
  background: none;
  padding: 2px 0;
  cursor: pointer;
  border-radius: 4px;
}

.summary button:hover .summary-name { text-decoration: underline; text-underline-offset: 3px; }

.summary button.is-pressed .summary-name {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--faint);
}

.summary-name { font-size: 13px; font-weight: 650; color: var(--ink); }

.summary .line { display: inline; color: var(--muted); font-size: 12px; margin-right: 7px; }
.summary .line:last-child { margin-right: 0; }
.summary .line.ok { color: var(--ok); }
.summary .line.ban { color: var(--ban); }
.summary .line.warn { color: var(--warn); }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.stat {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 3px 11px;
  min-height: 26px;
}

button.stat { cursor: pointer; }
button.stat:hover { border-color: var(--line-strong); }
button.stat.is-pressed { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.stat b {
  font-size: 12.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.stat span { color: var(--muted); font-size: 11.5px; }

/* —— 工具栏 —— */

.toolbar { margin-top: 12px; align-items: center; }

.search { flex: 1 1 240px; min-width: 0; }

input[type="search"], input[type="text"], input[type="email"], input[type="date"], textarea, select {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 30px;
  padding: 4px 10px;
  font-size: 13px;
}

textarea { min-height: 76px; resize: vertical; }

.result-meta { margin: 10px 0 8px; font-size: 12px; }

/* —— 视图切换 —— */

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 2px;
  gap: 2px;
}

.view-btn {
  min-height: 24px;
  padding: 1px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.view-btn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.view-btn:hover:not([aria-pressed="true"]) { color: var(--ink); }

/* —— 紧凑列表 —— */

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
}

.row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: border-color 0.12s ease;
}

.row:hover { border-color: var(--line-strong); }
.row.is-open { border-color: var(--ink); }

.row-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 4px 12px;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.row-id {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex: 1 1 220px;
}

.row-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 24ch;
}

.row-name.is-email, .row-email, .card-email, code, .channel-account {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.row-email, .card-email {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-sub {
  font-size: 11.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.row-pills {
  display: flex;
  gap: 4px;
  flex: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.6;
  background: var(--surface-2);
  color: var(--muted);
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
  flex: none;
}

.pill.status-active { background: var(--ok-bg); color: var(--ok); }
.pill.status-active .pill-dot { background: var(--ok); }
.pill.status-banned { background: var(--ban-bg); color: var(--ban); }
.pill.status-banned .pill-dot { background: var(--ban); }
.pill.status-limited { background: var(--warn-bg); color: var(--warn); }
.pill.status-limited .pill-dot { background: var(--warn); }
.pill.status-expired { background: var(--expired-bg); color: var(--expired); }
.pill.status-expired .pill-dot { background: var(--expired); }
.pill.status-free { background: var(--free-bg); color: var(--free); }
.pill.status-free .pill-dot { background: var(--free); }
.pill.status-closed .pill-dot { background: var(--line-strong); }

.pill-name { font-weight: 600; }
.pill-state { opacity: 0.85; }

.row-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  margin-left: auto;
}

.row-updated {
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.chev {
  color: var(--faint);
  font-size: 10px;
  transition: transform 0.15s ease;
}

.row.is-open .chev { transform: rotate(180deg); }

.row-detail { padding: 4px 12px 12px; border-top: 1px solid var(--line); }
.row-detail[hidden] { display: none !important; }

.row-detail-inner { padding-top: 10px; display: grid; gap: 8px; }

.row-actions { justify-content: flex-start; }

.row-extras { display: grid; gap: 2px; }

/* —— 瀑布流卡片 —— */

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 300px;
  column-gap: 10px;
}

.card {
  break-inside: avoid;
  margin: 0 0 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 11px 13px 9px;
  transition: border-color 0.12s ease;
}

.card:hover { border-color: var(--line-strong); }

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.card-id { min-width: 0; }

.card-name {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-email {
  display: block;
  margin-top: 1px;
  word-break: break-all;
  white-space: normal;
}

.card-updated {
  flex: none;
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.card-platforms {
  display: grid;
  gap: 1px;
  margin-top: 8px;
}

.cline {
  display: flex;
  align-items: center;
  gap: 7px;
  width: calc(100% + 12px);
  margin: 0 -6px;
  padding: 3px 6px;
  border: 0;
  border-radius: 6px;
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.6;
}

.cline:hover { background: var(--hover); }

.cline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
  flex: none;
}

.cline-name { color: var(--muted); font-weight: 550; flex: none; }
.cline-state { font-weight: 650; color: var(--muted); }
.cline-plan {
  color: var(--faint);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.cline.status-active .cline-dot { background: var(--ok); }
.cline.status-active .cline-state { color: var(--ok); }
.cline.status-banned .cline-dot { background: var(--ban); }
.cline.status-banned .cline-state { color: var(--ban); }
.cline.status-limited .cline-dot { background: var(--warn); }
.cline.status-limited .cline-state { color: var(--warn); }
.cline.status-expired .cline-dot { background: var(--expired); }
.cline.status-expired .cline-state { color: var(--expired); }
.cline.status-free .cline-dot { background: var(--free); }
.cline.status-free .cline-state { color: var(--free); }

.cline-warn {
  flex: none;
  width: 15px;
  height: 15px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--warn);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
}

.card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--faint);
}

.card-actions {
  display: flex;
  gap: 4px 12px;
  margin-top: 6px;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.card:hover .card-actions,
.card:focus-within .card-actions { opacity: 1; }

@media (hover: none) {
  .card-actions { opacity: 1; }
}

/* —— 展开详情里的会员卡（沿用） —— */

.platforms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.platform-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  height: 100%;
  min-height: 88px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: var(--surface-2);
  cursor: pointer;
}

.platform-cell:hover, .platform-cell.is-column { border-color: var(--ink); }
.platform-cell.status-active { background: var(--ok-bg); }
.platform-cell.status-banned { background: var(--ban-bg); }
.platform-cell.status-limited { background: var(--warn-bg); }
.platform-cell.status-expired { background: var(--expired-bg); }
.platform-cell.status-free { background: var(--free-bg); }
.platform-cell.status-closed { background: transparent; border-style: dashed; }

.platform-name { font-size: 11px; color: var(--muted); font-weight: 600; }
.platform-status { font-size: 13px; font-weight: 650; }
.status-active .platform-status { color: var(--ok); }
.status-banned .platform-status { color: var(--ban); }
.status-limited .platform-status { color: var(--warn); }
.status-expired .platform-status { color: var(--expired); }
.status-free .platform-status { color: var(--free); }
.status-closed .platform-status { color: var(--muted); }

.platform-meta, .platform-reason, .platform-warn {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

.platform-reason {
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.platform-billing {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink);
}

.platform-billing.is-missing, .platform-warn { color: var(--warn); }

.payline {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  margin-top: 3px;
}

.payline-label, .payline-via {
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
}

.payline-account {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.35;
  word-break: break-all;
  color: var(--ink);
}

.payline.is-missing .payline-via { color: var(--warn); }

.latest {
  margin: 6px 0 0;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
}

/* —— 支付渠道 —— */

.meta-line, .account-note {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.channel-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }

.channel-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.channel-card:hover { border-color: var(--line-strong); }

.channel-title { font-size: 13px; font-weight: 650; }
.channel-card .channel-account { font-size: 11.5px; }

.pay-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 650;
}

button.pay-badge { border: 0; cursor: pointer; }
.pay-badge.is-missing { background: var(--warn-bg); color: var(--warn); }

.channels { display: grid; gap: 6px; margin-top: 8px; }

.channel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 10px;
  background: var(--surface-2);
  cursor: pointer;
}

.channel:hover { border-color: var(--ink); }
.channel.is-off { border-style: dashed; }

.channel-name, .channel-use, .channel-note { font-size: 11.5px; color: var(--muted); line-height: 1.4; }

.channel-account {
  font-size: 11.5px;
  line-height: 1.4;
  word-break: break-all;
}

.channel-account.is-empty { font-family: inherit; color: var(--muted); }

.account-actions { margin-top: 2px; flex: none; gap: 4px 12px; }

.text-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: transparent;
}

.text-btn:hover { color: var(--ink); text-decoration-color: var(--faint); }
.text-btn.danger:hover { color: var(--ban); text-decoration-color: var(--ban); }

.empty { padding: 40px 4px 8px; max-width: 52ch; }
.empty h2 { margin: 0 0 6px; font-size: 16px; }
.empty p { margin: 0 0 14px; color: var(--muted); }

.foot { margin-top: 28px; }
.foot p { margin: 0; font-size: 12px; max-width: 78ch; }

.boot-error h1 { font-size: 17px; }
.boot-error p { max-width: 62ch; }

/* —— 菜单 —— */

.menu {
  position: fixed;
  z-index: 30;
  min-width: 190px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12.5px;
}

.menu button:hover:not(:disabled) { background: var(--hover); }
.menu button:disabled { color: var(--faint); cursor: default; }
.menu button.is-selected { color: var(--ink); font-weight: 600; }
.menu button.is-selected::after { content: "✓"; float: right; color: var(--muted); font-weight: 500; }
.menu .sep { height: 1px; background: var(--line); margin: 5px 4px; }

/* —— 自绘下拉 —— */

.dd-host { display: inline-flex; }

.dd-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
}

.dd-btn:hover { border-color: var(--line-strong); }
.dd-btn[aria-expanded="true"] { border-color: var(--ink); }

.dd-label { font-weight: 550; white-space: nowrap; }

.dd-chev { color: var(--faint); font-size: 9px; transition: transform 0.12s ease; }
.dd-btn[aria-expanded="true"] .dd-chev { transform: rotate(180deg); }

/* —— 对话框 —— */

dialog {
  border: 1px solid var(--line);
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  max-height: min(88dvh, 900px);
}

#editor { width: min(720px, calc(100vw - 24px)); }
#incident, #external, #confirm, #token { width: min(460px, calc(100vw - 24px)); }

dialog::backdrop { background: rgb(20 18 16 / 0.5); }

.dialog-form {
  max-height: min(88dvh, 900px);
  overflow: auto;
  padding: 16px 18px 0;
}

.dialog-form h2 { margin: 0; font-size: 17px; letter-spacing: -0.01em; }
.intro { margin: 5px 0 0; font-size: 12.5px; }

.form-grid, .platform-fields, .pay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-grid { margin-top: 14px; }
.span-2 { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.field input, .field textarea, .field select, .platform-editor input, .platform-editor textarea, .platform-editor select {
  background: var(--surface-2);
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin: 10px 0 0;
  padding: 11px 12px;
  min-inline-size: 0;
}

legend { padding: 0 4px; font-size: 12px; color: var(--muted); }
.platform-editor legend { color: var(--ink); font-weight: 650; font-size: 13px; }

.pay-option {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
}

.pay-option:has(input:checked) {
  border-color: var(--ink);
  background: var(--accent-soft);
}

.check-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  color: var(--ink);
  font-size: 13px;
}

.billing-box { display: grid; gap: 8px; }
.billing-box .hint { margin: 0; }

.pay-option strong { display: block; color: var(--ink); font-weight: 650; }
.pay-option small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.pay-grid { margin-top: 8px; }

.section-label { margin: 15px 0 0; font-size: 13px; font-weight: 650; }
.hint { margin: 7px 0 0; font-size: 12px; }

.timeline { list-style: none; margin: 7px 0 0; padding: 0; display: grid; gap: 4px; }
.timeline li { font-size: 12px; color: var(--muted); }

/* —— 会员期次编辑 —— */

.history-editor { margin-top: 10px; }
.history-editor .btn { margin-top: 8px; }

.history-list { display: grid; gap: 6px; margin-top: 8px; }

.history-item {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.history-item input[type="date"] { min-height: 28px; }
.history-index { color: var(--faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.history-sep { color: var(--faint); font-size: 11.5px; }

.discard-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  background: var(--warn-bg);
  color: var(--warn);
}

.discard-bar p { margin: 0; }
.discard-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dialog-form > .field { margin-top: 10px; }

.field-error {
  min-height: 1.2em;
  margin: 10px 0 0;
  color: var(--ban);
  font-size: 12px;
}

.dialog-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 0 14px;
  background: var(--surface);
}

.confirm-body { margin-top: 10px; }
.confirm-body strong { word-break: break-all; }

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 24px));
  padding: 8px 14px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  font-size: 12.5px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }

/* —— 移动端 —— */

@media (max-width: 720px) {
  .top { flex-direction: column; align-items: stretch; }
  .top-actions { justify-content: flex-end; }
  h1 { font-size: 16px; }
  .summary { gap: 4px 16px; }
  .pill-state { display: none; }
  .row-sub { display: none; }
  .row-id { flex-basis: auto; }
}

@media (max-width: 560px) {
  .wrap { width: min(1200px, calc(100% - 20px)); padding-top: 14px; }
  .platforms, .form-grid, .platform-fields, .pay-grid { grid-template-columns: 1fr; }
  .channel-card { flex-direction: column; }
  .span-2 { grid-column: auto; }
  input, textarea, select { font-size: 16px; }
  .row-updated { display: none; }
  .row-email { display: none; }
  .row-head { flex-wrap: wrap; row-gap: 2px; }
  .row-id { flex: 1 1 100%; }
  .row-pills { flex: 1 1 auto; }
  .search { flex-basis: 100%; }
  .cards { columns: 1; }
}

@media (prefers-reduced-motion: reduce) {
  button:active { transform: none; }
  .chev { transition: none; }
  .card-actions { transition: none; }
}
