/* 设计基准：GitHub Primer 式的克制后台风格
   —— 中性灰 + 单一蓝色强调；13px 密度；1px 边框；6px 圆角；不用阴影堆叠 */
:root {
  color-scheme: light;
  --canvas: #f6f8fa;
  --paper: #ffffff;
  --border: #d0d7de;
  --border-muted: #e7ebef;
  --ink: #1f2328;
  --muted: #656d76;
  --accent: #0969da;
  --accent-bg: #ddf4ff;
  --success: #1a7f37;
  --danger: #cf222e;
  --attention: #9a6700;
  --radius: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
}
button { font-family: inherit; }
[hidden] { display: none !important; }
svg { display: block; }

/* ============ 登录 ============ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
}
.login-box { width: 308px; }
.login-heading {
  font-size: 20px;
  font-weight: 400;
  text-align: center;
  margin-bottom: 18px;
  letter-spacing: .5px;
}
.login-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.login-error {
  border: 1px solid rgba(207, 34, 46, .4);
  background: #fff1f0;
  color: var(--danger);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 14px;
}
.login-foot {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 18px;
}

/* ============ 框架 ============ */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 208px;
  flex: none;
  border-right: 1px solid var(--border);
  background: var(--canvas);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand { padding: 16px 16px 10px; }
.brand-name { font-size: 14px; font-weight: 600; }
.brand-sub { font-size: 12px; color: var(--muted); }

.side-nav { padding: 6px 8px 16px; }
.nav-caption {
  font-size: 11px;
  color: var(--muted);
  padding: 12px 8px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  font-size: 13px;
  color: var(--ink);
  padding: 6px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
}
.nav-item svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.nav-item:hover { background: rgba(208, 215, 222, .32); }
.nav-item.active { background: rgba(208, 215, 222, .32); font-weight: 600; }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
}
.nav-item.active svg { color: var(--ink); }

.main-area { flex: 1; min-width: 0; }
.topbar {
  height: 49px;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.page-title { font-size: 14px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-user { color: var(--muted); }
.topbar-sep { width: 1px; height: 14px; background: var(--border); }
.btn-link {
  border: none;
  background: none;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 4px;
}
.btn-link:hover { text-decoration: underline; }

.page-root { padding: 20px 24px 48px; max-width: 1200px; margin: 0 auto; }

/* ============ 卡片 ============ */
.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-muted);
}
.card-title { font-size: 13px; font-weight: 600; }
.card-desc { color: var(--muted); font-size: 12px; margin-top: 1px; }
.card-body { padding: 14px 16px; }
.card-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 统计条 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.stat-card {
  padding: 12px 16px;
  border-right: 1px solid var(--border-muted);
}
.stat-card:last-child { border-right: none; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { font-size: 20px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; min-width: 640px; }
table.data th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-muted);
  white-space: nowrap;
}
table.data td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
table.data tbody tr:hover { background: var(--canvas); }
table.data tbody tr:last-child td { border-bottom: none; }
.cell-main { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 12px; }
.empty-state { text-align: center; color: var(--muted); padding: 40px 0; }

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--border-muted);
}
.pager-info { color: var(--muted); font-size: 12px; margin-right: auto; }

/* ============ 状态标签：描边小标签 + 圆点 ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  line-height: 18px;
  padding: 0 8px;
  border-radius: 2em;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--paper);
  font-weight: 500;
}
.badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex: none;
}
.badge-ok { color: var(--success); border-color: rgba(26, 127, 55, .4); }
.badge-ok::before { background: var(--success); }
.badge-danger { color: var(--danger); border-color: rgba(207, 34, 46, .4); }
.badge-danger::before { background: var(--danger); }
.badge-warn { color: var(--attention); border-color: rgba(154, 103, 0, .4); }
.badge-warn::before { background: var(--attention); }
.badge-info { color: var(--accent); border-color: rgba(9, 105, 218, .4); }
.badge-info::before { background: var(--accent); }
.badge-primary { color: var(--accent); border-color: rgba(9, 105, 218, .4); }
.badge-primary::before { background: var(--accent); }
.badge-muted { }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  padding: 4px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--canvas);
  color: var(--ink);
  cursor: pointer;
  transition: background .1s;
  user-select: none;
}
.btn:hover:not(:disabled) { background: #eef1f4; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #0860ca; }
.btn-danger-text { color: var(--danger); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #a40e26; }
.btn-secondary { }
.btn-ghost { border-color: transparent; background: none; color: var(--accent); }
.btn-ghost:hover:not(:disabled) { background: var(--accent-bg); }
.btn-sm { font-size: 12px; padding: 2px 8px; }
.btn-block { width: 100%; padding: 6px; }

/* ============ 表单 ============ */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 5px; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 4px; font-weight: 400; }
.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
.field input[type="datetime-local"],
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 10px;
  font-size: 13px;
  line-height: 20px;
  font-family: inherit;
  background: var(--paper);
  color: var(--ink);
  outline: none;
}
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(9, 105, 218, .15);
}
.field-row { display: flex; gap: 12px; }
.field-row > .field { flex: 1; min-width: 0; }

/* 开关 */
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0;
  background: #afb8c1;
  border-radius: 999px;
  cursor: pointer;
  transition: background .12s;
}
.switch .slider::before {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .12s;
}
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider::before { transform: translateX(16px); }

.switch-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-muted);
}
.switch-line:last-child { border-bottom: none; }
.switch-line .sw-label { font-weight: 600; }
.switch-line .sw-desc { color: var(--muted); font-size: 12px; }

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  align-items: start;
}
/* 配置页：顶部Tab + 宽幅双栏卡片 */
.cfg-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 1160px;
  margin: 0 auto 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.cfg-tab {
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  padding: 9px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.cfg-tab:hover { color: var(--ink); }
.cfg-tab.active {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--accent);
}
.config-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 780px;
  margin: 0 auto;
}
.config-stack.tabbed {
  max-width: 1160px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
  gap: 16px;
  align-items: start;
}
.config-stack.tabbed .card { margin-bottom: 0; }
.config-stack + .save-bar,
.config-stack.tabbed + .save-bar {
  max-width: 1160px;
  margin: 16px auto 0;
}
.config-stack .card { margin-bottom: 12px; }
.card.collapsible > .card-head { cursor: pointer; user-select: none; }
.card.collapsible > .card-head::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .15s;
  flex: none;
  margin-left: auto;
}
.card.collapsible.collapsed > .card-head { border-bottom: none; }
.card.collapsible.collapsed > .card-head::after { transform: rotate(-45deg); }
.card.collapsible.collapsed > .card-body { display: none; }

.share-title-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.share-title-row input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.share-title-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(9, 105, 218, .15); }
.tool-mode-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-muted);
}
.tool-mode-row:last-child { border-bottom: none; }
.tool-mode-name { font-weight: 600; width: 72px; flex: none; }
.tool-mode-row select {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 8px;
  font-size: 13px;
  font-family: inherit;
}
.save-bar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

/* ============ 弹窗 ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 35, 40, .5);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 100%;
  max-width: 480px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(31, 35, 40, .2);
}
.modal.modal-lg { max-width: 640px; }
.modal-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-muted);
}
.modal-title { font-size: 14px; font-weight: 600; }
.modal-close {
  border: none;
  background: none;
  font-size: 16px;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius);
  line-height: 1;
}
.modal-close:hover { background: var(--canvas); color: var(--ink); }
.modal-body { padding: 16px; overflow-y: auto; }
.modal-foot {
  flex: none;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-muted);
}
.modal-foot .btn { min-width: 72px; }

.kv-list { display: grid; grid-template-columns: 100px 1fr; gap: 8px 12px; }
.kv-list dt { color: var(--muted); }
.kv-list dd { word-break: break-all; font-variant-numeric: tabular-nums; }

/* ============ Toast ============ */
.toast-root {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: #24292f;
  color: #fff;
  border-radius: var(--radius);
  padding: 7px 14px;
  font-size: 13px;
  max-width: 80vw;
}
.toast.toast-ok { background: var(--success); }
.toast.toast-error { background: var(--danger); }

/* ============ 响应式 ============ */
@media (max-width: 840px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--border); }
  .side-nav { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px 8px 10px; }
  .nav-caption { display: none; }
  .nav-item { width: auto; }
  .nav-item.active::before { display: none; }
  .page-root { padding: 14px 12px 32px; }
  .kv-list { grid-template-columns: 88px 1fr; }
  .field-row { flex-direction: column; gap: 0; }
}

/* ============ 2026-08-23 运营后台视觉重构 ============ */
:root {
  --canvas: #f7f9fa;
  --paper: #ffffff;
  --paper-soft: #f8fafb;
  --sidebar: #172129;
  --sidebar-hover: #202d36;
  --sidebar-active: #263640;
  --border: #dce3e7;
  --border-muted: #e9eef1;
  --ink: #17212b;
  --muted: #6f7c86;
  --accent: #0a9ba3;
  --accent-strong: #07858c;
  --accent-bg: #e9f8f8;
  --success: #18a957;
  --success-bg: #edf9f1;
  --danger: #ef4444;
  --danger-bg: #fff1f1;
  --attention: #e98118;
  --attention-bg: #fff6e9;
  --info: #267be8;
  --info-bg: #edf5ff;
  --radius: 7px;
  --sidebar-width: 236px;
}

body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--canvas);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { letter-spacing: 0; }

/* 登录 */
.login-page {
  min-height: 100vh;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(420px, 42%) 1fr;
  align-items: stretch;
  background: var(--paper);
}
.login-brand {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: var(--sidebar);
}
.login-brand::after {
  content: "";
  position: absolute;
  left: 70px;
  bottom: 64px;
  width: 330px;
  height: 150px;
  background-image: url("./brand-cat.png");
  background-repeat: repeat;
  background-size: 58px 58px;
  opacity: .035;
}
.login-brand-inner {
  position: relative;
  z-index: 1;
  width: min(470px, calc(100% - 96px));
  min-height: 100%;
  margin: 0 auto;
  padding: 17vh 0 80px;
}
.login-brand-lockup { display: flex; align-items: center; gap: 20px; }
.login-brand-mark { width: 78px; height: 78px; object-fit: contain; }
.login-brand-lockup h1 { font-size: 34px; line-height: 1.2; font-weight: 720; }
.login-brand-lockup p { margin-top: 7px; color: #b8c3ca; font-size: 20px; }
.login-brand-copy { margin-top: 92px; }
.login-brand-copy h2 { font-size: 22px; line-height: 1.45; font-weight: 650; }
.login-brand-copy ul { list-style: none; margin-top: 34px; display: grid; gap: 24px; }
.login-brand-copy li { display: flex; align-items: center; gap: 15px; font-size: 16px; color: #e6ecef; }
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid #5b6a75;
  border-radius: 7px;
  color: #c7d1d6;
  font-size: 12px;
}
.paw-pattern { display: none; }
.login-main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 72px 8vw;
  background: var(--paper);
}
.login-status {
  position: absolute;
  top: 32px;
  right: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #44515b;
}
.login-version { margin-left: 8px; padding-left: 16px; border-left: 1px solid var(--border); color: var(--muted); }
.status-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--success); }
.login-box { width: min(100%, 520px); }
.login-heading { margin-bottom: 36px; text-align: left; }
.login-heading h2 { font-size: 34px; line-height: 1.2; font-weight: 720; }
.login-heading p { margin-top: 9px; color: var(--muted); font-size: 16px; }
.login-form .field { margin-bottom: 22px; }
.login-form .field label { margin-bottom: 9px; font-size: 15px; }
.input-affix {
  height: 54px;
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  transition: border-color .15s, box-shadow .15s;
}
.input-affix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10, 155, 163, .10); }
.input-affix > span { width: 48px; text-align: center; color: var(--muted); font-size: 12px; }
.input-affix input {
  width: 100%; height: 100%; border: 0 !important; padding: 0 16px 0 0 !important;
  box-shadow: none !important; font-size: 15px !important; background: transparent !important;
}
.remember-line { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); margin: -3px 0 22px; cursor: pointer; }
.remember-line input { accent-color: var(--accent); }
.login-submit { height: 50px; font-size: 16px; font-weight: 650; }
.login-audit { margin-top: 20px; text-align: center; color: var(--muted); font-size: 13px; }
.login-audit::before { content: "✓"; color: var(--accent); margin-right: 7px; }
.login-foot { position: absolute; right: 42px; bottom: 26px; margin: 0; color: var(--muted); }
.login-error { border-color: #f5b7b7; background: var(--danger-bg); padding: 10px 12px; margin-bottom: 16px; }

/* 框架 */
.app-shell { width: 100%; min-height: 100vh; background: var(--canvas); }
.sidebar {
  width: var(--sidebar-width);
  border-right: 0;
  color: #e7eef1;
  background: var(--sidebar);
  scrollbar-width: thin;
  scrollbar-color: #394851 transparent;
}
.brand { display: flex; align-items: center; gap: 12px; min-height: 92px; padding: 20px 24px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-mark { width: 40px; height: 40px; object-fit: contain; }
.brand-name { color: #fff; font-size: 16px; font-weight: 700; }
.brand-sub { margin-top: 1px; color: #9eabb3; font-size: 12px; }
.side-nav { padding: 14px 0 28px; }
.nav-caption { padding: 17px 24px 7px; color: #77858e; font-size: 11px; font-weight: 600; }
.nav-item {
  gap: 12px;
  min-height: 46px;
  padding: 0 24px;
  border-radius: 0;
  color: #cdd6db;
  font-size: 14px;
}
.nav-item svg { width: 19px; height: 19px; color: #aab5bb; }
.nav-item:hover { color: #fff; background: var(--sidebar-hover); }
.nav-item.active { color: #27d7dc; background: var(--sidebar-active); font-weight: 650; }
.nav-item.active::before { left: 0; top: 0; bottom: 0; width: 4px; border-radius: 0; background: #24dbe0; }
.nav-item.active svg { color: #27d7dc; }
.main-area { width: 0; flex: 1 1 auto; min-width: 0; min-height: 100vh; background: var(--canvas); }
.topbar {
  height: 88px;
  padding: 0 30px;
  border-bottom: 1px solid var(--border-muted);
  box-shadow: none;
  z-index: 20;
}
.topbar-heading { min-width: 0; }
.page-title { font-size: 25px; line-height: 1.2; font-weight: 720; }
.page-subtitle { margin-top: 4px; color: var(--muted); font-size: 12px; }
.topbar-right { gap: 12px; }
.service-status { display: inline-flex; align-items: center; gap: 7px; color: #43515a; font-size: 13px; white-space: nowrap; }
.user-avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: #e7ecef; color: #6c7881; font-weight: 700; }
.topbar-user { color: var(--ink); font-weight: 600; }
.topbar-sep { height: 22px; background: var(--border); }
.btn-link { color: var(--muted); }
.btn-link:hover { color: var(--danger); text-decoration: none; }
.page-root {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 88px);
  margin: 0;
  padding: 26px 30px 56px;
}
.page-root > * { max-width: none; }

/* 通用布局 */
.page-toolbar,
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.toolbar .field,
.page-toolbar .field { margin: 0; }
.toolbar-spacer { flex: 1; }
.page-summary { margin: -4px 0 18px; color: var(--muted); font-size: 13px; }
.page-summary strong { color: var(--success); font-weight: 650; }
.info-band {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  padding: 11px 14px;
  border: 1px solid #cfe0f4;
  border-radius: var(--radius);
  color: #49647d;
  background: #f3f8fe;
  font-size: 13px;
}
.info-band::before { content: "i"; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex: none; border-radius: 50%; color: #fff; background: var(--info); font-size: 11px; font-weight: 700; }

.card {
  border-color: var(--border);
  border-radius: var(--radius);
  box-shadow: none;
  margin-bottom: 18px;
}
.card-head { min-height: 62px; padding: 14px 18px; gap: 16px; }
.card-title { font-size: 15px; font-weight: 700; }
.card-desc { margin-top: 3px; font-size: 12px; }
.card-body { padding: 18px; }
.card-tools { gap: 10px; }

.stat-grid,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
  border: 0;
  background: transparent;
  overflow: visible;
}
.stat-card,
.metric-card {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
}
.stat-label, .metric-label { color: #55636d; font-size: 13px; }
.stat-value, .metric-value { margin-top: 8px; font-size: 28px; line-height: 1.15; font-weight: 720; color: #111a22; }
.metric-foot { margin-top: 10px; color: var(--muted); font-size: 12px; }
.metric-up { color: var(--success); }
.metric-down { color: var(--danger); }
.metric-accent { color: var(--attention); }
.analytics-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(310px, .75fr); gap: 18px; margin-bottom: 18px; }
.analytics-panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--paper); padding: 18px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.panel-title { font-size: 15px; font-weight: 700; }
.panel-desc { margin-top: 3px; color: var(--muted); font-size: 12px; }
.chart-wrap { position: relative; height: 260px; min-height: 220px; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; }
.progress-list { display: grid; gap: 18px; }
.progress-row { display: grid; grid-template-columns: 1fr auto; gap: 7px 14px; align-items: center; }
.progress-label { color: #3c4a53; }
.progress-value { color: var(--muted); font-variant-numeric: tabular-nums; }
.progress-track { grid-column: 1 / -1; height: 7px; border-radius: 4px; background: #e8edef; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; background: var(--accent); }
.progress-fill.warn { background: var(--attention); }
.revenue-row { display: flex; align-items: baseline; justify-content: space-between; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border-muted); }
.revenue-row strong { color: var(--attention); font-size: 26px; }
.chart-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 12px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 50%; }
.metric-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.mini-stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-bottom: 18px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--border); }
.mini-stat-row > div { display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 12px 18px; background: var(--paper); }
.mini-stat-row strong { font-size: 21px; font-weight: 720; }
.mini-stat-label { color: var(--muted); font-size: 13px; }
.season-band { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.rank-tabs { margin-bottom: 14px; }

/* 表格 */
.table-wrap { position: relative; width: 100%; overflow-x: auto; overflow-y: hidden; }
table.data { width: 100%; min-width: 760px; }
table.data th {
  height: 46px;
  padding: 0 14px;
  color: #596772;
  background: var(--paper-soft);
  border-bottom-color: var(--border);
  font-size: 12px;
  font-weight: 650;
}
table.data td { height: 58px; padding: 10px 14px; border-bottom-color: var(--border-muted); }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: #f3fbfb; }
table.data th:last-child,
table.data td:last-child {
  position: sticky;
  right: 0;
  z-index: 3;
  background: var(--paper);
  box-shadow: -10px 0 14px -14px rgba(23, 33, 41, .45);
}
table.data th:last-child { z-index: 4; background: var(--paper-soft); }
table.data tbody tr:hover td:last-child { background: #f3fbfb; }
.cell-main { font-weight: 650; }
.cell-sub { color: var(--muted); }
.player-cell { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.player-avatar { width: 34px; height: 34px; flex: none; border-radius: 7px; object-fit: contain; background: #edf2f3; padding: 4px; }
.pager { min-height: 58px; padding: 12px 16px; gap: 7px; }
.pager .btn { min-width: 34px; }
.pager-info { font-size: 13px; }
.rank-mark { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 700; background: #eef2f4; color: #53616b; }
.rank-1 { color: #8d6500; background: #ffefb5; }
.rank-2 { color: #65717a; background: #e4e9ec; }
.rank-3 { color: #995d35; background: #f8dfcf; }
.row-menu { position: relative; }
.row-menu summary { list-style: none; width: 34px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 6px; color: #4d5a63; cursor: pointer; font-weight: 700; }
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu[open] summary { border-color: var(--accent); color: var(--accent); }
.row-menu-panel {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  right: auto;
  z-index: 1000;
  min-width: 150px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--paper);
  box-shadow: 0 12px 34px rgba(20,32,40,.18);
}
.row-menu[open] > .row-menu-panel,
.row-menu-panel.is-portal { display: block; }
.row-menu-panel .btn { width: 100%; justify-content: flex-start; border: 0; background: transparent; }

/* 标签 */
.badge { gap: 0; min-height: 23px; padding: 1px 8px; border-radius: 4px; font-size: 12px; line-height: 19px; }
.badge::before { display: none; }
.badge-ok { color: var(--success); border-color: #c9ebd5; background: var(--success-bg); }
.badge-danger { color: var(--danger); border-color: #ffcaca; background: var(--danger-bg); }
.badge-warn { color: var(--attention); border-color: #f3d5b0; background: var(--attention-bg); }
.badge-info, .badge-primary { color: var(--info); border-color: #ccddf7; background: var(--info-bg); }
.badge-muted { color: #78858e; border-color: #e0e5e8; background: #f3f5f6; }

/* 按钮和输入 */
.btn {
  min-height: 36px;
  padding: 7px 14px;
  border-color: var(--border);
  background: var(--paper);
  font-size: 13px;
  font-weight: 600;
  transition: border-color .12s, background .12s, color .12s, transform .06s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:hover:not(:disabled) { border-color: #c7d0d5; background: #f4f7f8; }
.btn:focus-visible,
.cfg-tab:focus-visible,
.nav-item:focus-visible,
.row-menu summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn-primary { color: #fff; border-color: var(--accent); background: var(--accent); }
.btn-primary:hover:not(:disabled) { border-color: var(--accent-strong); background: var(--accent-strong); }
.btn-secondary { background: var(--paper); }
.btn-ghost { min-height: 30px; padding: 4px 8px; color: var(--accent-strong); background: transparent; border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--accent-bg); border-color: transparent; }
.btn-sm { min-height: 32px; padding: 5px 10px; }
.btn-block { width: 100%; }
.btn-danger-text { color: var(--danger); }

.field { margin-bottom: 17px; }
.field label { margin-bottom: 7px; color: #36444e; font-weight: 650; }
.field .hint { margin-top: 5px; color: var(--muted); }
.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
.field input[type="datetime-local"],
.field select,
.field textarea,
.toolbar input,
.toolbar select,
.page-toolbar input,
.page-toolbar select {
  min-height: 40px;
  padding: 8px 11px;
  border-color: var(--border);
  font-size: 13px;
}
.field textarea { min-height: 116px; }
.field input:focus, .field select:focus, .field textarea:focus,
.toolbar input:focus, .toolbar select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 155, 163, .10);
}
.field-row { gap: 16px; }
.switch { width: 40px; height: 22px; }
.switch .slider { background: #c4cdd2; }
.switch .slider::before { width: 16px; height: 16px; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch-line { min-height: 58px; padding: 10px 0; }
.switch-line .sw-label { font-weight: 650; }

/* 配置页 */
.cfg-tabs { max-width: none; margin: -6px 0 22px; gap: 22px; padding: 0; }
.cfg-tab { padding: 13px 1px 11px; font-size: 14px; }
.cfg-tab.active { color: var(--accent-strong); border-bottom-color: var(--accent); }
.config-stack.tabbed { display: block; max-width: none; }
.config-stack.tabbed .card {
  margin: 0;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
}
.config-stack.tabbed .card:first-child { border-top: 1px solid var(--border); }
.config-stack.tabbed .card-head { padding: 22px 4px 12px; border: 0; }
.config-stack.tabbed .card-body { padding: 0 4px 22px; }
.config-stack.tabbed + .save-bar { max-width: none; }
.tool-mode-row { min-height: 58px; padding: 10px 0; gap: 12px; }
.tool-mode-name { width: 82px; }
.tool-mode-row select { min-height: 36px; border-color: var(--border); padding: 7px 10px; }
.save-bar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  min-height: 68px;
  align-items: center;
  margin: 18px -30px -56px;
  padding: 12px 30px;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,.96);
}
.save-bar::before { content: "配置修改后需保存才会生效"; margin-right: auto; color: var(--muted); font-size: 13px; }
.config-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding: 12px 16px; border: 1px solid #cde5e5; border-radius: var(--radius); background: var(--accent-bg); font-size: 13px; }
.config-meta > span:first-child { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-strong); font-weight: 650; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(34, 157, 93, .12); }

/* 弹窗 */
.modal-overlay { padding: 28px; background: rgba(19, 29, 36, .48); backdrop-filter: blur(2px); }
.modal { max-width: 620px; max-height: 90vh; border-color: var(--border); border-radius: 8px; box-shadow: 0 18px 50px rgba(18, 31, 39, .22); }
.modal.modal-lg { max-width: 840px; }
.modal-head { min-height: 82px; padding: 18px 24px; }
.modal-title { font-size: 20px; font-weight: 720; }
.modal-close { width: 34px; height: 34px; padding: 0; font-size: 18px; }
.modal-body { padding: 24px; }
.modal-foot { min-height: 72px; align-items: center; padding: 14px 24px; }
.modal-foot .btn { min-width: 96px; }
.form-section-title { margin: 8px 0 15px; padding-top: 20px; border-top: 1px solid var(--border-muted); color: #24323b; font-size: 14px; font-weight: 720; }
.modal-info { margin: 8px 0 0; }
.kv-list { grid-template-columns: 120px 1fr; gap: 11px 16px; }
.kv-list dt { padding: 8px 0; }
.kv-list dd { padding: 8px 0; border-bottom: 1px solid var(--border-muted); }
.toast { padding: 10px 16px; border-radius: 6px; box-shadow: 0 8px 26px rgba(18,31,39,.18); }
.log-detail-cell { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1100px) {
  :root { --sidebar-width: 210px; }
  .stat-grid, .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .analytics-grid { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 38% 1fr; }
  .login-brand-inner { width: calc(100% - 54px); }
}

@media (max-width: 840px) {
  .login-page { display: block; background: var(--paper); }
  .login-brand { min-height: 220px; }
  .login-brand-inner { width: auto; padding: 45px 30px; }
  .login-brand-lockup h1 { font-size: 25px; }
  .login-brand-lockup p { font-size: 15px; }
  .login-brand-copy { display: none; }
  .login-main { min-height: calc(100vh - 220px); padding: 80px 24px; }
  .login-status { top: 22px; right: 22px; }
  .login-foot { position: static; margin-top: 50px; }
  .app-shell { display: block; }
  .main-area { width: 100%; }
  .sidebar { width: 100%; height: auto; position: relative; }
  .brand { min-height: 70px; padding: 14px 18px; }
  .side-nav { display: flex; overflow-x: auto; flex-wrap: nowrap; padding: 8px; }
  .nav-caption { display: none; }
  .nav-item { width: auto; min-width: max-content; min-height: 40px; padding: 0 14px; border-radius: 6px; }
  .nav-item.active::before { display: none; }
  .topbar { position: relative; height: 78px; padding: 0 18px; }
  .service-status, .topbar-sep, .user-avatar { display: none; }
  .page-title { font-size: 21px; }
  .page-root { padding: 18px 14px 40px; }
  .stat-grid, .metric-grid { grid-template-columns: 1fr; }
  .mini-stat-row { grid-template-columns: 1fr; }
  .season-band, .config-meta { align-items: flex-start; flex-direction: column; }
  .field-row { flex-direction: column; gap: 0; }
  .save-bar { margin: 18px -14px -40px; padding: 12px 14px; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal, .modal.modal-lg { max-width: none; max-height: 92vh; border-radius: 10px 10px 0 0; }
}
