﻿/* ===================================================================
   接口授权中心 · 样式表
   设计基调：简约、留白、柔和光影 + 靛紫渐变点缀
   =================================================================== */

:root {
  --brand-1: #6366f1;
  --brand-2: #a855f7;
  --brand: #5b5bd6;
  --brand-soft: rgba(99, 102, 241, 0.1);

  --bg: #f4f5fa;
  --bg-grad: radial-gradient(1200px 600px at 12% -10%, #e8e9ff 0%, rgba(244, 245, 250, 0) 60%),
             radial-gradient(900px 500px at 100% 0%, #f0e9ff 0%, rgba(244, 245, 250, 0) 55%);
  --surface: #ffffff;
  --surface-2: #fbfbfe;
  --ink: #101226;
  --ink-2: #3d4159;
  --muted: #767c93;
  --line: #e7e9f2;
  --line-strong: #d8dbe8;

  --ok: #12a150;
  --ok-soft: rgba(18, 161, 80, 0.1);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, 0.12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.1);

  --shadow-sm: 0 1px 2px rgba(16, 18, 38, 0.05), 0 1px 3px rgba(16, 18, 38, 0.04);
  --shadow: 0 10px 30px -12px rgba(16, 18, 38, 0.18), 0 2px 6px rgba(16, 18, 38, 0.04);
  --shadow-lg: 0 30px 70px -30px rgba(16, 18, 38, 0.35);

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;

  --side-bg: linear-gradient(180deg, #0e1122 0%, #14182e 100%);
  --side-ink: rgba(255, 255, 255, 0.66);
  --side-ink-strong: #ffffff;
}

html[data-theme='dark'] {
  --bg: #0b0d17;
  --bg-grad: radial-gradient(1100px 600px at 10% -10%, rgba(99, 102, 241, 0.16) 0%, rgba(11, 13, 23, 0) 60%),
             radial-gradient(900px 500px at 100% 0%, rgba(168, 85, 247, 0.14) 0%, rgba(11, 13, 23, 0) 55%);
  --surface: #14172a;
  --surface-2: #171b30;
  --ink: #eef0fa;
  --ink-2: #c3c8dd;
  --muted: #8b91ab;
  --line: #242942;
  --line-strong: #313754;
  --brand-soft: rgba(99, 102, 241, 0.18);
  --ok-soft: rgba(18, 161, 80, 0.18);
  --danger-soft: rgba(220, 38, 38, 0.16);
  --warn-soft: rgba(217, 119, 6, 0.18);
  --shadow: 0 12px 34px -16px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.2);
  --side-bg: linear-gradient(180deg, #0a0c16 0%, #101426 100%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Inter', 'HarmonyOS Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--bg-grad);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
code, pre, .mono { font-family: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace; }
button { font-family: inherit; }
::selection { background: rgba(99, 102, 241, 0.24); }

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

.login {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  z-index: 1;
}

.login-bg { position: absolute; inset: 0; overflow: hidden; }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.62;
  animation: float 16s ease-in-out infinite;
}
.b1 { width: 560px; height: 560px; left: -8%; top: -12%; background: radial-gradient(circle, #7c7cf5, transparent 65%); }
.b2 { width: 620px; height: 620px; right: -12%; bottom: -18%; background: radial-gradient(circle, #b478f5, transparent 62%); animation-delay: -6s; }
.grid-mask {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line-strong) 1px, transparent 1px), linear-gradient(90deg, var(--line-strong) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.35;
  mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 72%);
}
@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(20px, -28px, 0) scale(1.06); }
}

.login-card {
  position: relative;
  width: min(430px, 100%);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 34px 32px 26px;
  box-shadow: var(--shadow-lg);
}

.login-card .brand { display: flex; gap: 14px; align-items: center; margin-bottom: 26px; }
.brand-mark {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(99, 102, 241, 0.9);
}
.brand-mark svg { width: 26px; height: 26px; }
.brand-mark.sm { width: 38px; height: 38px; border-radius: 11px; }
.brand-mark.sm svg { width: 21px; height: 21px; }

.login-card h1 { margin: 0; font-size: 20px; letter-spacing: -0.3px; }
.login-card .brand p { margin: 2px 0 0; font-size: 12px; color: var(--muted); letter-spacing: 0.2px; }

.login-form { display: grid; gap: 16px; }
.login-error {
  margin: -4px 0 0;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12.5px;
}
.login-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
  color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.dot-ok { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }

/* ---------------------------------------------------------------- 表单元素 */

.field { display: grid; gap: 7px; }
.field > span { font-size: 12.5px; color: var(--ink-2); font-weight: 550; letter-spacing: 0.2px; }
.field > span .opt { color: var(--muted); font-weight: 400; }

input[type='text'], input[type='password'], input[type='number'], input[type='date'], select, textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.7; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand-1);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

/* ---------------------------------------------------------------- 按钮 */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px;
  font-size: 13px; font-weight: 550; letter-spacing: 0.2px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.16s, background 0.16s, border-color 0.16s, opacity 0.16s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--brand-1); color: var(--brand); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  border: none;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  box-shadow: 0 10px 24px -12px rgba(99, 102, 241, 0.95);
}
.btn-primary:hover { color: #fff; filter: brightness(1.05); box-shadow: 0 14px 30px -12px rgba(99, 102, 241, 1); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 32%, var(--line-strong)); background: var(--surface); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; height: 42px; font-size: 13.5px; }

.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); cursor: pointer;
  transition: all 0.16s;
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand-1); }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------------------------------------------------------------- 框架 */

.shell { position: relative; z-index: 1; display: flex; min-height: 100vh; }

.sidebar {
  width: 244px; flex: none;
  display: flex; flex-direction: column;
  background: var(--side-bg);
  color: var(--side-ink);
  padding: 22px 14px 16px;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; }
.side-brand-text { display: grid; line-height: 1.35; min-width: 0; }
.side-brand-text strong { color: var(--side-ink-strong); font-size: 14.5px; letter-spacing: 0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-brand-text span { font-size: 10.5px; letter-spacing: 0.8px; text-transform: uppercase; opacity: 0.45; }

.nav { display: grid; gap: 4px; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--side-ink);
  transition: background 0.16s, color 0.16s;
}
.nav-item svg { width: 18px; height: 18px; opacity: 0.7; transition: opacity 0.16s; }
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-item:hover svg { opacity: 1; }
.nav-item.active {
  background: linear-gradient(100deg, rgba(99, 102, 241, 0.32), rgba(168, 85, 247, 0.16));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
}
.nav-item.active svg { opacity: 1; }
.nav-item.active::before {
  content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--brand-1), var(--brand-2));
}

.side-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.side-tip { display: grid; gap: 3px; margin-bottom: 10px; }
.side-tip strong { font-size: 11px; letter-spacing: 0.6px; text-transform: uppercase; opacity: 0.45; font-weight: 600; }
.side-tip code { font-size: 11.5px; color: #b9bdff; }
.ver { font-size: 10.5px; opacity: 0.35; letter-spacing: 0.4px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 22px 34px 6px;
}
.topbar-title h2 { margin: 0; font-size: 21px; letter-spacing: -0.4px; }
.topbar-title p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
}

.view { padding: 20px 34px 56px; }
.page-body { display: grid; gap: 20px; align-content: start; }

/* ---------------------------------------------------------------- 卡片 */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.card-head h3 { margin: 0; font-size: 14.5px; letter-spacing: -0.1px; }
.card-head .sub { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.card-body { padding: 20px; }
.card-body.tight { padding: 6px 8px 8px; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); gap: 14px; }
.stat {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.stat::after {
  content: ''; position: absolute; right: -30px; top: -40px;
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, var(--brand-soft), transparent 70%);
}
.stat .label { font-size: 12px; color: var(--muted); letter-spacing: 0.2px; }
.stat .value { margin-top: 8px; font-size: 27px; font-weight: 680; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.stat .foot { margin-top: 6px; font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .value em { font-style: normal; font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; }

/* 图表 */
.chart { position: relative; display: flex; align-items: flex-end; gap: 10px; height: 148px; padding: 8px 4px 0; }
.chart::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: 26px; height: 108px;
  background-image: repeating-linear-gradient(to top, var(--line) 0 1px, transparent 1px 27px);
  opacity: 0.6; pointer-events: none;
}
.chart-col { position: relative; z-index: 1; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.chart-bars { display: flex; align-items: flex-end; gap: 3px; height: 110px; width: 100%; justify-content: center; }
.chart-bar { width: 9px; border-radius: 4px 4px 2px 2px; min-height: 3px; transition: height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.chart-bar.a { background: linear-gradient(180deg, var(--brand-1), rgba(99, 102, 241, 0.35)); }
.chart-bar.d { background: linear-gradient(180deg, #f87171, rgba(248, 113, 113, 0.3)); }
.chart-label { font-size: 10.5px; color: var(--muted); white-space: nowrap; }

.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); align-items: center; }
.legend i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; margin-right: 5px; }
.legend .lg-a i { background: var(--brand-1); }
.legend .lg-d i { background: #f87171; }

/* ---------------------------------------------------------------- 表格 */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
thead th {
  text-align: left; font-weight: 600; font-size: 11.5px;
  letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted);
  padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
  background: var(--surface-2);
}
thead th:first-child { border-top-left-radius: 10px; }
thead th:last-child { border-top-right-radius: 10px; }
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.14s; }
tbody tr:hover { background: var(--surface-2); }
td.mono, .mono { font-size: 12.5px; }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn + .btn { margin-left: 6px; }
.num { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 徽标 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px;
  font-size: 11.5px; font-weight: 550; letter-spacing: 0.1px;
  border-radius: 999px;
  background: var(--brand-soft); color: var(--brand);
  white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.no { background: var(--danger-soft); color: var(--danger); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.plain { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* 开关 */
.switch { position: relative; display: inline-flex; width: 38px; height: 21px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--line-strong); transition: background 0.18s;
}
.switch span::after {
  content: ''; position: absolute; left: 2.5px; top: 2.5px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.24);
  transition: transform 0.18s;
}
.switch input:checked + span { background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); }
.switch input:checked + span::after { transform: translateX(17px); }

/* ---------------------------------------------------------------- 应用卡 */

.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.app-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr);
}
.app-card > * { min-width: 0; }
.app-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand-1) 34%, var(--line)); }
.app-card .app-top { display: flex; align-items: flex-start; gap: 12px; }
.app-ico {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  font-weight: 700; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  letter-spacing: -0.5px;
}
.app-meta { min-width: 0; }
.app-meta h4 { margin: 0; font-size: 14.5px; letter-spacing: -0.2px; }
.app-meta p { margin: 2px 0 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-keys { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); border: 1px dashed var(--line-strong); min-width: 0; overflow: hidden; }
.key-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
.key-row .k { color: var(--muted); width: 62px; flex: none; font-size: 11px; letter-spacing: 0.3px; }
.key-row code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.copy-btn { border: none; background: transparent; color: var(--muted); cursor: pointer; padding: 2px; display: grid; place-items: center; border-radius: 5px; }
.copy-btn:hover { color: var(--brand); background: var(--brand-soft); }
.copy-btn svg { width: 14px; height: 14px; }
.app-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.app-nums { display: flex; gap: 16px; font-size: 11.5px; color: var(--muted); }
.app-nums b { display: block; font-size: 15px; color: var(--ink); font-weight: 650; letter-spacing: -0.3px; line-height: 1.3; }
.app-ops { display: flex; gap: 6px; align-items: center; }

/* ---------------------------------------------------------------- 空状态 */

.empty { display: grid; place-items: center; gap: 10px; padding: 54px 20px; text-align: center; }
.empty > svg {
  width: 34px; height: 34px; padding: 9px; box-sizing: content-box;
  border-radius: 16px; background: var(--brand-soft); color: var(--brand);
}
.empty .ico {
  width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
}
.empty .ico svg { width: 26px; height: 26px; }
.empty h4 { margin: 4px 0 0; font-size: 14px; }
.empty p { margin: 0; font-size: 12.5px; color: var(--muted); max-width: 380px; }

/* ---------------------------------------------------------------- 工具条 */

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; min-width: 0; }
.search { position: relative; width: 240px; max-width: 100%; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
.search input { padding-left: 33px; height: 38px; }
select.mini { width: auto; height: 38px; padding: 0 30px 0 11px; }

/* 页头 */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.crumb { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.crumb a:hover { color: var(--brand); }
.crumb .sep { opacity: 0.5; }

/* 添加表单 */
.form-grid { display: grid; grid-template-columns: minmax(200px, 1.4fr) minmax(160px, 1fr) 150px auto; gap: 12px; align-items: end; }
.form-grid .actions { display: flex; gap: 8px; }
.form-grid.rule-form { grid-template-columns: minmax(180px, 1.3fr) minmax(170px, 1fr) minmax(140px, 0.9fr) 150px auto; }
.form-grid.ep-form { grid-template-columns: minmax(150px, 1fr) 96px minmax(180px, 1.3fr) minmax(120px, .8fr) auto; }
@media (max-width: 1280px) {
  .form-grid.rule-form, .form-grid.ep-form { grid-template-columns: 1fr 1fr; }
  .form-grid.rule-form .actions, .form-grid.ep-form .actions { grid-column: 1 / -1; }
}
@media (max-width: 1080px) { .form-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

.hint { font-size: 12px; color: var(--muted); display: flex; gap: 7px; align-items: flex-start; margin: 0; }
.hint > svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--brand); }
.hint code { background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; font-size: 11.5px; }

/* ---------------------------------------------------------------- 弹层 */

.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(9, 11, 22, 0.45);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 24px;
  animation: fade 0.16s ease;
}
.modal {
  width: min(520px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  animation: pop 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.modal.wide { width: min(680px, 100%); }
.modal-head { padding: 20px 22px 0; }
.modal-head h3 { margin: 0; font-size: 16px; letter-spacing: -0.2px; }
.modal-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.modal-body { padding: 18px 22px; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 0 22px 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.985); } }

/* 提示 */
.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 90; display: grid; gap: 9px; }
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 15px;
  min-width: 210px;
  font-size: 13px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand-1);
  border-radius: 10px;
  box-shadow: var(--shadow);
  animation: slide 0.22s ease;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }
.toast .t-ico { width: 16px; height: 16px; flex: none; }
.toast.ok .t-ico { color: var(--ok); }
.toast.err .t-ico { color: var(--danger); }
@keyframes slide { from { opacity: 0; transform: translateX(14px); } }

/* ---------------------------------------------------------------- 文档页 */

.docs-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .docs-grid { grid-template-columns: 1fr; } }

.code-block { position: relative; border-radius: var(--r); overflow: hidden; background: #0e1122; border: 1px solid #1d2138; }
.code-block pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 12.5px; line-height: 1.75; color: #d6d9f0; }
.code-block .cb-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 8px 14px; border-bottom: 1px solid #1d2138; }
.code-block .cb-head span { font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; color: #6f76a0; }
.code-block .copy-btn { color: #8b91bb; }
.code-block .copy-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.tok-k { color: #a5b4fc; }
.tok-s { color: #86efac; }
.tok-c { color: #646b93; }
.tok-n { color: #fcd34d; }

.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink-2); }

.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.tab { padding: 6px 13px; font-size: 12.5px; border-radius: 7px; color: var(--muted); cursor: pointer; border: none; background: transparent; }
.tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.pager .p-ops { display: flex; gap: 6px; align-items: center; }

/* 设置页 */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.setting-row:last-child { border-bottom: none; }
.setting-row .st { min-width: 0; }
.setting-row .st strong { display: block; font-size: 13px; font-weight: 570; }
.setting-row .st span { font-size: 12px; color: var(--muted); }

@media (max-width: 880px) {
  .sidebar { position: fixed; left: -260px; z-index: 40; transition: left 0.24s; box-shadow: var(--shadow-lg); }
  .sidebar.open { left: 0; }
  .topbar, .view { padding-left: 18px; padding-right: 18px; }
  .app-grid { grid-template-columns: 1fr; }
}

svg { max-width: 100%; }
.code-block pre { white-space: pre; }
.code-block.wrap pre { white-space: pre-wrap; word-break: break-word; }


/* ------------------------------------------------ 分组 / 限流 / 配额 */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-size: 12px; color: var(--ink-2); cursor: pointer;
  transition: all .16s; display: inline-flex; align-items: center; gap: 5px;
}
.chip:hover { border-color: var(--brand-1); color: var(--brand); }
.chip.active { background: var(--brand-soft); border-color: transparent; color: var(--brand); font-weight: 560; }
.chip small { font-size: 11px; opacity: .65; }

.limit-cell { display: grid; gap: 4px; }
.quota { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.qbar { width: 54px; height: 5px; border-radius: 3px; background: var(--line-strong); overflow: hidden; }
.qbar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--brand-1), var(--brand-2)); }
.qbar.warn i { background: linear-gradient(90deg, #f59e0b, #ef4444); }

.group-create { display: flex; gap: 9px; }
.group-create input { flex: 1; }
.group-list { display: grid; gap: 4px; max-height: 320px; overflow: auto; }
.group-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px dashed var(--line);
}
.group-row:last-child { border-bottom: none; }
.group-row strong { font-size: 13px; font-weight: 570; }
.g-ops { display: flex; gap: 4px; flex: none; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
