/* 影刀调度中心面板样式（2026-09-19 重做）。
   主色取影刀品牌红 #EB2000（本机影刀客户端 logo 实测色值）。
   颜色全部是 :root 上的 token：深色模式只重定义同一组 token，组件不写死颜色。
   只用系统字体：CSP 只放行同源资源，不引外部字体。 */

:root {
  --brand: #eb2000;
  --brand-hover: #c81b00;
  --brand-press: #a91700;
  --brand-soft: #fff1ed;
  --brand-softer: #fff8f6;
  --brand-ring: rgba(235, 32, 0, .22);
  --brand-grad: linear-gradient(135deg, #ff4a1f 0%, #eb2000 55%, #c41800 100%);

  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef0f3;
  --border: #e5e7eb;
  --border-strong: #d0d5dd;
  --text: #0f1728;
  --text-2: #344054;
  --text-dim: #667085;

  --ok: #067647;
  --ok-soft: #ecfdf3;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --danger: #d92d20;
  --danger-soft: #fef3f2;
  --info: #175cd3;
  --info-soft: #eff8ff;

  /* 侧栏：深色底，和影刀客户端左侧导航一个路数。 */
  --nav-bg: #16181d;
  --nav-bg-2: #1e2128;
  --nav-line: #2a2e37;
  --nav-text: #c3c8d1;
  --nav-muted: #7f8794;
  --nav-hover: rgba(255, 255, 255, .06);
  --nav-active: rgba(235, 32, 0, .16);

  --accent: var(--brand);
  --accent-soft: var(--brand-soft);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 20px 48px -12px rgba(16, 24, 40, .22);
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  --sans: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #ff4a26;
    --brand-hover: #ff6a4d;
    --brand-press: #e63a17;
    --brand-soft: rgba(255, 74, 38, .14);
    --brand-softer: rgba(255, 74, 38, .07);
    --brand-ring: rgba(255, 74, 38, .3);
    --bg: #0e1014;
    --surface: #16191f;
    --surface-2: #1b1f26;
    --surface-3: #232830;
    --border: #272c35;
    --border-strong: #363c47;
    --text: #f2f4f7;
    --text-2: #d0d5dd;
    --text-dim: #98a2b3;
    --ok: #47cd89;
    --ok-soft: rgba(71, 205, 137, .12);
    --warn: #fdb022;
    --warn-soft: rgba(253, 176, 34, .12);
    --danger: #f97066;
    --danger-soft: rgba(249, 112, 102, .12);
    --info: #53b1fd;
    --info-soft: rgba(83, 177, 253, .12);
    --nav-bg: #0b0c10;
    --nav-bg-2: #13151a;
    --nav-line: #22252d;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 3px rgba(0, 0, 0, .35);
    --shadow-lg: 0 24px 56px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --brand: #ff4a26;
  --brand-hover: #ff6a4d;
  --brand-press: #e63a17;
  --brand-soft: rgba(255, 74, 38, .14);
  --brand-softer: rgba(255, 74, 38, .07);
  --brand-ring: rgba(255, 74, 38, .3);
  --bg: #0e1014;
  --surface: #16191f;
  --surface-2: #1b1f26;
  --surface-3: #232830;
  --border: #272c35;
  --border-strong: #363c47;
  --text: #f2f4f7;
  --text-2: #d0d5dd;
  --text-dim: #98a2b3;
  --ok: #47cd89;
  --ok-soft: rgba(71, 205, 137, .12);
  --warn: #fdb022;
  --warn-soft: rgba(253, 176, 34, .12);
  --danger: #f97066;
  --danger-soft: rgba(249, 112, 102, .12);
  --info: #53b1fd;
  --info-soft: rgba(83, 177, 253, .12);
  --nav-bg: #0b0c10;
  --nav-bg-2: #13151a;
  --nav-line: #22252d;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 3px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 56px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--brand-ring); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:where(button, a, input, select, textarea):focus-visible {
  outline: 3px solid var(--brand-ring);
  outline-offset: 1px;
}
.icon { flex: 0 0 auto; display: block; }

.booting { min-height: 100vh; display: grid; place-items: center; color: var(--text-dim); }

/* ---------------------------------------------------------- 外壳 */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px;
  flex: 0 0 248px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--nav-bg);
  background-image: radial-gradient(120% 60% at 0% 0%, rgba(235, 32, 0, .12) 0%, transparent 60%);
  border-right: 1px solid var(--nav-line);
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
}

.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 8px 22px; margin-bottom: 8px;
  border-bottom: 1px solid var(--nav-line);
  color: #fff; font-size: 17px; font-weight: 700; letter-spacing: .02em;
}
.brand .logo { flex: 0 0 auto; filter: drop-shadow(0 6px 14px rgba(235, 32, 0, .35)); }
.brand small {
  display: block; margin-top: 2px;
  font-size: 11.5px; font-weight: 500; color: var(--nav-muted); letter-spacing: .08em;
}
.nav-group {
  padding: 16px 12px 6px; font-size: 11.5px; letter-spacing: .12em;
  color: var(--nav-muted); font-weight: 600;
}

.nav-link {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-height: 42px; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--nav-text); text-decoration: none; cursor: pointer;
  font-size: 14px; font-weight: 500;
  transition: background-color .15s ease, color .15s ease;
}
.nav-link:hover { background: var(--nav-hover); color: #fff; text-decoration: none; }
.nav-link .icon { color: var(--nav-muted); transition: color .15s ease; }
.nav-link:hover .icon { color: #fff; }
.nav-link > span:not(.count) { flex: 1; min-width: 0; }
.nav-link.active { background: var(--nav-active); color: #fff; font-weight: 600; }
.nav-link.active .icon { color: #ff5a36; }
.nav-link.active::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--brand);
}
.nav-link .count {
  min-width: 22px; padding: 0 7px; text-align: center;
  font-size: 12px; line-height: 20px; font-variant-numeric: tabular-nums;
  background: var(--nav-line); color: var(--nav-text); border-radius: 999px;
}
.nav-link.alert .count { background: var(--brand); color: #fff; font-weight: 700; }

.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--nav-line); }
.whoami {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 12px; color: var(--nav-muted); font-size: 12px; min-width: 0;
}
.whoami .avatar {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-grad); color: #fff; font-weight: 700; font-size: 14px;
}
.whoami .who { min-width: 0; }
.whoami strong {
  display: block; color: #fff; font-size: 14px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-foot .nav-link { min-height: 36px; padding: 7px 12px; font-size: 13px; color: var(--nav-muted); }

.main {
  flex: 1; min-width: 0;
  padding: 32px clamp(20px, 3vw, 48px) 64px;
}
.main > * { max-width: 1480px; margin-left: auto; margin-right: auto; }

/* ---------------------------------------------------------- 页头 */

.page-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px;
  margin-bottom: 24px; min-height: 44px;
}
.page-head h1 {
  font-size: 26px; line-height: 1.3; margin: 0; font-weight: 700; letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
/* 说明文字另起一行放在标题下：标题和操作按钮同一行，版面更利落。 */
.page-head .hint { order: 10; flex-basis: 100%; color: var(--text-dim); font-size: 13.5px; margin-top: -4px; }
.page-head .spacer { flex: 1; }
.page-head > .mono:not(h1) { color: var(--text-dim); font-size: 13px; }
/* 详情页把执行单编号当标题：等宽但保持标题的分量。 */
.page-head h1.mono { font-size: 22px; font-weight: 700; letter-spacing: 0; color: var(--text); }

.welcome {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 26px 28px; margin-bottom: 22px;
  border-radius: calc(var(--radius) + 4px);
  background: var(--nav-bg);
  background-image:
    radial-gradient(80% 140% at 100% 0%, rgba(235, 32, 0, .55) 0%, transparent 55%),
    radial-gradient(60% 120% at 0% 100%, rgba(255, 106, 64, .16) 0%, transparent 60%);
  color: #fff; box-shadow: var(--shadow-lg);
  border: 1px solid var(--nav-line);
}
.welcome h1 { margin: 0; font-size: 24px; font-weight: 700; }
.welcome p { margin: 4px 0 0; color: rgba(255, 255, 255, .72); font-size: 13.5px; }
.welcome .spacer { flex: 1; }
.welcome .meta { text-align: right; font-size: 13px; color: rgba(255, 255, 255, .72); }
.welcome .meta strong { display: block; font-size: 20px; color: #fff; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------- 卡片 */

/* 概览固定 6 张卡：宽屏一行 6 张，常规 3×2，不出现 4+2 的空缺。 */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (min-width: 1680px) { .cards { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.card {
  position: relative; min-width: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px 18px; box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.card .label { color: var(--text-dim); font-size: 13px; font-weight: 500; padding-right: 48px; }
.card .value {
  font-size: 34px; line-height: 1.2; font-weight: 700; margin: 10px 0 4px;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.card .sub { font-size: 12.5px; color: var(--text-dim); min-height: 20px; }
.card .chip {
  position: absolute; top: 18px; right: 18px;
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-2);
}
.card .chip.accent { background: var(--brand-soft); color: var(--brand); }
.card .chip.ok { background: var(--ok-soft); color: var(--ok); }
.card .chip.warn { background: var(--warn-soft); color: var(--warn); }
.card .chip.danger { background: var(--danger-soft); color: var(--danger); }
.card .chip.info { background: var(--info-soft); color: var(--info); }
.card.attention { border-color: var(--danger); box-shadow: inset 4px 0 0 var(--danger), var(--shadow-sm); }
.card.attention .value { color: var(--danger); }

/* ---------------------------------------------------------- 面板 */

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  margin-top: 22px; overflow: hidden;
}
.panel > header {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  min-height: 58px; padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  font-size: 15px; font-weight: 650;
}
/* 标题前一道品牌红竖条：一眼扫出每个区块从哪开始。 */
.panel > header > span:first-child { display: inline-flex; align-items: center; gap: 10px; }
.panel > header > span:first-child::before {
  content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--brand);
}
.panel > header .spacer { flex: 1; }
.panel-body { padding: 22px; }

.note {
  margin: 0; padding: 12px 16px; line-height: 1.75; font-size: 13px;
  background: var(--warn-soft); color: var(--warn);
  border: 1px solid transparent; border-left: 3px solid var(--warn); border-radius: var(--radius-sm);
}
.note + .note, .page-head + .note { margin-top: 12px; }
.panel .note { border-radius: 0; border-left-width: 3px; border-bottom: 1px solid var(--border); }
.main > .note { margin-bottom: 18px; }

/* ---------------------------------------------------------- 表格 */

.table-wrap { overflow-x: auto; scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 14px 22px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th {
  padding-top: 11px; padding-bottom: 11px;
  font-size: 12.5px; font-weight: 600; color: var(--text-dim);
  background: var(--surface-2); letter-spacing: .02em;
}
td { vertical-align: middle; color: var(--text-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .12s ease; }
tbody tr:hover { background: var(--surface-2); }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--brand-softer); }
tbody tr.clickable:hover td:first-child { color: var(--brand); }
td.wrap { white-space: normal; min-width: 220px; overflow-wrap: anywhere; }
td > button + button { margin-left: 6px; }
td strong { color: var(--text); }
.mono { font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.dim { color: var(--text-dim); }
.empty { padding: 56px 20px; text-align: center; color: var(--text-dim); line-height: 1.8; }

/* ---------------------------------------------------------- 徽标与进度 */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap;
  background: var(--surface-3); color: var(--text-dim);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.neutral { background: var(--surface-3); color: var(--text-dim); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }

.bar { height: 6px; min-width: 72px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand-grad); border-radius: 999px; }

/* ---------------------------------------------------------- 按钮与表单 */

button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 8px 16px;
  font: inherit; font-weight: 500; line-height: 1.4;
  border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}
button:hover:not(:disabled) { background: var(--surface-2); border-color: var(--text-dim); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 1px 2px rgba(235, 32, 0, .25), 0 6px 16px -6px rgba(235, 32, 0, .55);
}
button.primary:hover:not(:disabled) { background: var(--brand-hover); border-color: var(--brand-hover); }
button.primary:active:not(:disabled) { background: var(--brand-press); }
button.danger { color: var(--danger); border-color: var(--danger); background: transparent; box-shadow: none; }
button.danger:hover:not(:disabled) { background: var(--danger-soft); border-color: var(--danger); }
button.small { min-height: 32px; padding: 5px 12px; font-size: 13px; border-radius: 8px; }

label.field { display: block; margin-bottom: 16px; min-width: 0; }
label.field > span { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 600; color: var(--text-2); }
input, select, textarea {
  width: 100%; min-width: 0; min-height: 40px; padding: 9px 12px;
  font: inherit; line-height: 1.5; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:hover, select:hover, textarea:hover { border-color: var(--text-dim); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
input[readonly] { background: var(--surface-2); }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--brand); }
textarea { min-height: 84px; resize: vertical; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 160px; }
.row > .shrink { flex: 0 0 auto; }

.error-box, .ok-box {
  padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 14px;
  border: 1px solid transparent;
}
.error-box { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.ok-box { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.secret {
  font-family: var(--mono); font-size: 12.5px; word-break: break-all;
  background: var(--surface-2); border: 1px dashed var(--border-strong);
  padding: 12px; border-radius: var(--radius-sm); margin: 8px 0;
}

/* ---------------------------------------------------------- 登录与注册 */

.login-wrap {
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  background: var(--surface);
}
.login-hero {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  padding: clamp(32px, 5vw, 72px);
  background: var(--nav-bg);
  background-image:
    radial-gradient(70% 60% at 100% 0%, rgba(235, 32, 0, .6) 0%, transparent 60%),
    radial-gradient(60% 50% at 0% 100%, rgba(255, 106, 64, .22) 0%, transparent 65%);
  color: #fff;
}
.login-hero::after {
  /* 细网格底纹：只做质感，不抢内容。 */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
.login-hero > * { position: relative; z-index: 1; }
.login-hero .hero-brand { display: flex; align-items: center; gap: 14px; font-size: 18px; font-weight: 700; }
.login-hero h2 { margin: 0; font-size: clamp(30px, 3.2vw, 44px); line-height: 1.25; font-weight: 800; letter-spacing: .01em; }
.login-hero h2 span { display: block; }
.login-hero h2 em { font-style: normal; color: #ff6a47; }
.login-hero .lead { margin: 16px 0 0; max-width: 34em; color: rgba(255, 255, 255, .72); font-size: 15px; line-height: 1.8; }
.hero-points { display: grid; gap: 14px; margin: 34px 0 0; padding: 0; list-style: none; }
.hero-points li { display: flex; gap: 14px; align-items: flex-start; }
.hero-points .chip {
  flex: 0 0 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .08); color: #ff7a5c; border: 1px solid rgba(255, 255, 255, .08);
}
.hero-points strong { display: block; font-size: 14.5px; }
.hero-points span { color: rgba(255, 255, 255, .62); font-size: 13px; }
.login-hero .foot { color: rgba(255, 255, 255, .45); font-size: 12px; }

.login-side { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.login-card {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px); padding: 36px 34px; box-shadow: var(--shadow-lg);
}
.login-card .mobile-brand { display: none; }
.login-card h1 { font-size: 24px; margin: 0 0 6px; font-weight: 700; }
.login-card p.sub { color: var(--text-dim); font-size: 13.5px; margin: 0 0 26px; }
.login-card form button.primary { width: 100%; min-height: 44px; font-size: 15px; margin-top: 6px; }
.auth-switch { margin-top: 16px; text-align: center; }
.auth-switch button { width: 100%; }

/* ---------------------------------------------------------- 弹层 */

.modal-back {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center; padding: 16px;
  background: rgba(10, 12, 16, .5);
  backdrop-filter: blur(3px);
  animation: fade-in .15s ease;
}
.modal {
  width: 100%; max-width: 500px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px); padding: 26px 26px 22px; box-shadow: var(--shadow-lg);
  animation: pop-in .18s ease;
}
.modal h2 { font-size: 18px; margin: 0 0 6px; font-weight: 700; }
.modal .sub { color: var(--text-dim); font-size: 13.5px; margin: 0 0 20px; }
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin: 22px -26px -22px; padding: 16px 26px;
  border-top: 1px solid var(--border); background: var(--surface-2);
}
.modal.wide { max-width: 860px; }
.modal.wide .runlog { max-height: 60vh; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@media (prefers-reduced-motion: reduce) {
  .modal, .modal-back, .card, button { animation: none; transition: none; }
}

/* ---------------------------------------------------------- 时间线与键值 */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; display: flex; gap: 14px; padding: 12px 0 12px 20px; border-bottom: 1px solid var(--border); }
.timeline li::before {
  content: ""; position: absolute; left: 2px; top: 20px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft);
}
.timeline li:last-child { border-bottom: 0; }
.timeline .when { color: var(--text-dim); font-size: 12px; flex: 0 0 150px; font-family: var(--mono); }
.timeline .what { flex: 1; min-width: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 28px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--text-dim); }
.kv dd { margin: 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }

/* 影刀运行日志：终端样式，等宽、深底。 */
.runlog {
  max-height: 440px; overflow: auto;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.75;
  background: #0f1115; color: #d0d5dd; border-radius: var(--radius-sm);
  padding: 12px 16px; border: 1px solid var(--nav-line);
}
.runlog .dim { color: #7f8794; }
.runlog .empty { color: #7f8794; padding: 28px 0; }
.runlog-line { white-space: pre-wrap; word-break: break-word; padding: 1px 0; }
.runlog-line + .runlog-line { border-top: 1px solid rgba(255, 255, 255, .04); }
.runlog-line.error { color: #ff8a73; }
.runlog-status { font-size: 12.5px; margin-bottom: 8px; min-height: 1em; }

/* ---------------------------------------------------------- 组织与邀请 */

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.scope-filters {
  display: flex; gap: 14px; flex-wrap: wrap; margin: 0 0 4px;
  padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.scope-filters .field { min-width: 220px; flex: 1; margin: 0; }
.management-scopes { display: grid; gap: 8px; margin-bottom: 10px; }
.scope-row { display: flex; gap: 8px; align-items: center; }
.scope-row select { flex: 1; }
.invite-code { display: flex; gap: 8px; }
.invite-code input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; }

/* ---------------------------------------------------------- 窄屏 */

@media (max-width: 960px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-card .mobile-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; font-weight: 700; font-size: 17px; }
}

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar {
    position: sticky; top: 0; z-index: 20;
    width: auto; height: auto; flex: none;
    flex-direction: row; align-items: center; gap: 4px;
    overflow-x: auto; padding: 10px 12px;
    border-right: 0; border-bottom: 1px solid var(--nav-line);
  }
  .brand { padding: 0 10px 0 2px; margin: 0; border: 0; font-size: 0; }
  .brand small, .nav-group { display: none; }
  .nav-link { flex: 0 0 auto; min-height: 38px; white-space: nowrap; }
  .nav-link.active::before { display: none; }
  .sidebar-foot { display: flex; margin: 0 0 0 auto; border: 0; padding: 0 0 0 8px; }
  .whoami { display: none; }
  .main { padding: 20px 16px 48px; }
  .page-head h1 { font-size: 22px; }
  .welcome { padding: 20px; }
  .welcome .meta { text-align: left; }
  .welcome .spacer { display: none; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card .value { font-size: 28px; }
  th, td { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 520px) {
  /* 手机上仍两列：一屏能看到大半数字，而不是只有两张卡。 */
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { padding: 14px 14px 12px; }
  .card .chip { width: 30px; height: 30px; top: 12px; right: 12px; border-radius: 9px; }
  .card .chip svg { width: 16px; height: 16px; }
  .card .label { padding-right: 34px; font-size: 12px; }
  .card .value { font-size: 26px; margin-top: 8px; }
  .card .sub { font-size: 11.5px; }
  .login-card { padding: 28px 22px; }
  .timeline li { flex-direction: column; gap: 2px; }
  .timeline .when { flex: none; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { margin-top: 8px; }
}
