/* ============================================================================
 * console.css — SaaS 运营后台（第一阶段：租户）
 * ----------------------------------------------------------------------------
 * 设计原则
 *  1. 页面容器用玻璃拟态（延续现有系统风格）
 *  2. 表格本体绝对不透明 —— 深色实底，保证数字清晰、滚动不掉帧、状态色可辨
 *  3. 不使用原生 alert / confirm / select / button，全部自绘
 *  4. 不使用 emoji，图标统一 SVG 线性（stroke-width: 1.5）
 *  5. 数字统一 tabular-nums，避免跳动
 * ========================================================================== */

/* ---------- tokens ---------- */
:root {
  --bg: #0a0f1a;
  --bg-deep: #070b13;
  --card: #111827;
  --glass: rgba(17, 24, 39, 0.58);
  --glass-strong: rgba(17, 24, 39, 0.82);

  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-mute: #64748b;

  --primary: #3b82f6;
  --primary-deep: #2563eb;
  --success: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;

  /* 表格专用（不透明） */
  --tbl-bg: #0f172a;
  --tbl-head: #1e293b;
  --tbl-zebra: #131c2e;
  --tbl-hover: #17233c;

  --line: rgba(148, 163, 184, 0.14);
  --line-soft: rgba(148, 163, 184, 0.07);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;

  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  /* 低对比环境光，衬托玻璃层次 */
  background:
    radial-gradient(900px 520px at 8% -6%, rgba(59, 130, 246, 0.12), transparent 62%),
    radial-gradient(760px 480px at 96% 4%, rgba(16, 185, 129, 0.07), transparent 60%),
    radial-gradient(800px 600px at 60% 108%, rgba(99, 102, 241, 0.07), transparent 62%),
    var(--bg);
  background-attachment: fixed;
  overflow: hidden;
}

::selection { background: rgba(59, 130, 246, 0.35); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.4); background-clip: content-box; }

button, input { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- 图标 ---------- */
.ico {
  width: 18px; height: 18px;
  flex: 0 0 auto;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ico-sm { width: 15px; height: 15px; }
.ico-lg { width: 22px; height: 22px; }

/* ============================================================================
 * 骨架
 * ========================================================================== */
.app {
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  height: 100vh;
}

/* ---------- 侧边栏 ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  padding: 18px 12px 14px;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.72), rgba(10, 15, 26, 0.86));
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border-right: 1px solid var(--line-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 20px;
}
.brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
  color: #fff;
}
.brand-name { font-size: 13.5px; font-weight: 600; letter-spacing: 0.2px; }
.brand-sub { font-size: 11px; color: var(--text-mute); letter-spacing: 0.3px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  padding: 0 10px 8px;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--text-mute);
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13.5px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.16s ease, color 0.16s ease;
  user-select: none;
}
.nav-item:hover { background: rgba(148, 163, 184, 0.08); color: var(--text); }
.nav-item.is-active {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.3);
  color: #dbeafe;
}
.nav-item.is-active .ico { color: #60a5fa; }
.nav-item .nav-soon {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-mute);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 4px;
  line-height: 15px;
}

.sidebar-foot { margin-top: auto; padding: 10px 10px 0; border-top: 1px solid var(--line-soft); }
.user-row { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.34);
  color: #93c5fd;
  font-size: 11.5px;
  font-weight: 600;
}
.user-name { font-size: 12.5px; }
.btn-logout {
  margin-left: auto;
  background: none;
  border: none;
  padding: 4px;
  color: var(--text-mute);
  cursor: pointer;
  border-radius: 6px;
  display: grid; place-items: center;
}
.btn-logout:hover { color: var(--danger); background: rgba(239, 68, 68, 0.1); }

/* ---------- 主区 ---------- */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 58px;
  padding: 0 26px;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(10, 15, 26, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.topbar-title { font-size: 14.5px; font-weight: 600; letter-spacing: 0.2px; }
.topbar-crumb { font-size: 12.5px; color: var(--text-mute); }
.topbar-spacer { flex: 1; }

/* 演示数据标记 */
.mock-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: #94a3b8;
  background: rgba(100, 116, 139, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.22);
}
.mock-badge .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: #94a3b8;
}

/* 滚动内容区 */
.scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 26px 40px;
}

/* ---------- 玻璃页面容器 ---------- */
.page {
  max-width: 1320px;
  margin: 0 auto;
  background: var(--glass);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 18px 50px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 22px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.page-head h1 { font-size: 17px; font-weight: 600; letter-spacing: 0.2px; }
.page-head p { font-size: 12.5px; color: var(--text-mute); margin-top: 3px; }
.page-head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.page-body { padding: 18px 22px 22px; }
.page-body.tight { padding: 0; }

/* 次级面板（详情页分块） */
.panel {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.panel + .panel { margin-top: 14px; }
.panel-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
}
.panel-head h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.panel-head .ico { color: var(--text-mute); }
.panel-head-actions { margin-left: auto; }

/* ============================================================================
 * 按钮
 * ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.2px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
  user-select: none;
}
.btn:hover { background: rgba(148, 163, 184, 0.15); border-color: rgba(148, 163, 184, 0.28); }
.btn:active { transform: translateY(0.5px); }
.btn:focus-visible { outline: 2px solid rgba(59, 130, 246, 0.55); outline-offset: 2px; }
.btn[disabled], .btn.is-disabled { opacity: 0.42; cursor: not-allowed; }
.btn[disabled]:hover, .btn.is-disabled:hover { background: rgba(148, 163, 184, 0.08); border-color: var(--line); }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.28);
}
.btn-primary:hover { background: #2f74e8; border-color: #2f74e8; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: rgba(148, 163, 184, 0.1); color: var(--text); border-color: transparent; }

/* 危险：默认只用描边，不铺红色 */
.btn-danger {
  background: transparent;
  border-color: rgba(239, 68, 68, 0.55);
  color: #fca5a5;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.12); border-color: var(--danger); color: #fecaca; }

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

.btn-sm { height: 27px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; }

/* 行内文字操作 */
.link-btn {
  background: none; border: none; padding: 0;
  color: #60a5fa; font-size: 12.5px; cursor: pointer;
  border-bottom: 1px solid transparent;
}
.link-btn:hover { border-bottom-color: rgba(96, 165, 250, 0.5); }

/* ============================================================================
 * 表格（不透明底 —— 设计决策：表格内禁用玻璃拟态）
 * ========================================================================== */
.tbl-wrap {
  background: var(--tbl-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.tbl-scroll { max-height: 62vh; overflow: auto; }

table.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--tbl-bg);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.tbl thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--tbl-head);
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-align: left;
  padding: 11px 14px;
  white-space: nowrap;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}
.tbl thead th.num { text-align: right; }

.tbl tbody td {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.tbl tbody tr:nth-child(even) { background: var(--tbl-zebra); }
.tbl tbody tr:last-child td { border-bottom: none; }

/* 可点击行 */
.tbl tbody tr.is-clickable { cursor: pointer; }
.tbl tbody tr.is-clickable:hover { background: var(--tbl-hover); }
.tbl tbody tr.is-clickable:hover .tenant-name { color: #93c5fd; }

.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td.act { text-align: right; white-space: nowrap; }
.act-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

/* 到期预警竖条 */
.tbl tbody tr.warn > td:first-child { box-shadow: inset 3px 0 0 0 var(--warn); }
.tbl tbody tr.crit > td:first-child { box-shadow: inset 3px 0 0 0 var(--danger); }

/* ============================================================================
 * 状态标签
 * ========================================================================== */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 23px;
  padding: 0 9px 0 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.2px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.pill .dot { width: 5px; height: 5px; border-radius: 50%; flex: 0 0 auto; }

.pill-running { color: #6ee7b7; background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.3); }
.pill-running .dot { background: var(--success); box-shadow: 0 0 6px rgba(16, 185, 129, 0.8); }

.pill-suspended { color: #cbd5e1; background: rgba(100, 116, 139, 0.16); border-color: rgba(148, 163, 184, 0.26); }
.pill-suspended .dot { background: #64748b; }

.pill-expired { color: #fca5a5; background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.3); }
.pill-expired .dot { background: var(--danger); }

.pill-upgrading { color: #fcd34d; background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.3); }
.pill-upgrading .dot { background: var(--warn); }

/* 本机徽章 */
.badge-local {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 17px;
  padding: 0 6px;
  margin-left: 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.32);
  vertical-align: 1px;
}

/* 数字/辅助文字 */
.tenant-cell { display: flex; align-items: center; gap: 0; min-width: 0; }
.tenant-name { font-size: 13.5px; font-weight: 500; letter-spacing: 0.2px; transition: color 0.15s ease; }
.muted { color: var(--text-dim); }
.mono { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.dim { color: var(--text-mute); }
.text-danger { color: #f87171; }
.text-warn { color: #fbbf24; }
.text-success { color: #34d399; }
.nowrap { white-space: nowrap; }

/* 到期天数小注 */
.days-note { font-size: 11.5px; margin-top: 1px; }
.days-note.warn { color: var(--warn); }
.days-note.crit { color: var(--danger); }

/* ============================================================================
 * 开关
 * ========================================================================== */
.switch {
  position: relative;
  width: 40px; height: 22px;
  border-radius: 999px;
  background: #334155;
  border: 1px solid rgba(148, 163, 184, 0.24);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
  flex: 0 0 auto;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1), background 0.18s ease;
}
.switch[data-on="1"] { background: var(--primary); border-color: var(--primary); }
.switch[data-on="1"]::after { transform: translateX(18px); background: #fff; }
.switch:focus-visible { outline: 2px solid rgba(59, 130, 246, 0.55); outline-offset: 2px; }
.switch.is-locked { cursor: not-allowed; opacity: 0.5; }

.switch-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
}
.switch-row + .switch-row { border-top: 1px solid var(--line-soft); }
.switch-row-text { min-width: 0; }
.switch-row-title { font-size: 13.5px; font-weight: 500; }
.switch-row-desc { font-size: 12px; color: var(--text-mute); margin-top: 2px; }
.switch-row-side { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.lock-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-mute);
}

/* ============================================================================
 * 详情页
 * ========================================================================== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 8px 4px 4px;
  border-radius: 7px;
  background: none;
  border: none;
  margin-bottom: 14px;
}
.back-link:hover { color: var(--text); background: rgba(148, 163, 184, 0.1); }

/* 顶部摘要卡 */
.summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 20px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    linear-gradient(120deg, rgba(59, 130, 246, 0.09), transparent 46%),
    rgba(15, 23, 42, 0.6);
}
.summary-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.summary h1 { font-size: 21px; font-weight: 600; letter-spacing: 0.3px; }
.summary-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.summary-meta .sep { color: var(--text-mute); opacity: 0.6; }

.summary-expiry { text-align: right; padding-left: 24px; border-left: 1px solid var(--line-soft); }
.summary-expiry .cap {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-mute);
  text-transform: uppercase;
}
.summary-expiry .big {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
  line-height: 1.2;
}
.summary-expiry .big.warn { color: #fbbf24; }
.summary-expiry .big.crit { color: #f87171; }
.summary-expiry .sub { font-size: 11.5px; color: var(--text-mute); margin-top: 3px; }

/* 键值网格 */
.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.kv {
  background: rgba(15, 23, 42, 0.85);
  padding: 12px 14px;
}
.kv .k { font-size: 11.5px; color: var(--text-mute); letter-spacing: 0.03em; }
.kv .v {
  font-size: 17px;
  font-weight: 600;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}
.kv .v small { font-size: 11.5px; font-weight: 400; color: var(--text-mute); margin-left: 3px; }

/* 配额进度 */
.quota-bar {
  height: 6px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.14);
  overflow: hidden;
  margin-top: 10px;
}
.quota-bar > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  transition: width 0.4s ease;
}
.quota-bar.over > i { background: linear-gradient(90deg, #ef4444, #f87171); }

/* 计费条 */
.billing-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.billing-cell {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--line-soft);
}
.billing-cell .cap { font-size: 11.5px; color: var(--text-mute); }
.billing-cell .amt {
  font-size: 22px;
  font-weight: 600;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
}
.billing-cell .amt .cur { font-size: 13px; font-weight: 400; color: var(--text-dim); margin-right: 2px; }
.billing-cell.is-overdue { border-color: rgba(239, 68, 68, 0.35); background: rgba(239, 68, 68, 0.06); }

/* 操作区 */
.op-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}
.op-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
  background: rgba(15, 23, 42, 0.7);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.op-card:hover { background: rgba(23, 35, 60, 0.9); border-color: rgba(148, 163, 184, 0.24); }
.op-card .ico { color: var(--text-dim); margin-top: 1px; }
.op-card-title { font-size: 13px; font-weight: 500; }
.op-card-desc { font-size: 11.5px; color: var(--text-mute); margin-top: 2px; line-height: 1.45; }
.op-card.is-danger { border-color: rgba(239, 68, 68, 0.3); }
.op-card.is-danger:hover { background: rgba(239, 68, 68, 0.09); border-color: rgba(239, 68, 68, 0.5); }
.op-card.is-danger .ico, .op-card.is-danger .op-card-title { color: #fca5a5; }
.op-card[disabled] { opacity: 0.45; cursor: not-allowed; }
.op-card[disabled]:hover { background: rgba(15, 23, 42, 0.7); border-color: var(--line-soft); }

/* ============================================================================
 * 弹窗
 * ========================================================================== */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 7, 13, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in 0.16s ease;
}
.modal-mask.closing { animation: fade-out 0.14s ease forwards; }

.modal {
  width: 100%;
  max-width: 430px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(23, 33, 54, 0.96), rgba(13, 20, 34, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  animation: modal-in 0.2s cubic-bezier(0.2, 0.8, 0.3, 1);
  overflow: hidden;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 18px 20px 0;
}
.modal-icon {
  width: 30px; height: 30px;
  flex: 0 0 auto;
  border-radius: 8px;
  display: grid; place-items: center;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: #f87171;
}
.modal-icon.neutral {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.28);
  color: #60a5fa;
}
.modal-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding-top: 4px;
  line-height: 1.4;
}
.modal-close {
  margin-left: auto;
  background: none; border: none;
  color: var(--text-mute);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: grid; place-items: center;
}
.modal-close:hover { color: var(--text); background: rgba(148, 163, 184, 0.12); }

.modal-body { padding: 14px 20px 4px; }
.modal-body p { font-size: 13px; color: var(--text-dim); line-height: 1.6; }
.modal-body p + p { margin-top: 8px; }
.modal-body strong { color: var(--text); font-weight: 600; }

/* 后果说明框 */
.consequence {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.22);
  font-size: 12.5px;
  color: #fca5a5;
  line-height: 1.55;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.consequence .ico { flex: 0 0 auto; margin-top: 1px; }
.consequence.neutral {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.24);
  color: #bfdbfe;
}

/* 表单 */
.field { margin-top: 14px; }
.field-label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.field-label .req { color: var(--danger); margin-left: 3px; }

.input {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  background: rgba(9, 14, 24, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input::placeholder { color: #4b5b73; }
.input:focus {
  border-color: rgba(59, 130, 246, 0.7);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}
.input.is-invalid { border-color: rgba(239, 68, 68, 0.7); }
.input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16); }
.input.mono { font-family: var(--mono); }

.field-hint { font-size: 11.5px; color: var(--text-mute); margin-top: 6px; }
.field-error { font-size: 11.5px; color: #f87171; margin-top: 6px; display: none; }
.field-error.show { display: block; }

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px 18px;
}
.modal-foot .btn { height: 34px; }
/* 默认聚焦「取消」时给出明确焦点环 */
.btn:focus-visible, .btn.tab-focus { outline: 2px solid rgba(96, 165, 250, 0.7); outline-offset: 2px; }

/* ============================================================================
 * Toast / 顶部错误条 / 空态
 * ========================================================================== */
.toast-wrap {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 220px;
  max-width: 380px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  background: rgba(23, 33, 54, 0.97);
  border: 1px solid var(--line);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.2s ease;
  pointer-events: auto;
}
.toast.out { animation: toast-out 0.18s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }
.toast .ico { flex: 0 0 auto; }
.toast-success .ico { color: var(--success); }
.toast-error .ico { color: var(--danger); }
.toast-info .ico { color: var(--primary); }
.toast-error { border-color: rgba(239, 68, 68, 0.35); }

/* 顶部错误条（不白屏） */
.err-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1320px;
  margin: 0 auto 14px;
  padding: 11px 14px;
  border-radius: var(--radius);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.32);
  color: #fca5a5;
  font-size: 12.5px;
}
.err-bar .ico { flex: 0 0 auto; }
.err-bar .err-msg { min-width: 0; }
.err-bar .btn { margin-left: auto; }

/* 空态 */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 64px 24px;
  text-align: center;
  background: var(--tbl-bg);
}
.empty-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid var(--line);
  color: var(--text-mute);
  margin-bottom: 10px;
}
.empty h3 { font-size: 14px; font-weight: 500; }
.empty p { font-size: 12.5px; color: var(--text-mute); margin-bottom: 14px; }

/* 骨架/加载 */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 60px;
  color: var(--text-mute);
  font-size: 12.5px;
}
.spinner {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.25);
  border-top-color: var(--primary);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 开发中占位 */
.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 90px 24px;
  text-align: center;
}
.placeholder .ph-icon {
  width: 46px; height: 46px;
  border-radius: 13px;
  display: grid; place-items: center;
  background: rgba(148, 163, 184, 0.09);
  border: 1px solid var(--line);
  color: var(--text-mute);
  margin-bottom: 8px;
}
.placeholder h3 { font-size: 14.5px; font-weight: 500; }
.placeholder p { font-size: 12.5px; color: var(--text-mute); max-width: 320px; line-height: 1.6; }

/* ============================================================================
 * 登录页
 * ========================================================================== */
.login-body {
  display: grid;
  place-items: center;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(760px 520px at 22% 14%, rgba(59, 130, 246, 0.18), transparent 60%),
    radial-gradient(680px 480px at 82% 82%, rgba(99, 102, 241, 0.14), transparent 62%),
    radial-gradient(520px 380px at 70% 12%, rgba(16, 185, 129, 0.08), transparent 60%),
    var(--bg);
}

/* 极淡网格底纹，增加质感 */
.login-body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 42%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 42%, #000 0%, transparent 72%);
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 2;
  width: 372px;
  padding: 34px 32px 30px;
  border-radius: 20px;
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(34px) saturate(165%);
  -webkit-backdrop-filter: blur(34px) saturate(165%);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 30px 80px rgba(0, 0, 0, 0.6);
}

.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.login-brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
.login-brand-name { font-size: 14px; font-weight: 600; }
.login-brand-sub { font-size: 11.5px; color: var(--text-mute); }

.login-title { font-size: 19px; font-weight: 600; letter-spacing: 0.3px; }
.login-sub { font-size: 12.5px; color: var(--text-mute); margin-top: 4px; margin-bottom: 22px; }

.login-field { margin-bottom: 14px; }
.login-field label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.login-input-wrap { position: relative; }
.login-input-wrap .ico {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-mute);
  pointer-events: none;
}
.login-input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 35px;
  border-radius: var(--radius-sm);
  background: rgba(9, 14, 24, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.login-input::placeholder { color: #475569; }
.login-input:focus {
  border-color: rgba(59, 130, 246, 0.65);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}
.login-input.is-invalid { border-color: rgba(239, 68, 68, 0.65); }

.login-btn {
  width: 100%;
  height: 38px;
  margin-top: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--primary);
  background: linear-gradient(180deg, #4b8ef7, #2f74e8);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.4px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.3);
  transition: filter 0.15s ease;
}
.login-btn:hover { filter: brightness(1.07); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; filter: none; }

.login-error {
  display: none;
  align-items: flex-start;
  gap: 7px;
  margin-bottom: 14px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-size: 12.5px;
  line-height: 1.5;
}
.login-error.show { display: flex; }
.login-error .ico { flex: 0 0 auto; margin-top: 1px; }

.login-foot {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-mute);
}
.login-foot .mono { font-size: 11px; }

/* 登录页演示提示 */
.login-demo {
  margin-top: 12px;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  background: rgba(148, 163, 184, 0.08);
  border: 1px dashed rgba(148, 163, 184, 0.24);
  font-size: 11.5px;
  color: var(--text-mute);
  line-height: 1.55;
}

/* ============================================================================
 * 开通租户（4.2）
 * ----------------------------------------------------------------------------
 * 分步列表刻意用左对齐的「图标 + 名称 + 说明」三栏，说明文字允许换行：
 * 开通失败时后端会把具体报错塞进说明里，截断就看不出是证书还是端口问题。
 * ========================================================================== */

/* 表单两列 / 三列 */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}
.form-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.form-grid .field { margin-top: 14px; }

@media (max-width: 720px) {
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
}

/* 分步列表 */
.step-list {
  margin-top: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(9, 14, 24, 0.6);
  overflow: hidden;
}
.step-item {
  display: grid;
  grid-template-columns: 22px 82px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 7px 11px;
  font-size: 12.5px;
  border-top: 1px solid var(--line-soft);
}
.step-item:first-child { border-top: none; }

.step-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 10px;
  line-height: 1;
  margin-top: 1px;
  border: 1px solid var(--line);
  color: var(--text-mute);
  flex: 0 0 auto;
}
.step-name { color: var(--text-dim); }
.step-msg {
  color: var(--text-mute);
  line-height: 1.5;
  word-break: break-word;
  font-size: 11.5px;
}

.step-item.is-pending .step-ico { border-style: dashed; }
.step-item.is-pending .step-msg { color: #4b5b73; }

.step-item.is-running .step-ico {
  border-color: var(--primary);
  border-top-color: transparent;
  animation: step-spin 0.7s linear infinite;
}
.step-item.is-running .step-name { color: var(--text); }
.step-item.is-running .step-msg { color: var(--text-dim); }
@keyframes step-spin { to { transform: rotate(360deg); } }

.step-item.is-ok .step-ico {
  border-color: rgba(16, 185, 129, 0.55);
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
}
.step-item.is-ok .step-msg { color: var(--text-dim); }

.step-item.is-warn .step-ico {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.14);
  color: #fcd34d;
}
.step-item.is-warn .step-msg { color: #fcd34d; }

.step-item.is-fail .step-ico {
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}
.step-item.is-fail .step-name { color: var(--text); }
.step-item.is-fail .step-msg { color: #fca5a5; }

/* 初始密码展示：只显示一次，做成一眼能看到、方便复制的块 */
.cred-box {
  margin-top: 14px;
  padding: 12px 13px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.07);
  border: 1px solid rgba(16, 185, 129, 0.28);
}
.cred-cap {
  font-size: 11.5px;
  color: #6ee7b7;
  margin-bottom: 8px;
}
.cred-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cred-line .mono {
  font-size: 14px;
  letter-spacing: 0.4px;
  color: var(--text);
  background: rgba(9, 14, 24, 0.8);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 10px;
  user-select: all;
}
.cred-box .field-hint { margin-top: 8px; }

/* 备份记录列表 */
.bk-list {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(9, 14, 24, 0.6);
  overflow: hidden;
}
.bk-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 90px 40px;
  gap: 10px;
  align-items: center;
  padding: 7px 11px;
  font-size: 12.5px;
  border-top: 1px solid var(--line-soft);
}
.bk-row:first-child { border-top: none; }
.bk-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-when { font-size: 11.5px; }
.bk-tag {
  justify-self: end;
  font-size: 10.5px;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 5px;
  padding: 1px 5px;
  line-height: 1.5;
}
.bk-tag.manual {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
}

@media (max-width: 720px) {
  .bk-row { grid-template-columns: minmax(0, 1fr) 90px 70px 36px; gap: 6px; }
  .bk-when { display: none; }
}

/* ============================================================================
 * 计费页 / 监控页 / 操作记录页（4.4）
 * ========================================================================== */

/* 顶部三个汇总格 */
.sum-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.sum-cell {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 16px;
}
.sum-cell.is-overdue { border-color: rgba(239, 68, 68, 0.35); }
.sum-cell .cap { font-size: 11.5px; color: var(--text-mute); }
.sum-cell .amt {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
}
.sum-cell .amt .cur { font-size: 14px; margin-right: 2px; color: var(--text-dim); }

/* 展开行 */
.detail-row td { padding: 0 !important; background: rgba(9, 14, 24, 0.5); }
.detail-box { padding: 12px 14px; }
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.mini-cap {
  font-size: 11.5px;
  color: var(--text-mute);
  margin-bottom: 6px;
}
.tbl.mini { font-size: 12px; }
.tbl.mini th, .tbl.mini td { padding: 5px 8px; }

@media (max-width: 1000px) {
  .two-col { grid-template-columns: 1fr; }
  .sum-strip { grid-template-columns: 1fr; }
}

/* 监控卡片 */
.mon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.mon-card {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mon-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mon-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  min-width: 0;
}
.mon-kv {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.mon-k .cap { font-size: 11px; color: var(--text-mute); }
.mon-k .v {
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.mon-k .sub { font-size: 10.5px; color: var(--text-mute); margin-top: 2px; }
.mon-chart { height: 46px; }
.spark { width: 100%; height: 46px; display: block; }
.mon-nochart {
  font-size: 11.5px;
  padding: 12px 0;
  text-align: center;
  border: 1px dashed var(--line-soft);
  border-radius: var(--radius-sm);
}

/* 说明块（比 consequence 中性） */
.notice {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.07);
  border: 1px solid rgba(59, 130, 246, 0.22);
  font-size: 12.5px;
  color: #bfdbfe;
  line-height: 1.6;
}
.notice .ico { flex: 0 0 auto; margin-top: 1px; color: #93c5fd; }
.notice.is-warn {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.32);
  color: #fcd34d;
}
.notice.is-warn .ico { color: #fbbf24; }
.notice-title { font-weight: 600; margin-bottom: 3px; color: var(--text); }

/* 筛选条 */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 13px;
  margin-bottom: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}
.filter-grp {
  display: flex;
  align-items: center;
  gap: 6px;
  /* ⛔ 不换行、横向滚动：动作/租户的 chip 必须全部可见可点，
     按条数截断会把低频动作（记录收款、出账单）整掉，而那正是对账要筛的 */
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: thin;
}
.filter-grp::-webkit-scrollbar { height: 5px; }
.filter-grp::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.28);
  border-radius: 3px;
}
.filter-grp .chip { flex: 0 0 auto; }

/* 汇总格上的口径说明 */
.cap-note {
  font-size: 10.5px;
  color: #4b5b73;
  margin-left: 6px;
  font-weight: 400;
}
.filter-cap {
  font-size: 11.5px;
  color: var(--text-mute);
  margin-right: 2px;
  min-width: 28px;
}
.chip {
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-dim);
  font-size: 11.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.chip:hover { background: rgba(148, 163, 184, 0.16); color: var(--text); }
.chip i {
  font-style: normal;
  font-size: 10.5px;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}
.chip.is-on {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.55);
  color: #bfdbfe;
}
.chip.is-on i { color: #93c5fd; }
.filter-date { width: 132px; height: 26px; font-size: 11.5px; padding: 0 7px; }

/* 审计动作标签 */
.act-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 11.5px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid var(--line);
  color: var(--text-dim);
  white-space: nowrap;
}

/* detail 列：截断 + hover 看全文 */
.detail-cell {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-dim);
}

/* 分页 */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 0 2px;
}
.pager-info { font-size: 11.5px; color: var(--text-mute); padding: 0 4px; }

/* ============================================================================
 * 响应式
 * ========================================================================== */
@media (max-width: 1120px) {
  .app { grid-template-columns: 64px minmax(0, 1fr); }
  .brand-name, .brand-sub, .nav-label, .nav-item span, .sidebar-foot .user-name { display: none; }
  .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .nav-item { justify-content: center; }
  .sidebar-foot .user-row { justify-content: center; }
  .btn-logout { margin-left: 0; }
}

@media (max-width: 860px) {
  .scroll { padding: 14px; }
  .summary { grid-template-columns: 1fr; }
  .summary-expiry {
    text-align: left;
    padding-left: 0;
    border-left: none;
    border-top: 1px solid var(--line-soft);
    padding-top: 12px;
  }
  .billing-row { grid-template-columns: 1fr; }
}

/* 降低动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
 * [2026-12-04 三版本] 版本选择 + 数量上限
 * 用现有 token（--card/--line/--primary），不引入新色，避免跟面板其它区块不协调
 * ======================================================================== */
.edition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.edition-card {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(148, 163, 184, 0.04);
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s;
}
.edition-card:hover { border-color: rgba(59, 130, 246, 0.55); background: rgba(59, 130, 246, 0.07); }
.edition-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.edition-card.is-current {
  border-color: rgba(59, 130, 246, 0.7);
  background: rgba(59, 130, 246, 0.1);
  cursor: default;
}
.edition-card.is-current:hover { background: rgba(59, 130, 246, 0.1); }
.edition-card.is-disabled { opacity: 0.45; cursor: not-allowed; }
.edition-card.is-disabled:hover { border-color: var(--line); background: rgba(148, 163, 184, 0.04); }

.edition-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.edition-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.edition-desc { margin-top: 6px; font-size: 11.5px; line-height: 1.6; color: var(--text-dim); }

.pill-ok {
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 999px;
  color: #7dd3fc;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.32);
  white-space: nowrap;
}

.limits-grid { display: grid; gap: 10px; margin-top: 4px; }
.limit-row {
  display: grid;
  grid-template-columns: 150px 110px 1fr;
  align-items: center;
  gap: 10px;
}
.limit-label { font-size: 12.5px; color: var(--text-dim); }
.limit-hint { font-size: 11.5px; }

.panel-actions { margin-top: 12px; display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 720px) {
  .limit-row { grid-template-columns: 1fr; gap: 4px; }
}

/* 12 个模块两列排，否则一行一个要把版本/上限面板推到屏幕外 */
.module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 22px;
}
.module-grid .switch-row { padding: 9px 0; }
@media (max-width: 1000px) {
  .module-grid { grid-template-columns: 1fr; }
}

/* 模块开关上的「开发中」标记（后端闸门还没实现，不能让销售以为关得掉） */
.pill-warn {
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 999px;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.32);
  white-space: nowrap;
}

/* ==========================================================================
 * 切版本二次确认弹窗（2026-12-04）
 * 用户明确要求：切版本必须把「会发生什么」完整摆出来，不能一句话带过。
 * ======================================================================== */
.consequence.success {
  background: rgba(16, 185, 129, 0.09);
  border-color: rgba(16, 185, 129, 0.26);
  color: #a7f3d0;
}

.tag {
  display: inline-block;
  font-size: 11.5px;
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1.6;
}
.tag-mute {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.plain-list {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--text-dim);
}
.plain-list li { list-style: disc; }

.kv-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 16px;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 6px;
}
.kv-list b { color: var(--text); font-variant-numeric: tabular-nums; }
