/* ============================================================
   Prism Bridge 管理台 · 样式
   设计：浅色为默认，靛蓝主色 + 青→玫瑰的细微光谱点缀；
   圆角卡片、柔和阴影、充足留白；数字 tabular-nums；
   全部颜色走 CSS 变量，data-theme 切换。
   ============================================================ */

:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7fb;
  --bg-2: #eef0f6;
  --panel: #ffffff;
  --panel-2: #f8f9fc;
  --panel-3: #f1f3f8;
  --line: #e6e8f0;
  --line-2: #d4d8e4;
  --text: #1a1d2e;
  --text-2: #4b5268;
  --muted: #6b7286;
  --faint: #979dae;
  --accent: #4f46e5;
  --accent-2: #4338ca;
  --accent-ink: #4338ca;
  --accent-soft: #eef0ff;
  --accent-ring: rgba(79, 70, 229, 0.22);
  --ok: #0f8a5f;
  --ok-soft: #e4f6ee;
  --warn: #b4690e;
  --warn-soft: #fdf3e2;
  --bad: #d1435b;
  --bad-soft: #fdeaee;
  --info: #0e7fa8;
  --info-soft: #e3f4fa;
  --cyan: #06b6d4;
  --violet: #8b5cf6;
  --rose: #f43f5e;
  --spectrum: linear-gradient(90deg, #22d3ee 0%, #6366f1 50%, #f472b6 100%);
  --input-bg: #ffffff;
  --bar-bg: #e9ebf2;
  --code-bg: #f4f5f9;
  --code-text: #2d3148;
  --shadow-s: 0 1px 2px rgba(26, 29, 46, 0.04), 0 2px 8px rgba(26, 29, 46, 0.04);
  --shadow-m: 0 1px 2px rgba(26, 29, 46, 0.05), 0 10px 28px rgba(26, 29, 46, 0.07);
  --shadow-l: 0 24px 64px rgba(26, 29, 46, 0.2);
  --backdrop: rgba(26, 29, 46, 0.36);
  --radius: 14px;
  --radius-s: 10px;
  --radius-xs: 7px;
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1017;
  --bg-2: #0a0c12;
  --panel: #161923;
  --panel-2: #1b1f2b;
  --panel-3: #212637;
  --line: #262b3a;
  --line-2: #343a4d;
  --text: #e7e9f2;
  --text-2: #b6bccd;
  --muted: #9298ab;
  --faint: #656c80;
  --accent: #818cf8;
  --accent-2: #6d78f0;
  --accent-ink: #a5adfb;
  --accent-soft: rgba(129, 140, 248, 0.14);
  --accent-ring: rgba(129, 140, 248, 0.3);
  --ok: #34c58f;
  --ok-soft: rgba(52, 197, 143, 0.14);
  --warn: #e4a53d;
  --warn-soft: rgba(228, 165, 61, 0.14);
  --bad: #f3708a;
  --bad-soft: rgba(243, 112, 138, 0.14);
  --info: #45b3dd;
  --info-soft: rgba(69, 179, 221, 0.14);
  --input-bg: #11141d;
  --bar-bg: #262b3a;
  --code-bg: #10131b;
  --code-text: #d7dbe8;
  --shadow-s: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-m: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 28px rgba(0, 0, 0, 0.35);
  --shadow-l: 0 24px 64px rgba(0, 0, 0, 0.6);
  --backdrop: rgba(0, 0, 0, 0.6);
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* 主题切换时的平滑过渡（仅切换瞬间生效） */
html.theming, html.theming *, html.theming *::before, html.theming *::after {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, fill 0.3s ease, stroke 0.3s ease, box-shadow 0.3s ease !important;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, pre, .mono { font-family: var(--mono); }
code { font-size: 0.88em; background: var(--accent-soft); color: var(--accent-ink); padding: 1px 6px; border-radius: 6px; }
::selection { background: var(--accent-ring); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.hidden { display: none !important; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.ic { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 布局 ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 14px 16px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; margin-bottom: 22px; }
.brand .logo { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 6px 18px rgba(79, 70, 229, 0.28); }
.brand-text { min-width: 0; flex: 1 1 auto; }
.brand h1 { margin: 0; font-size: 1.05rem; font-weight: 700; letter-spacing: 0.01em; }
.brand p { margin: 2px 0 0; color: var(--faint); font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-icon.side-close { display: none; }

.nav { display: flex; flex-direction: column; gap: 14px; flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar-button { display: none; height: 0; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 0.7rem; font-weight: 600; color: var(--faint); letter-spacing: 0.14em; padding: 0 12px 6px; }
.nav-btn {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-s);
  color: var(--muted); font-weight: 500; text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-btn:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav-btn .ic { opacity: 0.75; }
.nav-btn.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav-btn.active .ic { opacity: 1; }
.nav-btn.active::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--spectrum); background-size: 100% 300%;
}
.nav-live {
  margin-left: auto; font-size: 0.7rem; font-weight: 700; padding: 0 7px; border-radius: 999px; line-height: 18px;
  background: var(--accent); color: #fff; font-variant-numeric: tabular-nums;
}
.side-foot {
  margin: 14px 4px 0; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel-2);
  font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; display: grid; gap: 4px;
}
.side-foot-row { display: flex; justify-content: space-between; gap: 10px; }
.side-foot-row b { color: var(--text); font-weight: 600; white-space: nowrap; }

.main { min-width: 0; padding: 26px 36px 64px; width: 100%; max-width: 1360px; margin-inline: auto; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar h2 { margin: 0; font-size: 1.45rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.page-sub { margin: 4px 0 0; color: var(--muted); font-size: 0.875rem; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.btn-icon.menu-btn { display: none; }

/* SSE 状态 */
.sse-status {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); font-size: 0.78rem; color: var(--muted); font-weight: 600;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; flex: 0 0 auto; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.dot.off { background: var(--faint); }
.dot.info { background: var(--info); box-shadow: 0 0 0 3px var(--info-soft); }
.dot.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* 主题图标 */
#theme-btn .ic-moon { display: none; }
[data-theme="dark"] #theme-btn .ic-sun { display: none; }
[data-theme="dark"] #theme-btn .ic-moon { display: block; }

/* ---------- 页面通用 ---------- */
.page { display: grid; gap: 16px; animation: fadein 0.2s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-s); min-width: 0;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.panel-head.wrap { flex-wrap: wrap; }
.panel-head h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.hint { color: var(--muted); font-size: 0.875rem; line-height: 1.75; margin: 0 0 12px; }
.hint:last-child { margin-bottom: 0; }
.hint-inline { color: var(--faint); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.link { font-size: 0.82rem; font-weight: 600; }
.toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.toolbar .hint { margin: 0; max-width: 760px; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.details-panel summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-weight: 700; list-style: none; }
.details-panel summary::-webkit-details-marker { display: none; }
.details-panel summary::before { content: "▸"; color: var(--faint); margin-right: 8px; font-size: 0.85rem; }
.details-panel[open] summary::before { content: "▾"; }
.details-panel summary > span:first-of-type { flex: 1 1 auto; }
.details-body { margin-top: 12px; }
.sub-details { margin-top: 12px; }
.sub-details summary { cursor: pointer; font-size: 0.82rem; color: var(--muted); font-weight: 600; margin-bottom: 8px; }

/* ---------- 横幅 ---------- */
.banners { display: grid; gap: 10px; margin-bottom: 16px; }
.banners:empty { display: none; }
.banner {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius-s); font-size: 0.9rem; line-height: 1.6;
  border: 1px solid transparent;
}
.banner .ic { margin-top: 3px; }
.banner b { font-weight: 700; }
.banner .banner-detail { color: inherit; opacity: 0.85; font-size: 0.85rem; margin-top: 2px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.banner.bad { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.banner.info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.banner a { color: inherit; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }

/* ---------- 指标卡 ---------- */
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric {
  position: relative; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px 14px; box-shadow: var(--shadow-s);
}
.metric::after {
  content: ""; position: absolute; left: 18px; right: 18px; top: 0; height: 2px; border-radius: 0 0 2px 2px;
  background: var(--spectrum); opacity: 0.55;
}
.metric .k { font-size: 0.78rem; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; display: flex; justify-content: space-between; gap: 8px; }
/* flex + gap：主值与「/ 出」之间留出间距（原来 3px 会黏在一起）；
   flex-wrap + overflow-wrap：累计量涨到百亿以上时换行，而不是被 .metric 的 overflow:hidden 裁掉。 */
.metric .v {
  margin-top: 8px; font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15;
  font-variant-numeric: tabular-nums; display: flex; align-items: baseline; flex-wrap: wrap;
  gap: 4px 8px; min-width: 0; overflow-wrap: anywhere;
}
.metric .v small { font-size: 0.95rem; font-weight: 600; color: var(--faint); letter-spacing: 0; }
.metric .v.good { color: var(--ok); }
.metric .v.warn { color: var(--warn); }
.metric .v.bad { color: var(--bad); }
.metric .v.accent { color: var(--accent-ink); }
.metric .s { margin-top: 6px; font-size: 0.78rem; color: var(--faint); font-variant-numeric: tabular-nums; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 15px; border-radius: var(--radius-s); border: 1px solid transparent;
  font-weight: 600; font-size: 0.875rem; line-height: 1.3; white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn .ic { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(67, 56, 202, 0.25), 0 6px 16px rgba(79, 70, 229, 0.22); }
.btn-primary:hover { background: var(--accent-2); }
[data-theme="dark"] .nav-live { color: #0e1017; }
[data-theme="dark"] .btn-primary { color: #0e1017; box-shadow: 0 6px 16px rgba(129, 140, 248, 0.18); }
.btn-ghost { background: var(--panel); color: var(--text-2); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn-danger { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.btn-danger:hover { background: var(--bad); color: #fff; }
.btn-danger.solid { background: var(--bad); color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 0.8rem; border-radius: var(--radius-xs); }
.btn-sm .ic { width: 14px; height: 14px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-busy="true"] { opacity: 0.6; cursor: not-allowed; box-shadow: none; }
.btn[aria-busy="true"] .ic { display: none; }
.btn[aria-busy="true"]::before, .btn-icon[aria-busy="true"]::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn-icon:hover { color: var(--text); border-color: var(--line-2); background: var(--panel-2); }
.btn-icon.sm { width: 28px; height: 28px; border-radius: var(--radius-xs); }
.btn-icon.sm .ic { width: 15px; height: 15px; }
.btn-icon.ok { color: var(--ok); border-color: var(--ok); }
.btn-icon.plain { border-color: transparent; background: transparent; }
.link-btn { appearance: none; border: 0; background: none; padding: 0; color: var(--accent-ink); font-weight: 600; cursor: pointer; font-size: inherit; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  border: 1px solid var(--line-2); background: var(--panel); color: var(--text-2); border-radius: 999px;
  padding: 4px 12px; font-size: 0.8rem; font-weight: 600; transition: border-color 0.15s ease, color 0.15s ease;
}
.chip-btn:hover { border-color: var(--accent); color: var(--accent-ink); }

/* ---------- 表单 ---------- */
.input, .select, .textarea {
  width: 100%; background: var(--input-bg); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--radius-s);
  padding: 9px 12px; font-size: 0.9rem; line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.input:disabled, .select:disabled, .textarea:disabled { opacity: 0.6; cursor: not-allowed; }
.textarea { resize: vertical; min-height: 80px; }
.textarea.mono { font-family: var(--mono); font-size: 0.82rem; line-height: 1.5; }
.select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.select-sm { padding: 5px 28px 5px 10px; font-size: 0.82rem; border-radius: var(--radius-xs); }
.field { display: block; min-width: 0; }
.field-label { display: block; font-size: 0.8rem; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.field-help { display: block; font-size: 0.78rem; color: var(--faint); margin-top: 6px; line-height: 1.55; }
.field-error { color: var(--bad); font-size: 0.85rem; font-weight: 600; margin: -6px 0 8px; }
.field-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.field-inline .select, .toolbar-actions .select { width: auto; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.one { grid-template-columns: 1fr; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 0.82rem; color: var(--muted); font-weight: 600; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; cursor: pointer; }

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.82rem; color: var(--muted); font-weight: 600; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i {
  position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--bar-bg); flex: 0 0 auto;
  transition: background 0.18s ease; border: 1px solid var(--line-2);
}
.switch i::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.18s ease;
}
.switch input:checked + i { background: var(--accent); border-color: var(--accent); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + i { opacity: 0.5; cursor: not-allowed; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; margin: 0 -6px; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--faint); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; white-space: nowrap; padding-top: 2px; padding-bottom: 8px; }
th.r, td.r { text-align: right; }
td.num, th.num { font-variant-numeric: tabular-nums; }
tbody tr { transition: background 0.1s ease; }
tbody tr:hover { background: var(--panel-2); }
tbody tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
tr.row-new { animation: rowin 0.6s ease; }
@keyframes rowin { from { background: var(--accent-soft); } to { background: transparent; } }
td .sub { display: block; color: var(--faint); font-size: 0.75rem; margin-top: 1px; font-variant-numeric: tabular-nums; }
td.mono, .mono { font-family: var(--mono); font-size: 0.82rem; }
.table-wrap.dense table { font-size: 0.82rem; }
.table-wrap.dense th, .table-wrap.dense td { white-space: nowrap; padding: 8px 9px; }
.cell-actions { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; }
.ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; white-space: nowrap; background: var(--panel-3); color: var(--muted); line-height: 1.5;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.9; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge.off { background: var(--panel-3); color: var(--faint); }
.badge.running::before { animation: pulse 1.2s ease-in-out infinite; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; background: var(--panel-3); color: var(--text-2); font-size: 0.75rem; font-weight: 600; font-family: var(--mono); }
.tag.accent { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- 进度条 ---------- */
.bar { height: 6px; border-radius: 99px; background: var(--bar-bg); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--cyan), var(--accent)); transition: width 0.4s ease; }
.bar.warn > i { background: linear-gradient(90deg, #f5b544, var(--warn)); }
.bar.bad > i { background: linear-gradient(90deg, #fb7185, var(--bad)); }
.bar.ok > i { background: linear-gradient(90deg, #5eead4, var(--ok)); }

/* ---------- 图表 ---------- */
.chart-wrap { position: relative; }
.chart { width: 100%; height: 200px; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-text { fill: var(--faint); font-size: 10px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.chart .bar-ok { fill: var(--accent); opacity: 0.8; transition: opacity 0.15s ease; }
.chart .bar-err { fill: var(--bad); }
.chart g.col:hover .bar-ok { opacity: 1; }
.chart .bar-hit { fill: transparent; }
.chart-legend { display: flex; gap: 14px; font-size: 0.75rem; color: var(--faint); margin-top: 6px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.chart-tip {
  position: absolute; pointer-events: none; transform: translate(-50%, calc(-100% - 8px));
  background: var(--text); color: var(--bg); padding: 6px 10px; border-radius: 8px; font-size: 0.75rem; white-space: nowrap;
  font-variant-numeric: tabular-nums; box-shadow: var(--shadow-m); opacity: 0; transition: opacity 0.12s ease;
}
.chart-tip.show { opacity: 1; }

/* ---------- KV ---------- */
.kv { display: grid; gap: 8px; }
.kv-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 0.875rem; }
.kv-row .k { color: var(--muted); font-size: 0.8rem; font-weight: 600; padding-top: 2px; }
.kv-row .v { min-width: 0; word-break: break-word; font-variant-numeric: tabular-nums; }
.kv-inline { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.82rem; color: var(--muted); }
.kv-inline:empty { display: none; }
.kv-inline b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.kv-inline .mono { font-size: 0.78rem; }

/* ---------- 代码块 ---------- */
.code-wrap { position: relative; margin: 0; }
.code-wrap + .code-wrap { margin-top: 12px; }
.code-wrap .code-title { font-size: 0.78rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
pre.code {
  margin: 0; padding: 12px 14px; background: var(--code-bg); color: var(--code-text);
  border: 1px solid var(--line); border-radius: var(--radius-s);
  font-size: 0.8rem; line-height: 1.6; overflow: auto; white-space: pre; tab-size: 2; max-height: 480px;
}
pre.code.wrap { white-space: pre-wrap; word-break: break-word; }
.code-wrap, .cmd-line pre.code { min-width: 0; max-width: 100%; }
.modal-body > *, .drawer-body > * { min-width: 0; }
pre code, .event-log code { background: none; color: inherit; padding: 0; border-radius: 0; font-size: inherit; }
.code-wrap .copy-btn { position: absolute; top: 8px; right: 8px; }
.code-wrap > pre.code { padding-right: 44px; }
.code-wrap.titled .copy-btn { top: 34px; }
.cmd-line { display: flex; align-items: center; gap: 8px; }
.cmd-line pre.code { flex: 1 1 auto; padding: 8px 12px; }

/* ---------- 空状态 / 加载 ---------- */
.empty { text-align: center; padding: 36px 20px; color: var(--muted); font-size: 0.9rem; }
.empty .empty-icon { width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; }
.empty .empty-icon .ic { width: 22px; height: 22px; }
.empty b { display: block; color: var(--text); font-size: 0.95rem; margin-bottom: 4px; }
.empty .empty-sub { font-size: 0.82rem; color: var(--faint); }
.empty .btn { margin-top: 12px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 28px; color: var(--faint); font-size: 0.85rem; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
.skeleton { background: linear-gradient(90deg, var(--panel-3) 25%, var(--panel-2) 50%, var(--panel-3) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 6px; height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- 账号卡 ---------- */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.acc-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-s); display: grid; gap: 14px; position: relative; }
.acc-card.disabled { opacity: 0.72; }
.acc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.acc-title { min-width: 0; }
.acc-title h4 { margin: 0; font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acc-title .acc-email { color: var(--faint); font-size: 0.78rem; margin-top: 2px; word-break: break-all; }
.acc-msg { font-size: 0.8rem; color: var(--bad); background: var(--bad-soft); padding: 6px 10px; border-radius: 8px; line-height: 1.5; }
.acc-msg.warn { color: var(--warn); background: var(--warn-soft); }
.cookie-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cookie-item { background: var(--panel-2); border-radius: var(--radius-s); padding: 9px 11px; }
.cookie-item .k { font-size: 0.72rem; color: var(--faint); font-weight: 600; }
.cookie-item .v { font-size: 0.85rem; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.cookie-item .v.warn { color: var(--warn); }
.cookie-item .v.bad { color: var(--bad); }
.cookie-item .bar { margin-top: 6px; height: 4px; }
.acc-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; font-size: 0.8rem; color: var(--muted); }
.acc-stats div b { display: block; color: var(--text); font-size: 0.95rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.danger-panel { border-color: color-mix(in srgb, var(--bad) 22%, var(--line)); }
.reset-opts { display: grid; gap: 10px; margin-top: 4px; }
.reset-opts .check { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; cursor: pointer; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel-2); }
.reset-opts .check:hover { border-color: var(--line-2); }
.reset-opts .check input { width: 16px; height: 16px; accent-color: var(--accent); }
.reset-opts .check span { font-weight: 600; font-size: 0.86rem; }
.reset-opts .check em { grid-column: 2; font-style: normal; color: var(--muted); font-size: 0.78rem; line-height: 1.5; }

.plan-tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; line-height: 1.5; border: 1px solid transparent; white-space: nowrap;
}
.plan-plus { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 1px 6px rgba(79, 70, 229, 0.35); }
.plan-pro { background: linear-gradient(135deg, #7c3aed, #d946ef); color: #fff; box-shadow: 0 1px 6px rgba(124, 58, 237, 0.35); }
.plan-team { background: linear-gradient(135deg, #0d9488, #22c55e); color: #fff; box-shadow: 0 1px 6px rgba(13, 148, 136, 0.3); }
.plan-free { background: var(--panel-3); color: var(--muted); border-color: var(--line-2); }
.plan-other { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-soft); }
.plan-unknown { background: transparent; color: var(--faint); border-color: var(--line); font-weight: 600; }

.acc-line { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.8rem; color: var(--muted); align-items: center; }
.acc-line b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.acc-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- 模型卡 ---------- */
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.model-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-s); }
.model-card .model-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.model-card h4 { margin: 0; font-size: 1.02rem; font-weight: 700; }
.model-card .model-id { color: var(--faint); font-size: 0.8rem; font-family: var(--mono); }
.model-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 0.8rem; margin-bottom: 10px; }
.model-meta b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- 设置 ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; }
.setting {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 190px); gap: 4px 16px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.setting .s-label { font-weight: 600; font-size: 0.9rem; }
.setting .s-key { font-family: var(--mono); font-size: 0.72rem; color: var(--faint); margin-left: 6px; font-weight: 500; }
.setting .s-help { grid-column: 1; color: var(--muted); font-size: 0.78rem; line-height: 1.55; }
.setting .s-ctl { grid-row: 1 / span 2; grid-column: 2; display: flex; justify-content: flex-end; }
.setting.dirty .s-label::after { content: "•"; color: var(--accent); margin-left: 6px; }
.rejected { margin-bottom: 12px; }
.health-list { display: grid; gap: 8px; margin-top: 10px; }
.health-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; background: var(--panel-2); border-radius: var(--radius-s); font-size: 0.85rem; }
.health-item .dot { margin-top: 7px; }
.health-item b { font-weight: 600; }
.health-item .sub { color: var(--muted); font-size: 0.78rem; display: block; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  appearance: none; border: 0; background: none; padding: 8px 14px; font-weight: 600; font-size: 0.875rem; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; border-radius: 6px 6px 0 0;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent-ink); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.guide-body p.hint { margin-bottom: 10px; }

/* 能力说明 */
.cap-title { margin: 0 0 8px; font-size: 0.9rem; font-weight: 700; }
.cap-title.ok { color: var(--ok); }
.cap-title.warn { color: var(--warn); }
.cap-list { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 0.875rem; line-height: 1.7; display: grid; gap: 4px; }

/* ---------- 试跑 ---------- */
.play-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.play-status { display: flex; align-items: center; gap: 10px; }
.play-status .mono { font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.reasoning-list { display: grid; gap: 6px; margin: 12px 0; }
.reasoning-list:empty { display: none; }
.reasoning-item {
  padding: 8px 12px; border-left: 3px solid var(--violet); background: var(--panel-2); border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  font-size: 0.82rem; color: var(--text-2); line-height: 1.6; animation: fadein 0.25s ease;
}
.reasoning-item .r-label { font-size: 0.7rem; color: var(--faint); font-weight: 600; letter-spacing: 0.06em; margin-right: 6px; }
.tool-call { border: 1px solid var(--line); border-radius: var(--radius-s); margin-top: 12px; overflow: hidden; }
.tool-call .tc-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--panel-2); font-size: 0.82rem; font-weight: 600; }
.tool-call .tc-head .tag { font-size: 0.78rem; }
.tool-call pre.code { border: 0; border-radius: 0; }

/* Markdown */
.md { font-size: 0.925rem; line-height: 1.75; }
.md:empty { display: none; }
.md p { margin: 0 0 10px; }
.md h1, .md h2, .md h3, .md h4 { margin: 14px 0 8px; line-height: 1.35; }
.md h1 { font-size: 1.2rem; } .md h2 { font-size: 1.1rem; } .md h3 { font-size: 1rem; } .md h4 { font-size: 0.95rem; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md li { margin: 2px 0; }
.md pre { margin: 0 0 12px; }
.md blockquote { margin: 0 0 10px; padding: 4px 12px; border-left: 3px solid var(--line-2); color: var(--muted); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.md a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 事件流 ---------- */
.event-log { max-height: 320px; overflow: auto; font-family: var(--mono); font-size: 0.78rem; line-height: 1.6; background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 12px; color: var(--code-text); }
.event-log .ev { display: flex; gap: 10px; padding: 2px 0; }
.event-log .ev-t { color: var(--faint); flex: 0 0 auto; }
.event-log .ev-k { flex: 0 0 auto; min-width: 110px; font-weight: 600; }
.event-log .ev-k.start { color: var(--info); } .event-log .ev-k.end { color: var(--ok); } .event-log .ev-k.err { color: var(--bad); } .event-log .ev-k.acc { color: var(--violet); } .event-log .ev-k.maint { color: var(--warn); }
.event-log .ev-m { min-width: 0; word-break: break-all; }
.event-log .empty { padding: 14px; }

/* ---------- 抽屉 / 弹窗 / 确认 ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: var(--backdrop); backdrop-filter: blur(2px); display: grid; animation: fadein 0.15s ease; }
.overlay.center { place-items: center; padding: 20px; }
.overlay.right { justify-items: end; }
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-l);
  animation: popin 0.18s ease;
}
.modal.wide { width: min(760px, 100%); }
@keyframes popin { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-head, .drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 22px 0; }
.modal-head h3, .drawer-head h3 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.modal-body { padding: 14px 22px 6px; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 20px; flex-wrap: wrap; }
.modal-foot .spacer { flex: 1 1 auto; }
.confirm-msg { color: var(--text-2); font-size: 0.925rem; line-height: 1.7; }
.confirm-msg b { color: var(--text); }
.drawer {
  width: min(640px, 100%); height: 100%; overflow: auto; background: var(--panel); border-left: 1px solid var(--line);
  box-shadow: var(--shadow-l); animation: slidein 0.22s ease; display: flex; flex-direction: column;
}
.drawer.wide { width: min(820px, 100%); }
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-body { padding: 14px 22px 24px; display: grid; gap: 14px; align-content: start; }
.drawer-body h4, .modal-body h4 { margin: 6px 0 0; font-size: 0.85rem; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; }

/* Toast */
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 12px;
  background: var(--text); color: var(--bg); font-size: 0.875rem; font-weight: 500; line-height: 1.5;
  box-shadow: var(--shadow-l); animation: toastin 0.2s ease; border-left: 4px solid var(--accent);
}
.toast .ic { margin-top: 2px; }
.toast.ok { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--bad); }
.toast.warn { border-left-color: var(--warn); }
.toast.out { animation: toastout 0.2s ease forwards; }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toastout { to { opacity: 0; transform: translateY(8px); } }

/* 一次性密钥展示 */
.secret-box { display: flex; gap: 8px; align-items: center; }
.secret-box pre.code { flex: 1 1 auto; padding: 10px 12px; white-space: pre-wrap; word-break: break-all; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(900px 500px at 15% -10%, rgba(99, 102, 241, 0.12), transparent 60%), radial-gradient(800px 460px at 95% 0%, rgba(244, 114, 182, 0.08), transparent 55%), var(--bg); }
.login-card {
  width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 30px 30px 24px;
  box-shadow: var(--shadow-m); display: grid; gap: 16px; position: relative; overflow: hidden;
}
.login-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--spectrum); }
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-brand img { border-radius: 14px; box-shadow: 0 8px 22px rgba(79, 70, 229, 0.3); }
.login-brand h1 { margin: 0; font-size: 1.25rem; font-weight: 700; }
.login-brand p { margin: 2px 0 0; color: var(--muted); font-size: 0.85rem; }
.login-foot { margin: 0; color: var(--faint); font-size: 0.78rem; line-height: 1.6; text-align: center; }

/* ---------- 响应式 ---------- */
@media (max-width: 1199px) and (min-width: 900px) {
  /* 中等宽度：图标轨道式侧栏 */
  .app { grid-template-columns: 76px minmax(0, 1fr); }
  .side { padding: 18px 10px 14px; align-items: stretch; }
  .brand { padding: 0; justify-content: center; margin-bottom: 18px; }
  .brand-text { display: none; }
  .nav-label { display: none; }
  .nav-btn { justify-content: center; padding: 11px 0; }
  .nav-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .nav-btn .ic { width: 20px; height: 20px; }
  .nav-live { position: absolute; top: 4px; right: 6px; margin: 0; font-size: 0.62rem; line-height: 15px; padding: 0 5px; }
  .nav-btn.active::before { left: -10px; }
  .side-foot { display: none; }
  .main { padding: 24px 28px 56px; }
  .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1199px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 899px) {
  /* 窄屏：顶部导航按钮 + 抽屉式侧栏 */
  .app { grid-template-columns: 1fr; }
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100vh; width: min(300px, 86vw);
    transform: translateX(-104%); transition: transform 0.22s ease; box-shadow: none; z-index: 70;
  }
  .side.open { transform: none; box-shadow: var(--shadow-l); }
  .btn-icon.side-close { display: inline-flex; }
  .side-backdrop { position: fixed; inset: 0; background: var(--backdrop); z-index: 65; }
  .btn-icon.menu-btn { display: inline-flex; }
  .main { padding: 16px 16px 48px; }
  .topbar { align-items: center; margin-bottom: 14px; }
  .topbar h2 { font-size: 1.2rem; }
  .page-sub { display: none; }
  .sse-status .sse-text { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .acc-grid, .model-grid { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-actions { justify-content: flex-start; }
  .kv-row { grid-template-columns: 1fr; gap: 2px; }
  .setting { grid-template-columns: 1fr; }
  .setting .s-ctl { grid-row: auto; grid-column: 1; justify-content: flex-start; margin-top: 6px; }
  .cookie-row { gap: 6px; }
  .cookie-item { padding: 7px 8px; }
  .cookie-item .v { font-size: 0.78rem; }
  .toasts { right: 12px; bottom: 12px; left: 12px; max-width: none; }
  .modal-head, .drawer-head { padding: 16px 16px 0; }
  .modal-body, .drawer-body { padding: 12px 16px 6px; }
  .modal-foot { padding: 12px 16px 16px; }
}
@media (max-width: 560px) {
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { padding: 12px 14px 12px; }
  .metric .v { font-size: 1.35rem; }
  .metric .v small { flex-basis: 100%; }
  .panel { padding: 14px 14px; }
  .acc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- 添加账号：分步引导 ---------- */
.method-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.method-card { display: flex; align-items: center; gap: 8px; text-align: left; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel-2); color: var(--text-2); cursor: pointer; font: inherit; font-size: 0.82rem; line-height: 1.3; min-width: 0; transition: border-color .15s, background .15s, color .15s; }
.method-card:hover { border-color: var(--line-2); color: var(--text); }
.method-card.active { border-color: var(--accent); background: var(--accent-soft); color: var(--text); box-shadow: 0 0 0 3px var(--accent-ring); }
.method-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.method-num { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--panel-3); color: var(--muted); font-weight: 700; font-size: 0.74rem; }
.method-card.active .method-num { background: var(--accent); color: #fff; }
.method-title { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; font-weight: 600; min-width: 0; }
.method-title .badge { font-size: 0.66rem; padding: 1px 6px; }
.method-panel { display: grid; gap: 12px; }
.method-desc { color: var(--text-2); font-size: 0.86rem; line-height: 1.55; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--panel-2); border-radius: 0 var(--radius-xs) var(--radius-xs) 0; }
.steps { margin: 0; padding-left: 0; list-style: none; counter-reset: step; display: grid; gap: 8px; }
.steps > li { position: relative; padding-left: 32px; line-height: 1.6; font-size: 0.86rem; color: var(--text); }
.steps > li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 0.74rem; display: inline-flex; align-items: center; justify-content: center; }
.steps .code-wrap { margin: 6px 0 2px; }
.kbd { display: inline-block; padding: 0 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; background: var(--panel-2); font: 600 0.76rem var(--mono); color: var(--text-2); vertical-align: middle; }
code.inline { font: 0.82rem var(--mono); background: var(--code-bg); color: var(--code-text); padding: 1px 6px; border-radius: 5px; }
.paste-box { display: grid; gap: 12px; }
.parse-preview { display: grid; gap: 4px; font-size: 0.82rem; line-height: 1.5; padding: 8px 10px; border-radius: var(--radius-xs); background: var(--panel-2); border: 1px solid var(--line); }
.parse-preview.muted { color: var(--muted); }
.pp-line { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.pp-line .ic { flex: 0 0 auto; width: 15px; height: 15px; margin-top: 3px; }
.pp-line.ok { color: var(--ok); font-weight: 600; }
.pp-line.warn { color: var(--warn); }
.pp-line.bad { color: var(--bad); font-weight: 600; }
.pp-line.muted { color: var(--muted); font-weight: 400; }
.pp-line.big { font-size: 1rem; }
.pp-line .spinner { width: 14px; height: 14px; }
.progress-view { display: grid; gap: 10px; padding: 8px 4px; min-height: 90px; }
@media (max-width: 899px) { .method-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
