/* Linknlink AI Platform —— 暗色 glass 风格（参照 codexproxy 设计语言）
   设计 token：
   - 背景：深蓝紫 #0a0f1d + 蓝紫双光晕径向渐变
   - 卡片：半透明玻璃 + backdrop-filter blur + 顶部高光线
   - 主色：蓝 #3b82f6  辅色：紫 #8b5cf6  渐变 brand
   - 字体：Inter（CDN preconnect）+ -apple-system 兜底
*/

:root {
  --bg-dark:        #0a0f1d;
  --bg-card:        rgba(30, 41, 59, 0.55);
  --surface-2:      rgba(255, 255, 255, 0.035);
  --surface-hover:  rgba(255, 255, 255, 0.06);
  --text-main:      #f1f5f9;
  --text-muted:     #94a3b8;
  --text-faint:     #64748b;
  --primary:        #3b82f6;
  --primary-hover:  #2563eb;
  --accent:         #8b5cf6;
  --danger:         #ef4444;
  --success:        #34d399;
  --warn:           #fb923c;
  --border:         rgba(148, 163, 184, 0.14);
  --border-strong:  rgba(148, 163, 184, 0.26);
  --shadow-soft:    0 1px 2px rgba(0,0,0,.2), 0 8px 24px rgba(0,0,0,.22);
  --radius:         16px;
  --radius-sm:      10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  color: var(--text-main);
  background: var(--bg-dark);
  background-image:
    radial-gradient(circle at 78% -10%, rgba(59, 130, 246, 0.14), transparent 42%),
    radial-gradient(circle at 12% 108%, rgba(139, 92, 246, 0.10), transparent 45%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
  margin: 0;
  padding: 0;
}
#app.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 15px;
}

.admin-balance-gift-page .settings-section {
  margin-bottom: 18px;
}
.admin-balance-card .row {
  align-items: center;
}
.admin-balance-card .row label {
  width: 142px;
}
.admin-balance-card .row input {
  flex: 1 1 220px;
  min-width: 220px;
}
.admin-balance-card .row button {
  flex: 0 0 auto;
}
.admin-balance-result {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--text-muted);
}
.admin-balance-result strong {
  color: var(--success);
  font-size: 1.25rem;
}
.admin-balance-history-scroll {
  overflow-x: auto;
}
.admin-balance-history-table {
  min-width: 760px;
}
.admin-balance-history-table th,
.admin-balance-history-table td {
  white-space: nowrap;
  vertical-align: top;
  padding: 10px 10px;
}
.admin-balance-history-table td:nth-child(2) {
  white-space: normal;
  min-width: 180px;
}
.admin-balance-history-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-balance-history-actions input {
  width: 220px;
  min-width: 180px;
}
@media (max-width: 700px) {
  .admin-balance-card .row label {
    width: 100%;
  }
  .admin-balance-card .row input,
  .admin-balance-card .row button {
    width: 100%;
    min-width: 0;
  }
  .admin-balance-history-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .admin-balance-history-actions input {
    flex: 1 1 180px;
    width: auto;
  }
}
.lang-switcher {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
}
.shell .lang-switcher {
  position: static;
  z-index: auto;
  box-shadow: none;
  flex-shrink: 0;
}
.lang-switcher select {
  min-width: 120px;
  width: auto;
  margin: 0;
  padding: 6px 10px;
}

/* ===== 顶部导航 ===== */
.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 18px;
  margin-bottom: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0)), var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
  position: relative;
}
.nav::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
  pointer-events: none;
}
.nav::after {
  content: 'Linknlink AI Platform';
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .3px;
  margin-right: 18px;
  background: linear-gradient(90deg, #60a5fa, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  order: -1;
}
.nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .18s, color .18s;
}
.nav a:hover { color: var(--text-main); background: var(--surface-hover); }
.nav a.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(59,130,246,.22), rgba(139,92,246,.10));
  box-shadow: inset 0 0 0 1px rgba(99,102,241,.25);
}
.nav .right {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav .right a { padding: 4px 10px; font-size: 12.5px; }

/* ===== 卡片 ===== */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,0)), var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 20px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
  animation: fadeIn .3s ease;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
  pointer-events: none;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

h2 {
  margin: 0 0 18px;
  font-weight: 650;
  font-size: 1.15rem;
  letter-spacing: -.01em;
  color: var(--text-main);
}

/* ===== 表单行 ===== */
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 10px 0;
  flex-wrap: wrap;
}
.row label {
  width: 88px;
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 13px;
}

input, select, textarea {
  font: inherit;
  padding: 9px 12px;
  background: rgba(2, 6, 23, .45);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-main);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  min-width: 160px;
}
input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  padding: 0;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--primary);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
textarea { resize: vertical; min-height: 64px; width: 100%; min-width: 280px; }

button {
  font: inherit;
  padding: 9px 16px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  transition: box-shadow .18s, transform .12s, background .18s;
  box-shadow: 0 4px 14px rgba(59,130,246,.30);
}
button:hover { box-shadow: 0 6px 20px rgba(59,130,246,.45); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
button.ghost {
  background: var(--surface-hover);
  color: var(--text-main);
  border: 1px solid var(--border);
  box-shadow: none;
}
button.ghost:hover {
  background: rgba(255,255,255,.12);
  border-color: var(--border-strong);
  box-shadow: none;
}

/* ===== 表格 ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 13px;
}
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: transparent;
}
.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.sort-header-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
.sortable-th:hover,
.sortable-th.active {
  color: var(--text-main);
}
.sort-arrow {
  color: var(--text-faint);
  font-size: 10px;
  line-height: 1;
  transition: color .15s, transform .15s;
}
.sortable-th:hover .sort-arrow,
.sortable-th.active .sort-arrow {
  color: var(--primary);
}
.sortable-th:hover .sort-arrow {
  transform: translateY(-1px);
}
tbody tr { transition: background .15s; }
tbody tr:hover td { background: var(--surface-2); }
tr:last-child td { border-bottom: none; }
td button { padding: 5px 12px; font-size: 12px; box-shadow: none; }
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(2, 6, 23, .18);
}
.pager-info {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}
.pager-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.pager-jump {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
}
.pager-page-input {
  width: 72px;
  min-width: 72px;
  margin: 0;
}
.pager-actions select {
  width: auto;
  min-width: 86px;
  margin: 0;
}
.pager-actions button {
  min-height: 34px;
}

/* ===== 标签 ===== */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid transparent;
}
.tag.pending  { background: rgba(251,146,60,.12);  color: var(--warn);    border-color: rgba(251,146,60,.30); }
.tag.approved { background: rgba(52,211,153,.12);  color: var(--success); border-color: rgba(52,211,153,.30); }
.tag.rejected { background: rgba(239,68,68,.12);   color: var(--danger);  border-color: rgba(239,68,68,.30); }
.tag.danger   { background: rgba(239,68,68,.12);   color: var(--danger);  border-color: rgba(239,68,68,.30); }
.tag.disabled { background: rgba(148,163,184,.12); color: var(--text-muted); border-color: var(--border); }

/* ===== Claude Guard Admin ===== */
.admin-guard-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.admin-guard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.admin-guard-head h2 {
  margin-bottom: 4px;
}
.guard-filter-panel {
  border: 1px solid var(--border);
  background: rgba(15,23,42,.22);
  border-radius: 8px;
  padding: 14px;
}
.guard-filter-title {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.guard-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}
.guard-filter-grid .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}
.guard-filter-grid .field span {
  font-size: 12px;
  color: var(--text-muted);
}
.guard-filter-grid input,
.guard-filter-grid select {
  min-height: 38px;
}
.guard-query-btn {
  min-height: 38px;
}
.guard-result-wrap {
  margin-top: 0;
}
.guard-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.guard-summary-card {
  border: 1px solid var(--border);
  background: rgba(15,23,42,.18);
  border-radius: 8px;
  padding: 14px;
}
.guard-summary-card span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.guard-summary-card strong {
  font-size: 20px;
}
.guard-summary-card.danger strong {
  color: var(--danger);
}
.guard-record-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.guard-record {
  border: 1px solid var(--border);
  background: rgba(15,23,42,.18);
  border-radius: 8px;
  padding: 14px;
}
.guard-record-compact {
  display: grid;
  grid-template-columns: 150px 180px minmax(180px, 1fr) minmax(180px, 1.5fr) minmax(150px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
}
.guard-compact-time,
.guard-compact-request {
  color: var(--text-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.guard-compact-client,
.guard-compact-account,
.guard-compact-reasons {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.guard-compact-account {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.guard-compact-reasons {
  overflow: hidden;
}
.guard-compact-reasons .tag {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.guard-record-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.guard-record-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.guard-record-actions {
  color: var(--text-muted);
  text-align: right;
  word-break: break-all;
}
.guard-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.guard-info-block {
  min-width: 0;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 8px;
  padding: 10px;
  background: rgba(2,6,23,.14);
}
.guard-info-block span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.guard-info-block strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.guard-reason-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.guard-reason-title {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 6px;
}
@media (max-width: 1100px) {
  .guard-filter-grid,
  .guard-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .admin-guard-head,
  .guard-record-top {
    flex-direction: column;
  }
  .guard-record-compact {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .guard-filter-grid,
  .guard-summary-grid,
  .guard-info-grid,
  .guard-reason-row {
    grid-template-columns: 1fr;
  }
}

/* ===== 错误 / 辅助 ===== */
.error {
  color: #fca5a5;
  background: rgba(239,68,68,.10);
  border: 1px solid rgba(239,68,68,.30);
  border-radius: 9px;
  padding: 10px 14px;
  margin: 10px 0 16px;
  font-size: 13px;
}
.muted { color: var(--text-faint); font-size: 12.5px; }

/* ===== 登录卡片居中 ===== */
#app:has(> .card:only-child) { display: flex; align-items: center; justify-content: center; }
#app > .card:only-child { max-width: 460px; width: 100%; }

/* ===== 响应式 ===== */
@media (max-width: 720px) {
  #app { padding: 16px 14px 48px; }
  .activation-code-row { grid-template-columns: 1fr; }
  .nav { flex-wrap: wrap; padding: 12px 14px; }
  .nav::after { width: 100%; margin-bottom: 6px; }
  .nav .right { width: 100%; margin-left: 0; justify-content: flex-end; }
  .row label { width: 100%; }
  table { font-size: 12px; }
  th, td { padding: 10px 8px; }
  .api-key-list-controls {
    display: grid;
    grid-template-columns: 1fr;
  }
  .pager {
    align-items: stretch;
    flex-direction: column;
  }
  .pager-actions {
    justify-content: flex-start;
  }
}

/* ========== 登录页（参照 codexproxy auth-card） ========== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)), var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px 32px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 60px rgba(0,0,0,.45), 0 0 0 1px rgba(99,102,241,.12);
  position: relative;
}
.auth-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
}
.auth-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 8px 24px rgba(59,130,246,.40);
  color: #fff;
}
.auth-logo svg { width: 28px; height: 28px; }
.auth-brand {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .3px;
  background: linear-gradient(90deg, #60a5fa, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}
.auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 24px;
}
.auth-tabs {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 22px;
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 9px 14px;
  border-radius: 9px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .18s, color .18s;
}
.auth-tab:hover { color: var(--text-main); }
.auth-tab.active {
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff;
  box-shadow: 0 4px 14px rgba(59,130,246,.30);
}
.login-mode-tabs {
  display: flex;
  gap: 18px;
  margin: 0 0 14px;
  font-size: 13px;
}
.login-mode {
  cursor: pointer;
  color: var(--text-muted);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color .18s, border-color .18s;
}
.login-mode:hover { color: var(--text-main); }
.login-mode.active { color: var(--primary); border-bottom-color: var(--primary); }

.auth-field {
  position: relative;
  margin-bottom: 14px;
}
.auth-field .field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-faint);
  pointer-events: none;
}
.auth-field input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  background: rgba(2, 6, 23, .5);
  border: 1px solid var(--border);
  border-radius: 11px;
  font-size: 14px;
  min-width: 0;
}
.auth-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}

/* 密码明文/密文切换眼睛 */
.auth-field input.has-eye {
  padding-right: 40px;
}
.auth-field .field-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-faint);
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color .15s;
}
.auth-field .field-eye:hover { color: var(--text-main); }
.auth-field .field-eye svg { width: 18px; height: 18px; }

.code-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

/* 手机号与国家码 */
.phone-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.phone-row .cc-input {
  width: 86px;
  flex-shrink: 0;
  padding: 12px 12px;
  background: rgba(2, 6, 23, .5);
  border: 1px solid var(--border);
  border-radius: 11px;
  font-size: 14px;
  text-align: center;
}
.phone-row .cc-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}
.phone-row .phone-field {
  flex: 1;
  margin-bottom: 0;
}
.code-row input {
  flex: 1;
  padding: 12px 14px;
  background: rgba(2, 6, 23, .5);
  border: 1px solid var(--border);
  border-radius: 11px;
  font-size: 14px;
}
.code-row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}
.code-row button {
  flex-shrink: 0;
  padding: 0 16px;
  background: var(--surface-hover);
  color: var(--text-main);
  border: 1px solid var(--border);
  box-shadow: none;
  white-space: nowrap;
}
.code-row button:hover {
  background: rgba(255,255,255,.12);
  border-color: var(--border-strong);
}

.auth-submit {
  width: 100%;
  padding: 13px;
  font-size: 14.5px;
  font-weight: 600;
  margin-top: 6px;
}
.auth-switch {
  text-align: center;
  margin-top: 16px;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.auth-switch:hover { text-decoration: underline; }

.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  backdrop-filter: blur(14px);
  color: var(--text-main);
  font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  z-index: 1000;
  animation: toastIn .25s ease;
}
.toast.error { border-color: rgba(239,68,68,.40); color: #fca5a5; }
.toast.success { border-color: rgba(52,211,153,.40); color: var(--success); }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ========== 已登录态：header + sidebar 布局 ========== */
.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0)), var(--bg-card);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.topbar-logo {
  width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 4px 14px rgba(59,130,246,.32);
}
.topbar-logo svg { width: 18px; height: 18px; }
.topbar-brand {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .3px;
  background: linear-gradient(90deg, #60a5fa, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
}
.topbar-right > button {
  flex-shrink: 0;
  white-space: nowrap;
}
.btn-apply-partner {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid rgba(139, 92, 246, .35);
  background: linear-gradient(135deg, rgba(59,130,246,.18), rgba(139,92,246,.22));
  color: #e0e7ff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(139,92,246,.18);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.btn-apply-partner:hover {
  transform: translateY(-1px);
  border-color: rgba(139, 92, 246, .55);
  box-shadow: 0 6px 18px rgba(139,92,246,.30);
}
.topbar-user { color: var(--text-main); }
.topbar-logout {
  color: var(--text-muted);
  text-decoration: none;
}
.topbar-logout:hover { color: var(--primary); }

.shell-body {
  flex: 1;
  display: flex;
  align-items: stretch;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 24px;
  gap: 24px;
}
.sidebar {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0)), var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  align-self: stretch;
  min-height: calc(100vh - 88px - 48px);
  position: sticky;
  top: 88px;
}
.sidebar .sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar .menu-item {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sidebar .menu-item:hover { background: var(--surface-hover); color: var(--text-main); }
.sidebar .menu-item.active {
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff;
  box-shadow: 0 4px 14px rgba(59,130,246,.30);
}
.content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 内容卡片内的创建表单一行 */
.create-row {
  display: flex;
  gap: 10px;
  margin: 8px 0 18px;
  flex-wrap: wrap;
}
.create-row input { flex: 1; min-width: 180px; }

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.section-head h2 {
  margin-bottom: 6px;
}
.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: rgba(2, 6, 23, .28);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.inline-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) minmax(100px, 140px) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  margin: 0 0 16px;
  background: rgba(2, 6, 23, .32);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.inline-form.compact {
  grid-template-columns: minmax(220px, 1fr) minmax(140px, 180px) auto;
}
.inline-form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12.5px;
}
.inline-form .field input {
  width: 100%;
  min-width: 0;
}
.inline-form .field-sm {
  max-width: 160px;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.notice {
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, .30);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
}
.notice.danger {
  color: #fca5a5;
  background: rgba(239, 68, 68, .08);
  border-color: rgba(239, 68, 68, .28);
}
.notice strong {
  margin-right: 4px;
  color: var(--text-main);
}
.table-wrap {
  overflow-x: auto;
}
.activation-code-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
}
.activation-code-row input {
  width: 100%;
  margin: 0;
}
.activation-check-result {
  min-height: 28px;
  margin: 4px 0 12px;
}
.activation-result-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--text-muted);
}
.product-type-admin-panel {
  display: grid;
  gap: 14px;
}
.empty-state {
  padding: 22px 16px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
  background: rgba(2, 6, 23, .24);
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.hourly-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.subsection-title {
  margin: 0 0 12px;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 600;
}
.table-search {
  width: 100%;
  max-width: 320px;
  margin: 0 0 12px;
}
.api-key-list-controls {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin: 0 0 14px;
  background: rgba(2, 6, 23, .28);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.api-key-list-controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
  color: var(--text-muted);
  font-size: 12.5px;
}
.api-key-list-controls select {
  width: 100%;
  min-width: 0;
  margin: 0;
}
.api-key-list-controls input {
  width: 100%;
  min-width: 0;
  margin: 0;
}
.api-key-usage-panel {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(2, 6, 23, .20);
}
.api-benefits-card { overflow: hidden; }
.api-benefits-content { display: flex; flex-direction: column; gap: 14px; }
.api-benefits-title { margin: 0 !important; }
.api-benefit-owner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(2, 6, 23, .18);
}
.api-benefit-owner-label { flex: 0 0 auto; color: var(--text-muted); font-size: 12px; }
.api-benefit-owner-value { min-width: 0; overflow-wrap: anywhere; color: var(--text-main); font-size: 12.5px; }
.api-benefit-discount-panel {
  display: grid;
  grid-template-columns: auto auto;
  gap: 12px 18px;
  align-items: center;
  justify-content: start;
  padding: 16px;
  border: 1px solid rgba(96, 165, 250, .38);
  border-radius: 12px;
  background: rgba(37, 99, 235, .08);
}
.api-benefit-discount-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.api-benefit-active-badge {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  color: #bbf7d0;
  background: rgba(22, 163, 74, .18);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.api-benefit-metrics { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(110px, auto); gap: 14px 28px; min-width: 0; }
.api-benefit-metric { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.api-benefit-metric > span { color: var(--text-muted); font-size: 11px; }
.api-benefit-metric > strong { min-width: 0; color: var(--text-main); font-size: 14px; overflow-wrap: anywhere; }
.api-benefit-range > strong { color: var(--approved); font-size: 16px; }
.api-benefit-detail-button { min-height: 38px; padding: 8px 13px; white-space: nowrap; }
.api-benefit-description { grid-column: 1 / -1; margin: 0; color: var(--text-muted); font-size: 12.5px; }
.api-benefit-empty { padding: 14px 16px; border: 1px dashed var(--border); border-radius: 12px; color: var(--text-muted); background: rgba(2, 6, 23, .12); }
.api-benefit-bind-section { display: flex; flex-direction: column; gap: 7px; padding-top: 2px; }
.api-benefit-bind-label { color: var(--text-muted); font-size: 12px; font-weight: 600; }
.api-benefit-bind-form { display: grid; grid-template-columns: minmax(220px, 360px) max-content; gap: 9px; align-items: center; justify-content: start; }
.api-benefit-bind-form input { width: 100%; min-width: 0; min-height: 42px; margin: 0; }
.api-benefit-bind-form button { width: auto !important; min-height: 42px; margin: 0; padding-inline: 18px; white-space: nowrap; }
.api-model-discount-link {
  display: inline-flex;
  align-items: center;
  padding: 2px 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--primary);
  font: inherit;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}
.api-model-discount-link:hover { text-decoration: underline; }
.api-model-discount-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.api-key-discount-link { width: 100%; max-width: 210px; flex-direction: column; align-items: flex-start; gap: 2px; }
.api-key-discount-code { display: block; width: 100%; overflow: hidden; color: inherit; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.api-key-discount-range { color: var(--approved); font-size: 12px; font-weight: 700; white-space: nowrap; }
.api-model-discount-detail { min-width: min(420px, 75vw); }
.api-model-discount-table-wrap { max-height: min(58vh, 520px); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.api-model-discount-table { width: 100%; }
.api-model-discount-table thead { position: sticky; top: 0; z-index: 1; }
.api-model-discount-table th:last-child,
.api-model-discount-table td:last-child { width: 1%; white-space: nowrap; text-align: right; }
.api-model-discount-value { color: var(--approved); font-weight: 700; }
@media (max-width: 760px) {
  .api-benefit-discount-panel { grid-template-columns: 1fr; }
  .api-benefit-detail-button { justify-self: start; }
  .api-benefit-metrics { grid-template-columns: 1fr; gap: 10px; }
  .api-benefit-bind-form { grid-template-columns: 1fr; }
  .api-benefit-bind-form button { width: 100% !important; }
}
.recharge-amount-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.recharge-amount-btn {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(2, 6, 23, .24);
  color: var(--text-main);
  font-size: 18px;
  font-weight: 700;
  box-shadow: none;
}
.recharge-amount-btn.active {
  border-color: var(--primary);
  background: rgba(129, 140, 248, .12);
  color: #e0e7ff;
}

/* 操作列 */
.col-ops { white-space: nowrap; width: 1%; }
.col-ops .op {
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--text-main);
  box-shadow: none;
  margin-right: 6px;
  cursor: pointer;
}
.col-ops .op:last-child { margin-right: 0; }
.col-ops .op:hover { border-color: var(--border-strong); background: rgba(255,255,255,.10); }
.col-ops .op.danger { color: #fca5a5; border-color: rgba(239,68,68,.30); }
.col-ops .op.danger:hover { background: rgba(239,68,68,.14); border-color: rgba(239,68,68,.55); }

.mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--text-main);
}

/* ========== 弹窗 ========== */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(2, 6, 23, .68);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  animation: maskIn .18s ease;
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)), var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
  animation: cardIn .22s ease;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 12px;
}
.modal-title { font-size: 15px; font-weight: 600; color: var(--text-main); }
.modal-close {
  min-width: 30px; min-height: 30px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; box-shadow: none; font-size: 22px; line-height: 1; cursor: pointer;
  color: var(--text-muted);
}
.modal-close:hover { background: rgba(148, 163, 184, .12); color: var(--text-main); }
.modal-body { padding: 4px 22px 18px; }
.modal-body input,
.modal-body textarea {
  width: 100%;
  margin-top: 10px;
}
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12.5px;
}
.modal-form .field input {
  margin-top: 0;
}

.model-check-list {
  max-height: 220px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--border, #d9d9d9);
  border-radius: 8px;
}

.model-check-list .checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.model-check-list .checkbox-line input,
.admin-model-modal .field input[type="checkbox"] {
  width: auto;
  min-width: 16px;
  flex: 0 0 auto;
  margin: 0;
}
.field.field-checkbox {
  display: grid;
  grid-template-columns: max-content 16px;
  align-items: center;
  column-gap: 10px;
  min-width: 0;
}
.field.field-checkbox > span:first-child {
  min-width: 0;
}
.field.field-checkbox input[type="checkbox"] {
  grid-column: 2;
  grid-row: 1;
}
.field.field-checkbox .field-hint {
  grid-column: 1 / -1;
  grid-row: 2;
}

.model-check-list .checkbox-line span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 22px 18px;
}
.modal-foot button { min-width: 100px; }
.modal-foot button.danger {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  border: 1px solid rgba(239,68,68,.50);
  box-shadow: 0 4px 14px rgba(239,68,68,.32);
}

.voucher-users-modal-card {
  width: min(1120px, calc(100vw - 32px));
  max-width: 1120px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}
.voucher-users-modal-card .modal-body {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.voucher-users-modal-body {
  min-height: 0;
}
.voucher-users-table-wrap {
  max-height: min(560px, calc(100vh - 230px));
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.voucher-users-table-wrap table {
  min-width: 860px;
}
.voucher-users-table-wrap th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef2f7;
  color: #111827;
  border-bottom-color: #cbd5e1;
}
.voucher-users-table-wrap td:nth-child(1) {
  min-width: 180px;
}
.voucher-users-table-wrap td:nth-child(3) {
  min-width: 220px;
}
.voucher-users-table-wrap td:nth-child(2),
.voucher-users-table-wrap td:nth-child(4) {
  white-space: nowrap;
}
.voucher-users-modal-body .empty-state {
  background: #f8fafc;
  color: #111827;
  border-color: #cbd5e1;
}
.modal-tip {
  font-size: 12.5px;
  color: var(--text-muted);
  background: rgba(251,146,60,.10);
  border: 1px solid rgba(251,146,60,.30);
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.key-show {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(2, 6, 23, .55);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.key-show code {
  flex: 1;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: #93c5fd;
  word-break: break-all;
}
.btn-copy {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: 12.5px;
  border-radius: 8px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text-main);
  box-shadow: none;
  cursor: pointer;
}
.btn-copy:hover { background: rgba(255,255,255,.12); border-color: var(--border-strong); }

/* ===== Admin pricing compact editor ===== */
.admin-pricing-page {
  overflow: hidden;
}
.pricing-help {
  margin-bottom: 14px;
  max-width: 880px;
}
.pricing-toolbar,
.pricing-section-head,
.pricing-card-head,
.pricing-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pricing-toolbar,
.pricing-section-head {
  margin: 10px 0 12px;
}
.pricing-section {
  margin-top: 18px;
}
.pricing-section h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 650;
  color: var(--text-main);
}
.pricing-section-title {
  font-size: 15px;
  font-weight: 650;
  color: var(--text-main);
}
.pricing-add-form,
.pricing-grid {
  display: grid;
  gap: 12px;
}
.pricing-add-form {
  grid-template-columns: minmax(120px, 160px) minmax(120px, 150px) minmax(220px, 1fr) minmax(160px, 220px) auto;
  align-items: end;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, .24);
}
.pricing-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.pricing-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(15, 23, 42, .28);
}
.pricing-card-head {
  margin-bottom: 12px;
}
.pricing-model-id {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #93c5fd;
  font-size: 13px;
}
.pricing-fields {
  display: grid;
  gap: 10px;
}
.upstream-fields {
  grid-template-columns: minmax(96px, .7fr) minmax(180px, 1.4fr);
}
.upstream-fields label:nth-child(3),
.upstream-fields label:nth-child(4) {
  grid-column: 1 / -1;
}
.price-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.pricing-add-form label,
.pricing-fields label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--text-muted);
  font-size: 12px;
}
.pricing-add-form input,
.pricing-fields input {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
}
.pricing-fields em {
  color: var(--text-faint);
  font-style: normal;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pricing-form-actions,
.pricing-card-actions {
  margin-top: 12px;
}
.pricing-card-actions {
  justify-content: flex-end;
}
.pricing-form-actions button,
.pricing-card-actions button {
  min-height: 36px;
}
.admin-models-page .pricing-toolbar {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 42, .30);
}
.admin-models-page .pricing-help {
  margin-bottom: 10px;
}
.admin-models-page .pricing-section {
  margin-top: 14px;
}
.admin-model-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
}

.slowdown-peak-read-grid {
  display: grid;
  grid-template-columns: minmax(260px, .75fr) minmax(280px, 1fr);
  gap: 12px;
  margin-top: 12px;
}
.slowdown-peak-read-card {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(2, 6, 23, .16);
}
.slowdown-peak-read-card > span,
.slowdown-configured-info span {
  display: block;
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 12px;
}
.slowdown-peak-read-card strong,
.slowdown-configured-info strong {
  color: var(--text-main);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.slowdown-peak-read-card p {
  margin: 0;
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.55;
}
.slowdown-chip-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.slowdown-chip-list strong,
.slowdown-model-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(15, 23, 42, .28);
  color: var(--text-main);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.2;
}
.slowdown-model-chip.ok {
  border-color: rgba(34, 197, 94, .32);
  background: rgba(22, 163, 74, .10);
}
.slowdown-model-chip-list {
  margin-top: 12px;
}
.slowdown-configured-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.slowdown-configured-info > div {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(2, 6, 23, .14);
}
.slowdown-rule-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}
.slowdown-rule-identity {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.slowdown-rule-name {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.slowdown-rule-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.slowdown-flow-step {
  min-width: 0;
  position: relative;
  padding: 12px;
  border: 1px solid rgba(59, 130, 246, .28);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(59, 130, 246, .13), rgba(15, 23, 42, .12));
}
.slowdown-flow-step.warn {
  border-color: rgba(245, 158, 11, .35);
  background: linear-gradient(180deg, rgba(245, 158, 11, .15), rgba(15, 23, 42, .12));
}
.slowdown-flow-step.muted {
  border-color: var(--border);
  background: rgba(2, 6, 23, .12);
}
.slowdown-flow-step span,
.slowdown-rule-meta-row span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.3;
}
.slowdown-flow-step strong {
  display: block;
  margin-top: 7px;
  color: var(--text-main);
  font-size: 18px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -.01em;
}
.slowdown-flow-step em {
  display: inline-flex;
  margin-top: 9px;
  min-height: 28px;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .28);
  color: var(--text-main);
  font-style: normal;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.slowdown-rule-meta-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.slowdown-rule-meta-row > div {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(2, 6, 23, .14);
}
.slowdown-rule-meta-row strong {
  display: block;
  margin-top: 5px;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 750;
}
.slowdown-axis-marker::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 12px;
  width: 1px;
  height: 112px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255,255,255,.72), rgba(148,163,184,.18));
  pointer-events: none;
}
.slowdown-axis-label-bubble {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(15, 23, 42, .94);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(2, 6, 23, .24);
  white-space: nowrap;
}
.slowdown-modal-delay-panel {
  padding: 14px;
  margin-top: 0;
}
.slowdown-modal-delay-panel .slowdown-axis-wrap {
  padding-top: 52px;
}
.slowdown-modal-delay-panel .slowdown-node-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.slowdown-modal-delay-panel .slowdown-field {
  margin: 12px 0 0;
}
.slowdown-modal-delay-panel .slowdown-node-card {
  position: relative;
  padding: 15px 16px;
}
.slowdown-modal-delay-panel .slowdown-node-title {
  font-size: 12.5px;
  letter-spacing: -.01em;
}
.slowdown-modal-delay-panel .slowdown-node-range {
  margin-bottom: 12px;
}
.slowdown-modal-delay-panel .slowdown-node-card .slowdown-hint {
  margin-top: 8px;
  min-height: 34px;
  font-size: 11.5px;
  line-height: 1.45;
}
.slowdown-modal-delay-panel .slowdown-node-card + .slowdown-node-card::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--border), transparent);
}
.slowdown-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.slowdown-status-card,
.slowdown-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(15, 23, 42, .24);
  padding: 14px;
}
.slowdown-status-card.ok {
  border-color: rgba(34, 197, 94, .32);
  background: rgba(22, 163, 74, .08);
}
.slowdown-status-card.warn {
  border-color: rgba(245, 158, 11, .35);
  background: rgba(245, 158, 11, .08);
}
.slowdown-status-card.muted-card {
  background: rgba(15, 23, 42, .16);
}
.slowdown-status-label {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.slowdown-status-value {
  color: var(--text-main);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}
.slowdown-enable-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}
.slowdown-enable-actions {
  display: inline-flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(2, 6, 23, .18);
}
.slowdown-enable-actions button {
  min-width: 58px;
  min-height: 34px;
  padding: 7px 12px;
}
.slowdown-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  align-items: start;
  margin-top: 16px;
}
.slowdown-peak-grid {
  grid-template-columns: 1fr;
}
.slowdown-peak-panel h3 {
  margin-bottom: 4px;
}
.slowdown-peak-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(260px, .85fr);
  gap: 14px;
  align-items: stretch;
  margin-top: 12px;
}
.slowdown-peak-layout .slowdown-field {
  margin-bottom: 0;
}
.slowdown-peak-layout textarea {
  min-height: 140px;
}
.slowdown-peak-guide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.slowdown-peak-item {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(2, 6, 23, .16);
}
.slowdown-peak-item.wide {
  grid-column: 1 / -1;
}
.slowdown-peak-item span {
  display: block;
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 12px;
}
.slowdown-peak-item strong {
  display: block;
  color: var(--text-main);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.slowdown-peak-item p {
  margin: 0;
  color: var(--text-main);
  font-size: 12px;
  line-height: 1.55;
}
.slowdown-delay-panel {
  margin-top: 14px;
  --slowdown-l1: 40%;
  --slowdown-l2: 80%;
}
.slowdown-model-panel {
  margin-top: 14px;
}
.slowdown-delay-toolbar {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(220px, 300px);
  gap: 14px;
  align-items: end;
  margin-top: 14px;
}
.slowdown-model-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.slowdown-model-actions,
.slowdown-configured-card .pricing-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.slowdown-panel h3 {
  margin: 0 0 12px;
}
.slowdown-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 12px;
}
.slowdown-field > span:first-child {
  font-weight: 650;
  color: var(--text-main);
}
.slowdown-field input,
.slowdown-field textarea {
  width: 100%;
  min-width: 0;
}
.slowdown-field textarea {
  min-height: 98px;
  resize: vertical;
}
.slowdown-hint {
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.45;
}
.slowdown-checkline {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin: 10px 0;
  color: var(--text-muted);
}
.slowdown-checkline input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}
.slowdown-checkline strong {
  display: block;
  color: var(--text-main);
  font-size: 13px;
}
.slowdown-range {
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr) auto minmax(80px, 1fr);
  gap: 8px;
  align-items: center;
}
.slowdown-range span {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}
.slowdown-notice {
  margin: 14px 0;
}
.slowdown-threshold-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.slowdown-node-grid {
  display: grid;
  grid-template-columns: var(--slowdown-l1) calc(var(--slowdown-l2) - var(--slowdown-l1)) calc(100% - var(--slowdown-l2));
  gap: 0;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.slowdown-axis-wrap {
  margin: 24px 0 8px;
  padding: 78px 0 0;
}
.slowdown-axis-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(148, 163, 184, .36), rgba(59, 130, 246, .42), rgba(245, 158, 11, .52));
}
.slowdown-axis-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.slowdown-axis-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 58px;
  color: var(--text-main);
  font-size: 11px;
  font-weight: 700;
  pointer-events: auto;
  z-index: 1;
}
.slowdown-marker-control {
  position: absolute;
  bottom: 22px;
  width: 132px;
  padding: 8px;
  border: 1px solid rgba(59, 130, 246, .34);
  border-radius: 10px;
  background: rgba(15, 23, 42, .94);
  box-shadow: 0 8px 24px rgba(2, 6, 23, .28);
}
.slowdown-axis-marker.level2 .slowdown-marker-control {
  border-color: rgba(245, 158, 11, .42);
}
.slowdown-marker-control > span:first-child {
  display: block;
  margin-bottom: 6px;
  color: var(--text-main);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}
.slowdown-percent-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
}
.slowdown-percent-input input {
  width: 100%;
  min-width: 0;
  padding: 6px 7px;
  text-align: right;
}
.slowdown-percent-input span {
  color: var(--text-muted);
  font-size: 12px;
}
.slowdown-axis-dot {
  width: 18px;
  height: 18px;
  border: 3px solid var(--bg-card);
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 1px var(--border-strong);
}
.slowdown-axis-marker.level2 .slowdown-axis-dot {
  background: #f59e0b;
}
.slowdown-axis-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--text-faint);
  font-size: 11px;
}
.slowdown-node-card {
  min-width: 0;
  padding: 13px;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: rgba(2, 6, 23, .18);
}
.slowdown-node-card:last-child {
  border-right: 0;
}
.slowdown-node-card.warn {
  border-color: var(--border);
  background: rgba(245, 158, 11, .07);
}
.slowdown-node-card.muted-card {
  background: rgba(15, 23, 42, .12);
}
.slowdown-node-title {
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
}
.slowdown-node-range {
  margin: 4px 0 10px;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}
.slowdown-node-delay {
  min-height: 36px;
  display: flex;
  align-items: center;
  color: var(--text-main);
  font-weight: 650;
}
.slowdown-rule-section {
  margin-top: 20px;
}
.slowdown-rule-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin: 12px 0;
}
.slowdown-rule-toolbar .slowdown-field {
  width: min(360px, 100%);
  margin-bottom: 0;
}
.slowdown-rules-grid {
  display: grid;
  gap: 12px;
}
.slowdown-rule-card {
  margin-bottom: 0;
}
.slowdown-rule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.slowdown-actions {
  display: flex;
  justify-content: flex-end;
}
.slowdown-configured-grid {
  display: grid;
  gap: 10px;
}
.slowdown-rule-modal-card {
  max-width: min(960px, calc(100vw - 36px));
}
.slowdown-rule-modal-wide {
  width: 100%;
}
.slowdown-modal-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}
.slowdown-modal-basics {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(2, 6, 23, .12);
}
.slowdown-seconds-range {
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.slowdown-delay-value {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  height: 38px;
  border: 1px solid rgba(96, 165, 250, .28);
  border-radius: 12px;
  background: rgba(15, 23, 42, .2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.slowdown-delay-value:focus-within {
  border-color: rgba(96, 165, 250, .72);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .14), inset 0 1px 0 rgba(255,255,255,.08);
  background: rgba(15, 23, 42, .28);
}
.slowdown-delay-value input {
  min-width: 0;
  height: 100%;
  padding: 8px 8px 8px 10px;
  border: 0;
  background: transparent;
  text-align: right;
  font-weight: 760;
  color: var(--text-main);
  box-shadow: none;
}
.slowdown-delay-value input:focus {
  outline: none;
  box-shadow: none;
}
.slowdown-delay-value span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-width: 30px;
  padding: 0 9px;
  border-left: 1px solid rgba(96, 165, 250, .22);
  background: rgba(59, 130, 246, .14);
  color: #bfdbfe;
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: .02em;
}
.slowdown-seconds-range .slowdown-range-separator {
  position: relative;
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, .7), transparent);
}
.slowdown-seconds-range .slowdown-range-separator::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: rgba(148, 163, 184, .9);
}
.slowdown-rule-modal-card .modal-body {
  overflow-x: auto;
}
.slowdown-rule-modal-card .modal-foot {
  justify-content: flex-end;
}
.slowdown-rule-modal {
  gap: 14px;
}
.slowdown-rule-modal select {
  width: 100%;
  min-width: 0;
}
.slowdown-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.slowdown-modal-check {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(2, 6, 23, .14);
}
.model-read-card .pricing-card-head {
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 9px;
}
.admin-models-page .pricing-card {
  padding: 11px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, .34);
}
.admin-models-page .pricing-section-head {
  margin: 8px 0 10px;
}
.admin-models-page .pricing-section h3 {
  font-size: 14px;
}
.admin-models-page .pricing-model-id {
  color: #bfdbfe;
  font-size: 12.5px;
  font-weight: 750;
}
.model-read-card .muted {
  font-size: 12px;
  line-height: 1.35;
}
.model-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  flex-shrink: 0;
}
.model-card-actions button,
.admin-models-page .pricing-card-head button {
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.model-read-grid,
.model-price-read {
  display: grid;
  gap: 6px;
}
.model-read-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.model-read-grid .wide {
  grid-column: 1 / -1;
}
.model-kv {
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(2, 6, 23, .32);
}
.model-kv span {
  display: block;
  margin-bottom: 3px;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 650;
}
.model-kv strong {
  display: block;
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-price-read .model-kv strong {
  color: #93c5fd;
}
.model-price-read .image-model-enabled-status.enabled strong {
  color: #34d399;
}
.model-price-read .image-model-enabled-status.disabled {
  border-color: rgba(239, 68, 68, .45);
  background: rgba(239, 68, 68, .10);
}
.model-price-read .image-model-enabled-status.disabled strong {
  color: #fca5a5;
}
.empty-state {
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  color: var(--text-muted);
  background: rgba(15, 23, 42, .20);
}
.admin-model-modal .modal-section-title {
  padding-top: 0;
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 750;
}
.admin-model-modal-card {
  width: min(920px, calc(100vw - 32px));
  max-width: 920px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}
.admin-model-modal-card .modal-body {
  min-height: 0;
  overflow: auto;
  padding-bottom: 14px;
}
.admin-model-modal-card .modal-foot {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.admin-model-modal {
  gap: 10px;
}
.admin-model-section {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(2, 6, 23, .20);
}
.admin-model-field-grid,
.admin-model-price-grid {
  display: grid;
  gap: 9px;
}
.admin-model-field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.admin-model-field-grid .field:nth-child(3),
.admin-model-field-grid .field:nth-child(4),
.admin-model-field-grid .field:nth-child(5),
.admin-model-field-grid.release-grid .field:nth-child(2) {
  grid-column: 1 / -1;
}
.admin-model-price-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.admin-model-modal .field {
  min-width: 0;
}
.admin-model-modal .field input,
.admin-model-modal .field select,
.admin-model-modal .field textarea {
  width: 100%;
  min-width: 0;
  margin-top: 0;
}
.admin-model-modal .field.field-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  padding: 0;
  margin: 0;
}
.admin-model-modal textarea {
  min-height: 68px;
}
.plan-config-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.image-model-field-grid,
.image-model-rate-grid {
  display: grid;
  gap: 9px;
}
.image-model-field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.image-model-rate-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.image-model-release-grid .field:last-child {
  grid-column: 1 / -1;
}
.image-model-modal-card {
  width: min(820px, calc(100vw - 32px));
}
.plan-config-modal-card .modal-body {
  overscroll-behavior: contain;
}
.plan-config-tabs {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}
.plan-config-tab-panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(2, 6, 23, .18);
}
.plan-config-tab-panel.collapsed {
  background: rgba(2, 6, 23, .10);
}
.plan-config-panel-toggle {
  width: 100%;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 16px;
  border: 0;
  border-radius: 0;
  background: rgba(15, 23, 42, .42);
  color: var(--text-main);
  box-shadow: none;
  text-align: left;
  cursor: pointer;
}
.plan-config-panel-toggle:hover {
  background: rgba(30, 41, 59, .58);
}
.plan-config-panel-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.plan-config-panel-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.plan-config-panel-title {
  font-size: 15px;
  font-weight: 760;
}
.plan-config-panel-description {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 450;
  line-height: 1.45;
}
.plan-config-panel-tools {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.plan-config-panel-meta {
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 11.5px;
  white-space: nowrap;
}
.plan-config-panel-action {
  min-width: 58px;
  color: var(--text-main);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}
.plan-config-panel-body {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border);
}
.plan-config-panel-body[hidden] {
  display: none;
}
.plan-config-content-block {
  padding: 16px;
}
.plan-config-content-block + .plan-config-content-block {
  border-top: 1px solid var(--border);
}
.plan-config-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.plan-config-toolbar h3 {
  margin: 0 0 7px;
}
.plan-config-image-explain {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 12px;
}
.plan-config-image-explain .tag {
  white-space: normal;
  line-height: 1.35;
}
.plan-config-feature-status {
  display: flex;
  align-items: center;
  gap: 8px;
}
.plan-config-provider-groups {
  display: grid;
  gap: 16px;
}
.plan-config-provider-group {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, .20);
}
.plan-config-provider-head {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 42, .32);
}
.plan-config-provider-head h4 {
  margin: 0;
  color: var(--text-main);
  font-size: 13.5px;
}
.plan-config-plan-list {
  display: grid;
}
.plan-config-plan-row {
  display: grid;
  grid-template-columns: minmax(180px, .9fr) minmax(310px, 1.45fr) minmax(220px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
}
.plan-config-plan-row + .plan-config-plan-row {
  border-top: 1px solid var(--border);
}
.plan-config-plan-row.disabled {
  opacity: .76;
}
.plan-config-plan-identity,
.plan-config-model-scope {
  min-width: 0;
}
.plan-config-plan-name {
  color: var(--text-main);
  font-size: 13.5px;
  font-weight: 740;
  line-height: 1.35;
}
.plan-config-plan-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}
.plan-config-plan-description {
  margin-top: 7px;
  font-size: 11.5px;
  line-height: 1.4;
}
.plan-config-plan-summary {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.plan-config-plan-summary .wide {
  grid-column: 1 / -1;
}
.plan-config-plan-summary .model-kv strong {
  white-space: normal;
  line-height: 1.4;
}
.plan-config-scope-label {
  display: block;
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
}
.plan-config-model-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.plan-config-model-chip {
  max-width: 100%;
  padding: 4px 7px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(2, 6, 23, .30);
  color: var(--text-main);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plan-config-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.plan-upstream-table-wrap {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.plan-upstream-table {
  min-width: 920px;
}
.plan-upstream-table th,
.plan-upstream-table td {
  padding: 9px 10px;
  vertical-align: middle;
}
.plan-upstream-table .unconfigured td {
  background: rgba(245, 158, 11, .035);
}
.plan-upstream-model {
  color: var(--text-main);
  font-weight: 650;
}
.plan-upstream-url {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plan-upstream-actions {
  text-align: right;
}
.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.45;
}
.admin-copy-tip {
  border-color: rgba(96, 165, 250, .34);
  background: rgba(59, 130, 246, .12);
  color: #dbeafe;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 1180px) {
  .plan-config-plan-row {
    grid-template-columns: minmax(180px, .8fr) minmax(0, 1.4fr);
  }
  .plan-config-model-scope,
  .plan-config-row-actions {
    grid-column: 1 / -1;
  }
  .plan-config-row-actions {
    justify-content: flex-start;
  }
}

/* 响应式：窄屏堆叠 */
@media (max-width: 860px) {
  .shell-body { flex-direction: column; padding: 16px; gap: 16px; }
  .sidebar {
    width: 100%; position: static;
    flex-direction: row; overflow-x: auto;
  }
  .sidebar .menu-item { flex: 1; text-align: center; white-space: nowrap; }
  .topbar { padding: 12px 16px; }
  .btn-apply-partner { padding: 6px 12px; font-size: 12px; }
  .topbar-user { display: none; }
  .section-head,
  .section-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .inline-form,
  .inline-form.compact {
    grid-template-columns: 1fr;
  }
  .inline-form .field-sm {
    max-width: none;
  }
  .form-actions {
    justify-content: flex-start;
  }
  .pricing-toolbar,
  .pricing-section-head,
  .pricing-card-head,
  .plan-config-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .plan-config-panel-toggle {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .plan-config-panel-tools {
    width: 100%;
    justify-content: space-between;
  }
  .plan-config-content-block {
    padding: 12px;
  }
  .plan-config-plan-row {
    grid-template-columns: 1fr;
  }
  .plan-config-model-scope,
  .plan-config-row-actions {
    grid-column: auto;
  }
  .pricing-add-form,
  .upstream-fields,
  .price-fields {
    grid-template-columns: 1fr;
  }
  .pricing-form-actions {
    margin-top: 0;
  }
  .admin-model-grid,
  .model-read-grid,
  .admin-model-field-grid,
  .admin-model-price-grid,
  .plan-config-field-grid,
  .image-model-field-grid,
  .image-model-rate-grid,
  .model-check-list,
  .slowdown-summary-grid,
  .slowdown-config-grid,
  .slowdown-delay-toolbar,
  .slowdown-threshold-grid,
  .slowdown-node-grid,
  .slowdown-rule-grid {
    grid-template-columns: 1fr;
  }
  .slowdown-range:not(.slowdown-seconds-range) {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .slowdown-seconds-range {
    grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
  }
  .slowdown-enable-row,
  .slowdown-peak-layout,
  .slowdown-peak-read-grid,
  .slowdown-peak-guide,
  .slowdown-modal-layout,
  .slowdown-modal-grid,
  .slowdown-modal-delay-panel .slowdown-node-grid,
  .slowdown-rule-card-head,
  .slowdown-rule-flow,
  .slowdown-rule-meta-row {
    grid-template-columns: 1fr;
  }
  .slowdown-enable-actions {
    justify-self: flex-start;
  }
  .slowdown-model-row {
    grid-template-columns: 1fr;
  }
  .slowdown-model-actions,
  .slowdown-configured-card .pricing-card-actions {
    justify-content: flex-start;
  }
  .slowdown-axis-wrap {
    padding-top: 86px;
  }
  .slowdown-marker-control {
    width: 116px;
  }
  .slowdown-node-card {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .slowdown-node-card:last-child {
    border-bottom: 0;
  }
}

/* ===== Partner 申请摘要 ===== */
.apply-summary {
  margin: 12px 0 4px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(15, 23, 42, .35);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
}
.apply-form { margin-top: 12px; }
.apply-form .row { margin-top: 10px; }

/* ---- 侧栏底部用户卡（参考 codexproxy）---- */
.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar-footer .user-box {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-footer .user-avatar {
  width: 36px; height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
}
.sidebar-footer .user-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sidebar-footer .user-name {
  font-size: 0.9rem;
  color: var(--text-main);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.sidebar-footer .role-badge {
  align-self: flex-start;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(59,130,246,0.18);
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sidebar-footer .cur-user {
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-all;
  line-height: 1.4;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
}
.sidebar-footer .logout-btn {
  padding: 9px 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  font-size: 13px;
  transition: border-color .2s, color .2s;
}
.sidebar-footer .logout-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
}

/* ---- 合作伙伴管理：汇总统计 + tab ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.stat-cell {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(15, 23, 42, .35);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-cell .stat-val {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}
.stat-cell .stat-label {
  font-size: 12px;
  color: var(--text-muted);
}
.stat-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-faint);
}
.stat-cell.ok   .stat-val { color: #34d399; }
.stat-cell.warn .stat-val { color: #fbbf24; }
.stat-cell.danger .stat-val { color: #f87171; }

.user-stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.user-stats-grid .stat-cell {
  min-width: 0;
  min-height: 72px;
  padding: 10px 12px;
  gap: 3px;
}
.user-stats-grid .stat-cell .stat-val {
  font-size: 1.35rem;
}
.user-stats-grid .stat-cell .stat-sub {
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.admin-collapsible-card {
  overflow: hidden;
  padding: 0;
  border-radius: 14px;
  background: rgba(2, 6, 23, .18);
  box-shadow: none;
  backdrop-filter: none;
}
.admin-collapsible-card > .admin-collapsible-head {
  margin: 0;
  padding: 14px 16px;
  min-height: 68px;
  border: 0;
  border-radius: 0;
  background: rgba(15, 23, 42, .42);
  color: var(--text-main);
  box-shadow: none;
  text-align: left;
}
.admin-collapsible-card.collapsed { background: rgba(2, 6, 23, .10); }
.admin-collapsible-head {
  align-items: center;
  cursor: pointer;
}
.admin-collapsible-head:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.admin-collapsible-leading {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 20px;
}
.admin-collapsible-head > .plan-config-panel-copy {
  flex: 1 1 auto;
  min-width: 0;
}
.admin-collapsible-actions,
.admin-growth-mode-controls,
.admin-consumption-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.admin-collapsible-actions { cursor: default; }
.admin-collapse-toggle {
  flex: 0 0 auto;
  min-width: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-main);
  font-size: 12px;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
}
.admin-collapse-toggle:hover {
  background: transparent;
  color: var(--text-main);
}
.admin-collapse-toggle-icon {
  font-size: 15px;
  line-height: 10px;
}
.admin-collapsible-body {
  min-width: 0;
  margin: 0;
  padding: 16px;
  border-top: 1px solid var(--border);
}
.admin-collapsible-body[hidden] {
  display: none;
}
.admin-growth-mode-controls button.small {
  min-height: 30px;
  padding: 5px 10px;
}
.admin-consumption-controls select {
  min-width: 120px;
  margin: 0;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-head h2 {
  margin: 0;
}
.user-growth-chart {
  width: 100%;
  height: 280px;
  display: block;
  margin-top: 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}
.admin-consumption-card .card-head {
  align-items: flex-start;
}
@media (max-width: 760px) {
  .user-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-collapsible-head { align-items: flex-start; flex-wrap: wrap; }
  .admin-collapsible-actions { width: auto; justify-content: flex-end; }
}
@media (max-width: 480px) {
  .user-stats-grid { grid-template-columns: 1fr; }
  .admin-consumption-controls select { min-width: 0; max-width: 100%; }
}
.request-errors-page {
  padding: 18px 20px;
}
.request-errors-page .card-head {
  margin-bottom: 10px;
}
.request-errors-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.request-errors-controls input,
.request-errors-controls select {
  min-width: 150px;
  margin: 0;
}
.request-errors-controls input {
  width: 220px;
}
.request-errors-notice {
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.45;
}
.request-errors-notice strong {
  color: var(--text-main);
  font-weight: 600;
}
.request-errors-table {
  min-width: 1380px;
  table-layout: fixed;
  font-size: 12px;
  font-family: inherit;
}
.request-errors-table,
.request-errors-table th,
.request-errors-table td,
.request-errors-table th *,
.request-errors-table td * {
  font-family: inherit !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}
.request-errors-table td * {
  font-weight: 400 !important;
}
.request-errors-table th,
.request-errors-table td {
  padding: 7px 9px;
  vertical-align: middle;
  line-height: 1.35;
}
.request-errors-table th {
  position: relative;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
}
.request-errors-column-resizer {
  position: absolute;
  z-index: 1;
  top: 0;
  right: -4px;
  bottom: 0;
  width: 8px;
  cursor: col-resize;
  touch-action: none;
}
.request-errors-column-resizer:hover,
.request-errors-column-resizer:active {
  background: var(--primary);
  opacity: .65;
}
.request-errors-table td > span,
.request-errors-table td > small {
  display: block;
  font-size: inherit;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.request-errors-table td:nth-child(1) { white-space: nowrap; }
.request-errors-time {
  white-space: nowrap;
}
.request-errors-time > div {
  display: block !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
.request-errors-time > div + div {
  margin-top: 2px;
}
.request-errors-client-meta {
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.request-errors-client-meta > span,
.request-errors-client-meta > small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.request-errors-client-meta > small {
  margin-top: 2px;
}
.request-errors-message {
  white-space: normal;
}
.request-errors-remote-ip,
.request-errors-plan,
.request-errors-http-error {
  white-space: normal !important;
  overflow-wrap: anywhere;
}
.request-errors-http-error {
  overflow: hidden;
}
.request-errors-http-line {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  line-height: 1.35;
  white-space: nowrap;
}
.request-errors-http-line + .request-errors-http-line {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.request-errors-http-source,
.request-errors-http-code {
  white-space: nowrap;
  font-weight: 600 !important;
}
.request-errors-http-source {
  flex: 0 0 auto;
  padding: 1px 5px;
  border: 1px solid rgba(248, 113, 113, .34);
  border-radius: 4px;
  background: rgba(127, 29, 29, .28);
  color: #fecaca;
}
.request-errors-http-line-upstream .request-errors-http-source {
  border-color: rgba(251, 191, 36, .34);
  background: rgba(120, 53, 15, .28);
  color: #fde68a;
}
.request-errors-http-code {
  flex: 0 0 auto;
  width: 3ch;
  min-width: 3ch;
  text-align: right;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}
.request-errors-http-separator {
  flex: 0 0 auto;
  color: var(--text-muted);
}
.request-errors-http-message {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap !important;
}
.request-errors-plan-name,
.request-errors-plan-billing {
  white-space: normal !important;
  overflow: visible !important;
  overflow-wrap: anywhere;
  text-overflow: clip !important;
}
.request-errors-plan {
  line-height: 1.25 !important;
}
.request-errors-plan-name,
.request-errors-plan-billing {
  display: block !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
.request-errors-request-id {
  white-space: normal !important;
  overflow: visible !important;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.request-errors-table tbody tr:hover td {
  background: rgba(59,130,246,.06);
}
.request-errors-row {
  cursor: pointer;
  outline: none;
}
.request-errors-row:focus-visible td {
  box-shadow: inset 0 0 0 2px var(--primary);
}
.request-error-detail-modal {
  width: min(1120px, calc(100vw - 32px));
  max-width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.request-error-detail-modal .modal-body {
  min-height: 0;
  overflow: auto;
}
.request-error-detail {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.request-error-detail-group {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15,23,42,.025);
}
.request-error-detail-group-title {
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}
.request-error-detail-group-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}
.request-error-detail-field-span-2 {
  grid-column: span 2;
}
.request-error-detail-group .request-error-detail-field {
  padding: 7px 8px;
}
.request-error-detail-group .request-error-detail-field strong {
  line-height: 1.35;
}
.request-error-detail-group-errors {
  gap: 9px;
}
.request-error-detail-group-diagnostics {
  gap: 9px;
}
.request-error-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.request-error-detail-field {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(15,23,42,.04);
}
.request-error-detail-label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 11px;
}
.request-error-detail-field strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 500;
}
.request-error-detail-section {
  min-width: 0;
}
.request-error-capture-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.request-error-curl-detail {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.request-error-curl-warning {
  padding: 10px 12px;
  border: 1px solid rgba(245, 158, 11, .45);
  border-radius: 7px;
  color: #fcd34d;
  background: rgba(245, 158, 11, .10);
  font-size: 12px;
  line-height: 1.5;
}
.request-error-curl-section {
  min-width: 0;
}
.request-error-curl-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.request-error-curl-section-head strong {
  font-size: 12px;
}
.request-error-curl-command {
  width: 100%;
  min-height: 116px;
  box-sizing: border-box;
  resize: vertical;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 11px;
  line-height: 1.55;
  white-space: pre;
}
.request-error-detail-section-final .request-error-detail-label {
  color: #fca5a5;
  font-weight: 600;
}
.request-error-detail-section-upstream .request-error-detail-label {
  color: #fcd34d;
  font-weight: 600;
}
.request-error-detail-message {
  max-width: 100%;
  max-height: min(320px, 32vh);
  box-sizing: border-box;
  margin: 0;
  padding: 10px 12px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(15,23,42,.06);
  color: var(--text-main);
  font: 12px/1.5 var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.request-error-detail-message-final {
  background: rgba(127, 29, 29, .32);
  border-color: rgba(248, 113, 113, .46);
  color: #fecaca;
}
.request-error-detail-message-upstream {
  background: rgba(120, 53, 15, .30);
  border-color: rgba(251, 191, 36, .46);
  color: #fde68a;
}
@media (max-width: 720px) {
  .request-error-detail-modal {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }
  .request-error-detail-grid {
    grid-template-columns: 1fr;
  }
  .request-error-detail-group-grid {
    grid-template-columns: 1fr;
  }
  .request-error-detail-field-span-2 {
    grid-column: auto;
  }
}
@media (min-width: 721px) and (max-width: 960px) {
  .request-error-detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .request-error-detail-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.admin-consumption-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.admin-consumption-controls select {
  min-width: 150px;
  margin: 0;
}
.admin-consumption-table-wrap {
  overflow-x: auto;
}
.admin-consumption-table {
  min-width: 1080px;
}
.admin-consumption-table th,
.admin-consumption-table td {
  white-space: nowrap;
}
.admin-consumption-account {
  white-space: normal !important;
  min-width: 180px;
}
.admin-consumption-account-name {
  color: var(--text-main);
}
.admin-consumption-account-email {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}
.admin-consumption-amount {
  color: #34d399;
  font-weight: 700;
}
.role-dist-grid {
  display: grid;
  gap: 12px;
}
.role-dist-row {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, .25);
}
.role-dist-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--text-main);
  font-size: 13px;
}
.role-dist-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, .16);
}
.role-dist-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.tab-bar {
  display: flex;
  gap: 4px;
  margin: 12px 0 14px;
  border-bottom: 1px solid var(--border);
}
.tab-bar .tab {
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.tab-bar .tab:hover { color: var(--text-main); }
.tab-bar .tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ===== 首登角色选择页（一左一右） ===== */
.role-choice-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background: var(--bg);
}
.role-choice-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}
.role-choice-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
}
.role-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 320px));
  gap: 24px;
  width: 100%;
  max-width: 720px;
}
.role-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.role-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
}
.role-card-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
  margin-bottom: 4px;
}
.role-card-icon svg { width: 30px; height: 30px; }
.role-card.partner .role-card-icon {
  background: rgba(251, 191, 36, 0.14);
  color: #fbbf24;
}
.role-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}
.role-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  min-height: 40px;
}
.role-card-cta {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
}
.role-card.partner .role-card-cta { color: #fbbf24; }
.role-choice-logout {
  margin-top: 32px;
  font-size: 13px;
  color: var(--text-muted);
}
.role-choice-logout a {
  margin-left: 8px;
  color: var(--primary);
  text-decoration: none;
}
.role-choice-logout a:hover { text-decoration: underline; }

/* ===== Playground / 功能测试 ===== */
.pg-viewport {
  margin-top: 14px;
  height: 420px;
  overflow-y: auto;
  background: rgba(2, 6, 23, .55);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}
.pg-msg {
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
}
.pg-msg.pg-system {
  color: var(--text-faint);
  font-style: italic;
  background: transparent;
  padding: 0;
}
.pg-msg.pg-user {
  background: rgba(59, 130, 246, .12);
  border-color: rgba(59, 130, 246, .35);
  color: var(--text-main);
}
.pg-msg.pg-assistant {
  background: rgba(16, 185, 129, .08);
  border-color: rgba(16, 185, 129, .28);
  color: var(--text-main);
}
.pg-msg.pg-error {
  background: rgba(239, 68, 68, .12);
  border-color: rgba(239, 68, 68, .35);
  color: #fca5a5;
}
.pg-image-bar {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(2, 6, 23, .35);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.pg-image-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.pg-image-meta {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
}
.pg-image-meta strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}
.pg-compose {
  margin-top: 12px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.pg-compose textarea {
  flex: 1;
  min-height: 56px;
  min-width: 0;
}
.pg-model-select {
  width: auto;
  min-width: 132px;
  max-width: 180px;
  flex: 0 0 auto;
}

@media (max-width: 720px) {
  .pg-compose {
    flex-wrap: wrap;
  }
  .pg-model-select {
    flex: 1 1 160px;
    max-width: none;
  }
}

/* 用量信息页：汇总卡片 + 明细表 */
.usage-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.usage-summary-box {
  padding: 10px 12px;
  background: rgba(2, 6, 23, .35);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.usage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.usage-table th,
.usage-table td {
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}
.usage-table th:first-child,
.usage-table td:first-child {
  text-align: left;
  white-space: nowrap;
}
.usage-table th {
  color: var(--text-faint);
  font-weight: 500;
  background: rgba(2, 6, 23, .35);
  position: sticky;
  top: 0;
}
.usage-table tbody tr:hover {
  background: rgba(59, 130, 246, .06);
}

.tab-btn {
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 8px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}
.tab-btn:hover {
  color: var(--text-main);
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ========== MiniMax 风格浅色控制台覆盖 ========== */
body.platform-light {
  background: #fff !important;
  background-image: none !important;
  color: #111827 !important;
}
body.platform-light #app {
  padding: 0 !important;
  background: #fff !important;
}
body.platform-light .shell {
  --bg-card: #ffffff;
  --surface-2: #f7f8fa;
  --surface-hover: #f2f3f5;
  --text-main: #111827;
  --text-muted: #4b5563;
  --text-faint: #8a8f98;
  --border: #eef0f3;
  --border-strong: #d9dde3;
  --shadow-soft: none;
  background: #fff;
  color: var(--text-main);
}
body:has(.shell) {
  background: #fff;
  background-image: none;
  color: #111827;
}
body.platform-light .shell .topbar {
  height: 48px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid #eef0f3;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.shell .topbar-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: transparent;
  color: #ef4444;
  box-shadow: none;
}
.shell .topbar-logo svg { width: 21px; height: 21px; }
.shell .topbar-logo-img {
  display: block;
  width: 164px;
  height: 32px;
  object-fit: contain;
}
.shell .topbar-home-link {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  text-decoration: none;
}
.shell .topbar-home-link:focus-visible {
  outline: 2px solid rgba(17, 24, 39, .35);
  outline-offset: 2px;
}
.shell .topbar-brand {
  color: #111827;
  background: none;
  -webkit-text-fill-color: currentColor;
  font-size: 14px;
  font-weight: 700;
}
.topbar-link {
  color: #111827;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 13px;
}
.topbar-link:hover,
.topbar-link.active {
  color: #2563eb;
  background: #f6f8ff;
}
.shell .lang-switcher {
  padding: 0;
  border: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.shell .lang-switcher .muted { display: none; }
.shell .lang-switcher select {
  min-width: 92px;
  padding: 4px 8px;
  background: #fff;
  color: #111827;
  border-color: #eef0f3;
}
.shell-body {
  max-width: none;
  padding: 0;
  gap: 0;
  align-items: stretch;
}
.sidebar {
  width: 144px;
  min-height: calc(100vh - 48px);
  top: 48px;
  align-self: flex-start;
  border: none;
  border-right: 1px solid #eef0f3;
  border-radius: 0;
  background: #fff;
  padding: 12px 8px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  position: sticky;
}
.sidebar .sidebar-menu { gap: 0; }
.menu-group { display: block; }
.menu-group-title {
  width: calc(100% - 20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 14px 10px 6px;
  padding: 2px 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #111827;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
}
.menu-group-title::after {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  margin-right: 2px;
  border-right: 1.5px solid #98a2b3;
  border-bottom: 1.5px solid #98a2b3;
  transform: rotate(45deg);
  transition: transform .15s ease;
}
.menu-group-title[aria-expanded="false"]::after { transform: rotate(-45deg); }
.menu-group-title:hover { background: #f7f8fa; }
.menu-group-title:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.menu-group-items {
  display: flex;
  flex-direction: column;
}
.menu-group-items[hidden] {
  display: none !important;
}
.sidebar .menu-item {
  margin: 1px 0;
  padding: 8px 14px;
  border-radius: 8px;
  color: #4b5563;
  font-size: 12.5px;
}
.sidebar .menu-item:hover {
  background: #f7f8fa;
  color: #111827;
}
.sidebar .menu-item.active {
  background: #f1f2f4;
  color: #111827;
  box-shadow: none;
}
.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #eef0f3;
}
.shell .user-avatar {
  background: #f1f2f4;
  color: #111827;
  box-shadow: none;
}
.shell .role-badge,
.shell .cur-user {
  color: #8a8f98;
}
.shell .logout-btn {
  width: 100%;
  margin-top: 8px;
  padding: 7px 10px;
  background: #fff;
  color: #4b5563;
  border-color: #eef0f3;
  box-shadow: none;
}
.content {
  padding: 56px 64px;
  background: #fff;
  gap: 18px;
}
.settings-page {
  max-width: 920px;
  width: 100%;
}
.settings-title {
  margin-bottom: 22px;
}
.settings-title h1 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}
.settings-title p {
  margin: 0;
  color: #8a8f98;
  font-size: 12px;
}
.settings-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin: 0 0 24px;
  padding: 4px;
  border: 1px solid #eef0f3;
  border-radius: 10px;
  background: #fafafa;
}
.shell .settings-tab {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #6b7280;
  box-shadow: none;
  white-space: nowrap;
}
.shell .settings-tab:hover {
  background: #f0f2f5;
  color: #111827;
  box-shadow: none;
}
.shell .settings-tab.active,
.shell .settings-tab[aria-selected="true"] {
  background: #111827;
  color: #fff;
}
.settings-tab-panels {
  min-width: 0;
}
.settings-tab-panel[hidden] {
  display: none;
}
.settings-tab-panel > .settings-section:last-child {
  margin-bottom: 0;
}
.settings-section {
  margin: 0 0 26px;
}
.settings-section h2 {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}
.settings-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.settings-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 24px;
}
.settings-label {
  color: #111827;
  font-size: 12.5px;
  font-weight: 500;
}
.settings-value {
  color: #6b7280;
  font-size: 12.5px;
  min-width: 0;
  word-break: break-all;
}
.settings-action {
  justify-self: end;
}
.settings-toggle-row {
  grid-template-columns: 110px max-content auto;
  justify-content: start;
  align-items: center;
  column-gap: 16px;
}
.settings-toggle-value {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.settings-toggle-value input[type="checkbox"] {
  flex: 0 0 auto;
}
.text-btn {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  color: #2563eb;
  font-size: 12.5px;
}
.text-btn:hover {
  background: transparent;
  box-shadow: none;
  text-decoration: underline;
}
.settings-form {
  max-width: 620px;
  margin-top: 16px;
}
.shell .row label { color: #111827; }
.shell input,
.shell select,
.shell textarea {
  background: #fff;
  color: #111827;
  border-color: #d9dde3;
}
.shell input::placeholder,
.shell textarea::placeholder { color: #b0b5bd; }
.shell button {
  background: #111827;
  border-color: #111827;
  box-shadow: none;
}
.shell button.secondary,
.shell button.ghost {
  background: #fff;
  color: #111827;
  border-color: #d9dde3;
}
.shell .card,
.shell .settings-section.partner-codes-card,
.shell .settings-section.partner-info-card {
  background: #fff;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.shell .card::before { display: none; }
.shell table {
  border: 1px solid #eef0f3;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.shell th,
.shell td {
  border-bottom-color: #eef0f3;
  color: #374151;
}
.shell th {
  background: #fafafa;
  color: #6b7280;
}
.shell tbody tr:hover td { background: #fafafa; }
.shell .muted { color: #8a8f98; }
.shell .mono { color: #374151; }
.shell .notice,
.shell .apply-summary,
.shell .empty-state,
.shell .api-key-usage-panel,
.shell .inline-form,
.shell .section-toolbar,
.shell .usage-summary-box {
  background: #fafafa;
  border-color: #eef0f3;
  color: #6b7280;
}
.plan-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid #eef0f3;
  border-radius: 12px;
  background: #fafafa;
}
.plan-name {
  margin-bottom: 4px;
  color: #111827;
  font-size: 16px;
  font-weight: 700;
}
.partner-rule {
  margin-top: 18px;
  max-width: 620px;
}
@media (max-width: 860px) {
  .shell-body { flex-direction: column; }
  .sidebar {
    width: 100%;
    min-height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid #eef0f3;
  }
  .content { padding: 28px 20px; }
  .settings-row { grid-template-columns: 1fr; gap: 4px; }
  .settings-action { justify-self: start; }
}

/* 最终浅色平台强覆盖：避免旧 glass 样式和浏览器缓存导致控制台仍显示深色 */
body.platform-light .shell,
body.platform-light .shell-body,
body.platform-light .topbar,
body.platform-light .sidebar,
body.platform-light .content {
  background: #fff !important;
  background-image: none !important;
  color: #111827 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.platform-light .topbar {
  height: 48px !important;
  padding: 0 20px !important;
  border-bottom: 1px solid #eef0f3 !important;
}
body.platform-light .topbar-right {
  gap: 10px !important;
}
body.platform-light .sidebar {
  width: 150px !important;
  min-height: calc(100vh - 48px) !important;
  top: 48px !important;
  padding: 10px 8px !important;
  border: 0 !important;
  border-right: 1px solid #eef0f3 !important;
  border-radius: 0 !important;
}
body.platform-light .sidebar .menu-group-title {
  width: calc(100% - 20px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin: 14px 10px 6px !important;
  padding: 2px 4px !important;
  border: 0 !important;
  background: transparent !important;
  color: #111827 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-align: left !important;
  cursor: pointer !important;
}
body.platform-light .sidebar .menu-group-title:hover { background: #f7f8fa !important; }
body.platform-light .sidebar .menu-item {
  min-height: 38px !important;
  display: flex !important;
  align-items: center !important;
  margin: 1px 0 !important;
  padding: 8px 14px !important;
  border-radius: 8px !important;
  color: #5f6673 !important;
  font-size: 12.5px !important;
  box-shadow: none !important;
  background: transparent !important;
  cursor: pointer !important;
}
body.platform-light .sidebar .menu-item:hover {
  background: #f7f8fa !important;
  color: #111827 !important;
}
body.platform-light .sidebar .menu-item.active {
  background: #f1f2f4 !important;
  color: #111827 !important;
  font-weight: 500 !important;
}
body.platform-light .content {
  padding: 58px 72px !important;
  max-width: none !important;
}
body.platform-light .settings-page {
  max-width: 760px !important;
}
body.platform-light .settings-title h1 {
  font-size: 24px !important;
  line-height: 1.25 !important;
  font-weight: 650 !important;
  letter-spacing: -0.02em !important;
  color: #111827 !important;
}
body.platform-light .settings-title p {
  margin-top: 14px !important;
  color: #475569 !important;
  font-size: 14px !important;
}
body.platform-light .settings-section h2 {
  margin-top: 20px !important;
  margin-bottom: 16px !important;
  color: #111827 !important;
  font-size: 17px !important;
  line-height: 1.35 !important;
}
body.platform-light .settings-rows {
  gap: 12px !important;
}
body.platform-light .settings-row {
  grid-template-columns: 110px minmax(0, 1fr) auto !important;
  align-items: start !important;
  min-height: 28px !important;
}
body.platform-light .settings-row.settings-toggle-row {
  grid-template-columns: 110px max-content auto !important;
  justify-content: start !important;
  align-items: center !important;
}
body.platform-light .settings-label,
body.platform-light .row label {
  color: #111827 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}
body.platform-light .settings-value,
body.platform-light .muted {
  color: #475569 !important;
  font-size: 14px !important;
}
body.platform-light .mono,
body.platform-light .cur-user {
  color: #334155 !important;
}
body.platform-light .sidebar-footer {
  border-top: 1px solid #eef0f3 !important;
}
body.platform-light .sidebar-footer .user-avatar {
  background: #111827 !important;
  color: #fff !important;
  box-shadow: none !important;
}
body.platform-light .sidebar-footer .role-badge {
  background: #f4f4f5 !important;
  color: #3f3f46 !important;
}

/* 流式 AI 状态页 */
.stream-status-page {
  width: 100%;
  max-width: 1360px;
  margin-inline: auto;
}
body.platform-light .settings-page.stream-status-page {
  width: 100% !important;
  max-width: 1360px !important;
  margin-inline: auto !important;
}
.stream-status-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 1px solid #eef0f3; }
.stream-status-head h2 { margin: 0 0 6px; color: #111827; font-size: 24px; line-height: 1.25; letter-spacing: -.02em; }
.stream-status-head p { margin: 0; color: #6b7280; font-size: 13px; }
.stream-status-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stream-status-actions button { min-width: 48px; }
.stream-tabs { display: flex; gap: 6px; margin: 16px 0; padding: 4px; width: fit-content; border: 1px solid #e4e4e7; border-radius: 10px; background: #f4f4f5; }
.stream-tab { min-height: 34px; padding: 7px 18px; border: 0; border-radius: 7px; background: transparent; color: #71717a; box-shadow: none; }
.stream-tab.active { background: #fff; color: #18181b; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.stream-tab-panel[hidden] { display: none !important; }
.stream-probe-settings { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding: 13px 16px; border: 1px solid #e4e4e7; border-radius: 6px; background: #fafafa; }
.stream-probe-settings > div:first-child { display: grid; gap: 3px; margin-right: auto; }
.stream-probe-settings label { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.stream-probe-interval-input { width: 84px; }
.stream-discovery-slot { margin: 14px 0; }
.stream-discovery-card { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 13px 16px; border: 1px solid #d1fae5; border-left: 3px solid #16a34a; border-radius: 0; background: #f7fef9; }
.stream-discovery-card.healthy { border-color: #bbf7d0; border-left-color: #16a34a; }
.stream-discovery-card.unknown { border-color: #fde68a; border-left-color: #d97706; background: #fffcf5; }
.stream-discovery-card > div:first-child { display: flex; gap: 8px; align-items: center; }
.stream-health-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #a1a1aa; }
.stream-health-dot.healthy { background: #16a34a; }
.stream-health-dot.degraded { background: #d97706; }
.stream-health-dot.down { background: #dc2626; }
.stream-health-dot.unknown { background: #a1a1aa; }
.stream-health-dot.na { background: #a1a1aa; }
.stream-health-dot.disabled { background: #71717a; }
.stream-status-section { overflow: hidden; }
.stream-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.stream-section-heading h3 { margin: 0; }
.stream-components { margin: 0; border-top: 1px solid #e5e7eb; }
.stream-component { padding: 15px 0; border-bottom: 1px solid #e5e7eb; background: #fff; }
.stream-component:last-child { border-bottom: 0; }
.stream-component-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 30px; margin: 0 0 10px; padding: 0; border: 0; background: transparent; color: #18181b; text-align: left; box-shadow: none; }
.stream-component-toggle:hover { background: transparent; color: #000; }
.stream-component-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.stream-component-title strong { font-size: 15px; }
.stream-component-uptime { color: #71717a; font-size: 13px; white-space: nowrap; }
.stream-health-icon { display: inline-grid; place-items: center; width: 21px; height: 21px; flex: 0 0 21px; border-radius: 50%; background: #a1a1aa; color: #fff; font-size: 13px; font-weight: 800; }
.stream-health-icon.healthy { background: #16a34a; }
.stream-health-icon.degraded { background: #d97706; }
.stream-health-icon.down { background: #dc2626; }
.stream-health-icon.na { background: #a1a1aa; }
.stream-health-icon.disabled { background: #71717a; }
.stream-chevron { color: #a1a1aa; font-size: 18px; line-height: 1; transform: rotate(-90deg); transition: transform .16s ease; }
.stream-chevron.expanded { transform: rotate(0); }
.stream-history-track { display: flex; align-items: stretch; width: min(100%, 1120px); max-width: 1120px; height: 16px; gap: 4px; justify-content: flex-start; }
.stream-history-bar { min-width: 3px; max-width: 36px; flex: 1 1 24px; border-radius: 0; background: #d4d4d8; }
button.stream-history-bar { height: 16px; margin: 0; padding: 0; border: 0; border-radius: 0 !important; cursor: pointer; box-shadow: none; transition: filter .12s ease, opacity .12s ease; }
button.stream-history-bar:hover, button.stream-history-bar:focus-visible { filter: brightness(.96); opacity: .92; outline: 0; }
button.stream-history-bar:focus-visible { box-shadow: 0 0 0 2px #2563eb; }
.stream-history-bar.healthy { background: #22c55e; }
.stream-history-bar.degraded { background: #f59e0b; }
.stream-history-bar.down { background: #ef4444; }
.stream-history-bar.unknown { background: #d4d4d8; }
.stream-history-bar.na { background: repeating-linear-gradient(135deg, #d4d4d8 0, #d4d4d8 3px, #f4f4f5 3px, #f4f4f5 6px); }
.stream-history-bar.disabled { background: repeating-linear-gradient(90deg, #a1a1aa 0, #a1a1aa 2px, #e4e4e7 2px, #e4e4e7 5px); }
.stream-component-models { margin: 16px 0 -15px; border-top: 1px solid #eef0f3; background: #fafafa; }
.stream-component-model { padding: 14px 0 16px 30px; border-bottom: 1px solid #eef0f3; }
.stream-component-model:last-child { border-bottom: 0; }
.stream-component-model-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.stream-model-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.stream-model-name small { overflow: hidden; color: #71717a; text-overflow: ellipsis; white-space: nowrap; }
.stream-matrix-wrap { max-width: 1320px; overflow-x: auto; }
.stream-matrix-table { width: 100%; min-width: 860px; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.stream-matrix-table th:first-child, .stream-matrix-table td:first-child { width: 180px; }
.stream-matrix-table th { padding: 8px 10px; border-bottom: 1px solid #e5e7eb; background: #f8fafc; color: #64748b; font-size: 11px; letter-spacing: .04em; }
.stream-matrix-table th:first-child { text-align: left; }
.stream-matrix-table td { padding: 7px 5px; vertical-align: top; }
.stream-matrix-table td:first-child { padding-top: 12px; }
.stream-matrix-table td:first-child small { display: block; margin-top: 4px; color: #71717a; }
.stream-status-cell { display: flex; flex-direction: column; align-items: stretch; width: 100%; min-width: 0; min-height: 60px; gap: 5px; padding: 8px 10px; border: 1px solid #e4e7ec; border-radius: 0; background: #fff; color: #18181b; text-align: left; cursor: pointer; box-shadow: none; transition: border-color .18s ease, background-color .18s ease; }
.stream-status-cell:hover { border-color: #94a3b8; background: #f8fafc; }
.stream-status-cell.healthy { border-left: 4px solid #16a34a; }
.stream-status-cell.degraded { border-left: 4px solid #d97706; }
.stream-status-cell.down { border-left: 4px solid #dc2626; }
.stream-status-cell.unknown { border-left: 4px solid #a1a1aa; }
.stream-status-cell.na { border-left: 4px solid #a1a1aa; }
.stream-status-cell.disabled { border-left: 4px solid #71717a; }
.stream-status-cell-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.stream-status-cell-title { display: flex; gap: 7px; align-items: center; font-weight: 650; }
.stream-cell-metrics { display: grid; gap: 4px; }
.stream-cell-metrics small { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #71717a; font-size: 11px; line-height: 1.35; }
.stream-cell-metrics b { color: #3f3f46; font-weight: 600; white-space: nowrap; }
.stream-cell-na { color: #71717a; font-size: 12px; }
.stream-probe-toggle { min-width: 34px; min-height: 22px; padding: 2px 7px; border: 1px solid #d4d4d8; border-radius: 999px; background: #f4f4f5; color: #71717a; font-size: 11px; line-height: 16px; box-shadow: none; }
.stream-probe-toggle.enabled { border-color: #86efac; background: #dcfce7; color: #166534; }
.stream-empty { padding: 24px 0; text-align: center; }
.stream-trend-meta { margin: -6px 0 10px; }
.stream-latency-chart { position: relative; min-height: 280px; }
.stream-latency-chart svg { display: block; width: 100%; min-height: 280px; background: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, .035), transparent 44%), linear-gradient(180deg, #fff 0%, #fafafa 100%); border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 2px rgba(15, 23, 42, .025); }
.stream-dual-chart { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.stream-chart-card { min-width: 0; padding: 14px; border: 1px solid #e4e4e7; border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.stream-chart-card h4 { margin: 0; font-size: 14px; }
.stream-chart-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.stream-chart-card .stream-latency-chart { min-height: 230px; }
.stream-chart-card .stream-latency-chart svg { min-height: 230px; }
.stream-chart-legend { display: flex; justify-content: center; gap: 8px; margin-top: 10px; color: #52525b; font-size: 11px; }
button.stream-chart-legend-item { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 4px 9px; border: 1px solid transparent; border-radius: 999px; background: #f4f4f5; color: #52525b; font-size: 11px; line-height: 16px; box-shadow: none; }
button.stream-chart-legend-item:hover { border-color: #d4d4d8; background: #e4e4e7; color: #18181b; box-shadow: none; }
button.stream-chart-legend-item.is-hidden { background: #fafafa; color: #a1a1aa; text-decoration: line-through; opacity: .72; }
button.stream-chart-legend-item:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.stream-chart-legend i { width: 16px; height: 3px; border-radius: 2px; }
.stream-chart-grid { stroke: #e4e4e7; stroke-width: 1; stroke-dasharray: 3 6; }
.stream-chart-label { fill: #71717a; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.stream-chart-label-right { fill: #7c3aed; }
.stream-chart-axis-title { fill: #52525b; font-size: 10.5px; font-weight: 650; letter-spacing: .02em; }
.stream-chart-axis-title-right { fill: #7c3aed; }
.stream-chart-line { fill: none; stroke-width: 2.65; stroke-linejoin: round; stroke-linecap: round; }
.stream-chart-area { pointer-events: none; }
.stream-chart-point { cursor: crosshair; transition: r .12s ease, filter .12s ease; }
.stream-chart-point:hover { r: 5px; filter: drop-shadow(0 1px 3px rgba(15, 23, 42, .18)); }
.stream-chart-tooltip { position: absolute; z-index: 3; max-width: 220px; padding: 7px 9px; border: 1px solid #d4d4d8; border-radius: 8px; background: rgba(24, 24, 27, .94); color: #fff; font-size: 11px; line-height: 1.35; pointer-events: none; box-shadow: 0 8px 24px rgba(15, 23, 42, .18); }
.stream-chart-tooltip[hidden] { display: none; }
.stream-chart-dot { fill: #18181b; }
.stream-history-popover { position: fixed; z-index: 1100; width: min(300px, calc(100vw - 20px)); padding: 13px; border: 1px solid #d4d4d8; border-radius: 12px; background: rgba(255, 255, 255, .98); color: #18181b; box-shadow: 0 14px 36px rgba(15, 23, 42, .18); }
.stream-history-popover-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 5px; }
.stream-history-popover-time { color: #71717a; font-size: 11px; font-variant-numeric: tabular-nums; }
.stream-history-popover-status { display: inline-flex; margin: 10px 0; padding: 3px 8px; border-radius: 999px; background: #f4f4f5; color: #71717a; font-size: 11px; font-weight: 650; }
.stream-history-popover-status.healthy { background: #dcfce7; color: #166534; }
.stream-history-popover-status.degraded { background: #fef3c7; color: #92400e; }
.stream-history-popover-status.down { background: #fee2e2; color: #991b1b; }
.stream-history-popover-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.stream-history-popover-grid > div { display: grid; gap: 2px; padding: 8px 9px; border: 1px solid #eef0f3; border-radius: 8px; background: #fafafa; }
.stream-history-popover-grid strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.stream-history-popover-close { min-width: 26px; min-height: 26px; padding: 0; border: 0; background: transparent; color: #71717a; box-shadow: none; font-size: 20px; line-height: 1; }
.stream-history-popover-close:hover { background: #f4f4f5; color: #18181b; box-shadow: none; }
.stream-probe-detail-modal { width: min(1160px, calc(100vw - 48px)); max-width: 1160px; max-height: calc(100vh - 48px); }
.stream-probe-detail-modal .modal-head { padding: 18px 24px 14px; border-bottom: 1px solid #eef0f3; }
.stream-probe-detail-modal .modal-title { font-size: 17px; }
.stream-probe-detail-modal .modal-body { max-height: calc(100vh - 120px); padding: 18px 24px 24px; overflow-y: auto; }
.stream-probe-detail-content { display: grid; gap: 16px; }
.stream-probe-detail-meta { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid #e4e4e7; border-radius: 10px; background: #fafafa; }
.stream-probe-detail-meta .muted { margin-left: auto; }
.stream-probe-detail-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.stream-probe-detail-summary > div { display: grid; gap: 5px; padding: 12px 14px; border: 1px solid #e4e4e7; border-radius: 10px; background: #fafafa; }
.stream-probe-detail-summary strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.stream-actual-controls { display: flex; gap: 12px; margin-bottom: 14px; padding: 13px 16px; border: 1px solid #e4e4e7; border-radius: 12px; background: #fafafa; }
.stream-actual-controls label { display: flex; align-items: center; gap: 8px; }
.stream-actual-controls select { min-width: 190px; }
.stream-actual-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.stream-summary-card { display: grid; gap: 7px; padding: 16px; border: 1px solid #e4e4e7; border-radius: 12px; background: #fff; }
.stream-summary-card strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.stream-metric-table { width: 100%; }
.stream-metric-table th, .stream-metric-table td { padding: 10px 12px; }
.stream-metric-table tbody tr { cursor: pointer; }
.stream-metric-table tbody tr:hover, .stream-metric-table tbody tr.selected { background: #f4f4f5; }
body.platform-light .stream-component-toggle,
body.platform-light .stream-component-toggle:hover { min-height: 30px !important; padding: 0 !important; border: 0 !important; background: transparent !important; color: #18181b !important; }
body.platform-light .stream-status-cell { min-height: 60px !important; background: #fff !important; border-color: #e4e7ec !important; color: #18181b !important; }
body.platform-light .stream-status-cell.healthy { border-left-color: #16a34a !important; background: #f7fef9 !important; }
body.platform-light .stream-status-cell.degraded { border-left-color: #d97706 !important; background: #fffcf5 !important; }
body.platform-light .stream-status-cell.down { border-left-color: #dc2626 !important; background: #fffafa !important; }
body.platform-light .stream-status-cell.unknown { border-left-color: #a1a1aa !important; background: #fafafa !important; }
body.platform-light .stream-status-cell.na { border-left-color: #a1a1aa !important; background: #fafafa !important; }
body.platform-light .stream-status-cell.disabled { border-left-color: #71717a !important; background: #fafafa !important; }
body.platform-light .stream-status-cell:hover { border-color: #a1a1aa !important; }
body.platform-light button.stream-history-bar { height: 16px !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
body.platform-light button.stream-history-bar.healthy { background: #22c55e !important; }
body.platform-light button.stream-history-bar.degraded { background: #f59e0b !important; }
body.platform-light button.stream-history-bar.down { background: #ef4444 !important; }
body.platform-light button.stream-history-bar.unknown { background: #d4d4d8 !important; }
body.platform-light button.stream-history-bar.na { background: repeating-linear-gradient(135deg, #d4d4d8 0, #d4d4d8 3px, #f4f4f5 3px, #f4f4f5 6px) !important; }
body.platform-light button.stream-history-bar.disabled { background: repeating-linear-gradient(90deg, #a1a1aa 0, #a1a1aa 2px, #e4e4e7 2px, #e4e4e7 5px) !important; }
body.platform-light button.stream-history-popover-close,
body.platform-light button.stream-history-popover-close:hover { min-width: 26px !important; min-height: 26px !important; padding: 0 !important; border: 0 !important; background: transparent !important; color: #71717a !important; box-shadow: none !important; }
body.platform-light .stream-tab { min-height: 34px !important; padding: 7px 18px !important; border: 0 !important; background: transparent !important; color: #71717a !important; }
body.platform-light .stream-tab.active { background: #fff !important; color: #18181b !important; }
body.platform-light button.stream-chart-legend-item { min-height: 26px !important; padding: 4px 9px !important; border: 1px solid transparent !important; background: #f4f4f5 !important; color: #52525b !important; box-shadow: none !important; }
body.platform-light button.stream-chart-legend-item:hover { border-color: #d4d4d8 !important; background: #e4e4e7 !important; color: #18181b !important; }
body.platform-light button.stream-chart-legend-item.is-hidden { background: #fafafa !important; color: #a1a1aa !important; }
body.platform-light button.stream-range-button {
  min-height: 34px !important;
  padding: 7px 13px !important;
  border: 1px solid #d4d4d8 !important;
  background: #fff !important;
  color: #52525b !important;
  box-shadow: none !important;
}
body.platform-light button.stream-range-button:hover {
  border-color: #a1a1aa !important;
  background: #f4f4f5 !important;
  color: #18181b !important;
}
body.platform-light button.stream-range-button.primary,
body.platform-light button.stream-range-button.primary:hover {
  border-color: #111827 !important;
  background: #111827 !important;
  color: #fff !important;
}
body.platform-light .stream-probe-toggle { min-width: 34px !important; min-height: 22px !important; padding: 2px 7px !important; border: 1px solid #d4d4d8 !important; background: #f4f4f5 !important; color: #71717a !important; }
body.platform-light .stream-probe-toggle.enabled { border-color: #86efac !important; background: #dcfce7 !important; color: #166534 !important; }
body.platform-light .modal-close { min-width: 30px !important; min-height: 30px !important; padding: 0 !important; border: 0 !important; background: transparent !important; color: #71717a !important; }
body.platform-light .modal-close:hover { background: #f4f4f5 !important; color: #18181b !important; }
@media (max-width: 860px) {
  .stream-status-head, .stream-discovery-card { flex-direction: column; align-items: stretch; }
  .stream-status-actions { justify-content: flex-start; }
  .stream-probe-settings, .stream-actual-controls { align-items: stretch; flex-direction: column; }
  .stream-probe-settings > div:first-child { margin-right: 0; }
  .stream-actual-controls label { align-items: stretch; flex-direction: column; }
  .stream-actual-summary, .stream-dual-chart { grid-template-columns: 1fr; }
  .stream-probe-detail-modal { width: calc(100vw - 20px); max-height: calc(100vh - 20px); }
  .stream-probe-detail-modal .modal-body { padding: 14px; }
  .stream-probe-detail-summary { grid-template-columns: 1fr; }
  .stream-probe-detail-meta { align-items: flex-start; flex-wrap: wrap; }
  .stream-probe-detail-meta .muted { width: 100%; margin-left: 0; }
  .stream-component-model { padding-left: 20px; }
  .stream-component-model-head { align-items: flex-start; flex-direction: column; gap: 6px; }
  .stream-model-name { flex-wrap: wrap; }
}
body.platform-light .sidebar-footer .cur-user {
  background: #f8fafc !important;
  border-color: #eef0f3 !important;
}
body.platform-light .logout-btn {
  min-height: 40px !important;
  background: #fff !important;
  color: #334155 !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: none !important;
  cursor: pointer !important;
}
body.platform-light .text-btn,
body.platform-light button.text-btn {
  min-height: 32px !important;
  padding: 0 4px !important;
  background: transparent !important;
  color: #111827 !important;
  border: 0 !important;
  box-shadow: none !important;
}
body.platform-light button,
body.platform-light .btn-apply-partner {
  min-height: 38px !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}
body.platform-light .topbar-link { display: none !important; }
body.platform-light input,
body.platform-light select,
body.platform-light textarea {
  background: #fff !important;
  color: #111827 !important;
  border-color: #d8dee8 !important;
}
body.platform-light input:focus,
body.platform-light select:focus,
body.platform-light textarea:focus,
body.platform-light button:focus-visible,
body.platform-light .menu-item:focus-visible {
  outline: 2px solid rgba(17, 24, 39, .35) !important;
  outline-offset: 2px !important;
}

/* 黑白灰控制台主题：统一余额、支付按钮、选中态和状态标签 */
body.platform-light .shell {
  --primary: #111827 !important;
  --primary-hover: #000000 !important;
  --accent: #52525b !important;
  --success: #111827 !important;
  --warn: #71717a !important;
  --danger: #111827 !important;
}
body.platform-light .topbar-logo {
  color: #111827 !important;
}
body.platform-light .topbar-logo-img {
  display: block !important;
  width: 164px !important;
  height: 32px !important;
  object-fit: contain !important;
}
body.platform-light .sidebar-footer .user-avatar {
  background: #111827 !important;
  color: #fff !important;
}
body.platform-light .sidebar-footer .role-badge {
  background: #f4f4f5 !important;
  color: #3f3f46 !important;
}
body.platform-light .sidebar .menu-item.active {
  background: #f3f4f6 !important;
  color: #111827 !important;
  box-shadow: inset 3px 0 0 #111827 !important;
}
body.platform-light button,
body.platform-light button.primary,
body.platform-light .auth-submit,
body.platform-light .recharge-amount-btn.active,
body.platform-light .recharge-amount-btn.active:hover {
  background: #111827 !important;
  border-color: #111827 !important;
  color: #fff !important;
  box-shadow: none !important;
}
body.platform-light button:hover,
body.platform-light button.primary:hover,
body.platform-light .recharge-amount-btn.active:hover {
  background: #000 !important;
  border-color: #000 !important;
}
body.platform-light .sort-header-button,
body.platform-light .sort-header-button:hover {
  min-height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: inherit !important;
  box-shadow: none !important;
  font: inherit !important;
  letter-spacing: inherit !important;
  text-transform: inherit !important;
}
body.platform-light .sortable-th:hover .sort-header-button,
body.platform-light .sortable-th.active .sort-header-button {
  color: #111827 !important;
}
body.platform-light .sort-arrow {
  color: #9ca3af !important;
}
body.platform-light .sortable-th:hover .sort-arrow,
body.platform-light .sortable-th.active .sort-arrow {
  color: #111827 !important;
}
body.platform-light button.secondary,
body.platform-light button.ghost,
body.platform-light .btn-copy,
body.platform-light .op,
body.platform-light .col-ops .op,
body.platform-light .recharge-amount-btn {
  background: #fff !important;
  border: 1px solid #d4d4d8 !important;
  color: #18181b !important;
  box-shadow: none !important;
}
body.platform-light button.secondary:hover,
body.platform-light button.ghost:hover,
body.platform-light .btn-copy:hover,
body.platform-light .op:hover,
body.platform-light .col-ops .op:hover,
body.platform-light .recharge-amount-btn:hover {
  background: #f4f4f5 !important;
  border-color: #a1a1aa !important;
  color: #111827 !important;
}
body.platform-light .text-btn,
body.platform-light button.text-btn {
  color: #111827 !important;
  background: transparent !important;
  border: 0 !important;
}
body.platform-light .stats-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  gap: 14px !important;
}
body.platform-light .stat-card,
body.platform-light .stats-grid > div {
  background: #f4f4f5 !important;
  background-image: linear-gradient(180deg, #fafafa, #f4f4f5) !important;
  border: 1px solid #e4e4e7 !important;
  border-radius: 14px !important;
  box-shadow: none !important;
  color: #18181b !important;
}
body.platform-light .stat-value,
body.platform-light .balance-value,
body.platform-light .stats-grid strong,
body.platform-light .stats-grid .mono {
  color: #111827 !important;
}
body.platform-light .recharge-amount-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
  gap: 12px !important;
}
body.platform-light .recharge-amount-btn {
  min-height: 64px !important;
  border-radius: 12px !important;
  font-size: 18px !important;
  font-weight: 700 !important;
}
body.platform-light .pager,
body.platform-light .slowdown-status-card,
body.platform-light .slowdown-panel,
body.platform-light .slowdown-node-card,
body.platform-light .api-key-list-controls {
  background: #fff !important;
  border-color: #e4e4e7 !important;
  box-shadow: none !important;
}
body.platform-light .slowdown-status-card.ok {
  background: #f0fdf4 !important;
  border-color: #bbf7d0 !important;
}
body.platform-light .slowdown-status-card.warn,
body.platform-light .slowdown-node-card.warn {
  background: #fffbeb !important;
  border-color: #fde68a !important;
}
body.platform-light .slowdown-status-card.muted-card,
body.platform-light .slowdown-node-card.muted-card {
  background: #f8fafc !important;
}
body.platform-light .slowdown-flow-step {
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
}
body.platform-light .slowdown-flow-step.warn {
  background: #fffbeb !important;
  border-color: #fde68a !important;
}
body.platform-light .slowdown-flow-step.muted {
  background: #f8fafc !important;
  border-color: #e4e4e7 !important;
}
body.platform-light .slowdown-flow-step em {
  background: #fff !important;
  color: #111827 !important;
  border: 1px solid #e4e4e7 !important;
}
body.platform-light .slowdown-enable-actions,
body.platform-light .slowdown-peak-item,
body.platform-light .slowdown-peak-read-card,
body.platform-light .slowdown-configured-info > div,
body.platform-light .slowdown-rule-meta-row > div,
body.platform-light .slowdown-chip-list strong,
body.platform-light .slowdown-model-chip,
body.platform-light .slowdown-modal-basics,
body.platform-light .slowdown-modal-check {
  background: #f8fafc !important;
  border-color: #e4e4e7 !important;
}
body.platform-light .pager-info,
body.platform-light .slowdown-hint,
body.platform-light .slowdown-node-range,
body.platform-light .slowdown-status-label {
  color: #64748b !important;
}
body.platform-light .slowdown-axis-track {
  background: linear-gradient(90deg, #e5e7eb, #bfdbfe, #fde68a) !important;
}
body.platform-light .slowdown-axis-dot {
  border-color: #fff !important;
}
body.platform-light .slowdown-delay-value {
  background: #fff !important;
  border-color: #bfdbfe !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7) !important;
}
body.platform-light .slowdown-delay-value:focus-within {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .16) !important;
}
body.platform-light .slowdown-delay-value span {
  background: #dbeafe !important;
  border-left-color: #bfdbfe !important;
  color: #1d4ed8 !important;
}
body.platform-light .slowdown-marker-control {
  background: #fff !important;
  border-color: #bfdbfe !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .08) !important;
}
body.platform-light .slowdown-axis-marker.level2 .slowdown-marker-control {
  border-color: #fde68a !important;
}
body.platform-light .slowdown-percent-input span {
  color: #64748b !important;
}
body.platform-light .slowdown-status-value,
body.platform-light .slowdown-peak-item strong,
body.platform-light .slowdown-peak-item p,
body.platform-light .slowdown-node-title,
body.platform-light .slowdown-node-delay {
  color: #111827 !important;
}
body.platform-light .tag,
body.platform-light .tag.approved,
body.platform-light .tag.pending,
body.platform-light .tag.rejected,
body.platform-light .tag.disabled {
  background: #f4f4f5 !important;
  border-color: #d4d4d8 !important;
  color: #3f3f46 !important;
}
body.platform-light .tab.active,
body.platform-light .tab-btn.active {
  color: #111827 !important;
  border-bottom-color: #111827 !important;
}
body.platform-light .tab,
body.platform-light .tab-btn {
  color: #71717a !important;
}
body.platform-light a,
body.platform-light .auth-switch {
  color: #111827 !important;
}
body.platform-light .key-show code {
  color: #111827 !important;
}
body.platform-light .notice.danger,
body.platform-light .col-ops .op.danger {
  color: #111827 !important;
  background: #fafafa !important;
  border-color: #d4d4d8 !important;
}
body.platform-light input:focus,
body.platform-light select:focus,
body.platform-light textarea:focus {
  border-color: #111827 !important;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, .10) !important;
}
body.platform-light .toast.success,
body.platform-light .toast.error {
  color: #111827 !important;
  border-color: #d4d4d8 !important;
}

/* 用量统计 / 余额 / API Key 创建 / 弹窗：黑白灰收口 */
body.platform-light .api-key-create-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  margin: 8px 0 16px !important;
  flex-wrap: wrap !important;
}
body.platform-light .api-key-create-actions button {
  min-width: 138px !important;
}
body.platform-light .api-key-list-controls {
  background: #fafafa !important;
  border: 1px solid #e4e4e7 !important;
  border-radius: 12px !important;
}
body.platform-light .api-key-list-controls label {
  color: #71717a !important;
}
body.platform-light .usage-summary {
  gap: 12px !important;
  margin: 14px 0 18px !important;
}
body.platform-light .usage-summary-box,
body.platform-light .stat-cell {
  background: #fafafa !important;
  border: 1px solid #e4e4e7 !important;
  border-radius: 14px !important;
  box-shadow: none !important;
}
body.platform-light .usage-summary-box strong,
body.platform-light .stat-cell .stat-val,
body.platform-light .stat-cell.ok .stat-val,
body.platform-light .stat-cell.warn .stat-val,
body.platform-light .stat-cell.danger .stat-val,
body.platform-light .stats-grid .stat-val {
  color: #111827 !important;
}
body.platform-light .stat-cell .stat-label,
body.platform-light .stat-sub,
body.platform-light .usage-summary-box .muted {
  color: #71717a !important;
}
body.platform-light .user-growth-chart {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
}
body.platform-light .role-dist-row {
  background: #fafafa !important;
  border: 1px solid #e4e4e7 !important;
  border-radius: 12px !important;
}
body.platform-light .role-dist-head {
  color: #111827 !important;
}
body.platform-light .role-dist-track {
  background: #e5e7eb !important;
}
body.platform-light .role-dist-track span {
  background: #111827 !important;
}
body.platform-light .hourly-block,
body.platform-light .api-key-usage-panel {
  background: #fafafa !important;
  border: 1px solid #e4e4e7 !important;
  border-radius: 14px !important;
  padding: 16px !important;
}
body.platform-light .subsection-title {
  color: #111827 !important;
  margin: 0 0 12px !important;
}
body.platform-light .usage-table {
  border: 1px solid #e4e4e7 !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  background: #fff !important;
}
body.platform-light .usage-table th {
  background: #fafafa !important;
  color: #71717a !important;
  font-weight: 600 !important;
}
body.platform-light .usage-table td {
  color: #3f3f46 !important;
}
body.platform-light .usage-table tbody tr:hover,
body.platform-light .usage-table tbody tr:hover td {
  background: #f4f4f5 !important;
}
body.platform-light .modal-mask {
  background: rgba(17, 24, 39, .34) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
}
body.platform-light .modal-card {
  background: #fff !important;
  border: 1px solid #e4e4e7 !important;
  border-radius: 20px !important;
  box-shadow: 0 24px 80px rgba(17, 24, 39, .18) !important;
  color: #111827 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.platform-light .modal-title {
  color: #111827 !important;
  font-size: 16px !important;
  font-weight: 700 !important;
}
body.platform-light .modal-close {
  color: #71717a !important;
}
body.platform-light .modal-close:hover {
  color: #111827 !important;
}
body.platform-light .modal-body,
body.platform-light .modal-form .field {
  color: #3f3f46 !important;
}
body.platform-light button.api-model-discount-link,
body.platform-light button.api-model-discount-link:hover {
  min-height: auto !important;
  margin: 0 !important;
  padding: 4px 7px !important;
  border: 1px solid #bfdbfe !important;
  border-radius: 7px !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  box-shadow: none !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  white-space: nowrap !important;
}
body.platform-light button.api-key-discount-link,
body.platform-light button.api-key-discount-link:hover {
  align-items: flex-start !important;
  white-space: normal !important;
}
body.platform-light .api-key-discount-range { color: #15803d !important; }
body.platform-light button.api-model-discount-link:hover {
  border-color: #93c5fd !important;
  background: #dbeafe !important;
  text-decoration: none !important;
}
body.platform-light .api-model-discount-value { color: #15803d !important; }
body.platform-light .api-benefit-owner,
body.platform-light .api-benefit-empty {
  background: #f8fafc !important;
  border-color: #dbe3ee !important;
}
body.platform-light .api-benefit-discount-panel {
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
}
body.platform-light .api-benefit-active-badge {
  background: #dcfce7 !important;
  color: #15803d !important;
}
body.platform-light button.api-benefit-detail-button,
body.platform-light button.api-benefit-detail-button:hover {
  background: #fff !important;
  border: 1px solid #bfdbfe !important;
  color: #1d4ed8 !important;
  box-shadow: none !important;
}
body.platform-light button.api-benefit-detail-button:hover {
  background: #eff6ff !important;
  border-color: #93c5fd !important;
}
body.platform-light .modal-body input,
body.platform-light .modal-body select,
body.platform-light .modal-body textarea,
body.platform-light .modal-form input,
body.platform-light .modal-form select,
body.platform-light .modal-form textarea {
  background: #fff !important;
  border: 1px solid #d4d4d8 !important;
  color: #111827 !important;
  box-shadow: none !important;
}
body.platform-light .modal-body input::placeholder,
body.platform-light .modal-body textarea::placeholder {
  color: #71717a !important;
  opacity: 1 !important;
}
body.platform-light .modal-body input:focus,
body.platform-light .modal-body select:focus,
body.platform-light .modal-body textarea:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14) !important;
}
body.platform-light .modal-tip {
  background: #fafafa !important;
  border: 1px solid #e4e4e7 !important;
  color: #52525b !important;
}
body.platform-light .request-error-detail-field {
  background: #f8fafc !important;
  border-color: #e4e4e7 !important;
}
body.platform-light .request-error-detail-group {
  background: #fff !important;
  border-color: #e4e4e7 !important;
}
body.platform-light .request-error-detail-group-title {
  color: #374151 !important;
}
body.platform-light .request-error-detail-label {
  color: #64748b !important;
}
body.platform-light .request-error-detail-field strong {
  color: #374151 !important;
}
body.platform-light .request-error-detail-message {
  background: #f8fafc !important;
  border-color: #d4d4d8 !important;
  color: #1f2937 !important;
}
body.platform-light .request-errors-notice {
  background: #f8fafc !important;
  border-color: #e4e4e7 !important;
  color: #64748b !important;
}
body.platform-light .request-errors-notice strong {
  color: #374151 !important;
}
body.platform-light .request-error-detail-section-final .request-error-detail-label {
  color: #b91c1c !important;
}
body.platform-light .request-error-detail-section-upstream .request-error-detail-label {
  color: #a16207 !important;
}
body.platform-light .request-error-detail-message-final {
  background: #fff1f2 !important;
  border-color: #fecdd3 !important;
  color: #9f1239 !important;
}
body.platform-light .request-error-detail-message-upstream {
  background: #fffbeb !important;
  border-color: #fde68a !important;
  color: #92400e !important;
}
body.platform-light .request-errors-http-line + .request-errors-http-line {
  border-top-color: #e4e4e7 !important;
}
body.platform-light .request-errors-http-source {
  border-color: #fecdd3 !important;
  background: #fff1f2 !important;
  color: #b91c1c !important;
}
body.platform-light .request-errors-http-line-upstream .request-errors-http-source {
  border-color: #fde68a !important;
  background: #fffbeb !important;
  color: #a16207 !important;
}
body.platform-light .request-errors-http-code {
  color: #374151 !important;
}
body.platform-light .request-errors-http-separator {
  color: #64748b !important;
}
body.platform-light .request-errors-table,
body.platform-light .request-errors-table th,
body.platform-light .request-errors-table td,
body.platform-light .request-errors-table th *,
body.platform-light .request-errors-table td * {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', Roboto, sans-serif !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
}
body.platform-light .request-errors-table td * {
  font-weight: 400 !important;
}
body.platform-light .admin-models-page .pricing-toolbar,
body.platform-light .admin-models-page .pricing-card,
body.platform-light .admin-model-section {
  background: #fff !important;
  border-color: #d4d4d8 !important;
  box-shadow: none !important;
}
body.platform-light .admin-models-page .pricing-toolbar {
  background: #f8fafc !important;
}
body.platform-light .plan-config-tab-panel,
body.platform-light .admin-collapsible-card,
body.platform-light .plan-config-provider-group {
  background: #fff !important;
  border-color: #dbe3ee !important;
  box-shadow: none !important;
}
body.platform-light .plan-config-panel-toggle,
body.platform-light .admin-collapsible-head,
body.platform-light .plan-config-provider-head {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #dbe3ee !important;
}
body.platform-light .plan-config-panel-toggle:hover {
  background: #f1f5f9 !important;
}
body.platform-light .admin-collapsible-head:hover {
  background: #f1f5f9 !important;
}
body.platform-light .plan-config-panel-title,
body.platform-light .admin-collapse-toggle,
body.platform-light .admin-collapse-toggle:hover,
body.platform-light .plan-config-plan-name,
body.platform-light .plan-config-provider-head h4,
body.platform-light .plan-upstream-model {
  color: #0f172a !important;
}
body.platform-light .admin-collapse-toggle,
body.platform-light .admin-collapse-toggle:hover {
  min-height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-weight: 600 !important;
}
body.platform-light .plan-config-panel-description,
body.platform-light .plan-config-panel-meta,
body.platform-light .plan-config-scope-label {
  color: #64748b !important;
}
body.platform-light .plan-config-panel-body,
body.platform-light .admin-collapsible-body,
body.platform-light .plan-config-content-block + .plan-config-content-block,
body.platform-light .plan-config-plan-row + .plan-config-plan-row {
  border-color: #e2e8f0 !important;
}
body.platform-light .plan-config-model-chip {
  background: #f8fafc !important;
  border-color: #dbe3ee !important;
  color: #334155 !important;
}
body.platform-light .plan-upstream-table-wrap {
  border-color: #dbe3ee !important;
}
body.platform-light .plan-upstream-table .unconfigured td {
  background: #fffbeb !important;
}
body.platform-light .admin-models-page .pricing-section h3,
body.platform-light .admin-models-page .pricing-section-title,
body.platform-light .admin-model-modal .modal-section-title {
  color: #0f172a !important;
}
body.platform-light .admin-models-page .pricing-model-id {
  color: #1d4ed8 !important;
}
body.platform-light .model-kv {
  background: #f8fafc !important;
  border-color: #dbe3ee !important;
}
body.platform-light .model-kv span {
  color: #475569 !important;
}
body.platform-light .model-kv strong {
  color: #0f172a !important;
}
body.platform-light .model-price-read .model-kv strong {
  color: #1d4ed8 !important;
}
body.platform-light .model-price-read .image-model-enabled-status.enabled strong {
  color: #047857 !important;
}
body.platform-light .model-price-read .image-model-enabled-status.disabled {
  border-color: #fca5a5 !important;
  background: #fef2f2 !important;
}
body.platform-light .model-price-read .image-model-enabled-status.disabled strong {
  color: #b91c1c !important;
}
body.platform-light .field-hint {
  color: #475569 !important;
}
body.platform-light .admin-copy-tip {
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
  color: #1e3a8a !important;
}
body.platform-light .model-card-actions button:hover,
body.platform-light .admin-models-page .pricing-card-head button:hover {
  border-color: #2563eb !important;
  color: #1d4ed8 !important;
}
body.platform-light .key-show {
  background: #fafafa !important;
  border-color: #e4e4e7 !important;
}
body.platform-light .key-show code {
  color: #111827 !important;
}
body.platform-light .toast {
  background: #fff !important;
  border: 1px solid #d4d4d8 !important;
  color: #111827 !important;
  box-shadow: 0 16px 40px rgba(17, 24, 39, .14) !important;
  backdrop-filter: none !important;
}
body.platform-light .toast.success,
body.platform-light .toast.error {
  color: #111827 !important;
  border-color: #d4d4d8 !important;
}

/* 功能测试页：优化对话框层次、输入区布局和 placeholder 可读性 */
body.platform-light .playground-card {
  max-width: 960px !important;
}
body.platform-light .playground-card > h2 {
  margin-bottom: 8px !important;
}
body.platform-light .pg-control-row {
  margin: 18px 0 14px !important;
  padding: 14px !important;
  background: #fafafa !important;
  border: 1px solid #e4e4e7 !important;
  border-radius: 14px !important;
}
body.platform-light .pg-control-row label {
  color: #3f3f46 !important;
  font-weight: 600 !important;
}
body.platform-light .pg-control-row select {
  min-height: 38px !important;
}
body.platform-light .pg-advanced-panel {
  background: #fafafa !important;
  border: 1px solid #e4e4e7 !important;
  border-radius: 14px !important;
  padding: 16px !important;
}
body.platform-light .pg-advanced-panel pre {
  background: #fff !important;
  border: 1px solid #e4e4e7 !important;
  color: #3f3f46 !important;
}
body.platform-light .pg-viewport {
  height: 480px !important;
  margin-top: 16px !important;
  padding: 18px !important;
  background: #fafafa !important;
  border: 1px solid #e4e4e7 !important;
  border-radius: 16px !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', Roboto, sans-serif !important;
  font-size: 14px !important;
  line-height: 1.65 !important;
}
body.platform-light .pg-msg {
  width: fit-content !important;
  max-width: min(78%, 680px) !important;
  margin: 0 0 12px !important;
  padding: 10px 13px !important;
  border-radius: 14px !important;
  border: 1px solid #e4e4e7 !important;
  color: #18181b !important;
  box-shadow: none !important;
}
body.platform-light .pg-msg.pg-system {
  width: 100% !important;
  max-width: none !important;
  padding: 0 0 10px !important;
  border: 0 !important;
  color: #71717a !important;
  background: transparent !important;
  font-style: normal !important;
  text-align: center !important;
}
body.platform-light .pg-msg.pg-user {
  margin-left: auto !important;
  background: #111827 !important;
  border-color: #111827 !important;
  color: #fff !important;
  border-bottom-right-radius: 5px !important;
}
body.platform-light .pg-msg.pg-assistant {
  margin-right: auto !important;
  background: #fff !important;
  border-color: #e4e4e7 !important;
  color: #18181b !important;
  border-bottom-left-radius: 5px !important;
}
body.platform-light .pg-msg.pg-error {
  background: #fafafa !important;
  border-color: #a1a1aa !important;
  color: #111827 !important;
}
body.platform-light .pg-image-bar {
  background: #fafafa !important;
  border-color: #e4e4e7 !important;
  border-radius: 14px !important;
}
body.platform-light .pg-image-thumb {
  border-color: #d4d4d8 !important;
  border-radius: 10px !important;
}
body.platform-light .pg-compose {
  margin-top: 14px !important;
  padding: 10px !important;
  align-items: center !important;
  background: #fff !important;
  border: 1px solid #e4e4e7 !important;
  border-radius: 14px !important;
  gap: 8px !important;
}
body.platform-light .pg-compose textarea {
  min-height: 38px !important;
  max-height: 120px !important;
  padding: 9px 12px !important;
  border-radius: 10px !important;
  resize: vertical !important;
  background: #fafafa !important;
}
body.platform-light .pg-compose textarea::placeholder,
body.platform-light textarea::placeholder,
body.platform-light input::placeholder {
  color: #71717a !important;
  opacity: 1 !important;
}
body.platform-light .pg-compose .pg-model-select {
  min-width: 132px !important;
  max-width: 190px !important;
  min-height: 38px !important;
  height: 38px !important;
  padding: 7px 10px !important;
  border-radius: 10px !important;
  background: #fafafa !important;
}
body.platform-light .pg-compose button,
body.platform-light .pg-compose button.primary,
body.platform-light .pg-compose button.ghost {
  min-height: 38px !important;
  height: 38px !important;
  padding: 0 14px !important;
  border-radius: 10px !important;
  line-height: 1 !important;
}
@media (max-width: 980px) {
  body.platform-light .playground-card {
    max-width: none !important;
  }
  body.platform-light .pg-msg {
    max-width: 88% !important;
  }
}
@media (max-width: 720px) {
  body.platform-light .pg-viewport {
    height: 420px !important;
  }
  body.platform-light .pg-compose {
    flex-wrap: wrap !important;
  }
  body.platform-light .pg-compose textarea {
    flex: 1 1 100% !important;
    order: -1 !important;
  }
  body.platform-light .pg-compose .pg-model-select {
    flex: 1 1 160px !important;
    max-width: none !important;
  }
}

/* 登录页同步控制台黑白灰品牌风格 */
body.auth-light {
  background: #fafafa !important;
  color: #111827 !important;
}
body.auth-light::before,
body.auth-light::after {
  display: none !important;
}
body.auth-light .auth-page {
  background: radial-gradient(circle at 50% 0%, rgba(24, 24, 27, .06), transparent 34%), #fafafa !important;
}
body.auth-light .auth-card {
  max-width: 420px !important;
  background: #fff !important;
  border: 1px solid #e4e4e7 !important;
  border-radius: 22px !important;
  box-shadow: 0 24px 80px rgba(17, 24, 39, .08) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body.auth-light .auth-card::before {
  background: transparent !important;
}
body.auth-light .auth-logo {
  display: none !important;
}
body.auth-light .auth-logo-img {
  display: block !important;
  width: 164px !important;
  height: 32px !important;
  object-fit: contain !important;
  margin: 0 auto 18px !important;
}
body.auth-light .auth-brand {
  color: #111827 !important;
  background: none !important;
  -webkit-text-fill-color: currentColor !important;
}
body.auth-light .auth-subtitle {
  color: #71717a !important;
}
body.auth-light .auth-tabs {
  background: #f4f4f5 !important;
  border-color: #e4e4e7 !important;
}
body.auth-light .auth-tab {
  color: #71717a !important;
}
body.auth-light .auth-tab:hover {
  color: #111827 !important;
}
body.auth-light .auth-tab.active {
  background: #111827 !important;
  color: #fff !important;
  box-shadow: none !important;
}
body.auth-light .login-mode {
  color: #71717a !important;
}
body.auth-light .login-mode:hover,
body.auth-light .login-mode.active {
  color: #111827 !important;
}
body.auth-light .login-mode.active {
  border-bottom-color: #111827 !important;
}
body.auth-light .auth-field .field-icon,
body.auth-light .auth-field .field-eye {
  color: #a1a1aa !important;
}
body.auth-light .auth-field .field-eye:hover {
  color: #111827 !important;
}
body.auth-light input,
body.auth-light select,
body.auth-light textarea,
body.auth-light .auth-field input,
body.auth-light .code-row input {
  background: #fff !important;
  color: #111827 !important;
  border-color: #d4d4d8 !important;
  box-shadow: none !important;
}
body.auth-light input::placeholder,
body.auth-light textarea::placeholder {
  color: #a1a1aa !important;
}
body.auth-light input:focus,
body.auth-light select:focus,
body.auth-light textarea:focus,
body.auth-light .auth-field input:focus,
body.auth-light .code-row input:focus {
  border-color: #111827 !important;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, .10) !important;
}
body.auth-light button,
body.auth-light .auth-submit {
  background: #111827 !important;
  border-color: #111827 !important;
  color: #fff !important;
  box-shadow: none !important;
}
body.auth-light button:hover,
body.auth-light .auth-submit:hover {
  background: #000 !important;
  border-color: #000 !important;
  box-shadow: none !important;
}
body.auth-light .code-row button {
  background: #fff !important;
  border-color: #d4d4d8 !important;
  color: #111827 !important;
}
body.auth-light .code-row button:hover {
  background: #f4f4f5 !important;
  border-color: #a1a1aa !important;
}
body.auth-light button:disabled,
body.auth-light .code-row button:disabled {
  background: #f4f4f5 !important;
  border-color: #e4e4e7 !important;
  color: #a1a1aa !important;
  cursor: not-allowed !important;
}
body.auth-light .auth-switch,
body.auth-light a {
  color: #111827 !important;
}
body.auth-light .toast.success,
body.auth-light .toast.error {
  color: #111827 !important;
  border-color: #d4d4d8 !important;
}
body.auth-light .settings-value-full,
body.platform-light .settings-value-full {
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}
body.platform-light .account-page .settings-row {
  grid-template-columns: 110px minmax(0, max-content) auto !important;
  justify-content: start !important;
  column-gap: 16px !important;
}
body.platform-light .account-page .settings-value {
  max-width: min(520px, calc(100vw - 360px)) !important;
}
body.platform-light .account-page .settings-action {
  justify-self: start !important;
}
body.platform-light .account-page .settings-action .text-btn {
  padding: 0 !important;
  min-height: auto !important;
  line-height: 1.5 !important;
}
@media (max-width: 860px) {
  body.platform-light .account-page .settings-row {
    grid-template-columns: 1fr !important;
    row-gap: 6px !important;
  }
  body.platform-light .account-page .settings-value {
    max-width: 100% !important;
  }
}
@media (max-width: 520px) {
  body.auth-light .auth-card {
    padding: 30px 22px 26px !important;
    border-radius: 18px !important;
  }
  body.auth-light .auth-logo-img {
    width: 150px !important;
    height: auto !important;
  }
}
@media (max-width: 860px) {
  body.platform-light .shell-body { flex-direction: column !important; }
  body.platform-light .sidebar {
    width: 100% !important;
    min-height: auto !important;
    position: static !important;
    border-right: 0 !important;
    border-bottom: 1px solid #eef0f3 !important;
  }
  body.platform-light .content { padding: 28px 20px !important; }
  body.platform-light .settings-row { grid-template-columns: 1fr !important; gap: 4px !important; }
}

/* 用量信息页：黑白浅色图表与统计区域 */
body.platform-light .usage-summary {
  gap: 12px !important;
  margin: 14px 0 18px !important;
}
body.platform-light .usage-summary-box,
body.platform-light .stat-cell {
  background: #fafafa !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}
body.platform-light .usage-summary-box strong,
body.platform-light .stat-cell .stat-val,
body.platform-light .stat-cell.ok .stat-val,
body.platform-light .stat-cell.warn .stat-val,
body.platform-light .stat-cell.danger .stat-val {
  color: #111827 !important;
}
body.platform-light .usage-summary-box .muted,
body.platform-light .stat-cell .stat-label {
  color: #71717a !important;
}
body.platform-light .hourly-block {
  border-top-color: #e5e7eb !important;
}
body.platform-light .subsection-title {
  color: #111827 !important;
  font-size: 15px !important;
  font-weight: 650 !important;
}
body.platform-light .usage-chart-controls {
  background: #fafafa !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}
body.platform-light .usage-chart-controls button.small,
body.platform-light .usage-chart-controls button.small.primary {
  min-height: 34px !important;
  padding: 7px 14px !important;
  border-radius: 8px !important;
  border: 1px solid #d4d4d8 !important;
  background: #fff !important;
  color: #111827 !important;
  box-shadow: none !important;
}
body.platform-light .usage-chart-controls button.small.primary {
  background: #111827 !important;
  border-color: #111827 !important;
  color: #fff !important;
}
body.platform-light .usage-chart-controls button.small.primary:hover {
  background: #000 !important;
  border-color: #000 !important;
  color: #fff !important;
}
body.platform-light .tab-header {
  gap: 10px !important;
  border-bottom-color: #e5e7eb !important;
  padding-bottom: 10px !important;
}
body.platform-light .tab-btn {
  min-height: 34px !important;
  padding: 7px 14px !important;
  border: 1px solid #d4d4d8 !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #52525b !important;
  box-shadow: none !important;
}
body.platform-light .tab-btn:hover {
  background: #f4f4f5 !important;
  color: #111827 !important;
  border-color: #a1a1aa !important;
}
body.platform-light .tab-btn.active {
  background: #111827 !important;
  border-color: #111827 !important;
  color: #fff !important;
}
body.platform-light .usage-chart-legend {
  margin-top: 10px !important;
}
body.platform-light .usage-legend-item {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  min-height: 28px !important;
  padding: 5px 10px !important;
  border: 1px solid #e4e4e7 !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #3f3f46 !important;
  font-size: 12px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  box-shadow: none !important;
}
body.platform-light .usage-legend-item:hover {
  border-color: #a1a1aa !important;
  background: #fafafa !important;
}
body.platform-light .usage-legend-item.is-hidden {
  color: #a1a1aa !important;
  background: #f4f4f5 !important;
  text-decoration: line-through !important;
}
body.platform-light .usage-legend-item.is-hidden span:first-child {
  filter: grayscale(1) !important;
}
body.platform-light .usage-chart-controls select,
body.platform-light .usage-chart-controls input {
  min-height: 34px !important;
  border-radius: 8px !important;
}
body.platform-light .usage-table {
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  overflow: hidden !important;
}
body.platform-light .usage-table th {
  background: #fafafa !important;
  color: #71717a !important;
  font-weight: 600 !important;
}
body.platform-light .usage-table td {
  color: #3f3f46 !important;
}
body.platform-light .usage-table tbody tr:hover td,
body.platform-light .usage-table tbody tr:hover {
  background: #fafafa !important;
}

/* Portal 套餐详情：继承老套餐体系，使用 frontend2 浅色黑白灰配色 */
body.platform-light .plan-detail-page {
  max-width: 1180px !important;
}
body.platform-light .plan-detail-page .plan-panel {
  margin-top: 18px !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
body.platform-light .plan-coming-soon {
  min-height: 220px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid #eef0f3 !important;
  border-radius: 14px !important;
  background: #fafafa !important;
  color: #6b7280 !important;
  font-size: 18px !important;
  font-weight: 650 !important;
}
body.platform-light .plan-section-head {
  display: flex !important;
  align-items: flex-end !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin-bottom: 10px !important;
}
body.platform-light .plan-section-head h2,
body.platform-light .plan-panel > h2 {
  margin: 0 0 6px !important;
  color: #111827 !important;
  font-size: 17px !important;
  font-weight: 650 !important;
}
body.platform-light .plan-loading,
body.platform-light .plan-empty {
  padding: 18px 20px !important;
  border: 1px solid #eef0f3 !important;
  border-radius: 12px !important;
  background: #fafafa !important;
  color: #6b7280 !important;
}
body.platform-light .direct-plan-detail,
body.platform-light .sub-record-detail,
body.platform-light .plan-price-row {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap: 8px !important;
}
body.platform-light .plan-info-item {
  min-width: 0 !important;
  padding: 9px 11px !important;
  border: 1px solid #eef0f3 !important;
  border-radius: 9px !important;
  background: #fafafa !important;
}
body.platform-light .plan-info-item.has-action {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  column-gap: 10px !important;
}
body.platform-light .plan-info-item.has-action .plan-info-label,
body.platform-light .plan-info-item.has-action .plan-info-value {
  grid-column: 1 !important;
}
body.platform-light .plan-info-action {
  grid-column: 2 !important;
  grid-row: 1 / span 2 !important;
  display: flex !important;
  align-items: center !important;
}
body.platform-light .plan-inline-action {
  min-height: 28px !important;
  padding: 5px 10px !important;
}
body.platform-light .plan-info-label {
  margin-bottom: 5px !important;
  color: #6b7280 !important;
  font-size: 12px !important;
}
body.platform-light .plan-info-value {
  overflow-wrap: anywhere !important;
  color: #111827 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}
body.platform-light .plan-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
  margin-top: 10px !important;
}
body.platform-light .plan-call-method-card {
  padding: 14px 16px !important;
  border: 1px solid #eef0f3 !important;
  border-radius: 12px !important;
  background: #fff !important;
}
body.platform-light .plan-call-method-title {
  margin-bottom: 12px !important;
  color: #111827 !important;
  font-size: 15px !important;
  font-weight: 650 !important;
}
body.platform-light .plan-call-method-rows {
  display: grid !important;
  gap: 8px !important;
}
body.platform-light .plan-call-method-row {
  display: grid !important;
  grid-template-columns: 78px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 12px !important;
  min-height: 38px !important;
  padding: 7px 9px !important;
  border: 1px solid #eef0f3 !important;
  border-radius: 9px !important;
  background: #fafafa !important;
}
body.platform-light .plan-call-method-label {
  color: #475569 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}
body.platform-light .plan-call-method-value {
  min-width: 0 !important;
  overflow-wrap: anywhere !important;
  background: transparent !important;
  color: #111827 !important;
  font-size: 12.5px !important;
}
body.platform-light .plan-call-method-row .plan-inline-action {
  justify-self: end !important;
}
body.platform-light .plan-call-method-actions {
  display: flex !important;
  justify-content: flex-end !important;
  margin-top: 12px !important;
}
body.platform-light .plan-tabs {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  margin: 0 0 10px !important;
  padding: 3px !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 9px !important;
  background: #f8fafc !important;
}
body.platform-light .plan-provider-filter {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex: 0 0 auto !important;
  color: #475569 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}
body.platform-light .plan-provider-select {
  min-width: 170px !important;
  min-height: 34px !important;
  padding: 6px 30px 6px 10px !important;
  border: 1px solid #dbe1e8 !important;
  border-radius: 9px !important;
  background: #fff !important;
  color: #111827 !important;
  font-size: 13px !important;
}
body.platform-light .plan-provider-groups {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
}
body.platform-light .plan-provider-group {
  min-width: 0 !important;
}
body.platform-light .plan-provider-group-title {
  margin: 0 0 8px !important;
  color: #475569 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}
body.platform-light .plan-provider-groups.all-providers .plan-provider-group-title {
  display: block !important;
  margin-bottom: 12px !important;
  color: #111827 !important;
  font-size: 17px !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
}
body.platform-light .plan-provider-groups.all-providers .plan-provider-group-title::after {
  content: '' !important;
  display: block !important;
  width: 100% !important;
  height: 1px !important;
  margin-top: 8px !important;
  background: #111827 !important;
}
body.platform-light .plan-provider-group .direct-plan-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 270px)) !important;
  justify-content: start !important;
}
body.platform-light .plan-tab {
  min-height: 28px !important;
  padding: 4px 14px !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: #64748b !important;
  box-shadow: none !important;
}
body.platform-light .plan-tab:hover {
  background: #fff !important;
  color: #111827 !important;
  box-shadow: none !important;
}
body.platform-light .plan-tab.active {
  background: #111827 !important;
  color: #fff !important;
}
body.platform-light .active-plan-monitor-head {
  margin: 20px 0 16px !important;
}
body.platform-light .active-plan-monitor-head h2 {
  margin: 0 !important;
}
body.platform-light .active-plan-refresh-btn {
  min-height: 30px !important;
  padding: 5px 12px !important;
  font-size: 12px !important;
}
body.platform-light .active-plan-grid,
body.platform-light .direct-plan-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
  align-items: stretch !important;
  grid-auto-rows: 1fr !important;
  gap: 10px !important;
}
body.platform-light .active-plan-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 680px)) !important;
  justify-content: start !important;
}
body.platform-light .active-plan-card,
body.platform-light .direct-plan-card {
  min-width: 0 !important;
  padding: 13px !important;
  border: 1px solid #eef0f3 !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}
body.platform-light .direct-plan-card {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 340px !important;
  padding: 11px !important;
}
body.platform-light .direct-plan-card > .plan-actions {
  margin-top: auto !important;
  padding-top: 6px !important;
}
body.platform-light .active-plan-card.primary,
body.platform-light .direct-plan-card.active {
  border-color: #111827 !important;
  box-shadow: 0 0 0 1px #111827 inset !important;
}
body.platform-light .direct-plan-card.purchased:not(.active) {
  border-color: #d4d4d8 !important;
  background: #fcfcfc !important;
}
body.platform-light .direct-plan-highlights {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
  margin-top: 7px !important;
}
body.platform-light .direct-plan-metric {
  min-width: 0 !important;
  padding: 8px 9px !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 9px !important;
  background: #f8fafc !important;
}
body.platform-light .direct-plan-metric-label {
  margin-bottom: 5px !important;
  color: #64748b !important;
  font-size: 12px !important;
}
body.platform-light .direct-plan-metric-value {
  color: #111827 !important;
  font-size: 16px !important;
  font-weight: 750 !important;
  line-height: 1.2 !important;
  overflow-wrap: anywhere !important;
}
body.platform-light .direct-plan-card .direct-plan-detail {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)) !important;
  margin-top: 10px !important;
}
body.platform-light .direct-plan-card .direct-plan-detail .plan-info-item {
  padding: 8px 9px !important;
}
body.platform-light .direct-plan-card .direct-plan-detail .plan-info-value {
  line-height: 1.35 !important;
  font-size: 12.5px !important;
}
body.platform-light .active-plan-top,
body.platform-light .direct-plan-head {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 10px !important;
  margin-bottom: 10px !important;
}
body.platform-light .active-plan-top {
  flex-direction: column !important;
  gap: 6px !important;
}
body.platform-light .active-plan-main,
body.platform-light .active-plan-meta {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 12px !important;
  width: 100% !important;
  min-width: 0 !important;
}
body.platform-light .active-plan-status {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}
body.platform-light .active-plan-title,
body.platform-light .direct-plan-name {
  color: #111827 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}
body.platform-light .active-plan-name,
body.platform-light .direct-plan-price {
  margin-top: 3px !important;
  color: #475569 !important;
  font-size: 12.5px !important;
}
body.platform-light .active-plan-expiry {
  color: #64748b !important;
  font-size: 12px !important;
  text-align: right !important;
  white-space: nowrap !important;
}
body.platform-light .direct-plan-price {
  color: #111827 !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
}
body.platform-light .direct-plan-badges {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  flex-wrap: wrap !important;
  margin-top: 6px !important;
}
body.platform-light .plan-tier-badge {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 20px !important;
  padding: 2px 7px !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 999px !important;
  background: #f8fafc !important;
  color: #475569 !important;
  font-size: 11px !important;
  font-weight: 500 !important;
}
body.platform-light .quota-box {
  margin-top: 8px !important;
  padding: 10px !important;
  border: 1px solid #eef0f3 !important;
  border-radius: 10px !important;
  background: #fafafa !important;
}
body.platform-light .quota-box-head,
body.platform-light .quota-line,
body.platform-light .quota-reset {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}
body.platform-light .quota-box-head strong {
  display: block !important;
  color: #111827 !important;
  font-size: 13px !important;
}
body.platform-light .quota-box-head span,
body.platform-light .quota-line,
body.platform-light .quota-reset {
  color: #6b7280 !important;
  font-size: 12px !important;
}
body.platform-light .quota-remain {
  color: #111827 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
}
body.platform-light .quota-bar {
  width: 100% !important;
  height: 8px !important;
  margin: 8px 0 !important;
  overflow: hidden !important;
  border-radius: 999px !important;
  background: #e5e7eb !important;
}
body.platform-light .quota-bar span {
  display: block !important;
  height: 100% !important;
  border-radius: 999px !important;
  background: #111827 !important;
}
.active-plan-monitor-head {
  margin-bottom: 14px;
}
.active-plan-monitor-head h2 {
  margin: 0;
}
.active-plan-refresh-btn {
  flex-shrink: 0;
  min-height: 32px;
  padding: 6px 12px;
  font-size: 12px;
}
.active-plan-refresh-btn:disabled {
  cursor: wait;
  opacity: .65;
}
.active-plan-usage-section {
  margin-top: 12px;
}
.active-plan-section-title {
  margin-bottom: 8px;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 750;
}
.active-plan-usage-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.active-plan-usage-card {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(2, 6, 23, .12);
}
.active-plan-usage-head,
.active-plan-usage-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.active-plan-usage-head strong {
  color: var(--text-main);
  font-size: 12px;
  font-weight: 750;
}
.active-plan-usage-head span {
  color: var(--text-main);
  font-size: 13px;
  font-weight: 800;
}
.active-plan-usage-bar {
  height: 7px;
  margin: 8px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, .24);
}
.active-plan-usage-bar span {
  display: block;
  height: 100%;
  min-width: 2px;
  max-width: 100%;
  border-radius: inherit;
  background: var(--primary);
}
.active-plan-usage-line {
  color: var(--text-muted);
  font-size: 11.5px;
  flex-wrap: wrap;
}
.active-plan-token-inline {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.active-plan-token-inline em {
  color: var(--text-muted);
  font-style: normal;
  font-weight: 650;
  white-space: nowrap;
}
.active-plan-usage-line em {
  color: var(--text-main);
  font-style: normal;
  font-weight: 650;
}
.active-plan-usage-line .active-plan-token-inline em {
  color: var(--text-muted);
}
body.platform-light .active-plan-section-title {
  color: #111827 !important;
}
body.platform-light .active-plan-usage-card {
  border-color: #e5e7eb !important;
  background: #f8fafc !important;
}
body.platform-light .active-plan-usage-head strong,
body.platform-light .active-plan-usage-line em {
  color: #111827 !important;
}
body.platform-light .active-plan-usage-head span {
  color: #111827 !important;
}
body.platform-light .active-plan-usage-bar {
  background: #e5e7eb !important;
}
body.platform-light .active-plan-usage-bar span {
  background: #111827 !important;
}
body.platform-light .active-plan-usage-line,
body.platform-light .active-plan-token-inline em {
  color: #64748b !important;
}
.quota-token-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 8px;
}
.quota-token-cell {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(2, 6, 23, .12);
}
.quota-token-cell span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.25;
}
.quota-token-cell strong {
  display: block;
  margin-top: 4px;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 750;
}
body.platform-light .quota-token-cell {
  border-color: #e5e7eb !important;
  background: #fff !important;
}
body.platform-light .quota-token-cell span {
  color: #64748b !important;
}
body.platform-light .quota-token-cell strong {
  color: #111827 !important;
}
body.platform-light .minimax-usage-section {
  margin-top: 14px !important;
}
body.platform-light .minimax-usage-section h3 {
  margin: 0 0 12px !important;
  color: #111827 !important;
  font-size: 15px !important;
  font-weight: 700 !important;
}
body.platform-light .minimax-usage-panel {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  padding: 14px 16px !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  background: #fff !important;
}
body.platform-light .minimax-usage-row {
  display: grid !important;
  grid-template-columns: 110px minmax(180px, 1fr) 96px !important;
  align-items: center !important;
  gap: 20px !important;
}
body.platform-light .minimax-usage-label {
  min-width: 0 !important;
}
body.platform-light .minimax-usage-label strong {
  display: block !important;
  color: #64748b !important;
  font-size: 12px !important;
  font-weight: 650 !important;
}
body.platform-light .minimax-usage-label span {
  display: block !important;
  margin-top: 3px !important;
  color: #94a3b8 !important;
  font-size: 11px !important;
}
body.platform-light .minimax-usage-track {
  width: 100% !important;
  height: 7px !important;
  overflow: hidden !important;
  border-radius: 999px !important;
  background: #f1f5f9 !important;
}
body.platform-light .minimax-usage-fill {
  display: block !important;
  height: 100% !important;
  min-width: 3px !important;
  border-radius: 999px !important;
}
body.platform-light .minimax-usage-fill.green {
  background: #0bb83f !important;
}
body.platform-light .minimax-usage-fill.orange {
  background: #ff8a1f !important;
}
body.platform-light .minimax-usage-stats {
  color: #111827 !important;
  font-size: 12px !important;
  line-height: 1.55 !important;
  text-align: right !important;
  white-space: nowrap !important;
}
body.platform-light .minimax-usage-stats strong {
  font-size: 13px !important;
  font-weight: 750 !important;
}
body.platform-light .plan-alert {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  margin: 0 0 14px !important;
  padding: 14px 16px !important;
  border: 1px solid #fde68a !important;
  border-radius: 12px !important;
  background: #fffbeb !important;
  color: #92400e !important;
}
@media (max-width: 760px) {
  body.platform-light .plan-call-method-row {
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 7px 10px !important;
  }
  body.platform-light .plan-call-method-label {
    grid-column: 1 / -1 !important;
  }
  body.platform-light .plan-call-method-row .plan-call-method-value:last-child {
    grid-column: 1 / -1 !important;
  }
  body.platform-light .plan-section-head,
  body.platform-light .active-plan-top,
  body.platform-light .direct-plan-head,
  body.platform-light .plan-alert {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  body.platform-light .plan-provider-filter {
    align-items: stretch !important;
    flex-direction: column !important;
  }
  body.platform-light .plan-provider-select {
    width: 100% !important;
  }
  body.platform-light .active-plan-grid,
  body.platform-light .direct-plan-grid {
    grid-template-columns: 1fr !important;
  }
  body.platform-light .direct-plan-highlights {
    grid-template-columns: 1fr !important;
  }
  .active-plan-usage-grid {
    grid-template-columns: 1fr !important;
  }
  body.platform-light .active-plan-main,
  body.platform-light .active-plan-meta {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 4px !important;
  }
  body.platform-light .active-plan-status {
    justify-content: flex-start !important;
  }
  body.platform-light .active-plan-expiry {
    text-align: left !important;
    white-space: normal !important;
  }
  body.platform-light .minimax-usage-row {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  body.platform-light .minimax-usage-stats {
    text-align: left !important;
  }
}

/* Slowdown rule modal polish */
.slowdown-rule-modal-card {
  max-width: min(1060px, calc(100vw - 40px));
}
.slowdown-rule-modal-card .modal-body {
  padding: 10px 24px 20px;
}
.slowdown-rule-modal-card .modal-foot {
  padding: 0 24px 22px;
  border-top: 1px solid rgba(148, 163, 184, .14);
  padding-top: 16px;
}
.slowdown-rule-modal .modal-tip {
  border-color: rgba(59, 130, 246, .22);
  background: linear-gradient(135deg, rgba(59, 130, 246, .10), rgba(99, 102, 241, .06));
  color: var(--text-main);
}
.slowdown-modal-layout {
  grid-template-columns: 1fr;
  gap: 18px;
}
.slowdown-modal-basics,
.slowdown-modal-delay-panel {
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(15, 23, 42, .18), rgba(2, 6, 23, .10));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.slowdown-modal-basics {
  padding: 16px;
}
.slowdown-modal-delay-panel {
  padding: 16px;
}
.slowdown-modal-delay-panel .slowdown-field {
  margin: 14px 0 0;
  max-width: 320px;
}
.slowdown-modal-delay-panel .slowdown-threshold-row {
  margin-top: 14px;
}
.slowdown-modal-delay-panel .slowdown-threshold-row .slowdown-field {
  max-width: none;
  margin: 0;
}
.slowdown-modal-delay-panel .slowdown-level-settings {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}
.slowdown-modal-delay-panel .slowdown-level-settings .slowdown-field {
  margin: 0;
  max-width: none;
}
.slowdown-modal-delay-panel .slowdown-axis-wrap {
  position: relative;
  margin: 8px 0 0;
  padding-top: 50px;
  padding-bottom: 0;
}
.slowdown-modal-delay-panel .slowdown-axis-track {
  height: 10px;
  background: linear-gradient(90deg, #e5e7eb 0 var(--slowdown-l1), #bfdbfe var(--slowdown-l1) var(--slowdown-l2), #fde68a var(--slowdown-l2) 100%);
}
.slowdown-modal-delay-panel .slowdown-axis-marker::after {
  display: none;
}
.slowdown-axis-label-bubble {
  bottom: 28px;
  padding: 7px 11px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .22);
}
.slowdown-axis-dot {
  width: 16px;
  height: 16px;
  border-width: 3px;
  background: #2563eb;
}
.slowdown-axis-marker.level2 .slowdown-axis-dot {
  background: #f59e0b;
}
.slowdown-axis-guides {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 2px;
  overflow: visible;
  pointer-events: none;
}
.slowdown-axis-guides line {
  stroke: rgba(148, 163, 184, .78);
  stroke-width: 1.4;
  stroke-dasharray: 4 4;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.slowdown-modal-delay-panel .slowdown-axis-labels {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  z-index: 1;
  margin-top: 0;
  pointer-events: none;
}
.slowdown-modal-delay-panel .slowdown-node-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 0;
  border: 0;
  overflow: visible;
}
.slowdown-modal-delay-panel .slowdown-node-card.muted-card {
  grid-column: auto;
}
.slowdown-modal-delay-panel .slowdown-node-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, .035);
  padding: 10px;
}
.slowdown-modal-delay-panel .slowdown-node-card + .slowdown-node-card::before {
  display: none;
}
.slowdown-modal-delay-panel .slowdown-node-card.muted-card {
  background: rgba(148, 163, 184, .08);
}
.slowdown-modal-delay-panel .slowdown-node-card.warn {
  border-color: rgba(245, 158, 11, .32);
  background: rgba(245, 158, 11, .10);
}
.slowdown-modal-delay-panel .slowdown-node-title {
  font-size: 12px;
  font-weight: 800;
}
.slowdown-modal-delay-panel .slowdown-node-range {
  margin: 3px 0 8px;
  color: #64748b;
  font-weight: 700;
}
.slowdown-modal-delay-panel .slowdown-node-card .slowdown-hint {
  display: none;
}
.slowdown-delay-value {
  width: 100%;
  min-width: 0;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
}
.slowdown-modal-delay-panel .slowdown-seconds-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14px minmax(0, 1fr);
  gap: 6px;
  width: 100%;
}
.slowdown-modal-delay-panel .slowdown-delay-value input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  appearance: textfield;
  -moz-appearance: textfield;
}
.slowdown-modal-delay-panel .slowdown-delay-value input::-webkit-outer-spin-button,
.slowdown-modal-delay-panel .slowdown-delay-value input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}
.slowdown-modal-delay-panel .slowdown-delay-value input:focus {
  border: 0;
  box-shadow: none;
}
.slowdown-modal-delay-panel .slowdown-delay-value span {
  flex: none;
  min-width: 32px;
}
.slowdown-rule-card-head .pricing-card-actions {
  align-items: center;
  margin-top: 0;
}
.slowdown-configured-card .pricing-card-actions .tag {
  order: -2;
}
.slowdown-configured-card .pricing-card-actions button:first-of-type {
  order: -1;
}

/* Plan action hints */
.plan-action-note {
  margin: 10px 0 8px;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.5;
}
.active-plan-card .plan-action-note {
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(148, 163, 184, .08);
}
body.platform-light .active-plan-card .plan-action-note {
  background: #f8fafc !important;
}

/* Plan intro inside each plan card */
.plan-tier-inline-note {
  margin: 2px 0 12px;
  padding: 12px 13px;
  border: 1px solid rgba(59, 130, 246, .20);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(59, 130, 246, .08), rgba(255, 255, 255, .03));
}
.plan-tier-inline-note.pro {
  border-color: rgba(245, 158, 11, .30);
  background: linear-gradient(135deg, rgba(245, 158, 11, .11), rgba(255, 255, 255, .03));
}
.plan-tier-inline-note span {
  display: inline-flex;
  margin-bottom: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, .12);
  color: #60a5fa;
  font-size: 11px;
  font-weight: 800;
}
.plan-tier-inline-note.pro span {
  background: rgba(245, 158, 11, .14);
  color: #f59e0b;
}
.plan-tier-inline-note strong {
  display: block;
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.3;
}
.plan-tier-inline-note p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.55;
}
body.platform-light .plan-tier-inline-note {
  border-color: #bfdbfe !important;
  background: #eff6ff !important;
}
body.platform-light .plan-tier-inline-note.pro {
  border-color: #fde68a !important;
  background: #fffbeb !important;
}
body.platform-light .slowdown-rule-modal-card .modal-tip,
body.platform-light .slowdown-modal-basics,
body.platform-light .slowdown-modal-delay-panel,
body.platform-light .slowdown-modal-delay-panel .slowdown-node-card {
  background: #fff !important;
}
body.platform-light .slowdown-modal-delay-panel .slowdown-node-card.muted-card {
  background: #f8fafc !important;
}
body.platform-light .slowdown-modal-delay-panel .slowdown-node-card.warn {
  background: #fffbeb !important;
}
@media (max-width: 900px) {
  .slowdown-modal-layout,
  .slowdown-modal-delay-panel .slowdown-node-grid {
    grid-template-columns: 1fr;
  }
}

/* Settings tabs are buttons too, but only the selected tab is a dark action. */
body.platform-light .shell .settings-tab,
body.platform-light .shell .settings-tab:hover {
  background: #fff !important;
  border: 0 !important;
  color: #6b7280 !important;
  box-shadow: none !important;
}
body.platform-light .shell .settings-tab.active,
body.platform-light .shell .settings-tab[aria-selected="true"],
body.platform-light .shell .settings-tab.active:hover,
body.platform-light .shell .settings-tab[aria-selected="true"]:hover {
  background: #111827 !important;
  border: 0 !important;
  color: #fff !important;
  box-shadow: none !important;
}

/* Keep the account footer in view while long sidebars scroll above it. */
body.platform-light .sidebar {
  height: calc(100vh - 48px) !important;
  max-height: calc(100vh - 48px) !important;
  overflow: hidden !important;
}
body.platform-light .sidebar-menu-search {
  flex: 0 0 auto !important;
  padding: 0 2px 10px !important;
}
body.platform-light .sidebar-menu-search-input {
  width: 100% !important;
  min-width: 0 !important;
  height: 34px !important;
  padding: 6px 9px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #111827 !important;
  font-size: 12px !important;
}
body.platform-light .sidebar-menu-search-input::placeholder {
  color: #94a3b8 !important;
}
body.platform-light .sidebar .sidebar-menu {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  scrollbar-gutter: stable;
}
body.platform-light .sidebar-menu-empty {
  padding: 12px 8px;
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
}
body.platform-light .sidebar-footer {
  flex: 0 0 auto !important;
  margin-top: 0 !important;
  background: #fff !important;
}
@media (max-width: 860px) {
  body.platform-light .sidebar {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
  body.platform-light .sidebar .sidebar-menu {
    flex: none !important;
    overflow: visible !important;
  }
}

/* Adjustable sidebar: keep the scrollbar quiet until the sidebar is in use. */
body.platform-light .sidebar {
  position: sticky !important;
  width: var(--sidebar-width, 150px) !important;
  flex: 0 0 var(--sidebar-width, 150px) !important;
  overflow: hidden !important;
}
body.platform-light .sidebar .sidebar-menu {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  scrollbar-gutter: auto;
}
body.platform-light .sidebar .sidebar-menu::-webkit-scrollbar {
  width: 6px;
}
body.platform-light .sidebar .sidebar-menu::-webkit-scrollbar-track {
  background: transparent;
}
body.platform-light .sidebar .sidebar-menu::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
}
body.platform-light .sidebar .sidebar-menu::-webkit-scrollbar-thumb:hover,
body.platform-light .sidebar:hover .sidebar-menu::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, .34);
}
body.platform-light .sidebar .sidebar-menu::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}
body.platform-light .sidebar:hover .sidebar-menu {
  scrollbar-color: rgba(100, 116, 139, .34) transparent;
}
body.platform-light .sidebar-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  width: 8px;
  cursor: col-resize;
  touch-action: none;
}
body.platform-light .sidebar-resize-handle:hover,
body.platform-light .sidebar-resize-handle:focus-visible {
  background: rgba(148, 163, 184, .16);
  outline: none;
}
body.sidebar-resizing {
  cursor: col-resize !important;
  user-select: none !important;
}
body.platform-light .sidebar-footer {
  gap: 6px !important;
  padding-top: 8px !important;
}
body.platform-light .sidebar-footer .user-box {
  gap: 7px !important;
}
body.platform-light .sidebar-footer .user-avatar {
  width: 30px !important;
  height: 30px !important;
  border-radius: 8px !important;
  font-size: .85rem !important;
}
body.platform-light .sidebar-footer .user-meta {
  gap: 2px !important;
}
body.platform-light .sidebar-footer .user-name {
  max-width: 110px !important;
  font-size: 12px !important;
}
body.platform-light .sidebar-footer .role-badge {
  padding: 1px 6px !important;
  font-size: 9px !important;
  line-height: 1.35 !important;
}
body.platform-light .sidebar-footer .cur-user {
  max-height: 28px !important;
  overflow: hidden !important;
  padding: 4px 6px !important;
  font-size: 10px !important;
  line-height: 1.25 !important;
  white-space: nowrap;
  text-overflow: ellipsis;
}
body.platform-light .sidebar-footer .logout-btn {
  min-height: 32px !important;
  margin-top: 0 !important;
  padding: 5px 8px !important;
  font-size: 12px !important;
}
@media (max-width: 860px) {
  body.platform-light .sidebar {
    width: 100% !important;
    flex: 0 0 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    position: static !important;
  }
  body.platform-light .sidebar-resize-handle {
    display: none !important;
  }
}
.pc-model-discount-grid { display: grid; gap: 8px; margin-top: 10px; max-height: 360px; overflow: auto; }
.pc-model-discount-row { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(100px, 140px); gap: 10px; align-items: center; }
.pc-model-discount-row label { display: flex; gap: 8px; align-items: center; }
.model-discount-grid { display: grid; gap: 8px; max-height: 360px; overflow: auto; margin-top: 10px; }
.model-discount-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(100px, 140px); gap: 10px; align-items: center; }
.model-discount-row label { display: flex; gap: 8px; align-items: center; }

.partner-list-table th:nth-child(5),
.partner-list-table td:nth-child(5) {
  width: 160px;
  min-width: 160px;
}
.partner-list-discount-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  line-height: 1.35;
}
.partner-list-discount-cell strong {
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.partner-list-discount-cell span {
  color: var(--text-faint);
  font-size: 11px;
  white-space: nowrap;
}
body.platform-light .partner-list-discount-cell strong {
  color: #111827;
}
body.platform-light .partner-list-discount-cell span {
  color: #64748b;
}

/* 合作伙伴专享折扣编辑弹窗：模型名、选择框和折扣输入各占独立列。 */
.partner-discount-modal {
  width: min(760px, calc(100vw - 32px));
  max-width: 760px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
}
.partner-discount-modal .modal-head {
  flex: 0 0 auto;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--border);
}
.partner-discount-modal .modal-body {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px 22px;
}
.partner-discount-modal .modal-foot {
  flex: 0 0 auto;
  padding: 14px 24px 20px;
  border-top: 1px solid var(--border);
  background: rgba(2, 6, 23, .08);
}
.partner-discount-modal .form-actions {
  width: 100%;
  justify-content: flex-end;
}
.partner-discount-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.partner-discount-intro {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.6;
}
.partner-discount-intro strong {
  color: var(--text-main);
  font-size: 14px;
}
.partner-discount-basics {
  display: block;
  min-width: 0;
}
.partner-discount-field,
.partner-discount-bulk-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
}
.partner-discount-field input,
.partner-discount-bulk-control input {
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
}
.partner-discount-field small {
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.4;
}
.partner-discount-bulk-control {
  display: flex;
  gap: 8px;
  min-width: 0;
}
.partner-discount-bulk-control input {
  flex: 1 1 auto;
}
.partner-discount-bulk-control button {
  flex: 0 0 auto;
  padding: 8px 12px;
  white-space: nowrap;
}
.partner-discount-bulk-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(59, 130, 246, .22);
  border-radius: 12px;
  background: rgba(59, 130, 246, .055);
}
.partner-discount-bulk-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.partner-discount-bulk-title strong {
  color: var(--text-main);
  font-size: 13px;
  white-space: nowrap;
}
.partner-discount-bulk-title span {
  color: var(--text-faint);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.partner-discount-bulk-title .partner-discount-selection-meta,
.partner-discount-bulk-title .partner-discount-picker-selection {
  flex: 0 0 auto;
  margin-left: auto;
  overflow: visible;
  color: #2563eb;
  font-weight: 600;
}
.partner-discount-bulk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}
.partner-discount-picker-field,
.partner-discount-bulk-value {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
}
.partner-discount-model-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  align-content: start;
  gap: 10px;
  width: 100% !important;
  min-width: 0 !important;
  height: 260px;
  max-height: 42vh;
  margin: 0 !important;
  padding: 6px !important;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
}
.partner-discount-provider-column {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, .035);
}
.partner-discount-provider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 2px 2px 6px;
  border-bottom: 1px solid var(--border);
}
.partner-discount-provider-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.partner-discount-provider-title strong {
  overflow: hidden;
  color: var(--text-main);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.partner-discount-provider-count {
  flex: 0 0 auto;
  color: var(--text-faint);
  font-size: 10.5px;
}
.partner-discount-provider-action {
  flex: 0 0 auto;
  min-width: 0;
  padding: 3px 7px;
  border-radius: 6px;
  background: transparent;
  color: var(--primary);
  box-shadow: none;
  font-size: 10.5px;
}
.partner-discount-provider-action:hover {
  background: rgba(59, 130, 246, .1);
  box-shadow: none;
}
.partner-discount-model-option {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  font-size: 12px;
  line-height: 1.2;
  text-align: left;
  transition: background .15s, border-color .15s;
  box-shadow: none;
}
.partner-discount-model-option:hover,
.partner-discount-model-option.is-selected {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  box-shadow: none;
}
.partner-discount-model-option-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.partner-discount-picker-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}
.partner-discount-picker-actions button {
  min-width: 0;
  padding: 8px 9px;
  white-space: nowrap;
}
.partner-discount-picker-actions button:last-child {
  grid-column: 1 / -1;
}
.partner-discount-model-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.partner-discount-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.partner-discount-section-head > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.partner-discount-section-head strong {
  color: var(--text-main);
  font-size: 13px;
  white-space: nowrap;
}
.partner-discount-section-hint {
  color: var(--text-faint);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.partner-discount-selection-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.partner-discount-selection-meta {
  color: var(--text-faint);
  font-size: 11.5px;
  white-space: nowrap;
}
.partner-discount-select-all {
  padding: 5px 9px;
  font-size: 11.5px;
  white-space: nowrap;
}
.partner-discount-model-table {
  display: grid;
  gap: 5px;
  max-height: 270px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(2, 6, 23, .12);
}
.partner-discount-current-provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(2, 6, 23, .12);
}
.partner-discount-current-provider-column {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, .035);
}
.partner-discount-current-provider-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 2px 6px;
  border-bottom: 1px solid var(--border);
}
.partner-discount-current-provider-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text-main);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.partner-discount-current-provider-head span {
  flex: 0 0 auto;
  color: var(--text-faint);
  font-size: 10.5px;
}
.partner-discount-table-head,
.partner-discount-table-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 10px;
  align-items: center;
  min-width: 0;
}
.partner-discount-table-head {
  padding: 3px 10px 6px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
}
.partner-discount-table-row {
  min-height: 46px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: rgba(255, 255, 255, .025);
  transition: background .15s, border-color .15s;
}
.partner-discount-table-row:hover,
.partner-discount-table-row.is-selected {
  background: rgba(59, 130, 246, .07);
  border-color: rgba(59, 130, 246, .18);
}
.partner-discount-model-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.partner-discount-current-value {
  justify-self: end;
  min-width: 86px;
  padding: 6px 10px;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
}

body.platform-light .partner-discount-modal .modal-foot {
  background: #fafafa;
  border-top-color: #e4e4e7;
}
body.platform-light .partner-discount-intro strong,
body.platform-light .partner-discount-section-head strong,
body.platform-light .partner-discount-model-name {
  color: #111827;
}
body.platform-light .partner-discount-intro,
body.platform-light .partner-discount-field,
body.platform-light .partner-discount-bulk-field {
  color: #475569;
}
body.platform-light .partner-discount-model-table {
  background: #fafafa;
  border-color: #e4e4e7;
}
body.platform-light .partner-discount-current-provider-grid {
  background: #fafafa;
  border-color: #e4e4e7;
}
body.platform-light .partner-discount-current-provider-column {
  background: #fff;
  border-color: #e4e4e7;
}
body.platform-light .partner-discount-current-provider-head {
  border-bottom-color: #e4e4e7;
}
body.platform-light .partner-discount-current-provider-head strong {
  color: #111827;
}
body.platform-light .partner-discount-bulk-title strong,
body.platform-light .partner-discount-current-value {
  color: #111827;
}
body.platform-light .partner-discount-picker-field,
body.platform-light .partner-discount-bulk-value {
  color: #475569;
}
body.platform-light .partner-discount-bulk-panel {
  background: #f8fafc;
  border-color: #dbeafe;
}
body.platform-light .partner-discount-model-picker {
  background: #fff;
  border-color: #d4d4d8 !important;
}
body.platform-light .partner-discount-provider-column {
  background: #fff;
  border-color: #e4e4e7;
}
body.platform-light .partner-discount-provider-head {
  border-bottom-color: #e4e4e7;
}
body.platform-light .partner-discount-provider-title strong {
  color: #111827;
}
body.platform-light .partner-discount-provider-action {
  background: #fff !important;
  color: #2563eb;
  border-color: #bfdbfe;
}
body.platform-light .partner-discount-provider-action:hover {
  background: #eff6ff !important;
}
body.platform-light .partner-discount-model-option {
  background: #fff !important;
  border-color: #e4e4e7;
  color: #111827;
}
body.platform-light .partner-discount-model-option:hover {
  background: #eff6ff !important;
  border-color: #bfdbfe;
  color: #1d4ed8;
}
body.platform-light .partner-discount-model-option.is-selected {
  background: #2563eb !important;
  border-color: #2563eb;
  color: #fff !important;
}
body.platform-light .partner-discount-table-row {
  background: #fff;
  border-color: #f1f5f9;
}
body.platform-light .partner-discount-table-row:hover,
body.platform-light .partner-discount-table-row.is-selected {
  background: #f8fafc;
  border-color: #dbeafe;
}

@media (max-width: 620px) {
  .partner-discount-modal {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }
  .partner-discount-modal .modal-head,
  .partner-discount-modal .modal-body,
  .partner-discount-modal .modal-foot {
    padding-left: 16px;
    padding-right: 16px;
  }
  .partner-discount-basics {
    grid-template-columns: 1fr;
  }
  .partner-discount-bulk-grid {
    grid-template-columns: 1fr;
  }
  .partner-discount-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .partner-discount-section-head > div:first-child {
    width: 100%;
  }
  .partner-discount-selection-actions {
    width: 100%;
    justify-content: space-between;
  }
  .partner-discount-model-table {
    max-height: 300px;
  }
  .partner-discount-table-head,
  .partner-discount-table-row {
    grid-template-columns: minmax(0, 1fr) 96px;
    gap: 8px;
  }
}

/* Provider 分组选择器：隔离全局按钮主题，并提供明确的分组收拢交互。 */
.partner-discount-provider-toggle {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 34px;
  padding: 3px 2px;
  border: 0;
  background: transparent;
  color: var(--text-main);
  box-shadow: none;
  text-align: left;
}
.partner-discount-provider-toggle:hover {
  background: transparent;
  color: var(--primary);
  box-shadow: none;
}
.partner-discount-provider-title {
  flex: 1 1 auto;
}
.partner-discount-provider-collapse-label {
  flex: 0 0 auto;
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 500;
}
.partner-discount-provider-chevron {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--text-faint);
  transition: transform .18s ease;
}
.partner-discount-provider-column.is-collapsed .partner-discount-provider-chevron {
  transform: rotate(-90deg);
}
.partner-discount-provider-models {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.partner-discount-provider-models[hidden] {
  display: none;
}
.partner-discount-current-provider-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 32px;
  gap: 8px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--text-main);
  box-shadow: none;
  text-align: left;
}
.partner-discount-current-provider-toggle strong {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.partner-discount-current-provider-toggle span {
  flex: 0 0 auto;
  color: var(--text-faint);
  font-size: 10.5px;
}
.partner-discount-current-provider-toggle:hover {
  background: transparent;
  color: var(--primary);
  box-shadow: none;
}
.partner-discount-current-provider-models {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.partner-discount-current-provider-models[hidden] {
  display: none;
}
.partner-discount-current-provider-column.is-collapsed .partner-discount-provider-chevron {
  transform: rotate(-90deg);
}
.partner-discount-provider-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 66px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid rgba(59, 130, 246, .35);
  background: rgba(59, 130, 246, .08);
  color: #2563eb;
  line-height: 1;
  white-space: nowrap;
}
.partner-discount-model-option {
  display: flex;
  align-items: center;
  min-height: 38px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 500;
  -webkit-text-fill-color: currentColor;
}
.partner-discount-provider-toggle:focus-visible,
.partner-discount-provider-action:focus-visible,
.partner-discount-model-option:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
body.platform-light .partner-discount-provider-toggle,
body.platform-light .partner-discount-provider-toggle:hover {
  min-height: 34px !important;
  padding: 3px 2px !important;
  border: 0 !important;
  background: transparent !important;
  color: #111827 !important;
  box-shadow: none !important;
}
body.platform-light .partner-discount-current-provider-toggle,
body.platform-light .partner-discount-current-provider-toggle:hover {
  min-height: 32px !important;
  padding: 2px 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #111827 !important;
  box-shadow: none !important;
}
body.platform-light .partner-discount-current-provider-toggle span {
  color: #64748b !important;
  -webkit-text-fill-color: currentColor !important;
}
body.platform-light .partner-discount-provider-collapse-label,
body.platform-light .partner-discount-provider-chevron {
  color: #64748b !important;
  -webkit-text-fill-color: currentColor !important;
}
body.platform-light .partner-discount-provider-action,
body.platform-light .partner-discount-provider-action:hover {
  width: auto !important;
  min-width: 66px !important;
  min-height: 32px !important;
  padding: 5px 9px !important;
  border: 1px solid #bfdbfe !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  -webkit-text-fill-color: #1d4ed8 !important;
  box-shadow: none !important;
}
body.platform-light .partner-discount-model-option {
  min-height: 38px !important;
  padding: 8px 10px !important;
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  box-shadow: none !important;
}
body.platform-light .partner-discount-model-option:hover {
  border-color: #93c5fd !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  -webkit-text-fill-color: #1d4ed8 !important;
}
body.platform-light .partner-discount-model-option.is-selected {
  border-color: #2563eb !important;
  background: #2563eb !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
@media (prefers-reduced-motion: reduce) {
  .partner-discount-provider-chevron,
  .partner-discount-model-option {
    transition: none;
  }
}
@media (max-width: 620px) {
  body.platform-light .partner-discount-provider-toggle,
  body.platform-light .partner-discount-provider-action,
  body.platform-light .partner-discount-model-option,
  body.platform-light .partner-discount-current-provider-toggle {
    min-height: 44px !important;
  }
}

/* 两步式模型折扣编辑器：模型卡片内同时展示当前折扣。 */
.partner-discount-modal {
  width: min(1180px, calc(100vw - 24px));
  max-width: 1180px;
  max-height: calc(100vh - 24px);
}
.partner-discount-modal .modal-body {
  padding: 18px 22px 22px;
}
.partner-discount-form {
  gap: 14px;
}
.partner-discount-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #fff;
}
.partner-discount-step-models {
  border-color: #bfdbfe;
  background: #f8fbff;
}
.partner-discount-step-setting {
  background: #f8fafc;
}
.partner-discount-step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.partner-discount-step-index {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.partner-discount-step-copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.partner-discount-step-copy strong {
  color: #0f172a;
  font-size: 14px;
}
.partner-discount-step-copy span {
  color: #64748b;
  font-size: 11.5px;
}
.partner-discount-step-head .partner-discount-picker-selection {
  flex: 0 0 auto;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.partner-discount-model-picker {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: max-content;
  align-items: start;
  height: min(400px, 46vh);
  max-height: 46vh;
  padding: 8px !important;
  gap: 10px;
}
.partner-discount-provider-column {
  align-self: start;
}
.partner-discount-model-option {
  justify-content: space-between;
  gap: 10px;
}
.partner-discount-model-option-name {
  flex: 1 1 auto;
}
.partner-discount-model-option-value {
  flex: 0 0 auto;
  min-width: 52px;
  padding: 3px 7px;
  border: 1px solid #dbe3ee;
  border-radius: 6px;
  background: #f1f5f9;
  color: #334155;
  font-family: Inter, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  -webkit-text-fill-color: currentColor;
}
.partner-discount-model-option.is-selected .partner-discount-model-option-value {
  border-color: rgba(255, 255, 255, .38);
  background: rgba(255, 255, 255, .16);
  color: #fff;
  -webkit-text-fill-color: #fff;
}
.partner-discount-selection-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.partner-discount-selection-toolbar button {
  min-width: 112px;
}
.partner-discount-setting-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(190px, auto);
  gap: 10px;
  align-items: end;
}
.partner-discount-setting-row .partner-discount-field input {
  min-height: 40px;
}
.partner-discount-setting-row > button {
  min-height: 40px;
  white-space: nowrap;
}
body.platform-light .partner-discount-step {
  background: #fff;
  border-color: #e2e8f0;
}
body.platform-light .partner-discount-step-models {
  background: #f8fbff;
  border-color: #bfdbfe;
}
body.platform-light .partner-discount-step-setting {
  background: #f8fafc;
}
body.platform-light .partner-discount-step-copy strong {
  color: #0f172a;
}
body.platform-light .partner-discount-model-option-value {
  border-color: #dbe3ee !important;
  background: #f1f5f9 !important;
  color: #334155 !important;
  -webkit-text-fill-color: #334155 !important;
}
body.platform-light .partner-discount-model-option.is-selected .partner-discount-model-option-value {
  border-color: rgba(255, 255, 255, .38) !important;
  background: rgba(255, 255, 255, .16) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
@media (max-width: 760px) {
  .partner-discount-model-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .partner-discount-setting-row {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 520px) {
  .partner-discount-modal {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
  }
  .partner-discount-model-picker {
    grid-template-columns: 1fr;
  }
  .partner-discount-step-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .partner-discount-step-head .partner-discount-picker-selection {
    width: 100%;
    padding-left: 0;
  }
  .partner-discount-selection-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .partner-discount-selection-toolbar button {
    min-width: 0;
  }
}
