/* 流光漫剪运营后台 — tokens mirror the desktop client (镜序混剪/ui/src/styles/tokens.css). */
:root,
[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0d0a0f;
  --canvas-raised: #141017;
  --surface: #17121a;
  --surface-subtle: #1c1620;
  --surface-tint: #251d2a;
  --ink: #e9e2ea;
  --ink-strong: #fbf7fb;
  --ink-muted: #a497a6;
  --ink-faint: #85788a;
  --line: #2a2130;
  --line-strong: #41354a;
  --sidebar: #110d13;
  --sidebar-hover: #1f1823;
  --action: #ff4a93;
  --action-hover: #ff6aa7;
  --action-soft: #3a1a2c;
  --accent-ink: #ff9cc4;
  --warning: #f2bf68;
  --warning-soft: #33281a;
  --danger: #ff8f9c;
  --danger-soft: #3a1d26;
  --success: #7ddcaa;
  --success-soft: #16302a;
  --neutral-soft: #241d28;
  --info: #b9a6ff;
  --info-soft: #261f3d;
  --gradient-soft: linear-gradient(100deg, rgb(255 173 59 / .14), rgb(255 61 139 / .14) 52%, rgb(122 92 255 / .14));
  --glow: 0 10px 34px rgb(255 61 139 / .32);
  --shadow-sm: 0 8px 22px rgb(0 0 0 / .28);
  --shadow-md: 0 18px 50px rgb(0 0 0 / .42);
  --focus: 0 0 0 3px rgb(255 74 147 / .36);
  --scrim: rgb(5 3 7 / .62);

  --flow-amber: #ffad3b;
  --flow-magenta: #ff3d8b;
  --flow-violet: #7a5cff;
  --gradient: linear-gradient(100deg, var(--flow-amber) 0%, var(--flow-magenta) 52%, var(--flow-violet) 100%);
  --font-sans: "Segoe UI Variable", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "Cascadia Code", Consolas, ui-monospace, monospace;
  --r-sm: 9px;
  --r-md: 13px;
  --r-lg: 18px;
}

[data-theme="light"] {
  color-scheme: light;
  --canvas: #f7f3f1;
  --canvas-raised: #efe8e5;
  --surface: #fffdfc;
  --surface-subtle: #faf6f4;
  --surface-tint: #f2ebe8;
  --ink: #3a2f38;
  --ink-strong: #1d141b;
  --ink-muted: #7a6b76;
  --ink-faint: #9a8b95;
  --line: #e8dfdc;
  --line-strong: #d3c6c2;
  --sidebar: #f2ece9;
  --sidebar-hover: #e9e0dc;
  --action: #e2337b;
  --action-hover: #c92368;
  --action-soft: #fde8f0;
  --accent-ink: #b81e5e;
  --warning: #8c5708;
  --warning-soft: #fff4d6;
  --danger: #c42b3a;
  --danger-soft: #fff0f1;
  --success: #1b7a4c;
  --success-soft: #e8f6ee;
  --neutral-soft: #efe8e5;
  --info: #5b3fd1;
  --info-soft: #efeaff;
  --gradient-soft: linear-gradient(100deg, rgb(255 173 59 / .16), rgb(255 61 139 / .16) 52%, rgb(122 92 255 / .16));
  --glow: 0 8px 28px rgb(255 61 139 / .28);
  --shadow-sm: 0 6px 18px rgb(60 30 50 / .08);
  --shadow-md: 0 18px 50px rgb(60 30 50 / .16);
  --focus: 0 0 0 3px rgb(226 51 123 / .28);
  --scrim: rgb(40 20 35 / .32);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: 14px/1.6 var(--font-sans); -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
.sprite { display: none; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-xl { width: 40px; height: 40px; stroke-width: 1.4; }
.muted { color: var(--ink-muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--font-mono); }
h1, h2, h3 { margin: 0; color: var(--ink-strong); font-weight: 600; line-height: 1.3; }
a { color: inherit; text-decoration: none; }
.link { color: var(--accent-ink); font-size: 13px; }
.link:hover { text-decoration: underline; }
code { font-family: var(--font-mono); font-size: 12.5px; background: var(--surface-tint); padding: 1px 6px; border-radius: 6px; }
.offscreen { position: fixed; left: -9999px; opacity: 0; }

/* ---------- 控件 ---------- */
input, select, button, textarea { font: inherit; color: inherit; }
input, select {
  height: 38px; padding: 0 12px; border-radius: var(--r-sm);
  background: var(--surface-subtle); border: 1px solid var(--line-strong); color: var(--ink-strong);
  min-width: 0; transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--ink-faint); }
input:focus, select:focus { outline: none; border-color: var(--action); box-shadow: var(--focus); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-strong); font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, filter .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-tint); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--gradient); border-color: transparent; color: #fff; font-weight: 600; text-shadow: 0 1px 1px rgb(0 0 0 / .18); }
.btn-primary:hover { background: var(--gradient); filter: brightness(1.07); box-shadow: var(--glow); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-muted); }
.btn-ghost:hover { background: var(--sidebar-hover); color: var(--ink-strong); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: transparent; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-lg { height: 42px; padding: 0 22px; font-size: 15px; }
.btn-icon { width: 36px; padding: 0; }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; color: var(--ink-muted); font-weight: 500; }
.field-label em { font-style: normal; color: var(--ink-faint); font-weight: 400; margin-left: 6px; }
.field-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--success); background: var(--success-soft); }
.pill.soon { color: var(--warning); background: var(--warning-soft); }
.pill.bad { color: var(--danger); background: var(--danger-soft); }
.pill.off { color: var(--ink-muted); background: var(--neutral-soft); }
.pill.brand { color: var(--accent-ink); background: var(--action-soft); }
.pill.info { color: var(--info); background: var(--info-soft); }
.pill.plain::before { display: none; }

/* ---------- 登录 ---------- */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(800px 420px at 15% 0%, rgb(255 173 59 / .12), transparent 60%),
    radial-gradient(700px 420px at 90% 100%, rgb(122 92 255 / .14), transparent 60%),
    var(--canvas);
}
.login-card {
  width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 32px; box-shadow: var(--shadow-md); position: relative; overflow: hidden;
}
.login-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--gradient); }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.login-title { font-size: 22px; font-weight: 700; color: var(--ink-strong); letter-spacing: .02em; }
.login-sub { color: var(--ink-muted); font-size: 13px; }
.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-form .btn { height: 42px; }
.login-note { display: flex; gap: 8px; margin: 20px 0 0; font-size: 12.5px; color: var(--ink-faint); }
.login-note .icon { width: 16px; height: 16px; margin-top: 2px; }
.logo {
  width: 40px; height: 40px; border-radius: 12px; background: var(--gradient); flex: none; position: relative;
  box-shadow: var(--glow);
}
.logo::after {
  content: ""; position: absolute; inset: 11px 9px; border-radius: 3px;
  background: linear-gradient(90deg, rgb(255 255 255 / .95) 0 30%, transparent 30% 40%, rgb(255 255 255 / .7) 40% 70%, transparent 70% 80%, rgb(255 255 255 / .45) 80%);
}

/* ---------- 框架 ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--sidebar); border-right: 1px solid var(--line); padding: 18px 12px;
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 22px; }
.side-brand .logo { width: 34px; height: 34px; border-radius: 10px; }
.side-brand .logo::after { inset: 9px 7px; }
.side-title { font-weight: 700; color: var(--ink-strong); font-size: 15.5px; }
.side-sub { font-size: 12px; color: var(--ink-faint); }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-group { font-size: 11.5px; color: var(--ink-faint); letter-spacing: .08em; padding: 14px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 12px; border-radius: var(--r-sm);
  color: var(--ink-muted); font-weight: 500; position: relative; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--sidebar-hover); color: var(--ink-strong); }
.nav-item.active { background: var(--gradient-soft); color: var(--ink-strong); }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gradient); }
.nav-item.active .icon { color: var(--accent-ink); }
.nav-count { margin-left: auto; font-style: normal; font-size: 12px; color: var(--ink-faint); }
.side-foot { border-top: 1px solid var(--line); padding: 14px 6px 0; display: flex; flex-direction: column; gap: 10px; }
.service-state { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-muted); padding: 0 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.service-state.down .dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.side-actions { display: flex; justify-content: space-between; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 14px;
  padding: 18px 32px; background: color-mix(in srgb, var(--canvas) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-text { flex: 1; min-width: 0; }
.topbar h1 { font-size: 20px; }
.topbar p { margin: 2px 0 0; font-size: 13px; }
.topbar-actions { display: flex; gap: 8px; }
.nav-toggle { display: none; }
.content { padding: 24px 32px 48px; max-width: 1320px; width: 100%; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; }
.panel-flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head h2 { font-size: 15.5px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

/* ---------- 概览 ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 4px; position: relative; transition: border-color .15s, transform .15s;
}
.kpi:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.kpi-label { font-size: 13px; color: var(--ink-muted); display: flex; align-items: center; gap: 8px; }
.kpi-dot { width: 8px; height: 8px; border-radius: 50%; }
.kpi-dot.ok { background: var(--success); }
.kpi-dot.soon { background: var(--warning); }
.kpi-dot.bad { background: var(--danger); }
.mini-row.clickable { cursor: pointer; }
.kpi-value { font-size: 30px; font-weight: 700; color: var(--ink-strong); line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi-foot { font-size: 12px; color: var(--ink-faint); }
.kpi.primary::after { content: ""; position: absolute; inset: auto -1px -1px; height: 3px; background: var(--gradient); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.mini-list { display: flex; flex-direction: column; }
.mini-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.mini-row:first-child { border-top: 0; padding-top: 2px; }
.mini-main { flex: 1; min-width: 0; }
.mini-main b { font-family: var(--font-mono); font-weight: 600; color: var(--ink-strong); font-size: 13.5px; }
.mini-main div { font-size: 12.5px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-row { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.feed-row:first-child { border-top: 0; padding-top: 2px; }
.feed-time { color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.feed-text b { color: var(--ink-strong); font-weight: 600; }
.feed-text span { color: var(--ink-muted); }
.empty { padding: 36px 16px; text-align: center; color: var(--ink-faint); font-size: 13px; }

/* ---------- 表格 ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; background: var(--surface-subtle); border: 1px solid var(--line); padding: 3px; border-radius: 11px; flex-wrap: wrap; }
.tab {
  height: 30px; padding: 0 12px; border-radius: 8px; border: 0; background: transparent; color: var(--ink-muted);
  cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--ink-strong); }
.tab.active { background: var(--surface); color: var(--ink-strong); box-shadow: var(--shadow-sm); }
.tab em { font-style: normal; font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.tab.active em { color: var(--accent-ink); }
.search { position: relative; width: 260px; max-width: 100%; }
.search .icon { position: absolute; left: 11px; top: 10px; width: 17px; height: 17px; color: var(--ink-faint); }
.search input { width: 100%; padding-left: 36px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12.5px; font-weight: 500; color: var(--ink-faint); padding: 10px 18px;
  background: var(--surface-subtle); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; transition: background .12s; }
.table tbody tr.clickable:hover { background: var(--surface-subtle); }
.table tr.dim .cell-user b { color: var(--ink-muted); }
.cell-user b { font-family: var(--font-mono); font-weight: 600; color: var(--ink-strong); font-size: 13.5px; display: block; }
.cell-user span { font-size: 12.5px; color: var(--ink-muted); display: block; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-sub { display: block; font-size: 12px; color: var(--ink-faint); }
.cell-time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.col-actions { text-align: right; width: 1%; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.log-detail { color: var(--ink-muted); font-size: 13px; }

/* ---------- 菜单 ---------- */
.menu {
  position: fixed; z-index: 30; min-width: 150px; padding: 5px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-md);
}
.menu button { display: flex; width: 100%; height: 34px; align-items: center; padding: 0 12px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: var(--ink); }
.menu button:hover { background: var(--surface-tint); color: var(--ink-strong); }

/* ---------- 开通 ---------- */
.create-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
#create-form { display: flex; flex-direction: column; gap: 18px; }
#create-form .panel-head { margin-bottom: 0; }
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.plan input { position: absolute; opacity: 0; pointer-events: none; }
.plan-body {
  display: flex; flex-direction: column; gap: 3px; padding: 14px; border-radius: var(--r-md); height: 100%;
  border: 1px solid var(--line-strong); background: var(--surface-subtle); cursor: pointer; transition: border-color .15s, background .15s;
}
.plan-body b { color: var(--ink-strong); font-size: 15px; }
.plan-body small { color: var(--ink-muted); font-size: 12.5px; }
.plan-body:hover { border-color: var(--ink-faint); }
.plan input:checked + .plan-body { border-color: var(--action); background: var(--gradient-soft); box-shadow: inset 0 0 0 1px var(--action); }
.plan input:focus-visible + .plan-body { box-shadow: var(--focus); }
#custom-days-field input { width: 160px; }
.advanced summary { cursor: pointer; color: var(--ink-muted); font-size: 13px; user-select: none; }
.advanced[open] summary { margin-bottom: 12px; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.result { min-height: 100%; }
.result-empty { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--ink-faint); gap: 6px; }
.result-empty p { margin: 0; font-size: 13px; }
.result-head { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.result-head p { margin: 2px 0 0; font-size: 13px; }
.result-ok { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--success-soft); color: var(--success); flex: none; }
.cred { margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.cred div { display: grid; grid-template-columns: 64px minmax(0, 1fr); padding: 11px 14px; border-top: 1px solid var(--line); background: var(--surface-subtle); }
.cred div:first-child { border-top: 0; }
.cred dt { color: var(--ink-faint); font-size: 13px; }
.cred dd { margin: 0; font-family: var(--font-mono); color: var(--ink-strong); font-size: 15px; word-break: break-all; }
.hint { margin: 12px 0 0; font-size: 12.5px; color: var(--ink-faint); }

/* ---------- 安全 ---------- */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; gap: 10px; font-size: 13.5px; }
.checklist .icon { color: var(--success); width: 17px; height: 17px; margin-top: 3px; }
.path { display: block; padding: 10px 12px; word-break: break-all; margin: 6px 0 10px; }
.page .panel p { margin: 0 0 8px; }
.page .panel p.hint { margin: 12px 0 0; }

/* ---------- 抽屉 ---------- */
.scrim, .modal-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 20; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); z-index: 21;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; transform: translateX(105%); transition: transform .22s ease;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.drawer-title { font: 600 18px var(--font-mono); color: var(--ink-strong); margin-bottom: 6px; word-break: break-all; }
.drawer-body { flex: 1; overflow-y: auto; padding: 6px 22px 28px; }
.section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.section:last-child { border-bottom: 0; }
.section h3 { font-size: 13px; color: var(--ink-faint); font-weight: 500; margin-bottom: 12px; letter-spacing: .04em; }
.kv { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 9px 12px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--ink-muted); }
.kv dd { margin: 0; color: var(--ink-strong); display: flex; align-items: center; gap: 8px; min-width: 0; word-break: break-all; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.device-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-subtle); margin-bottom: 8px; }
.device-row .icon { color: var(--ink-muted); }
.device-main { flex: 1; min-width: 0; }
.device-main b { display: block; color: var(--ink-strong); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.device-main span { font-size: 12px; color: var(--ink-faint); }
.timeline { display: flex; flex-direction: column; }
.tl-row { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 10px; font-size: 13px; padding: 7px 0; }
.tl-row time { color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.tl-row span { color: var(--ink-muted); }
.tl-row b { color: var(--ink-strong); font-weight: 500; margin-right: 6px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); border-radius: var(--r-md); margin-top: 10px; }
.danger-zone p { margin: 0; font-size: 12.5px; color: var(--ink-muted); }
.danger-zone b { display: block; color: var(--ink-strong); font-size: 13.5px; }

/* ---------- 对话框 / 提示 ---------- */
.modal-scrim { display: grid; place-items: center; padding: 20px; z-index: 40; }
.modal { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-md); }
.modal h3 { font-size: 17px; margin-bottom: 8px; }
.modal p { margin: 0 0 16px; white-space: pre-line; font-size: 13.5px; }
.modal .field { margin-bottom: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.modal.danger #modal-ok { background: var(--danger); color: var(--surface); text-shadow: none; }
.modal.danger #modal-ok:hover { box-shadow: none; filter: brightness(1.08); }
.toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); align-items: center; z-index: 50; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 380px; padding: 11px 14px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-md);
  font-size: 13.5px; color: var(--ink-strong); animation: toast-in .2s ease;
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex: none; }
.toast.err::before { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .create-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; z-index: 25; width: 248px; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-md); }
  .shell.nav-open .sidebar { transform: none; }
  .nav-toggle { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .topbar p { display: none; }
  .content { padding: 16px 16px 40px; }
  .grid-2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-row { grid-template-columns: 1fr; }
  .search { width: 100%; }
  /* 表格转卡片 */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table td { padding: 3px 0; border: 0; }
  .table td[data-label]::before { content: attr(data-label); display: inline-block; width: 70px; color: var(--ink-faint); font-size: 12px; }
  .col-actions { text-align: left; width: auto; }
  .row-actions { justify-content: flex-start; padding-top: 6px; }
  .cell-user span { max-width: none; }
}
@media (max-width: 480px) {
  .topbar-actions .btn-primary { width: 36px; padding: 0; font-size: 0; gap: 0; }
  .topbar-actions .btn-primary .icon { width: 17px; height: 17px; }
  .kpi-value { font-size: 24px; }
  .form-foot { flex-direction: column; align-items: stretch; }
}

/* ---------- 问号提示 ---------- */
.tip {
  display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 6px; position: relative;
  border-radius: 50%; border: 1px solid var(--line-strong); color: var(--ink-faint);
  font: 600 11px/1 var(--font-sans); cursor: help; vertical-align: 2px; letter-spacing: 0;
}
.tip:hover, .tip:focus-visible { color: var(--ink-strong); border-color: var(--ink-muted); outline: none; }
.tip::after {
  content: attr(data-tip); position: absolute; left: -8px; top: calc(100% + 8px); z-index: 60;
  width: max-content; max-width: 260px; padding: 8px 11px; border-radius: 9px;
  background: var(--ink-strong); color: var(--canvas); box-shadow: var(--shadow-md);
  font: 400 12.5px/1.55 var(--font-sans); text-align: left; white-space: normal;
  opacity: 0; transform: translateY(-3px); pointer-events: none; transition: opacity .12s, transform .12s;
}
.tip:hover::after, .tip:focus::after { opacity: 1; transform: none; }
.tip[data-tip=""] { display: none; }
.topbar h1 { display: flex; align-items: center; }

/* ---------- 设置列表 ---------- */
.settings { max-width: 860px; }
.settings-list { margin: 0; }
.settings-list > div { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: center; padding: 15px 2px; border-top: 1px solid var(--line); }
.settings-list > div:first-child { border-top: 0; padding-top: 4px; }
.settings-list > div:last-child { padding-bottom: 4px; }
.settings-list dt { color: var(--ink-muted); }
.settings-list dd { margin: 0; color: var(--ink-strong); word-break: break-all; }
@media (max-width: 900px) {
  .settings-list > div { grid-template-columns: 1fr; gap: 4px; }
}
