/* 网关外壳。色值对齐 DSH ui-theme 浅色令牌，不改 deepseek-harness。 */
:root {
  --bg: #fff;
  --page: #e7eef8;
  --sidebar: rgba(255, 255, 255, 0.72);
  --hover: rgba(38, 49, 72, 0.06);
  --hover-solid: #f1f3f5;
  --active: #ebeff2;
  --ink: #0f1115;
  --ink-2: #61666b;
  --ink-3: #81858c;
  --line: rgba(0, 0, 0, 0.1);
  --line-soft: rgba(0, 0, 0, 0.06);
  --link: #4176e6;
  --link-soft: #e4edfd;
  --ok: #15803d;
  --ok-bg: #e6faed;
  --err: #ec1313;
  --err-bg: #fef2f2;
  --warn: #b45309;
  --warn-bg: #fef5e7;
  --live: #16a34a;
  --boot: #d97706;
  --fill: #0f1115;
  --fill-hover: #43454a;
  --on-fill: #fff;
  --card: rgba(255, 255, 255, 0.92);
  --topbar: rgba(255, 255, 255, 0.78);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-panel: 28px;
  --elev: 0 0 0 0.5px rgba(0, 0, 0, 0.16), 0 3px 8px rgba(0, 0, 0, 0.03), 0 0 16px rgba(0, 0, 0, 0.02);
  --elev-soft: 0 0 0 0.5px rgba(0, 0, 0, 0.1), 0 4px 16px rgba(0, 0, 0, 0.03), 0 0 24px rgba(0, 0, 0, 0.03);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

html[data-appearance="light"] { color-scheme: light; }
html[data-appearance="dark"] { color-scheme: dark; }
html[data-appearance="dark"] {
  --bg: #1c1d21;
  --page: #151517;
  --sidebar: rgba(28, 29, 33, 0.88);
  --hover: rgba(255, 255, 255, 0.06);
  --hover-solid: #2a2b31;
  --active: #34353c;
  --ink: #f5f6f7;
  --ink-2: #c4c6cc;
  --ink-3: #8d9098;
  --line: rgba(255, 255, 255, 0.12);
  --line-soft: rgba(255, 255, 255, 0.06);
  --link: #8eb0f8;
  --link-soft: rgba(65, 118, 230, 0.24);
  --ok: #4ade80;
  --ok-bg: rgba(22, 163, 74, 0.18);
  --err: #f87171;
  --err-bg: rgba(236, 19, 19, 0.18);
  --warn: #fbbf24;
  --warn-bg: rgba(245, 158, 11, 0.16);
  --fill: #f3f4f6;
  --fill-hover: #e5e7eb;
  --on-fill: #151517;
  --card: rgba(32, 33, 38, 0.94);
  --topbar: rgba(21, 21, 23, 0.86);
  --elev: 0 0 0 0.5px rgba(255, 255, 255, 0.08), 0 8px 24px rgba(0, 0, 0, 0.28);
  --elev-soft: 0 0 0 0.5px rgba(255, 255, 255, 0.08), 0 8px 24px rgba(0, 0, 0, 0.22);
}
html[data-appearance="dark"] body {
  background:
    radial-gradient(920px 480px at 8% -12%, rgba(65, 118, 230, 0.18), transparent 62%),
    radial-gradient(720px 420px at 100% -8%, rgba(90, 120, 200, 0.12), transparent 58%),
    var(--page);
}
@media (prefers-color-scheme: dark) {
  html[data-appearance="system"] {
    color-scheme: dark;
    --bg: #1c1d21;
    --page: #151517;
    --sidebar: rgba(28, 29, 33, 0.88);
    --hover: rgba(255, 255, 255, 0.06);
    --hover-solid: #2a2b31;
    --active: #34353c;
    --ink: #f5f6f7;
    --ink-2: #c4c6cc;
    --ink-3: #8d9098;
    --line: rgba(255, 255, 255, 0.12);
    --line-soft: rgba(255, 255, 255, 0.06);
    --link: #8eb0f8;
    --link-soft: rgba(65, 118, 230, 0.24);
    --ok: #4ade80;
    --ok-bg: rgba(22, 163, 74, 0.18);
    --err: #f87171;
    --err-bg: rgba(236, 19, 19, 0.18);
    --warn: #fbbf24;
    --warn-bg: rgba(245, 158, 11, 0.16);
    --fill: #f3f4f6;
    --fill-hover: #e5e7eb;
    --on-fill: #151517;
    --card: rgba(32, 33, 38, 0.94);
    --topbar: rgba(21, 21, 23, 0.86);
    --elev: 0 0 0 0.5px rgba(255, 255, 255, 0.08), 0 8px 24px rgba(0, 0, 0, 0.28);
    --elev-soft: 0 0 0 0.5px rgba(255, 255, 255, 0.08), 0 8px 24px rgba(0, 0, 0, 0.22);
  }
  html[data-appearance="system"] body {
    background:
      radial-gradient(920px 480px at 8% -12%, rgba(65, 118, 230, 0.18), transparent 62%),
      radial-gradient(720px 420px at 100% -8%, rgba(90, 120, 200, 0.12), transparent 58%),
      var(--page);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 22px;
  color: var(--ink);
  background:
    radial-gradient(920px 480px at 8% -12%, rgba(77, 107, 254, 0.20), transparent 62%),
    radial-gradient(720px 420px at 100% -8%, rgba(125, 168, 255, 0.28), transparent 58%),
    radial-gradient(640px 360px at 72% 108%, rgba(210, 224, 255, 0.85), transparent 56%),
    var(--page);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }
button, a, [role="button"] { cursor: pointer; }
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}
::selection { background: var(--link-soft); }

h1, h2, h3 { font-weight: 600; letter-spacing: 0; }
code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--sidebar);
  padding: 1px 6px;
  border-radius: 4px;
}

.hidden { display: none !important; }

.mark {
  width: 28px;
  height: 28px;
  display: block;
  flex: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--fill);
  color: var(--on-fill);
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  box-shadow: var(--elev);
  transition: background-color 160ms ease, filter 160ms ease;
}
.btn:hover { background: var(--fill-hover); text-decoration: none; }
.btn:active { filter: brightness(1.08); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-ghost, .btn-outline, .btn-kill {
  border: 0;
  border-radius: var(--radius-sm);
  min-height: 32px;
  padding: 0 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}
.btn.ghost, .btn-outline, .btn-ghost {
  background: var(--bg);
  color: var(--ink);
  box-shadow: var(--elev-soft);
  font-weight: 500;
}
.btn.ghost:hover, .btn-outline:hover, .btn-ghost:hover { background: var(--hover-solid); }
.btn-outline.warn, .op.danger { color: var(--err); }
a.btn:hover { text-decoration: none; }

input, select, textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--sidebar);
  box-shadow: 0 0 0 0.5px var(--line);
  outline: none;
}
textarea { min-height: 180px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  background: var(--bg);
  box-shadow: 0 0 0 0.5px var(--link), 0 0 0 3px rgba(65, 118, 230, 0.16);
}
input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  height: 16px;
  padding: 0;
  box-shadow: none;
  accent-color: var(--fill);
}

.hint { margin: 0 0 16px; color: var(--ink-2); font-size: 13px; line-height: 20px; }
.msg { min-height: 20px; margin: 4px 0 8px; color: var(--err); font-size: 13px; line-height: 20px; }
.msg.ok { color: var(--ok); }

.card {
  background: var(--bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--elev-soft);
  padding: 20px 22px;
  margin-bottom: 16px;
}
.card h2, .sk-head h2 { margin: 0 0 6px; font-size: 16px; line-height: 24px; }

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 99px;
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
}
.pill.admin { background: var(--warn-bg); color: var(--warn); }
.pill.user { background: var(--active); color: var(--ink-2); }
.pill.active { background: var(--ok-bg); color: var(--ok); }
.pill.disabled { background: var(--err-bg); color: var(--err); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 8px; text-align: left; border-bottom: 0.5px solid var(--line); vertical-align: middle; }
th { color: var(--ink-3); font-weight: 500; font-size: 12px; }
td .op { color: var(--link); margin-right: 12px; font-weight: 500; white-space: nowrap; text-decoration: none; }
td .op:hover { text-decoration: underline dotted; text-underline-offset: 3px; }

.top, .topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  min-height: 64px;
  padding: 0 20px;
  background: var(--topbar);
  backdrop-filter: blur(16px);
  border-bottom: 0.5px solid var(--line);
}
.brand-lockup { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-lockup b, .brand-lockup h1 { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; }
.brand-lockup span, .brand-lockup p { margin: 0; display: block; color: var(--ink-3); font-size: 12px; line-height: 16px; font-weight: 400; }

/* 登录 */
body.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 88px 24px 40px;
}
.auth-brand {
  position: fixed;
  top: 28px;
  left: 32px;
  gap: 12px;
}
.auth-brand .mark { width: 40px; height: 40px; }
.auth-brand h1 { font-size: 24px; line-height: 32px; }
.auth-card {
  width: min(420px, 100%);
  background: var(--card);
  border-radius: var(--radius-panel);
  box-shadow: var(--elev);
  padding: 28px 28px 24px;
}
.auth-card .brand-lockup { margin-bottom: 28px; }
.auth-card h2 { margin: 0 0 4px; font-size: 20px; line-height: 28px; }
.auth-card > #loginView > .btn,
body.account .auth-card .btn { width: 100%; }
body.account .auth-card input { display: block; margin-bottom: 12px; }
.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 12px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 20px;
  user-select: none;
}
.remember input { width: 16px; min-height: 16px; flex: none; }
.field { position: relative; margin-bottom: 12px; }
.field svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}
.field input { padding-left: 40px; }
.stack { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.stack .btn, .stack a.btn { width: 100%; }
.portal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--fill);
  color: var(--on-fill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex: none;
}
.portal-head .who b { font-size: 16px; line-height: 24px; }
.portal-head .who span {
  display: inline-flex;
  margin-top: 4px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 99px;
  background: var(--active);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  align-items: center;
}
.portal-head .who span.admin { background: var(--warn-bg); color: var(--warn); }

/* 控制台 */
body.console {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 232px 1fr;
  grid-template-rows: 64px 1fr;
  grid-template-areas: "side top" "side main";
}
.side {
  grid-area: side;
  background: var(--sidebar);
  border-right: 0.5px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  min-height: 0;
}
.side .logo { padding: 4px 8px 18px; }
.menu { display: flex; flex-direction: column; gap: 2px; }
.menu a {
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.menu a:hover { background: var(--hover-solid); text-decoration: none; }
.menu a.active { background: var(--active); font-weight: 600; }
.menu a.soon { color: var(--ink-3); }
.tag-soon {
  font-size: 11px;
  line-height: 16px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--bg);
  color: var(--ink-3);
  box-shadow: 0 0 0 0.5px var(--line);
  font-weight: 500;
}
body.console .top { grid-area: top; }
.crumb { font-size: 15px; font-weight: 600; line-height: 22px; }
.crumb small { display: block; margin-top: 0; font-weight: 400; color: var(--ink-3); font-size: 12px; line-height: 16px; }
.top-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 2px;
  height: 32px;
}
.top-actions a,
.top-actions button,
.top-actions .who {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 13px;
  line-height: 1;
  font-weight: 500;
  white-space: nowrap;
  appearance: none;
}
.top-actions a:hover, .top-actions button:hover { background: var(--hover-solid); color: var(--ink); text-decoration: none; }
.appearance-switch {
  display: inline-flex;
  align-items: center;
  height: 32px;
  margin-right: 8px;
  padding: 2px;
  border-radius: 8px;
  background: var(--fill);
  box-shadow: inset 0 0 0 0.5px var(--line);
}
.appearance-switch button {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.appearance-switch button[aria-pressed="true"] {
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 0 0 0.5px var(--line);
}
body.auth .appearance-switch {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2;
  background: var(--card, var(--bg));
}
.top-actions .who { color: var(--ink); font-weight: 600; background: transparent; }
.main { grid-area: main; padding: 20px 24px 48px; overflow: auto; }
.view { display: none; }
.view.on { display: block; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--bg); border-radius: var(--radius-lg); box-shadow: var(--elev-soft); padding: 14px 16px; }
.stat label { display: block; color: var(--ink-3); font-size: 12px; line-height: 16px; }
.stat b { display: block; margin-top: 6px; font-size: 22px; line-height: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; align-items: center; }
.row > input, .row > select { flex: 1; min-width: 140px; width: auto; }
.bar { height: 6px; background: var(--active); border-radius: 99px; overflow: hidden; margin: 10px 0 4px; }
.bar i { display: block; height: 100%; width: 0; background: var(--fill); border-radius: 99px; }
.soon-box { background: var(--bg); border-radius: var(--radius-xl); box-shadow: var(--elev-soft); padding: 36px 28px; color: var(--ink-2); }
.soon-box h2 { margin: 0 0 8px; color: var(--ink); font-size: 16px; }

.ops { color: var(--ink); }
.ops h2 { margin: 0 0 6px; font-size: 16px; }
.ops-toolbar, .ops-form .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.ops-toolbar { margin: 4px 0 16px; }
.ops-meta { margin-left: auto; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.ops-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.ops-stat { background: var(--sidebar); border-radius: var(--radius-md); padding: 12px 14px; }
.ops-stat label { display: block; color: var(--ink-3); font-size: 11px; letter-spacing: 0.06em; }
.ops-stat b { font-size: 22px; line-height: 28px; font-variant-numeric: tabular-nums; }
.ops-form { margin: 0 0 8px; }
.ops-form .fld { display: flex; flex-direction: column; gap: 4px; flex: 0 1 132px; min-width: 108px; }
.ops-form .fld span { font-size: 12px; color: var(--ink-3); }
.ops-form .fld em { font-style: normal; color: var(--ink-3); margin-left: 4px; }
.ops-form .row input { width: 100%; flex: none; }
.pod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.pod-card {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--elev-soft);
  padding: 14px 16px 14px 18px;
}
.pod-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--ink-3);
}
.pod-card.live::before { background: var(--live); }
.pod-card.boot::before { background: var(--boot); }
.pod-card.bad::before { background: var(--err); }
.pod-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.pod-head .user { font-size: 16px; font-weight: 600; }
.pod-head .pn { display: block; margin-top: 2px; color: var(--ink-3); font-family: var(--mono); font-size: 11px; }
.led {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--active);
  color: var(--ink-2);
  white-space: nowrap;
}
.led.live { background: var(--ok-bg); color: var(--ok); }
.led.boot { background: var(--warn-bg); color: var(--warn); }
.led.bad { background: var(--err-bg); color: var(--err); }
.kv { display: grid; grid-template-columns: 56px 1fr; gap: 4px 8px; font-size: 12px; line-height: 18px; }
.kv span { color: var(--ink-3); }
.kv code { color: var(--ink); background: transparent; padding: 0; word-break: break-all; }
.pod-actions { margin-top: 12px; display: flex; justify-content: flex-end; }
.btn-kill {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--err-bg);
  color: var(--err);
  font-weight: 500;
  font-size: 13px;
}
.btn-kill:hover { filter: brightness(0.97); }
.ops-empty { text-align: center; padding: 36px 12px; color: var(--ink-2); }
.ops-empty b { display: block; margin-bottom: 4px; color: var(--ink); font-size: 15px; }
table.report td.num, table.report th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.use { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.use .bar { flex: 1; margin: 0; min-width: 64px; }
.use .pct { width: 36px; text-align: right; color: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }

.sk-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 8px; }
.sk-search { max-width: 360px; margin: 8px 0 18px; }
.section-label { margin: 18px 0 10px; font-size: 13px; line-height: 20px; font-weight: 600; color: var(--ink-2); }
.section-label:first-of-type { margin-top: 8px; }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.sk-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--elev-soft);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 148px;
}
.sk-card .sk-top { display: flex; gap: 12px; align-items: flex-start; }
.sk-ico {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--link-soft);
  color: var(--link);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex: none;
}
.sk-card h3 { margin: 0; font-size: 14px; line-height: 20px; }
.sk-card p {
  margin: 0;
  flex: 1;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sk-src { font-size: 12px; color: var(--ink-3); }
.sk-act { display: flex; justify-content: flex-end; gap: 8px; }
.manual { margin-top: 22px; }
.manual summary { color: var(--ink-2); cursor: pointer; font-size: 13px; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.24);
}
.modal.on { display: flex; }
.modal .box {
  width: min(520px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: var(--bg);
  border-radius: var(--radius-panel);
  box-shadow: var(--elev);
  padding: 22px 24px;
}
.modal .box.wide { width: min(720px, 100%); }
.modal h3 { margin: 0 0 6px; font-size: 16px; }
.modal pre {
  margin: 0 0 14px;
  padding: 12px;
  max-height: 52vh;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  background: var(--sidebar);
  border-radius: var(--radius-md);
  white-space: pre-wrap;
  word-break: break-word;
}
.modal input { margin-bottom: 12px; }
.modal .act { display: flex; justify-content: flex-end; gap: 8px; }

/* 文件页 */
body.files { min-height: 100vh; }
.page-main { max-width: 760px; margin: 0 auto; padding: 24px 20px 48px; }
.path { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.path a { color: var(--link); font-weight: 500; }
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 4px;
  border-bottom: 0.5px solid var(--line-soft);
}
.file-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--ink); text-decoration: none; }
.file-row a.name:hover { color: var(--link); }
.badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--active);
  color: var(--ink-2);
}
.badge.dir { background: var(--link-soft); color: var(--link); }
.badge.sheet { background: var(--ok-bg); color: var(--ok); }
.badge.doc { background: #dbeafe; color: #1d4ed8; }
.badge.ppt { background: var(--warn-bg); color: var(--warn); }
.badge.pdf, .badge.html { background: var(--err-bg); color: var(--err); }
.badge.img { background: #f3e8ff; color: #7e22ce; }
.linkish {
  border: 0;
  background: none;
  color: var(--link);
  font-weight: 500;
  padding: 6px 0;
  min-height: 32px;
}
.empty { padding: 28px 0; color: var(--ink-2); font-size: 14px; }

/* 改密 */
body.account { min-height: 100vh; display: flex; flex-direction: column; }
body.account .panel { flex: 1; display: grid; place-items: center; padding: 32px 16px; }
body.account .auth-card { width: min(420px, 100%); }

@media (max-width: 860px) {
  .auth-brand { top: 20px; left: 16px; }
  .auth-brand h1 { font-size: 20px; line-height: 28px; }
  body.console {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    grid-template-areas: "top" "side" "main";
  }
  .side { border-right: 0; border-bottom: 0.5px solid var(--line); }
  .menu { flex-direction: row; flex-wrap: wrap; }
  .stats, .ops-stats { grid-template-columns: 1fr 1fr; }
  .top, .topbar { padding: 10px 14px; height: auto; min-height: 56px; }
  .top-actions { flex-wrap: wrap; height: auto; justify-content: flex-end; }
  .main { padding: 16px 14px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
