:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --sidebar: #0b1220;
  --sidebar-2: #111b2e;
  --text: #0f172a;
  --muted: #55657d;
  --muted-2: #8090a5;
  --line: #e2e8f0;
  --line-2: #edf1f6;
  --primary: #2457f5;
  --primary-dark: #1b46c9;
  --primary-soft: #e9efff;
  --accent: #0f8f8e;
  --accent-soft: #e6f6f5;
  --success: #0e9f6e;
  --success-soft: #e6f7f0;
  --warning: #c2740a;
  --warning-soft: #fff5e5;
  --danger: #d92d20;
  --danger-soft: #fdecea;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
  --font: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cfd8e6; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.hidden { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------ 登录 */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: var(--surface);
}
.login-brand {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 10% 0%, rgba(36, 87, 245, 0.28), transparent 55%),
    radial-gradient(800px 500px at 100% 100%, rgba(15, 143, 142, 0.22), transparent 60%),
    linear-gradient(150deg, #0b1220 0%, #101b30 60%, #0b1424 100%);
  color: #fff;
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent 80%);
  pointer-events: none;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(140deg, #4d7bff, #2457f5 55%, #0f8f8e);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(36, 87, 245, 0.35);
}
.brand-logo svg { width: 22px; height: 22px; }
.brand-name { font-size: 17px; font-weight: 600; letter-spacing: .02em; }
.brand-sub { font-size: 12px; color: rgba(255,255,255,.55); letter-spacing: .14em; text-transform: uppercase; }
.login-copy { position: relative; z-index: 1; max-width: 520px; }
.login-copy .eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .18em;
  color: #8fb0ff;
  margin-bottom: 20px;
}
.login-copy h1 {
  font-size: 42px;
  line-height: 1.18;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.login-copy p { color: rgba(255,255,255,.66); font-size: 15px; line-height: 1.7; max-width: 440px; }
.login-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
  position: relative;
  z-index: 1;
}
.login-tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.045);
  border-radius: 999px;
  font-size: 12px;
  color: rgba(255,255,255,.82);
  backdrop-filter: blur(8px);
}
.login-tool i { width: 7px; height: 7px; border-radius: 50%; display: block; }
.login-foot { position: relative; z-index: 1; font-size: 12px; color: rgba(255,255,255,.38); }

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background:
    radial-gradient(600px 300px at 90% 0%, #f2f6ff, transparent 60%),
    var(--surface);
}
.login-form { width: 100%; max-width: 360px; }
.login-form h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.login-form .sub { color: var(--muted); margin-top: 8px; font-size: 13px; }
.login-form .field { margin-top: 22px; }
.login-form .submit { width: 100%; margin-top: 26px; height: 46px; }
.login-hint {
  margin-top: 22px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 10px;
}
.login-hint svg { flex: none; margin-top: 1px; color: var(--primary); }

/* ------------------------------------------------------------ 应用框架 */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 232px;
  background: var(--sidebar);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  z-index: 30;
}
.sidebar-top { padding: 22px 20px 18px; }
.sidebar .brand-mark { gap: 10px; }
.sidebar .brand-logo { width: 34px; height: 34px; border-radius: 9px; }
.sidebar .brand-logo svg { width: 18px; height: 18px; }
.sidebar .brand-name { font-size: 15px; color: #fff; }
.sidebar .brand-sub { font-size: 10px; color: rgba(255,255,255,.38); }
.side-nav { padding: 10px 12px; flex: 1; overflow-y: auto; }
.side-label {
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: 14px 12px 8px;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 9px;
  color: #a9b6c9;
  font-size: 13.5px;
  cursor: pointer;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
}
.side-link svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.side-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-link.active { background: linear-gradient(90deg, rgba(36,87,245,.9), rgba(36,87,245,.55)); color: #fff; box-shadow: 0 6px 16px rgba(36,87,245,.25); }
.side-link.active svg { opacity: 1; }
.side-badge {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: #fff;
}
.sidebar-bottom { padding: 14px 16px 18px; border-top: 1px solid rgba(255,255,255,.07); }
.admin-chip { display: flex; align-items: center; gap: 10px; }
.admin-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(140deg, #38537e, #1d2f4b);
  color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600;
}
.admin-meta { min-width: 0; }
.admin-meta b { display: block; font-size: 12.5px; color: #e2e8f0; font-weight: 500; }
.admin-meta span { display: block; font-size: 10.5px; color: rgba(255,255,255,.35); }
.logout-btn {
  margin-left: auto;
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.1);
  background: transparent; color: #93a4bb; cursor: pointer;
  display: grid; place-items: center;
}
.logout-btn:hover { color: #fff; background: rgba(255,255,255,.08); }

.main { margin-left: 232px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 68px;
  padding: 0 32px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar h1 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.topbar .crumb { color: var(--muted-2); font-size: 12px; margin-left: 2px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-date { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.content { padding: 26px 32px 48px; width: 100%; max-width: 1480px; }

.mobile-menu { display: none; }

/* ------------------------------------------------------------ 通用组件 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 14px rgba(36,87,245,.22); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { border-color: var(--line); background: var(--surface); color: var(--muted); }
.btn-ghost:hover { border-color: #c9d4e5; color: var(--text); background: var(--surface-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #fbdcd7; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn-icon { width: 34px; padding: 0; }
.btn-link { border: none; background: transparent; color: var(--primary); padding: 0 4px; height: 26px; font-size: 12.5px; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--danger); }
.btn-link.muted { color: var(--muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head {
  padding: 18px 20px 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.card-head h3 { font-size: 14px; font-weight: 600; }
.card-head p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; }
.card-body { padding: 18px 20px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.tool-stat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat {
  position: relative;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute;
  right: -30px; top: -30px;
  width: 100px; height: 100px; border-radius: 50%;
  background: var(--stat-tint, var(--primary-soft));
  opacity: .7;
}
.stat-head { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.stat-head .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--stat-color, var(--primary)); }
.stat-value { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; margin-top: 8px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-foot { margin-top: 6px; font-size: 12px; color: var(--muted-2); display: flex; gap: 8px; align-items: center; }
.stat-foot b { color: var(--stat-color, var(--primary)); font-weight: 600; }

.dash-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; margin-bottom: 18px; }
.dash-grid > .card { display: flex; flex-direction: column; }
.chart-wrap { padding: 20px 20px 12px; display: flex; flex-direction: column; flex: 1; }
.chart-bars { display: flex; align-items: flex-end; gap: 12px; flex: 1; min-height: 210px; margin-top: 8px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart-bar {
  width: 100%;
  max-width: 40px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #4d7bff, #2457f5);
  min-height: 3px;
  position: relative;
  transition: height .4s cubic-bezier(.2,.8,.2,1);
}
.chart-bar.zero { background: #e6ecf7; }
.chart-bar .tip {
  position: absolute;
  top: -24px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 11px; color: var(--text);
  opacity: .75;
}
.chart-label { font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); }

.tool-dist { padding: 8px 20px 16px; }
.dist-row { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.dist-row:last-child { border-bottom: 0; }
.dist-top { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.dist-top .dot { width: 8px; height: 8px; border-radius: 50%; }
.dist-top .num { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.dist-bar { height: 6px; background: #eef2f8; border-radius: 99px; margin-top: 9px; overflow: hidden; }
.dist-bar i { display: block; height: 100%; border-radius: 99px; background: var(--bar, var(--primary)); }
.dist-sub { font-size: 11px; color: var(--muted-2); margin-top: 5px; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; min-width: 760px; }
table.data th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-2);
  letter-spacing: .04em;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}
table.data td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); font-size: 13px; vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fbfcfe; }
table.data .code { font-family: var(--mono); font-size: 12.5px; letter-spacing: .01em; color: #1d2b45; white-space: nowrap; }
table.data .num { font-variant-numeric: tabular-nums; }
table.data .actions { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
table.data .sub { color: var(--muted-2); font-size: 11px; }
table.data .empty-row td { padding: 46px 0; text-align: center; color: var(--muted-2); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill.unused { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pill.active { background: var(--success-soft); color: var(--success); }
.pill.expired { background: var(--warning-soft); color: var(--warning); }
.pill.revoked { background: var(--danger-soft); color: var(--danger); }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.seg {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  height: 28px;
  padding: 0 11px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(15,23,42,.12); font-weight: 500; }
.toolbar .spacer { flex: 1; }

.input, .select, .textarea {
  height: 36px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0 11px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  font-size: 13px;
}
.input::placeholder, .textarea::placeholder { color: #a4b0c2; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(36,87,245,.12); }
.textarea { height: auto; min-height: 88px; padding: 9px 11px; resize: vertical; line-height: 1.6; }
.select { padding-right: 28px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2355657d' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 11px; top: 10px; width: 15px; height: 15px; color: var(--muted-2); }
.search-box .input { padding-left: 33px; width: 230px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 12px; font-weight: 500; color: var(--text); }
.field .help { font-size: 11.5px; color: var(--muted-2); }
.field + .field { margin-top: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .field + .field { margin-top: 0; }

.pagination { display: flex; align-items: center; gap: 8px; padding: 14px 20px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.pagination .spacer { flex: 1; }
.pagination .pages { display: flex; gap: 4px; }
.pagination .pg {
  min-width: 30px; height: 30px; padding: 0 8px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 7px;
  color: var(--muted); cursor: pointer; font-family: var(--mono); font-size: 12px;
}
.pagination .pg.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .pg:disabled { opacity: .45; cursor: not-allowed; }

.empty-box { padding: 54px 20px; text-align: center; color: var(--muted-2); }
.empty-box .empty-icon {
  width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center; color: #9aa9bd;
}
.empty-box b { display: block; color: var(--muted); font-weight: 500; margin-bottom: 4px; }

/* ------------------------------------------------------------ 弹窗 */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(9, 15, 28, .5);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 24px;
  animation: fadeIn .16s ease;
}
.modal {
  width: 100%; max-width: 520px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(9,15,28,.32);
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  animation: popIn .18s cubic-bezier(.2,.8,.2,1);
}
.modal.wide { max-width: 720px; }
.modal-head { padding: 20px 22px 0; display: flex; align-items: flex-start; gap: 12px; }
.modal-head h3 { font-size: 17px; font-weight: 600; }
.modal-head p { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.modal-close { margin-left: auto; width: 30px; height: 30px; border: 0; background: var(--surface-2); border-radius: 8px; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.modal-close:hover { background: #eef2f8; color: var(--text); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px 18px; display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--line); }
.modal-foot .left { margin-right: auto; }

.gen-tools { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.gen-tool {
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px;
  padding: 10px 8px; cursor: pointer; text-align: center; transition: all .15s;
}
.gen-tool .glyph {
  width: 30px; height: 30px; margin: 0 auto 6px; border-radius: 9px;
  display: grid; place-items: center; color: #fff; font-size: 12px;
}
.gen-tool b { display: block; font-size: 11.5px; font-weight: 500; color: var(--text); }
.gen-tool span { display: block; font-size: 10px; color: var(--muted-2); font-family: var(--mono); margin-top: 1px; }
.gen-tool:hover { border-color: #c9d4e5; }
.gen-tool.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(36,87,245,.1); background: #fbfcff; }

.qty-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.qty-chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 7px;
  height: 30px; padding: 0 12px; cursor: pointer; font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.qty-chip.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.result-codes {
  margin-top: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.result-codes .head { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.result-codes .head .spacer { flex: 1; }
.result-list { max-height: 260px; overflow-y: auto; padding: 8px 14px; }
.result-list div { font-family: var(--mono); font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--line); display: flex; align-items: center; gap: 8px; }
.result-list div:last-child { border-bottom: 0; }
.result-list button { margin-left: auto; }

/* ------------------------------------------------------------ 提示 */
#toast-root { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #0f1a2e; color: #fff; padding: 10px 16px; border-radius: 9px;
  font-size: 13px; box-shadow: 0 10px 30px rgba(9,15,28,.3);
  display: flex; align-items: center; gap: 8px;
  animation: toastIn .2s ease;
}
.toast.success { background: #0b3b2e; }
.toast.error { background: #4a1414; }
.toast svg { width: 15px; height: 15px; }

.settings-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
.settings-card .card-body { padding-top: 8px; }
.public-key {
  font-family: var(--mono); font-size: 11px; color: var(--muted); word-break: break-all;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
.account-line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.account-line:last-child { border-bottom: 0; }

.loading { display: flex; align-items: center; justify-content: center; padding: 80px 0; color: var(--muted-2); gap: 10px; font-size: 13px; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ 响应式 */
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  #toast-root { top: 70px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { min-height: 100vh; padding: 32px 24px; background: var(--surface); }
  .sidebar { position: fixed; inset: auto 0 0 0; width: 100%; height: auto; flex-direction: row; align-items: center; padding: 6px 8px; overflow-x: auto; z-index: 40; }
  .sidebar-top, .sidebar-bottom, .side-label, .side-badge { display: none; }
  .side-nav { display: flex; gap: 2px; padding: 0; overflow: visible; }
  .side-link { flex-direction: column; gap: 3px; padding: 7px 10px; font-size: 10.5px; width: auto; white-space: nowrap; }
  .side-link svg { width: 17px; height: 17px; }
  .main { margin-left: 0; padding-bottom: 68px; }
  .topbar { padding: 0 18px; height: 58px; }
  .content { padding: 18px 16px 32px; }
  .topbar-date { display: none; }
  .search-box .input { width: 100%; }
  .toolbar { padding: 12px 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .field + .field { margin-top: 0; }
  .modal { max-height: calc(100vh - 24px); }
  .modal-mask { padding: 12px; }
  .gen-tools { grid-template-columns: repeat(3, 1fr); }
  .stat-value { font-size: 26px; }
  .stat-foot { display: block; }
  .stat-foot b { display: block; margin-top: 2px; }
}
