/* ==========================================================================
   Azure OpenAI 接口管理平台 · 控制台样式
   设计：深色侧边栏 + 浅色内容区；无外部字体/图标依赖，离线可用。
   ========================================================================== */

/* --- 1. 设计变量与基础重置 ------------------------------------------------ */

:root {
  --sidebar-w: 268px;
  --topbar-h: 64px;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --line: #e3e8f0;
  --line-strong: #cbd5e1;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --muted-2: #98a2b3;

  --brand: #4f46e5;
  --brand-strong: #4338ca;
  --brand-soft: #eef2ff;
  --teal: #0e9384;
  --teal-soft: #f0fdfa;

  --green: #067647;
  --green-soft: #ecfdf3;
  --red: #b42318;
  --red-soft: #fef3f2;
  --amber: #b54708;
  --amber-soft: #fffaeb;
  --blue: #175cd3;
  --blue-soft: #eff8ff;
  --gray: #475467;
  --gray-soft: #f2f4f7;

  --sidebar: #0b1220;
  --sidebar-2: #0e1729;
  --sidebar-ink: #cbd5e1;
  --sidebar-muted: #8494ab;
  --sidebar-active: #1b2740;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 6px 20px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, 0.22);
  --ring: 0 0 0 3px rgba(79, 70, 229, 0.16);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, "Liberation Mono", Menlo,
    monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

svg {
  display: block;
  flex: none;
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 6px;
}

::selection {
  background: #ddd6fe;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 8px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 12px;
}

.noscript {
  margin: 48px auto;
  max-width: 640px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

/* --- 2. 通用工具类 -------------------------------------------------------- */

.muted {
  color: var(--muted);
}
.muted-2 {
  color: var(--muted-2);
}
.small {
  font-size: 12px;
}
.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: -0.01em;
}
.nowrap {
  white-space: nowrap;
}
.break-all {
  word-break: break-all;
}
.center {
  text-align: center;
}
.right {
  text-align: right;
}
.hidden {
  display: none !important;
}
.grow {
  flex: 1 1 auto;
  min-width: 0;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.row--between {
  justify-content: space-between;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stack--sm {
  gap: 6px;
}
.divider {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 16px 0;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.text-danger {
  color: var(--red);
}
.text-warn {
  color: var(--amber);
}
.text-success {
  color: var(--green);
}

/* --- 3. 启动与登录 -------------------------------------------------------- */

.app-root {
  min-height: 100vh;
}

.boot-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
}

.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.login__brand {
  position: relative;
  overflow: hidden;
  padding: 56px 60px;
  color: #e6edf7;
  background:
    radial-gradient(900px 520px at -10% -20%, rgba(79, 70, 229, 0.55), transparent 60%),
    radial-gradient(700px 460px at 110% 10%, rgba(14, 147, 132, 0.35), transparent 55%),
    linear-gradient(160deg, #0b1220 0%, #111c33 55%, #0b1220 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login__brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(148, 163, 184, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.09) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse at 30% 20%, #000 20%, transparent 72%);
  pointer-events: none;
}

.login__brand > * {
  position: relative;
  z-index: 1;
}

.login__brand-top {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.login__headline {
  max-width: 560px;
  margin: 48px 0 0;
}

.login__headline h2 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #f8fafc;
}

.login__headline p {
  margin-top: 16px;
  color: #a9b8cd;
  font-size: 15px;
  max-width: 480px;
}

.login__points {
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
  max-width: 520px;
}

.login__points li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: #c7d3e4;
  font-size: 13.5px;
}

.login__points svg {
  color: #7dd3c7;
  margin-top: 2px;
}

.login__brand-foot {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: #7c8ca5;
  font-size: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  padding-top: 20px;
}

.login__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: var(--surface);
}

.login__card {
  width: 100%;
  max-width: 430px;
}

.login__card h1 {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.login__card > p {
  color: var(--muted);
  margin-top: 8px;
  margin-bottom: 26px;
}

.login__error {
  margin-bottom: 18px;
}

.demo-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.demo-account {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.demo-account:hover {
  border-color: #c7c9f7;
  background: var(--brand-soft);
}

.demo-account:active {
  transform: translateY(1px);
}

.demo-account__avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 650;
  color: var(--brand-strong);
  background: var(--brand-soft);
  flex: none;
}

.demo-account__main {
  flex: 1 1 auto;
  min-width: 0;
}

.demo-account__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.demo-account__meta {
  font-size: 11.5px;
  color: var(--muted);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-account__role {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  flex: none;
}

.login__hint {
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
}

/* --- 4. 应用骨架 ---------------------------------------------------------- */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--sidebar-ink);
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  border-right: 1px solid rgba(148, 163, 184, 0.1);
  z-index: 50;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #6366f1, #4f46e5 55%, #0e9384 140%);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
  flex: none;
}

.brand-text {
  min-width: 0;
}

.brand-text strong {
  display: block;
  font-size: 14px;
  color: #f1f5f9;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand-text span {
  display: block;
  font-size: 11px;
  color: var(--sidebar-muted);
  margin-top: 1px;
}

.sidebar__scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 12px 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

.sidebar__scroll::-webkit-scrollbar {
  width: 8px;
}
.sidebar__scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 8px;
}

.nav-group + .nav-group {
  margin-top: 18px;
}

.nav-group__label {
  padding: 0 12px 6px;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6d7f98;
}

.nav {
  display: grid;
  gap: 2px;
}

.nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--sidebar-ink);
  font-size: 13px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav__item:hover {
  background: rgba(148, 163, 184, 0.09);
  color: #f1f5f9;
  text-decoration: none;
}

.nav__item.is-active {
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.28), rgba(79, 70, 229, 0.1));
  border-color: rgba(129, 140, 248, 0.35);
  color: #ffffff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #818cf8;
}

.nav__item svg {
  color: #94a3b8;
  width: 18px;
  height: 18px;
}

.nav__item.is-active svg {
  color: #c7d2fe;
}

.nav__badge {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.sidebar__foot {
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  padding: 12px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.06);
}

.sidebar-user__avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 650;
  color: #e0e7ff;
  background: rgba(99, 102, 241, 0.3);
  flex: none;
}

.sidebar-user__main {
  min-width: 0;
}

.sidebar-user__name {
  font-size: 12.5px;
  color: #f1f5f9;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user__meta {
  font-size: 11px;
  color: var(--sidebar-muted);
}

.sidebar__version {
  padding: 10px 12px 0;
  font-size: 10.5px;
  color: #64748b;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar__menu {
  display: none;
}

.topbar__title {
  min-width: 0;
}

.topbar__title strong {
  display: block;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.topbar__title span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}

.topbar__spacer {
  flex: 1 1 auto;
}

.topbar__meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.user-chip__avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-strong);
  background: var(--brand-soft);
  flex: none;
}

.user-chip__name {
  font-size: 12.5px;
  font-weight: 600;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip__role {
  font-size: 10.5px;
  color: var(--muted);
}

.view {
  flex: 1 1 auto;
  padding: 24px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  outline: none;
}

.sidebar-overlay {
  display: none;
}

/* --- 5. 页头 / 卡片 / 指标 ------------------------------------------------- */

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-head__main {
  min-width: 0;
}

.page-head h1 {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-head__desc {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  max-width: 820px;
}

.page-head__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.section {
  margin-top: 20px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.section-head p {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 3px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.card__head h3 {
  font-size: 14.5px;
  font-weight: 650;
}

.card__head p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.card__head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card__body {
  padding: 18px;
}

.card__body--flush {
  padding: 0;
}

.card__foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--surface-2);
  border-radius: 0 0 var(--radius) var(--radius);
}

.card--accent {
  border-color: #d9d6fe;
  background: linear-gradient(180deg, #fbfbff, #ffffff 40%);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat {
  position: relative;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.stat::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent, var(--brand));
  opacity: 0.65;
}

.stat__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stat__label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.stat__icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--accent, var(--brand));
  background: color-mix(in srgb, var(--accent, var(--brand)) 12%, #fff);
}

.stat__value {
  margin-top: 10px;
  font-size: 26px;
  line-height: 1.1;
  font-weight: 650;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat__value small {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
  letter-spacing: 0;
}

.stat__hint {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted);
}

.stat--alert .stat__value {
  color: var(--red);
}

/* --- 6. 按钮 / 表单 ------------------------------------------------------- */

.btn {
  --btn-bg: var(--surface);
  --btn-ink: var(--ink-2);
  --btn-line: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 13px;
  border-radius: 9px;
  border: 1px solid var(--btn-line);
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-size: 13px;
  font-weight: 550;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease,
    transform 0.05s ease, color 0.15s ease;
  text-decoration: none;
}

.btn:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn[disabled],
.btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn--primary {
  --btn-bg: linear-gradient(180deg, #5b52ea, var(--brand));
  --btn-ink: #ffffff;
  --btn-line: transparent;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn--primary:hover {
  background: linear-gradient(180deg, #4f46e5, var(--brand-strong));
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}

.btn--danger {
  --btn-ink: var(--red);
  --btn-line: #fecdc9;
  --btn-bg: #fff5f4;
}

.btn--danger:hover {
  --btn-bg: var(--red-soft);
  --btn-line: #fda29b;
}

.btn--subtle {
  --btn-line: transparent;
  --btn-bg: transparent;
  --btn-ink: var(--muted);
}

.btn--subtle:hover {
  --btn-bg: var(--surface-3);
  --btn-ink: var(--ink);
}

.btn--sm {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.btn--sm svg {
  width: 13px;
  height: 13px;
}

.btn--icon {
  width: 34px;
  min-height: 34px;
  padding: 0;
}

.btn--block {
  width: 100%;
}

.btn.is-busy {
  pointer-events: none;
  position: relative;
  color: transparent !important;
}

.btn.is-busy::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(79, 70, 229, 0.25);
  border-top-color: var(--brand);
  animation: spin 0.7s linear infinite;
}

.btn--primary.is-busy::after {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

.btn-group {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.field > label .req {
  color: var(--red);
  margin-left: 2px;
}

.field-hint {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.textarea {
  min-height: 96px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: #a5a1f5;
  box-shadow: var(--ring);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-2);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  background: var(--surface-3);
  color: var(--muted);
  cursor: not-allowed;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}

.check input[type="checkbox"],
.check input[type="radio"] {
  width: 15px;
  height: 15px;
  accent-color: var(--brand);
  margin: 0;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
  font-size: 12.5px;
  color: var(--ink-2);
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch__track {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #d0d5dd;
  position: relative;
  transition: background 0.15s ease;
  flex: none;
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.25);
  transition: transform 0.15s ease;
}

.switch input:checked + .switch__track {
  background: var(--brand);
}

.switch input:checked + .switch__track::after {
  transform: translateX(16px);
}

.switch input:focus-visible + .switch__track {
  box-shadow: var(--ring);
}

.toolbar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius) var(--radius) 0 0;
}

.toolbar .field {
  min-width: 150px;
  flex: 0 1 200px;
}

.toolbar .field--wide {
  flex: 1 1 240px;
}

.toolbar .grow {
  flex: 1 1 auto;
}

.toolbar__actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.filter-summary {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

/* --- 7. 表格 / 徽章 / 标签 ------------------------------------------------- */

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  min-width: 640px;
}

.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  padding: 9px 12px;
  white-space: nowrap;
}

.table td {
  padding: 11px 12px;
  border-bottom: 1px solid #eef1f6;
  vertical-align: middle;
  color: var(--ink-2);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr.is-clickable {
  cursor: pointer;
}

.table tbody tr.is-clickable:hover {
  background: #f9fafc;
}

.table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table .cell-main {
  font-weight: 600;
  color: var(--ink);
}

.table .cell-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.table--compact td {
  padding: 8px 12px;
}

.table__empty td {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  border: 1px solid transparent;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}

.badge--plain::before {
  display: none;
}

.badge--green {
  color: var(--green);
  background: var(--green-soft);
  border-color: #abefc6;
}
.badge--red {
  color: var(--red);
  background: var(--red-soft);
  border-color: #fecdca;
}
.badge--amber {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: #fedf89;
}
.badge--blue {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: #b2ddff;
}
.badge--gray {
  color: var(--gray);
  background: var(--gray-soft);
  border-color: #e4e7ec;
}
.badge--violet {
  color: var(--brand-strong);
  background: var(--brand-soft);
  border-color: #d9d6fe;
}

.chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 7px;
  font-size: 11px;
  background: var(--surface-3);
  color: var(--ink-2);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.chip--ok {
  color: var(--green);
  background: var(--green-soft);
  border-color: #abefc6;
}

.chip--warn {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: #fedf89;
}

.chip--bad {
  color: var(--red);
  background: var(--red-soft);
  border-color: #fecdca;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-2);
  display: inline-block;
  flex: none;
}

.dot--ok {
  background: #17b26a;
}
.dot--warn {
  background: #f79009;
}
.dot--bad {
  background: #f04438;
}

.meter {
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: #eef1f6;
  overflow: hidden;
  min-width: 90px;
}

.meter__fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #4f46e5, #0e9384);
  border-radius: 999px;
}

.meter__fill--warn {
  background: linear-gradient(90deg, #f79009, #f04438);
}

.meter__fill--over {
  background: linear-gradient(90deg, #f04438, #b42318);
}

.meter__stop {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: #b42318;
  opacity: 0.75;
}

.meter-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}

.money {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: help;
  border-bottom: 1px dotted #cbd5e1;
}

/* --- 8. 键值 / 代码 / 提示块 ----------------------------------------------- */

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px 20px;
}

.kv {
  min-width: 0;
}

.kv__key {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.kv__val {
  font-size: 13px;
  color: var(--ink);
  margin-top: 2px;
  word-break: break-word;
}

.kv__val.mono {
  font-size: 12px;
}

.code {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  max-height: 420px;
  margin: 0;
}

.code--light {
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}

.code-inline {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}

.callout {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 12.5px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
}

.callout svg {
  margin-top: 1px;
}

.callout--warn {
  background: var(--amber-soft);
  border-color: #fedf89;
  color: #7a2e0e;
}

.callout--danger {
  background: var(--red-soft);
  border-color: #fecdca;
  color: #7a271a;
}

.callout--info {
  background: var(--blue-soft);
  border-color: #b2ddff;
  color: #194185;
}

.callout--success {
  background: var(--green-soft);
  border-color: #abefc6;
  color: #054f31;
}

.callout__title {
  font-weight: 650;
  margin-bottom: 2px;
}

.notice-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.notice-list li + li {
  margin-top: 4px;
}

/* --- 9. 分栏 / 详情 / 进度 ------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.split--wide-left {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
}

.split-col {
  min-width: 0;
}

.candidate {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.candidate + .candidate {
  margin-top: 8px;
}

.candidate:hover {
  border-color: #d3d8e3;
  box-shadow: var(--shadow-sm);
}

.candidate__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.candidate__name {
  font-weight: 650;
  font-size: 13px;
  color: var(--ink);
  word-break: break-word;
}

.candidate__sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.candidate__meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.candidate__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.detail-block {
  padding: 16px 18px;
  background: var(--surface-2);
  border-top: 1px solid var(--line);
}

.expand {
  margin-top: 10px;
}

.details[open] .details__summary {
  margin-bottom: 8px;
}

.details__summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--brand);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  user-select: none;
}

.details__summary::-webkit-details-marker {
  display: none;
}

.details__summary::before {
  content: "▸";
  font-size: 10px;
  transition: transform 0.15s ease;
}

.details[open] .details__summary::before {
  transform: rotate(90deg);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 4px;
  display: grid;
  gap: 10px;
}

.timeline li {
  position: relative;
  padding-left: 18px;
  font-size: 12px;
  color: var(--ink-2);
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #818cf8;
  box-shadow: 0 0 0 3px #eef2ff;
}

.timeline li::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 15px;
  bottom: -12px;
  width: 1px;
  background: var(--line);
}

.timeline li:last-child::after {
  display: none;
}

.timeline time {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  margin-right: 8px;
}

.cap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.cap {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  min-width: 0;
}

.cap__head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--ink-2);
}

.cap__detail {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
  word-break: break-word;
}

.cap--ok {
  border-color: #abefc6;
  background: var(--green-soft);
}
.cap--ok .cap__head {
  color: var(--green);
}
.cap--ok .cap__detail {
  color: #067647;
}

.cap--bad {
  border-color: #fecdca;
  background: var(--red-soft);
}
.cap--bad .cap__head {
  color: var(--red);
}
.cap--bad .cap__detail {
  color: #912018;
}

.cap--unknown {
  border-color: var(--line);
  background: var(--surface-3);
}

/* --- 10. 加载 / 空态 ------------------------------------------------------ */

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(79, 70, 229, 0.2);
  border-top-color: var(--brand);
  animation: spin 0.75s linear infinite;
  display: inline-block;
  flex: none;
}

.spinner--lg {
  width: 28px;
  height: 28px;
  border-width: 3px;
}

.spinner--light {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: #eef1f6;
  border-radius: 7px;
  min-height: 12px;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  animation: shimmer 1.35s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.skeleton-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.skeleton-table {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.loading-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 26px;
  justify-content: center;
  color: var(--muted);
  font-size: 12.5px;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.empty__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--muted-2);
}

.empty strong {
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 600;
}

.empty p {
  font-size: 12px;
  max-width: 420px;
}

.inline-error {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  margin: 14px 0;
  border: 1px solid #fecdca;
  background: var(--red-soft);
  border-radius: 10px;
  color: #7a271a;
  font-size: 12.5px;
}

.inline-error .meta {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.8;
  margin-top: 4px;
}

/* --- 11. Toast / 模态 / 抽屉 ---------------------------------------------- */

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  background: #fff;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.2s ease both;
}

.toast--error {
  border-left-color: var(--red);
}
.toast--success {
  border-left-color: var(--green);
}
.toast--warn {
  border-left-color: var(--amber);
}
.toast--info {
  border-left-color: var(--blue);
}

.toast__icon {
  margin-top: 1px;
  color: var(--brand);
}
.toast--error .toast__icon {
  color: var(--red);
}
.toast--success .toast__icon {
  color: var(--green);
}
.toast--warn .toast__icon {
  color: var(--amber);
}
.toast--info .toast__icon {
  color: var(--blue);
}

.toast__main {
  flex: 1 1 auto;
  min-width: 0;
}

.toast__title {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
}

.toast__msg {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 2px;
  word-break: break-word;
}

.toast__meta {
  margin-top: 5px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  word-break: break-all;
}

.toast__close {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0 2px;
  font-size: 16px;
  line-height: 1;
  border-radius: 4px;
}

.toast__close:hover {
  color: var(--ink);
  background: var(--surface-3);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  overflow-y: auto;
  animation: fade-in 0.15s ease both;
}

.modal {
  width: min(640px, 100%);
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modal-in 0.18s cubic-bezier(0.16, 1, 0.3, 1) both;
  margin: auto;
}

.modal--sm {
  width: min(460px, 100%);
}

.modal--lg {
  width: min(860px, 100%);
}

.modal__head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal__head h2 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.modal__head p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.modal__close {
  border: 0;
  background: var(--surface-3);
  color: var(--muted);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: none;
}

.modal__close:hover {
  color: var(--ink);
  background: #e9eef6;
}

.modal__body {
  padding: 20px;
  max-height: min(66vh, 720px);
  overflow-y: auto;
}

.modal__foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.modal__foot--between {
  justify-content: space-between;
}

.modal__error {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid #fecdca;
  border-radius: 9px;
  padding: 9px 11px;
  word-break: break-word;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  justify-content: flex-end;
  animation: fade-in 0.15s ease both;
}

.drawer {
  width: min(620px, 100%);
  height: 100%;
  background: #fff;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: drawer-in 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes drawer-in {
  from {
    transform: translateX(40px);
    opacity: 0.4;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.drawer__head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.drawer__head h2 {
  font-size: 16px;
  font-weight: 650;
}

.drawer__head p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  word-break: break-all;
}

.drawer__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 20px 28px;
}

.drawer__foot {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* --- 12. 调试台 ----------------------------------------------------------- */

.playground {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.playground__request,
.playground__result {
  min-width: 0;
}

.result-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.result-meta .kv__val {
  font-family: var(--font-mono);
  font-size: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface-3);
  color: var(--ink-2);
}

.status-pill--ok {
  color: var(--green);
  background: var(--green-soft);
  border-color: #abefc6;
}

.status-pill--err {
  color: var(--red);
  background: var(--red-soft);
  border-color: #fecdca;
}

.stream-log {
  max-height: 320px;
  overflow: auto;
  border-top: 1px solid var(--line);
}

.stream-event {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
  padding: 6px 12px;
  border-bottom: 1px dashed #eef1f6;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
}

.stream-event:nth-child(odd) {
  background: #fcfdff;
}

.stream-event__name {
  color: var(--brand-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stream-event__data {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.output {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow: auto;
  background: #fff;
}

.output:empty {
  display: none;
}

.result-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  padding: 0 10px;
  background: var(--surface-2);
}

.result-tab {
  border: 0;
  background: transparent;
  padding: 9px 12px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.result-tab.is-active {
  color: var(--brand-strong);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

.result-tab:hover {
  color: var(--ink);
}

/* --- 13. 代码/字段辅助 ---------------------------------------------------- */

.inline-fields {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-fields .input,
.inline-fields .select {
  width: auto;
  min-width: 120px;
}

.hint-list {
  display: grid;
  gap: 8px;
}

.hint-item {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  align-items: flex-start;
}

.hint-item svg {
  margin-top: 1px;
  color: var(--muted-2);
}

.pager {
  display: flex;
  justify-content: center;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.pager:empty {
  display: none;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
  min-width: 0;
}

.panel__title {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.panel__value {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.panel__hint {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
}

.section-divider {
  margin: 26px 0 18px;
  border-top: 1px solid var(--line);
}

.list-plain {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.list-plain li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 12.5px;
}

.list-plain li.is-active {
  border-color: #c7c9f7;
  background: var(--brand-soft);
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding: 0 4px;
  overflow-x: auto;
}

.tab {
  border: 0;
  background: transparent;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.tab.is-active {
  color: var(--brand-strong);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

/* --- 14. 响应式 ----------------------------------------------------------- */

@media (max-width: 1280px) {
  .stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .playground {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1080px) {
  :root {
    --sidebar-w: 264px;
  }
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
  .split--wide-left {
    grid-template-columns: minmax(0, 1fr);
  }
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .topbar__menu {
    display: inline-flex;
  }
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-w);
    transform: translateX(-102%);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-lg);
  }
  .app-shell.sidebar-open .sidebar {
    transform: none;
  }
  .app-shell.sidebar-open .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(15, 23, 42, 0.4);
    border: 0;
    animation: fade-in 0.15s ease both;
  }
  .view {
    padding: 18px 16px 40px;
  }
  .topbar {
    padding: 10px 16px;
  }
}

@media (max-width: 820px) {
  .login {
    grid-template-columns: minmax(0, 1fr);
  }
  .login__brand {
    padding: 28px 24px;
    min-height: auto;
    gap: 20px;
  }
  .login__headline {
    margin-top: 12px;
  }
  .login__points,
  .login__brand-foot {
    display: none;
  }
  .login__panel {
    padding: 28px 20px 48px;
  }
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .form-grid .span-2 {
    grid-column: auto;
  }
  .topbar__title span {
    display: none;
  }
  .user-chip__name,
  .user-chip__role {
    display: none;
  }
  .user-chip {
    padding: 4px;
    border: 0;
    background: transparent;
  }
  .toolbar {
    align-items: stretch;
  }
  .toolbar .field {
    flex: 1 1 100%;
  }
  .toolbar__actions {
    margin-left: 0;
    width: 100%;
  }
  .toolbar__actions .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 560px) {
  .stat-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .page-head h1 {
    font-size: 19px;
  }
  .stat__value {
    font-size: 23px;
  }
  .toast-root {
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
  }
  .modal-backdrop {
    padding: 16px 10px;
  }
  .modal__body {
    padding: 16px;
  }
  .view {
    padding: 14px 12px 32px;
  }
  .topbar {
    gap: 8px;
  }
  .topbar .btn--logout span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
