:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #f1f3f6;
  --text: #111827;
  --text-2: #4b5563;
  --muted: #8b929c;
  --border: #eceef2;
  --border-strong: #dcdfe5;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: rgba(37, 99, 235, .08);
  --primary-ring: rgba(37, 99, 235, .2);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, .08);
  --ok: #16a34a;
  --ok-soft: rgba(22, 163, 74, .1);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, .1);
  --flash: rgba(250, 204, 21, .24);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 20px 48px rgba(16, 24, 40, .16);
  --radius: 12px;
  --radius-sm: 8px;
  --cell-x: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f12;
    --surface: #15181c;
    --surface-2: #1a1e23;
    --surface-3: #22272d;
    --text: #e7e9ec;
    --text-2: #b4bac2;
    --muted: #7f8791;
    --border: #252a31;
    --border-strong: #353b44;
    --primary: #5b8cff;
    --primary-hover: #7aa2ff;
    --primary-soft: rgba(91, 140, 255, .13);
    --primary-ring: rgba(91, 140, 255, .3);
    --danger: #f26b6b;
    --danger-soft: rgba(242, 107, 107, .12);
    --ok: #3ccf78;
    --ok-soft: rgba(60, 207, 120, .12);
    --warn: #f2a93b;
    --warn-soft: rgba(242, 169, 59, .12);
    --flash: rgba(250, 204, 21, .14);
    --shadow-sm: none;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}

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

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

a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 2px; }
::selection { background: var(--primary-ring); }

h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; }

.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.right { text-align: right; }
svg.i { width: 16px; height: 16px; flex: none; display: block; }

/* ---------- 动画 ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rowIn { from { opacity: 0; transform: translateY(-6px); } }
@keyframes rowOut { to { opacity: 0; transform: translateY(-4px); } }
@keyframes flash { from { background: var(--flash); } }
@keyframes blink { 50% { opacity: .3; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); }
  70%, 100% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
}

/* ---------- 表单控件 ---------- */
input, select {
  font: inherit;
  color: var(--text);
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--muted); }
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
input[type="checkbox"] { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--primary); }

select {
  appearance: none;
  -webkit-appearance: none;
  height: 32px;
  min-width: 150px;
  max-width: 220px;
  padding-right: 32px;
  font-size: 13px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238b929c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  text-overflow: ellipsis;
}

label { display: block; color: var(--text-2); font-size: 13px; font-weight: 500; }
label > input { display: block; width: 100%; margin-top: 6px; font-weight: 400; }
label.check { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 400; cursor: pointer; user-select: none; }
label.check > input { display: inline-block; width: 16px; margin: 0; }

.search { position: relative; display: block; }
.search > svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search > input { width: 240px; height: 32px; margin: 0; padding-left: 32px; font-size: 13px; }

/* ---------- 按钮 ---------- */
.btn {
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-solid:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.ghost.danger { color: var(--danger); }
.btn.ghost.danger:hover { background: var(--danger-soft); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.busy { color: transparent !important; pointer-events: none; }
.btn.busy::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--text-2);
  animation: spin .7s linear infinite;
}
.btn.primary.busy::after, .btn.danger-solid.busy::after { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }

.icon-btn {
  width: 32px;
  height: 32px;
  flex: none;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.bordered { border-color: var(--border-strong); background: var(--surface); }
.icon-btn.bordered:hover { background: var(--surface-3); }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn.busy svg { animation: spin .8s linear infinite; }
.icon-btn:disabled { cursor: default; }

.chip {
  font: inherit;
  font-size: 13px;
  height: 32px;
  padding: 0 12px 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background .2s var(--ease), color .2s, border-color .2s, transform .1s;
}
.chip svg { width: 14px; height: 14px; }
.chip:hover { color: var(--text); background: var(--surface-3); }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { background: var(--primary-soft); border-color: transparent; color: var(--primary); }

.link-btn {
  font: inherit;
  font-size: 12.5px;
  border: 0;
  background: none;
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--primary);
  cursor: pointer;
  transition: background .15s;
}
.link-btn:hover { background: var(--primary-soft); }

.btn:focus-visible, .icon-btn:focus-visible, .chip:focus-visible, .link-btn:focus-visible,
.tabs button:focus-visible, .count-btn:focus-visible, .copy:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-ring);
}

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  background: var(--surface-3);
  color: var(--text-2);
}
.badge.blue { background: var(--primary-soft); color: var(--primary); }
.badge.green { background: var(--ok-soft); color: var(--ok); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.yellow { background: var(--warn-soft); color: var(--warn); }
.badge .pdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: blink 1.4s ease-in-out infinite; }

.pill {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  flex: none;
  font-variant-numeric: tabular-nums;
  background: var(--surface-3);
  color: var(--text-2);
  transition: background .2s, color .2s;
}
.pill.ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--muted); }

.tag {
  display: inline-block;
  max-width: 160px;
  padding: 1px 8px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 20px;
  color: var(--text-2);
  background: var(--surface-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

/* ---------- 品牌 / 顶栏 ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; flex: none; }
.logo {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8d33a, #f0b90b);
  box-shadow: 0 2px 6px rgba(240, 185, 11, .35);
  position: relative;
  flex: none;
}
.logo::after {
  content: "";
  position: absolute;
  inset: 8px;
  background: #fff;
  transform: rotate(45deg);
  border-radius: 2px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  min-height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-3);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  font: inherit;
  font-size: 13.5px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s var(--ease), color .2s, box-shadow .2s;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: var(--shadow); }

.status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 380px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12.5px;
  cursor: default;
  transition: background .3s, color .3s, border-color .3s;
}
.status .text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.status.ok .dot { background: var(--ok); animation: pulse 2.4s infinite; }
.status.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.status.warn .dot { background: var(--warn); }
.status.err { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.status.err .dot { background: var(--danger); }

.user { display: flex; align-items: center; gap: 10px; flex: none; }
.user-name { font-weight: 500; }
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f8d33a, #f0b90b);
  color: #3b2f00;
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
}
.avatar.sm { width: 22px; height: 22px; font-size: 11px; }

/* ---------- 主体 ---------- */
.container { max-width: 1320px; margin: 0 auto; padding: 24px 20px 48px; }
.panel:not([hidden]) { animation: fadeUp .28s var(--ease); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
}
.card.narrow { max-width: 480px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 16px 20px;
}
.head-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.count { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12.5px;
}

.inline-form { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 20px 20px; align-items: center; }
.inline-form .grow { flex: 1 1 380px; min-width: 0; }
.inline-form input:not(.grow):not([type="checkbox"]) { flex: 0 1 220px; min-width: 0; }

.stack-form { padding: 0 20px 24px; }
.stack-form label { margin-bottom: 14px; }
.stack-form .btn { margin-top: 4px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th, .table td {
  padding: 11px var(--cell-x);
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table th {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  white-space: nowrap;
}
.table th.num, .table td.num { text-align: right; }
.table th.right, .table td.right { text-align: right; }
.table tbody > tr > td { transition: background .15s; }
.table tbody > tr:hover > td { background: var(--surface-2); }
.table tbody > tr:last-child > td { border-bottom: none; }
.txs td:first-child { font-variant-numeric: tabular-nums; }
.table .remark { display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }

tr.flash > td { animation: rowIn .3s var(--ease) both, flash 2.4s ease-out; }
tr.enter > td { animation: rowIn .24s var(--ease) both; animation-delay: var(--d, 0ms); }
tr.leave > td { animation: rowOut .16s ease-in forwards; }

.hash { display: inline-flex; align-items: center; gap: 2px; }
.copy {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, background .15s, color .15s;
}
.copy svg { width: 14px; height: 14px; }
tr:hover .copy, .copy:focus-visible { opacity: 1; }
.copy:hover { background: var(--surface-3); color: var(--text); }
.copy.done { opacity: 1; color: var(--ok); }
@media (hover: none) { .copy { opacity: 1; } }

.early { display: inline-flex; vertical-align: -2px; margin-left: 4px; color: var(--warn); cursor: help; }
.early svg { width: 13px; height: 13px; }

.row-actions { display: inline-flex; gap: 2px; justify-content: flex-end; }
.row-actions .btn + .btn { margin-left: 0; }

.who { display: flex; align-items: center; gap: 8px; }

/* ---------- 交易折叠组 ---------- */
.grp { display: flex; align-items: center; gap: 8px; min-width: 0; }
.txs .remark { max-width: 180px; }
.txs .remark-cell { min-width: 250px; } /* 展开/收起时列宽不跳动 */
.chev {
  width: 20px;
  height: 20px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
  transition: transform .25s var(--ease), background .15s, color .15s;
}
.chev svg { width: 14px; height: 14px; }
.chev-space { width: 20px; flex: none; }

tr.grp-head { cursor: pointer; }
tr.grp-head:hover .chev { background: var(--surface-3); color: var(--text); }
tr.grp-head.open .chev { transform: rotate(90deg); color: var(--primary); }
tr.grp-head.open .count-pill { background: var(--primary-soft); color: var(--primary); }

/* 展开后：左侧色条 + 树状连线把同组交易连在一起 */
.table tr.grp-head.open > td, .table tr.child > td { background: var(--surface-2); }
/* 色条用背景画，能覆盖单元格边框，行与行之间不断开 */
.table tr.grp-head.open > td:first-child, .table tr.child > td:first-child {
  background: linear-gradient(var(--primary), var(--primary)) left / 3px 100% no-repeat, var(--surface-2);
}
tr.grp-head.open > td { border-bottom-color: transparent; }
tr.child > td { padding-top: 8px; padding-bottom: 8px; font-size: 13px; border-bottom-color: transparent; }
tr.child.last > td { border-bottom-color: var(--border); }
tr.grp-head.open .remark-cell, tr.child .remark-cell { position: relative; }
tr.grp-head.open .remark-cell::before,
tr.child .remark-cell::before,
tr.child .remark-cell::after {
  content: "";
  position: absolute;
  left: calc(var(--cell-x) + 10px);
  border-color: var(--border-strong);
  border-style: solid;
  border-width: 0;
}
tr.grp-head.open .remark-cell::before { top: calc(50% + 12px); bottom: 0; border-left-width: 1.5px; }
tr.child .remark-cell::before { top: 0; bottom: 0; border-left-width: 1.5px; }
tr.child.last .remark-cell::before { bottom: 50%; }
tr.child .remark-cell::after { top: 50%; width: 12px; border-top-width: 1.5px; }

/* ---------- 用户的监控地址（管理员） ---------- */
.count-btn {
  font: inherit;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 24px;
  padding: 0 6px 0 10px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.count-btn svg { width: 13px; height: 13px; transition: transform .25s var(--ease); }
.count-btn:hover, .count-btn.open { background: var(--primary-soft); color: var(--primary); }
.count-btn.open svg { transform: rotate(90deg); }

tr.sub > td { padding: 2px 20px 16px; background: var(--surface-2); }
.table tbody > tr.sub:hover > td { background: var(--surface-2); }
.sub-list { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; }
.sub-list .table th { background: transparent; border-top: 0; }
.sub-list .table th, .sub-list .table td { padding: 8px 14px; }
.sub-list .loading, .sub-list .none { padding: 14px; color: var(--muted); font-size: 13px; }

/* ---------- 空状态 / 骨架屏 ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 56px 16px;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
.empty .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); }
.empty .ic svg { width: 22px; height: 22px; }

.sk-row > td { padding-top: 16px; padding-bottom: 16px; }
.table tbody > tr.sk-row:hover > td { background: transparent; }
.sk {
  display: block;
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-3) 30%, var(--surface-2) 50%, var(--surface-3) 70%);
  background-size: 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.sk-row:nth-child(2) .sk { width: 82%; }
.sk-row:nth-child(3) .sk { width: 64%; }
.sk-row:nth-child(4) .sk { width: 74%; }

.more { padding: 10px; text-align: center; border-top: 1px solid var(--border); }

/* ---------- 弹窗 ---------- */
dialog {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 22px 18px;
  width: min(420px, calc(100vw - 32px));
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
dialog[open] { animation: dlgIn .22s var(--ease); }
dialog::backdrop { background: rgba(15, 18, 24, .42); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
dialog[open]::backdrop { animation: fadeIn .2s ease; }
@keyframes dlgIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.dlg-msg { margin: 0; color: var(--text-2); white-space: pre-line; font-size: 13.5px; line-height: 1.65; word-break: break-all; }
#dlgField { margin-top: 14px; }
#dlgLabel { word-break: break-all; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

/* ---------- 提示 ---------- */
.toast-box {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: calc(100% - 32px);
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 9px 16px 9px 12px;
  border-radius: 10px;
  background: var(--text);
  color: var(--surface);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s var(--ease);
  transition: opacity .3s, transform .3s var(--ease);
}
.toast::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--primary); }
.toast.success::before { background: var(--ok); }
.toast.error::before { background: var(--danger); }
.toast.hide { opacity: 0; transform: translateY(-6px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(.97); } }

/* ---------- 登录页 ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(1000px 520px at 50% -10%, var(--primary-soft), transparent 70%), var(--bg);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px 32px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .08);
  animation: fadeUp .35s var(--ease);
}
.login-card .brand { font-size: 18px; }
.login-card .sub { margin: 8px 0 26px; color: var(--muted); font-size: 13.5px; }
.login-card label { margin-bottom: 14px; }
.login-card input, .login-card .btn { height: 40px; }
.form-error { min-height: 20px; margin-bottom: 8px; color: var(--danger); font-size: 13px; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px 12px; padding: 10px 16px; }
  .tabs { order: 3; width: 100%; }
  .tabs button { flex: 1 0 auto; }
  .user-name, #meRole { display: none; }
}

@media (max-width: 640px) {
  :root { --cell-x: 12px; }
  .brand-text { display: none; }
  .container { padding: 16px 12px 40px; }
  .card { margin-bottom: 14px; }
  .card-head { padding: 14px 16px; }
  .subbar { padding: 6px 16px; }
  .inline-form, .stack-form { padding-left: 16px; padding-right: 16px; }
  .table th:first-child, .table td:first-child { padding-left: 16px; }
  .table th:last-child, .table td:last-child { padding-right: 16px; }
  .search, .search > input { width: 100%; }
  .tools, .card-head .search { width: 100%; }
  select { flex: 1 1 auto; max-width: none; }
}

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