/* 阿里云邮箱取件台 —— 无外部依赖的本地界面样式 */
:root {
  --bg: #f3f4f6;
  --bg-2: #e9ebef;
  --panel: #ffffff;
  --panel-2: #fafbfc;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --text: #101828;
  --text-2: #344054;
  --muted: #667085;
  --brand: #ff6a00;
  --brand-2: #ff8a3d;
  --brand-soft: #fff3ea;
  --brand-soft-2: #ffe6d5;
  --ok: #079455;
  --ok-soft: #ecfdf3;
  --warn: #dc6803;
  --warn-soft: #fffaeb;
  --err: #d92d20;
  --err-soft: #fef3f2;
  --blue: #175cd3;
  --blue-soft: #eff8ff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --radius: 14px;
  --radius-sm: 9px;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1014;
    --bg-2: #12151b;
    --panel: #171a21;
    --panel-2: #1b1f27;
    --line: #2a2f3a;
    --line-strong: #3a4150;
    --text: #e7e9ee;
    --text-2: #c3c8d2;
    --muted: #98a2b3;
    --brand: #ff7a1a;
    --brand-2: #ff974d;
    --brand-soft: #2a1a0f;
    --brand-soft-2: #3a2412;
    --ok: #3ccb7f;
    --ok-soft: #0e2a1c;
    --warn: #fdb022;
    --warn-soft: #2a2110;
    --err: #ff6b5e;
    --err-soft: #2b1211;
    --blue: #84adff;
    --blue-soft: #10203d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .28);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 50% -300px, rgba(255, 106, 0, .07), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
        Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }

::selection { background: var(--brand-soft-2); color: var(--text); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------- 布局 */

.container {
  width: min(1080px, 100% - 40px);
  margin-inline: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--panel);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
  flex: 0 0 auto;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  box-shadow: 0 4px 10px rgba(255, 106, 0, .28);
  flex: 0 0 auto;
}
.brand-mark svg { width: 20px; height: 20px; }

.brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.brand-copy strong { font-size: 15px; letter-spacing: .01em; }
.brand-copy span { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}
.nav-link:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.nav-link.active { color: var(--brand); background: var(--brand-soft); }

.nav-form { margin: 0; }
.nav-button { font-weight: 500; }

.main { flex: 1 0 auto; padding: 28px 0 56px; }

.footer {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  padding: 18px 0 30px;
  color: var(--muted);
  font-size: 12.5px;
}
.footer .container { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- 通用组件 */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-pad { padding: 22px; }

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}
.section-head h2 { margin: 0; font-size: 16px; line-height: 1.4; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-head h1 { margin: 0; font-size: 26px; letter-spacing: -.01em; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
}
.btn:hover { background: var(--panel-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 106, 0, .22);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--brand), var(--brand)); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); }
.btn-danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 30%, var(--line)); }
.btn-danger:hover { background: var(--err-soft); }
.btn-sm { min-height: 32px; padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-lg { min-height: 48px; padding: 11px 20px; font-size: 15px; }

.inline { display: inline; margin: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--line);
}
.badge-brand { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-soft-2); }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack { display: grid; gap: 12px; }
.wrap-anywhere { overflow-wrap: anywhere; }

.alert {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  margin-bottom: 16px;
  font-size: 13.5px;
}
.alert-icon { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px; }
.alert-body { min-width: 0; }
.alert-title { font-weight: 650; margin: 0 0 3px; }
.alert p { margin: 0; color: var(--muted); }
.alert p + p { margin-top: 6px; }
.alert-error { border-color: color-mix(in srgb, var(--err) 28%, var(--line)); background: var(--err-soft); }
.alert-error .alert-title { color: var(--err); }
.alert-warn { border-color: color-mix(in srgb, var(--warn) 30%, var(--line)); background: var(--warn-soft); }
.alert-warn .alert-title { color: var(--warn); }
.alert-ok { border-color: color-mix(in srgb, var(--ok) 26%, var(--line)); background: var(--ok-soft); }
.alert-ok .alert-title { color: var(--ok); }
.alert-info { border-color: color-mix(in srgb, var(--blue) 22%, var(--line)); background: var(--blue-soft); }

.flash { margin-bottom: 18px; }
.flash ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); }
.flash li { margin: 2px 0; }

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

.auth-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 28px 18px;
  background:
    radial-gradient(900px 480px at 50% -10%, rgba(255, 106, 0, .16), transparent 65%),
    radial-gradient(700px 400px at 90% 100%, rgba(23, 92, 211, .06), transparent 60%),
    var(--bg);
}
.auth-shell { width: min(420px, 100%); }
.auth-card { padding: 30px 28px 24px; box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.auth-brand .brand-mark { width: 42px; height: 42px; border-radius: 12px; }
.auth-brand .brand-mark svg { width: 23px; height: 23px; }
.auth-title { margin: 0 0 6px; font-size: 22px; letter-spacing: -.01em; }
.auth-sub { margin: 0 0 20px; color: var(--muted); font-size: 13.5px; }
.auth-note { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.auth-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input, .textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  padding: 10px 13px;
  font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input { min-height: 44px; }
.textarea { min-height: 132px; resize: vertical; font-family: var(--mono); font-size: 12.8px; line-height: 1.6; }
.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .75; }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.field-error { color: var(--err); font-size: 12.5px; }

/* ---------------------------------------------------------------- 查询页 */

.hero {
  position: relative;
  overflow: hidden;
  padding: 30px 28px 26px;
  background:
    radial-gradient(700px 260px at 100% 0%, rgba(255, 106, 0, .12), transparent 60%),
    linear-gradient(135deg, var(--panel), var(--panel) 55%, var(--brand-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  margin-bottom: 10px;
}
.hero h1 { margin: 0; font-size: clamp(24px, 3.2vw, 32px); letter-spacing: -.02em; line-height: 1.25; }
.hero-sub { margin: 8px 0 20px; color: var(--muted); font-size: 14px; max-width: 640px; }

.query-form {
  display: flex;
  gap: 10px;
  align-items: stretch;
  max-width: 720px;
}
.query-input { flex: 1 1 auto; min-width: 0; height: 50px; font-size: 15px; padding: 0 16px; }
.query-btn { min-height: 50px; padding: 0 22px; font-size: 15px; }

.hero-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12.5px;
}
.hero-meta strong { color: var(--text); font-weight: 600; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.step {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.step-index {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 10px;
}
.step h3 { margin: 0 0 4px; font-size: 14px; }
.step p { margin: 0; color: var(--muted); font-size: 12.8px; line-height: 1.6; }

.result-account {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12.5px;
}
.result-account .dot-sep { opacity: .5; }
.section-gap { height: 18px; }
.alert-action { margin-top: 10px; }

.empty {
  padding: 46px 22px;
  text-align: center;
  color: var(--muted);
}
.empty svg { width: 40px; height: 40px; color: var(--line-strong); margin-bottom: 10px; }
.empty h3 { margin: 0 0 4px; color: var(--text); font-size: 15px; }
.empty p { margin: 0 auto; max-width: 460px; font-size: 13px; }

/* ---------------------------------------------------------------- 邮件卡片 */

.mail-card { margin-top: 4px; overflow: hidden; }
.mail-head { padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.mail-head-top { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.mail-subject {
  margin: 0;
  font-size: 21px;
  line-height: 1.4;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
  flex: 1 1 320px;
}
.mail-meta {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 10px 26px;
  margin: 14px 0 0;
  font-size: 13px;
}
.mail-meta-item { min-width: 0; display: flex; gap: 10px; }
.mail-meta dt { flex: 0 0 52px; color: var(--muted); }
.mail-meta dd { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
.mail-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.mail-tools .spacer { flex: 1 1 auto; }
.mail-tools .meta { color: var(--muted); font-size: 12.5px; margin-right: 6px; }

.mail-body { background: var(--panel); }
.mail-frame {
  display: block;
  width: 100%;
  height: 480px;
  border: 0;
  background: #fff;
}
.text-body {
  margin: 0;
  padding: 22px 24px;
  white-space: pre-wrap;
  word-break: break-word;
  font: 14px/1.7 var(--mono);
  color: var(--text);
}
pre.raw {
  margin: 0;
  padding: 18px 24px;
  white-space: pre-wrap;
  word-break: break-all;
  font: 12.5px/1.6 var(--mono);
  color: var(--text-2);
}
.truncated {
  padding: 8px 24px;
  background: var(--warn-soft);
  border-bottom: 1px solid var(--line);
  color: var(--warn);
  font-size: 12.5px;
}
.attachments {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 13px 24px;
  border-top: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 12.5px;
  color: var(--muted);
}
.attachments .label { color: var(--muted); font-weight: 500; }
.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  max-width: 100%;
}
.attach-chip svg { width: 14px; height: 14px; flex: 0 0 auto; }
.attach-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- 状态 / 表格 */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat { padding: 16px 18px; }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.stat-value { display: block; margin-top: 6px; font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat-value small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.chip-online { color: var(--ok); background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.chip-offline { color: var(--muted); background: var(--panel-2); border-color: var(--line); }
.chip-connecting { color: var(--blue); background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 22%, transparent); }
.chip-connecting .dot { animation: pulse 1s ease-in-out infinite; }
.chip-error { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 24%, transparent); }
.chip-auth_failed { color: var(--err); background: var(--err-soft); border-color: color-mix(in srgb, var(--err) 24%, transparent); }

@keyframes pulse { 50% { opacity: .35; } }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th {
  font-size: 11.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--panel-2);
  font-weight: 650;
  white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--panel-2); }
.table tbody tr:hover td { background: color-mix(in srgb, var(--panel-2) 60%, transparent); }
.th-actions { text-align: right; }
.table th.th-actions { text-align: right; }
.acct { display: grid; gap: 2px; min-width: 180px; }
.acct strong { font-weight: 600; overflow-wrap: anywhere; }
.acct small { color: var(--muted); font-family: var(--mono); font-size: 11.5px; }
.row-error { margin-top: 5px; color: var(--err); font-size: 11.5px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.actions form { margin: 0; }
.keepalive-flag { display: block; margin-top: 3px; color: var(--muted); font-size: 11.5px; }
.keepalive-flag.is-on { color: var(--ok); }
.when-online[hidden], .when-offline[hidden], [hidden] { display: none !important; }

/* ---------------------------------------------------------------- 导入 */

.import-grid { display: grid; gap: 16px; padding: 20px 22px 22px; }
.import-grid .textarea { min-height: 140px; }
.import-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.import-foot .spacer { flex: 1 1 auto; }
.file-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: 38px;
  padding: 7px 13px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
}
.file-btn:hover { border-color: var(--brand); color: var(--brand); }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.format-code {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
}
.refresh-note { color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.refresh-note.is-error { color: var(--err); }

/* ---------------------------------------------------------------- 错误页 */

.error-card { padding: 40px 28px 34px; text-align: center; }
.error-code {
  margin: 0 0 6px;
  font: 700 44px/1 var(--mono);
  color: var(--line-strong);
  letter-spacing: -.03em;
}
.error-card h1 { margin: 0 0 8px; font-size: 21px; }
.error-card p { margin: 0 auto 6px; max-width: 520px; }
.error-actions { margin-top: 20px !important; }

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

@media (max-width: 820px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: 1fr; }
  .mail-meta { grid-template-columns: 1fr; gap: 6px; }
  .hero { padding: 24px 20px 22px; }
  .mail-frame { height: 440px; }
}

@media (max-width: 620px) {
  .container { width: min(1080px, 100% - 28px); }
  .topbar-inner { min-height: 58px; gap: 10px; flex-wrap: wrap; padding: 8px 0; }
  .brand-copy span { display: none; }
  .nav { gap: 2px; }
  .nav-link { padding: 7px 9px; font-size: 12.5px; }
  .main { padding: 20px 0 40px; }
  .page-head h1 { font-size: 22px; }
  .query-form { flex-direction: column; }
  .query-btn { width: 100%; }
  .hero h1 { font-size: 23px; }
  .mail-head { padding: 18px 16px 14px; }
  .mail-subject { font-size: 18px; }
  .mail-frame { height: 400px; }
  .table th, .table td { padding: 11px 12px; }
  .actions { justify-content: flex-start; }
  .attachments { padding: 12px 16px; }
  .text-body, pre.raw { padding: 16px; }
}

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

/* ================================================================
   侧边栏控制台布局（仪表盘 / 邮箱管理 / 手动查询 / API接口）
   ================================================================ */

.app-body {
  display: block;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(1100px 500px at 70% -220px, rgba(255, 106, 0, .06), transparent 62%),
    var(--bg);
}

.app-main,
.content,
.content-inner,
.card,
.dash-grid,
.dash-main,
.dash-side,
.api-grid,
.api-endpoints,
.table-wrap,
.stats > * {
  min-width: 0;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.skip-link {
  position: fixed;
  left: 14px;
  top: -60px;
  z-index: 100;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
}
.skip-link:focus { top: 12px; text-decoration: none; }

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

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

.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  flex: 0 0 252px;
  width: 252px;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  background: linear-gradient(180deg, #111827 0%, #0b1220 100%);
  border-right: 1px solid rgba(255, 255, 255, .06);
  color: #e5e7eb;
  z-index: 30;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 6px 20px;
  color: #fff;
  text-decoration: none;
}
.side-brand:hover { text-decoration: none; }
.side-brand .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  flex: 0 0 auto;
  box-shadow: 0 6px 18px rgba(255, 106, 0, .32);
}
.side-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}
.side-brand-text strong { font-size: 15px; color: #f8fafc; letter-spacing: .01em; }
.side-brand-text small { margin-top: 4px; font-size: 11px; color: #94a3b8; }

.side-label {
  padding: 10px 10px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #64748b;
}

.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #cbd5e1;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.side-link svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: .88; }
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.side-link.active { background: rgba(255, 106, 0, .15); color: #fff; }
.side-link.active svg { color: var(--brand-2); opacity: 1; }
.side-link.active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}

.side-spacer { flex: 1 1 auto; min-height: 24px; }

.side-status {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .07);
  font-size: 12px;
  color: #cbd5e1;
}
.side-status-row { display: flex; align-items: center; gap: 7px; font-weight: 600; color: #e2e8f0; }
.side-status small { display: block; margin-top: 5px; color: #94a3b8; font-size: 11px; line-height: 1.5; }
.side-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(7, 148, 85, .18);
}
.side-status.is-off .dot { background: var(--err); box-shadow: 0 0 0 3px rgba(217, 45, 32, .18); }

.side-foot { margin-top: 12px; padding: 0 4px; color: #64748b; font-size: 11px; line-height: 1.6; }

.sidebar-backdrop { display: none; }

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

.app-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  min-height: 74px;
  padding: 14px 28px;
  background: var(--panel);
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-heading { min-width: 0; }
.topbar-heading h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -.01em;
  color: var(--text);
}
.topbar-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.topbar-actions .page-actions { margin: 0; }
.topbar-actions form { margin: 0; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--text-2);
  cursor: pointer;
  flex: 0 0 auto;
}
.icon-btn:hover { background: var(--panel-2); }
.icon-btn svg { width: 19px; height: 19px; }
.menu-toggle { display: none; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ok) 22%, transparent);
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.status-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(7, 148, 85, .13);
  animation: pulse 2.4s ease-in-out infinite;
}
.status-pill.is-off {
  color: var(--err);
  border-color: color-mix(in srgb, var(--err) 24%, transparent);
  background: var(--err-soft);
}
.status-pill.is-off .dot { animation: none; }

.userbox { display: inline-flex; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 9px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text-2);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
}
.user-chip:hover { background: var(--panel-2); }
.user-chip svg { width: 15px; height: 15px; color: var(--muted); }
.avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.content {
  flex: 1 0 auto;
  width: 100%;
  padding: 26px 28px 44px;
}
.content-inner { width: min(1240px, 100%); margin-inline: auto; }

.footer {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  padding: 16px 28px 22px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
.footer-inner {
  width: min(1240px, 100%);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.footer-sep { opacity: .5; }

/* ---------------------------------------------------------------- 仪表盘 */

.dash-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 24px 26px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(640px 240px at 100% 0%, rgba(255, 106, 0, .10), transparent 60%),
    linear-gradient(135deg, var(--panel), var(--panel) 58%, var(--brand-soft));
  box-shadow: var(--shadow-sm);
}
.dash-hero h2 { margin: 0; font-size: 22px; line-height: 1.35; letter-spacing: -.01em; }
.dash-hero p { margin: 7px 0 0; max-width: 660px; color: var(--muted); font-size: 13.5px; }
.dash-hero-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 4px; }

.dash-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--ok);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  white-space: nowrap;
}
.dash-eyebrow.is-warn { color: var(--warn); }
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(7, 148, 85, .14);
}
.dash-eyebrow.is-warn .live-dot { box-shadow: 0 0 0 3px rgba(220, 104, 3, .14); }

.dash-stats { margin-bottom: 18px; }
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 344px;
  gap: 18px;
  align-items: start;
}
.dash-main, .dash-side { display: grid; gap: 18px; min-width: 0; }

.stat-top { display: flex; align-items: center; gap: 9px; }
.stat-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand);
  flex: 0 0 auto;
}
.stat-icon svg { width: 17px; height: 17px; }
.stat-icon.ok { background: var(--ok-soft); color: var(--ok); }
.stat-icon.info { background: var(--blue-soft); color: var(--blue); }
.stat-icon.warn { background: var(--warn-soft); color: var(--warn); }
.stat-sub { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.stat.is-warn { border-color: color-mix(in srgb, var(--warn) 28%, var(--line)); }
.stat.is-warn .stat-value { color: var(--warn); }

.kv-list {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 18px;
  margin: 0;
  font-size: 13px;
}
.kv-list dt { color: var(--muted); white-space: nowrap; }
.kv-list dd { margin: 0; color: var(--text-2); min-width: 0; overflow-wrap: anywhere; }
.kv-list code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-size: 12px;
}

.inline-status { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 600; }
.inline-status .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.recent-list { padding: 8px 12px 14px; display: grid; gap: 2px; }
.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 12.5px;
}
.recent-item:hover { background: var(--panel-2); text-decoration: none; }
.recent-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.recent-time { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.mini-empty { padding: 14px 12px; color: var(--muted); font-size: 12.5px; line-height: 1.8; }

.quick-list { display: grid; gap: 8px; }
.quick-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.quick-link:hover { border-color: var(--line-strong); background: var(--panel-2); text-decoration: none; }
.quick-link svg { width: 16px; height: 16px; color: var(--muted); }
.dash-note { margin: 0; color: var(--muted); font-size: 12.8px; line-height: 1.75; }

.table.compact th, .table.compact td { padding: 10px 12px; }
.table.compact .acct { min-width: 170px; }
.table-wrap .table { min-width: 680px; }

/* ---------------------------------------------------------------- API 接口页 */

.api-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: 18px;
  margin: 18px 0;
}
.token-status-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.token-status-line code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-size: 12px;
}
.token-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.token-actions form { margin: 0; }
.token-note { margin-top: 12px !important; }

.token-reveal {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px dashed var(--brand);
  border-radius: 10px;
  background: var(--brand-soft);
}
.token-reveal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}
.token-reveal code {
  display: block;
  padding: 9px 11px;
  border: 1px solid var(--brand-soft-2);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.token-reveal .btn { margin-top: 8px; }

.token-empty {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--panel-2);
}
.token-empty .stat-icon { flex: 0 0 36px; width: 36px; height: 36px; }
.token-empty strong { display: block; margin-bottom: 3px; font-size: 13px; }
.token-empty p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.65; }

.section-title { margin: 4px 0 12px; font-size: 16px; letter-spacing: -.01em; }
.api-endpoints { display: grid; gap: 16px; margin-bottom: 18px; }

.endpoint-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}
.endpoint-path { font-family: var(--mono); font-size: 13.5px; font-weight: 600; color: var(--text); }
.endpoint-head p { margin: 0 0 0 auto; color: var(--muted); font-size: 12.5px; }
.method {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid transparent;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
}
.method-get { color: var(--ok); background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 24%, transparent); }
.method-post { color: var(--blue); background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 24%, transparent); }

.endpoint-body { padding: 16px 20px 20px; display: grid; gap: 14px; }
.endpoint-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.endpoint-params { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.param {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text-2);
}
.param code { color: var(--blue); font-family: var(--mono); font-size: 12px; font-weight: 600; }

.code-block {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 9px;
  background: #0b1220;
  color: #dbe4f0;
  font: 12px/1.7 var(--mono);
  overflow: auto;
  white-space: pre;
  tab-size: 2;
}

.api-try-form {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
}
.api-try-form .field { margin-bottom: 0; }
.api-try-form .btn { min-height: 44px; }
.api-result { min-height: 160px; max-height: 430px; overflow: auto; white-space: pre-wrap; }

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

@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: 1fr; }
  .api-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, 86vw);
    flex-basis: min(280px, 86vw);
    height: 100vh;
    transform: translateX(-102%);
    transition: transform .22s ease;
    box-shadow: 18px 0 50px rgba(0, 0, 0, .35);
    z-index: 60;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(15, 23, 42, .58);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
  .menu-toggle { display: inline-flex; }
  .app-body.sidebar-open { overflow: hidden; }
  .topbar { padding: 12px 18px; min-height: 68px; }
  .content { padding: 20px 18px 36px; }
  .footer { padding: 14px 18px 20px; }
}

@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-hero { padding: 20px 18px; }
  .dash-hero h2 { font-size: 19px; }
  .topbar-heading p { display: none; }
  .user-name { display: none; }
  .topbar { gap: 10px; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .status-pill { display: none; }
  .api-try-form { grid-template-columns: 1fr; }
  .endpoint-head p { margin-left: 0; width: 100%; }
  .section-head { padding: 16px; }
  .token-actions .btn { flex: 1 1 auto; }
}

@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .topbar { padding: 10px 14px; }
  .topbar-heading h1 { font-size: 18px; }
  .topbar-actions .page-actions .btn { min-height: 34px; padding: 5px 10px; font-size: 12.5px; }
  .topbar-actions .user-chip { padding: 3px 7px 3px 3px; }
  .content { padding: 16px 14px 30px; }
  .footer { padding: 12px 14px 18px; }
  .side-link { padding: 9px 11px; }
  .dash-hero-actions { width: 100%; }
  .dash-hero-actions .btn { flex: 1 1 auto; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .query-form { flex-direction: column; }
  .query-btn { width: 100%; }
  .mail-frame { height: 400px; }
  .table-wrap .table { min-width: 620px; }
  .token-reveal-head { align-items: flex-start; flex-direction: column; }
  .kv-list { grid-template-columns: 1fr; gap: 3px 0; }
  .kv-list dt { margin-top: 6px; }
  .endpoint-body { padding: 14px 16px 18px; }
  .endpoint-head { padding: 13px 16px; }
}

/* ================================================================
   账号列表框 / 自定义弹框与通知
   ================================================================ */

.icon-btn-sm { width: 28px; height: 28px; border-radius: 7px; }
.icon-btn-sm svg { width: 14px; height: 14px; }

.table-wrap .account-table { min-width: 1040px; }
.account-table {
  border-collapse: collapse;
  border: 1px solid var(--line);
}
.account-table th,
.account-table td {
  border: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
  padding: 12px 10px;
}
.account-table th { background: var(--panel-2); }
.account-table .acct { justify-items: center; text-align: center; }
.account-table .acct small { text-align: center; }
.account-table .actions { justify-content: center; }
.account-table .cell-stack {
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
}
.account-table .row-error { margin: 0 auto; max-width: 240px; }
.account-table .keepalive-flag { display: block; }
.account-table .id-cell {
  width: 58px;
  color: var(--muted);
  font-family: var(--mono);
  font-weight: 600;
}
.account-table .password-cell { min-width: 170px; }
.account-table .pwd-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.account-table .pwd-cell code {
  max-width: 260px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  text-align: center;
  white-space: normal;
  word-break: break-all;
}

/* ---- 弹框 */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .62);
  backdrop-filter: blur(4px);
}
.modal {
  display: flex;
  flex-direction: column;
  width: min(620px, 100%);
  max-height: min(86vh, 780px);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .35);
  animation: modal-in .16s ease-out;
}
.modal-sm { width: min(440px, 100%); }
.modal form { display: flex; flex-direction: column; min-height: 0; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { background: var(--panel-2); color: var(--text); }
.modal-body {
  padding: 20px;
  overflow-y: auto;
  min-height: 0;
}
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--panel-2);
}
.modal .textarea { min-height: 190px; }
.confirm-message { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.75; }
.modal-open { overflow: hidden; }

.drop-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12.5px;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.drop-hint svg { width: 16px; height: 16px; flex: 0 0 auto; }
.modal-body.is-drag {
  background: var(--brand-soft);
  outline: 2px dashed var(--brand);
  outline-offset: -8px;
  border-radius: 10px;
}
.modal-body.is-drag .drop-hint { border-color: var(--brand); color: var(--brand); background: var(--panel); }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- 通知 */

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--text-2);
  font-size: 13px;
  pointer-events: auto;
  animation: toast-in .18s ease-out;
}
.toast-text { flex: 1 1 auto; line-height: 1.55; overflow-wrap: anywhere; }
.toast-close {
  flex: 0 0 auto;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.toast-close:hover { color: var(--text); }
.toast-ok { border-left-color: var(--ok); }
.toast-error { border-left-color: var(--err); }
.toast-warn { border-left-color: var(--warn); }
.toast-out { opacity: 0; transform: translateY(6px); transition: opacity .18s ease, transform .18s ease; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 620px) {
  .modal-backdrop { padding: 12px; }
  .modal { max-height: 92vh; }
  .modal-head { padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px; }
  .modal-foot .btn { flex: 1 1 auto; }
  .toast-stack { right: 12px; bottom: 12px; width: calc(100vw - 24px); }
  .account-table th, .account-table td { padding: 10px 8px; }
}

/* ---- 压缩版账号列表框 / 批量选择 */

.table-wrap .account-table { min-width: 960px; }
.account-table { font-size: 12.5px; }
.account-table th,
.account-table td { padding: 6px 8px; line-height: 1.35; }
.account-table th { font-size: 11.5px; font-weight: 600; }
.account-table .check-cell { width: 32px; padding: 4px 6px; }
.account-table .id-cell { width: 46px; font-size: 11.5px; }
.account-table .acct strong { display: block; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.account-table .pwd-cell { gap: 4px; }
.account-table .pwd-cell code { max-width: 210px; padding: 1px 5px; font-size: 11.5px; line-height: 1.5; }
.account-table .pwd-cell .icon-btn { width: 24px; height: 24px; }
.account-table .pwd-cell .icon-btn svg { width: 12px; height: 12px; }
.account-table .cell-stack { gap: 1px; }
.account-table .chip { min-height: 20px; padding: 1px 7px; font-size: 11px; }
.account-table .keepalive-flag { font-size: 11px; }
.account-table .row-error { max-width: 200px; font-size: 10.5px; }
.account-table .actions { gap: 3px; flex-wrap: wrap; }
.account-table .actions .btn { min-height: 26px; padding: 2px 7px; font-size: 11.5px; border-radius: 6px; }
.account-table .actions .btn svg { width: 13px; height: 13px; }
.account-table .muted.small { font-size: 10.5px; }
.checkbox { width: 14px; height: 14px; margin: 0; accent-color: var(--brand); cursor: pointer; vertical-align: middle; }
#batch-delete-btn { white-space: nowrap; }
#batch-delete-btn:disabled { opacity: .45; cursor: not-allowed; }

.user-name { max-width: 132px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.user-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.user-table { min-width: 900px; font-size: 12.5px; }
.user-table th,
.user-table td { text-align: center; padding: 9px 8px; }
.user-table .id-cell { color: var(--muted); font-family: var(--mono); font-size: 11.5px; }
.user-table strong { font-size: 12.5px; }
.user-table-note { margin: 10px 14px 14px; }
.user-table form { display: inline-flex; }
@media (max-width: 900px) {
  .user-form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .account-table th,
  .account-table td { padding: 5px 6px; }
  .account-table .actions { gap: 2px; }
  .account-table .actions .btn { font-size: 11px; padding: 2px 5px; }
}


