/* DY 托管 —— 样式。颜色全部走 :root 上的 token，深色在下面两处覆盖（跟随系统 / 手动）。 */

:root {
  color-scheme: light;
  --brand: #FE2C55;
  --brand-2: #25F4EE;
  --bg: #F4F5F7;
  --bg-elev: #FBFBFC;
  --surface: #FFFFFF;
  --surface-2: #F7F8FA;
  --sunken: #ECEEF2;
  --seg-on: #FFFFFF;
  --border: #E4E6EB;
  --border-strong: #CDD1D9;
  --text: #121317;
  --text-2: #464A55;
  --text-3: #6B6F7A;
  --accent: #FE2C55;
  --accent-solid: #E8173F;
  --accent-hover: #D40F37;
  --accent-soft: #FFE8ED;
  --accent-ring: rgba(254, 44, 85, .26);
  --accent-ink: #D0103A;
  --on-accent: #FFFFFF;
  --cyan: #25F4EE;
  --cyan-ink: #00716E;
  --cyan-soft: #DDFAF8;
  --ok: #1F7A45;      --ok-soft: #E0F3E8;
  --bad: #C42B1C;     --bad-soft: #FDE7E4;
  --warn: #8F5A00;    --warn-soft: #FCF0D4;
  --info: #2459B3;    --info-soft: #E4ECFB;
  --neutral-soft: #EDEEF2;
  --switch-off: #CFD3DB;
  --inverse: #18181D;
  --inverse-text: #F4F4F6;
  --overlay: rgba(12, 12, 18, .46);
  --shadow-sm: 0 1px 2px rgba(16, 18, 30, .05);
  --shadow: 0 1px 2px rgba(16, 18, 30, .04), 0 6px 20px rgba(16, 18, 30, .06);
  --shadow-lg: 0 18px 50px rgba(12, 14, 26, .22);
  --log-bg: #121217;
  --log-text: #E6E6EC;
  --log-border: #24242C;
  --crab-eye: #2A1E18;
  --avatar-l: 38%;
  --chart-grid: #E9EBEF;
  --hero-from: #FFE9EE;
  --hero-to: #E3FBFA;

  --radius: 16px;
  --radius-sm: 11px;
  --radius-xs: 8px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", "Noto Sans Mono CJK SC", monospace;
  --sidebar-w: 248px;
  --tabbar-h: 60px;
  --topbar-h: 54px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0E0E12;
    --bg-elev: #121217;
    --surface: #18181E;
    --surface-2: #1E1E25;
    --sunken: #0A0A0D;
    --seg-on: #2C2C36;
    --border: #2A2A33;
    --border-strong: #3B3B47;
    --text: #F2F2F5;
    --text-2: #BABCC5;
    --text-3: #8B8E99;
    --accent: #FE2C55;
    --accent-solid: #E8173F;
    --accent-hover: #FF4569;
    --accent-soft: rgba(254, 44, 85, .15);
    --accent-ring: rgba(254, 44, 85, .38);
    --accent-ink: #FF6B85;
    --on-accent: #FFFFFF;
    --cyan: #25F4EE;
    --cyan-ink: #5FF7F2;
    --cyan-soft: rgba(37, 244, 238, .12);
    --ok: #6FD49A;      --ok-soft: rgba(80, 200, 125, .14);
    --bad: #FF8A7E;     --bad-soft: rgba(240, 80, 65, .16);
    --warn: #F0C46A;    --warn-soft: rgba(235, 175, 50, .14);
    --info: #8DB4F7;    --info-soft: rgba(90, 145, 235, .16);
    --neutral-soft: #26262E;
    --switch-off: #44444F;
    --inverse: #F2F2F5;
    --inverse-text: #15151A;
    --overlay: rgba(0, 0, 0, .62);
    --shadow-sm: none;
    --shadow: 0 1px 0 rgba(255, 255, 255, .02);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, .6);
    --log-bg: #09090C;
    --log-text: #E6E6EC;
    --log-border: #22222A;
    --crab-eye: #1A1311;
    --avatar-l: 76%;
    --chart-grid: #26262E;
    --hero-from: rgba(254, 44, 85, .16);
    --hero-to: rgba(37, 244, 238, .08);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E0E12;
  --bg-elev: #121217;
  --surface: #18181E;
  --surface-2: #1E1E25;
  --sunken: #0A0A0D;
  --seg-on: #2C2C36;
  --border: #2A2A33;
  --border-strong: #3B3B47;
  --text: #F2F2F5;
  --text-2: #BABCC5;
  --text-3: #8B8E99;
  --accent: #FE2C55;
  --accent-solid: #E8173F;
  --accent-hover: #FF4569;
  --accent-soft: rgba(254, 44, 85, .15);
  --accent-ring: rgba(254, 44, 85, .38);
  --accent-ink: #FF6B85;
  --on-accent: #FFFFFF;
  --cyan: #25F4EE;
  --cyan-ink: #5FF7F2;
  --cyan-soft: rgba(37, 244, 238, .12);
  --ok: #6FD49A;      --ok-soft: rgba(80, 200, 125, .14);
  --bad: #FF8A7E;     --bad-soft: rgba(240, 80, 65, .16);
  --warn: #F0C46A;    --warn-soft: rgba(235, 175, 50, .14);
  --info: #8DB4F7;    --info-soft: rgba(90, 145, 235, .16);
  --neutral-soft: #26262E;
  --switch-off: #44444F;
  --inverse: #F2F2F5;
  --inverse-text: #15151A;
  --overlay: rgba(0, 0, 0, .62);
  --shadow-sm: none;
  --shadow: 0 1px 0 rgba(255, 255, 255, .02);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .6);
  --log-bg: #09090C;
  --log-text: #E6E6EC;
  --log-border: #22222A;
  --crab-eye: #1A1311;
  --avatar-l: 76%;
  --chart-grid: #26262E;
  --hero-from: rgba(254, 44, 85, .16);
  --hero-to: rgba(37, 244, 238, .08);
}

/* ---------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
html:has(dialog[open]) { overflow: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: clip;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
img, video { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-ring); }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--text-3); }
.dim-text { color: var(--text-2); }
.nowrap { white-space: nowrap; }
.num-tab { font-variant-numeric: tabular-nums; }
.ic { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
.ic-sm { width: 15px; height: 15px; }
.ic-lg { width: 22px; height: 22px; }
.spacer { flex: 1; }
.stack-sm > * + * { margin-top: 8px; }
.stack > * + * { margin-top: 14px; }
.stack-lg > * + * { margin-top: 22px; }
.hstack { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wrap { flex-wrap: wrap; }
.break { overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- crab */

.crab { display: inline-block; flex: none; image-rendering: pixelated; }
.crab .eye { fill: var(--crab-eye); transform-box: fill-box; transform-origin: center; animation: crab-blink 6s infinite; }
.crab.sleep .eye { animation: none; transform: scaleY(.34) translateY(2px); }
.crab.busy { animation: crab-bob .5s var(--ease) infinite alternate; }
.crab.wave .arm-r { transform-box: fill-box; transform-origin: left bottom; animation: crab-wave 1.2s ease-in-out infinite; }
@keyframes crab-blink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.15); } }
@keyframes crab-bob { from { transform: translateY(0); } to { transform: translateY(-3px); } }
@keyframes crab-wave { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1px); } }

/* ---------------------------------------------------------------- shell */

.shell { min-height: 100vh; min-height: 100dvh; }
.sidebar { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 12px 0 16px;
  display: flex; align-items: center; gap: 10px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--border); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 17px; letter-spacing: .01em; min-width: 0; }
.brand-name { white-space: nowrap; letter-spacing: .02em; }
.brand-name b { font-weight: 800; color: var(--accent-ink); }
.mark { flex: none; border-radius: 9px; }
.mark.busy { animation: mark-bob .7s var(--ease) infinite alternate; }
@keyframes mark-bob { from { transform: translateY(0); } to { transform: translateY(-4px); } }
.brand:hover { text-decoration: none; }
.brand small { font-weight: 500; color: var(--text-3); font-size: 12px; }
.topbar .pills { display: flex; gap: 6px; min-width: 0; overflow: hidden; }
.main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 8px 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 28px); min-width: 0; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 0 4px env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--border);
}
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; font-weight: 600; color: var(--text-3); background: none; border: 0; cursor: pointer; padding: 0;
  transition: color .15s;
}
.tab:hover { text-decoration: none; color: var(--text-2); }
.tab .ic { width: 23px; height: 23px; transition: transform .2s var(--ease); }
.tab[aria-current="page"] { color: var(--accent-ink); }
.tab[aria-current="page"] .ic { transform: translateY(-1px); }
.tab .count, .nav-item .count, .top-bell .count, .more-tile .count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent-solid); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
}
.tab .count { position: absolute; top: 5px; left: calc(50% + 5px); box-shadow: 0 0 0 2px var(--surface); }
.tab .live-dot, .nav-item .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); animation: pulse-cyan 1.6s infinite; }
.tab .live-dot { position: absolute; top: 9px; left: calc(50% + 9px); box-shadow: 0 0 0 2px var(--surface); }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .topbar, .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px;
    position: sticky; top: 0; height: 100vh; height: 100dvh;
    padding: 20px 12px 16px; border-right: 1px solid var(--border); background: var(--bg-elev);
  }
  .sidebar .brand { padding: 2px 10px 18px; font-size: 17px; }
  .main { padding: 30px 40px 72px; }
}
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px;
  color: var(--text-2); font-weight: 600; font-size: 14.5px; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--sunken); color: var(--text); text-decoration: none; }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }
.nav-item .label { flex: 1; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 6px 0; border-top: 1px solid var(--border); }
.sidebar-status { display: flex; flex-direction: column; gap: 6px; padding: 0 4px; font-size: 12.5px; color: var(--text-3); }
.sidebar-status .hstack { gap: 7px; }
.sidebar-tools { display: flex; gap: 4px; }
.sdot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--border-strong); }
.sdot.ok { background: var(--ok); } .sdot.bad { background: var(--bad); } .sdot.warn { background: var(--warn); } .sdot.progress { background: var(--accent); }

.alerts { display: flex; flex-direction: column; gap: 10px; margin: 0 0 14px; }
.alerts:empty { display: none; }
.alert {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bad-soft); color: var(--bad); font-size: 14px; font-weight: 550;
  border: 1px solid color-mix(in srgb, var(--bad) 22%, transparent);
  animation: fade-up .25s var(--ease);
}
.alert.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.alert.info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 22%, transparent); }
.alert .text { flex: 1; min-width: 0; }
.alert .btn { flex: none; }

.page { animation: page-in .28s var(--ease); min-width: 0; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--accent-ring); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes pulse-cyan { 0% { box-shadow: 0 0 0 0 rgba(37, 244, 238, .45); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.page-head { display: flex; align-items: flex-end; gap: 12px; margin: 8px 0 18px; flex-wrap: wrap; }
.page-head .titles { flex: 1 1 220px; min-width: 0; }
.page-head h1 { font-size: 26px; line-height: 1.2; font-weight: 750; letter-spacing: -.01em; }
.page-head .sub { color: var(--text-3); font-size: 13.5px; margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.back:hover { color: var(--text); text-decoration: none; }
@media (min-width: 900px) { .page-head h1 { font-size: 28px; } }

.section-title { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--text-3); letter-spacing: .04em; margin: 26px 2px 10px; }
.section-title .spacer + a, .section-title a { font-weight: 600; letter-spacing: 0; }

/* ---------------------------------------------------------------- layout helpers */

.grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.grid-tiles { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2 { grid-column: span 2; }
}
@media (min-width: 1100px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; }
  .split > .side { position: sticky; top: 24px; grid-column: 2; grid-row: 1; }
  .split > .main-area { grid-column: 1; grid-row: 1; }
}
.split > * + * { margin-top: 0; }
@media (max-width: 1099px) { .split > * + * { margin-top: 14px; } }

/* ---------------------------------------------------------------- card */

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 16px; min-width: 0;
}
.card.flush { padding: 0; overflow: hidden; }
.card.tinted { background: var(--surface-2); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; min-width: 0; }
.card-head .title { font-size: 15.5px; font-weight: 700; flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.card-head .title .ic { color: var(--text-3); }
.card-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.card-sub { color: var(--text-3); font-size: 13px; }
a.card { color: inherit; display: block; transition: border-color .15s, transform .15s; }
a.card:hover { text-decoration: none; border-color: var(--border-strong); }
@media (min-width: 900px) { .card { padding: 18px 20px; } }

details.panel { padding: 0; }
details.panel > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius);
  user-select: none; -webkit-user-select: none;
}
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary .ic-chev { transition: transform .2s var(--ease); color: var(--text-3); }
details.panel[open] > summary .ic-chev { transform: rotate(90deg); }
details.panel[open] > summary { border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
details.panel > summary .sum-title { font-weight: 700; font-size: 15.5px; }
details.panel > summary .sum-sub { color: var(--text-3); font-size: 12.5px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.panel > summary .sum-text { flex: 1; min-width: 0; }
details.panel .panel-body > .row:first-child { border-top: 0; }

/* ---------------------------------------------------------------- settings rows */

.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 14px; padding: 13px 16px; min-height: 58px; min-width: 0; transition: opacity .2s; }
.row + .row, .rows > .row + .row { border-top: 1px solid var(--border); }
.row-text { flex: 1; min-width: 0; }
.row-label { display: block; font-weight: 600; font-size: 14.5px; line-height: 1.35; cursor: default; }
label.row-label[for] { cursor: pointer; }
.row-hint { color: var(--text-3); font-size: 12.5px; line-height: 1.45; margin-top: 3px; }
.row-error { color: var(--bad); font-size: 12.5px; margin-top: 4px; font-weight: 550; }
.row-warn { color: var(--warn); font-size: 12.5px; margin-top: 4px; font-weight: 550; }
.row-control { flex: none; display: flex; align-items: center; gap: 8px; min-width: 0; }
.row.stack { flex-direction: column; align-items: stretch; gap: 10px; }
.row.stack .row-control { width: 100%; flex-wrap: wrap; }
.row.dim .row-label, .row.dim .row-control { opacity: .5; }
.row.actions-row { flex-wrap: wrap; gap: 8px; }
.row-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-sub .lbl { font-size: 13px; color: var(--text-2); }
.row-sub .pair { display: inline-flex; align-items: center; gap: 8px; }
@media (min-width: 900px) { .row { padding: 14px 20px; } }

/* ---------------------------------------------------------------- inputs */

.input, .select, .textarea {
  font: inherit; font-size: 15px; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border-strong); border-radius: var(--radius-xs); padding: 8px 11px; min-height: 40px; width: 100%;
  transition: border-color .15s, box-shadow .15s, background .15s; min-width: 0;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); opacity: .9; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); background: var(--surface); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.input:disabled, .select:disabled, .textarea:disabled { opacity: .6; cursor: not-allowed; }
.textarea { resize: vertical; line-height: 1.55; min-height: 84px; }
.num { width: 88px; text-align: right; font-variant-numeric: tabular-nums; }
.time { width: 110px; font-variant-numeric: tabular-nums; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.select.auto { width: auto; max-width: 100%; }
.unit { color: var(--text-3); font-size: 13px; white-space: nowrap; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .hint { color: var(--text-3); font-size: 12.5px; }
.field-row { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .field-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.counter { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.counter.over { color: var(--bad); font-weight: 600; }
.input-wrap { position: relative; display: flex; align-items: center; width: 100%; }
.input-wrap > .ic { position: absolute; left: 11px; color: var(--text-3); pointer-events: none; }
.input-wrap > .input { padding-left: 36px; }
.input-wrap > .btn-inside { position: absolute; right: 4px; }
@media (max-width: 899px) { .input, .select, .textarea { font-size: 16px; } }

input[type="checkbox"].check { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; margin: 0; flex: none; }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 15px; border-radius: 11px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-size: 14.5px; font-weight: 600; line-height: 1;
  cursor: pointer; white-space: nowrap; user-select: none; -webkit-user-select: none; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, transform .1s, opacity .15s, box-shadow .15s;
  position: relative; min-width: 0;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); text-decoration: none; }
.btn:active { transform: scale(.975); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent-solid); border-color: var(--accent-solid); color: var(--on-accent); box-shadow: 0 1px 2px rgba(200, 20, 60, .25), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-soft { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.btn-soft:hover { background: var(--accent-soft); border-color: var(--accent-ring); }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 32%, var(--border)); background: var(--surface); }
.btn-danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn-danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger-solid:hover { background: color-mix(in srgb, var(--bad) 88%, #000); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--sunken); border-color: transparent; color: var(--text); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13.5px; border-radius: 9px; gap: 5px; }
.btn-sm .ic { width: 16px; height: 16px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 16px; border-radius: 13px; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-block { width: 100%; }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading > * { visibility: hidden; }
.btn.loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--text-3) var(--text-3) var(--text-3) transparent; animation: spin .7s linear infinite;
}
.btn-primary.loading::after, .btn-danger-solid.loading::after { border-color: #fff #fff #fff transparent; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row.end { justify-content: flex-end; }
@media (max-width: 599px) { .btn-row.fill > .btn { flex: 1 1 auto; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin .7s linear infinite; flex: none; }

.link-btn { background: none; border: 0; padding: 0; color: var(--accent-ink); font-weight: 600; cursor: pointer; font-size: inherit; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- switch */

.switch {
  --w: 48px; --h: 28px;
  position: relative; flex: none; width: var(--w); height: var(--h); border-radius: 999px; border: 0; padding: 0;
  background: var(--switch-off); cursor: pointer; transition: background .22s var(--ease), opacity .2s;
}
.switch-knob {
  position: absolute; top: 3px; left: 3px; width: calc(var(--h) - 6px); height: calc(var(--h) - 6px); border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25), 0 0 0 .5px rgba(0, 0, 0, .04);
  transition: transform .24s var(--ease);
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"] .switch-knob { transform: translateX(calc(var(--w) - var(--h))); }
.switch.busy { opacity: .65; pointer-events: none; }
.switch:disabled { opacity: .4; cursor: not-allowed; }
.switch:focus-visible { outline-offset: 3px; border-radius: 999px; }
.switch-lg { --w: 62px; --h: 36px; }

/* ---------------------------------------------------------------- segmented */

.seg { display: inline-flex; background: var(--sunken); border-radius: 11px; padding: 3px; gap: 2px; max-width: 100%; }
.seg button {
  flex: 1 1 auto; border: 0; background: transparent; font-size: 13.5px; font-weight: 600; color: var(--text-2);
  padding: 0 12px; min-height: 32px; border-radius: 8px; cursor: pointer; white-space: nowrap;
  transition: background .18s, color .18s, box-shadow .18s; min-width: 0;
}
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"], .seg button[aria-selected="true"], .seg button[aria-pressed="true"] {
  background: var(--seg-on); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 0 0 .5px var(--border);
}
.seg button.hot[aria-checked="true"] { color: var(--accent-ink); }
.seg.full { display: flex; width: 100%; }
.seg.scroll { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.seg.scroll::-webkit-scrollbar { display: none; }
.seg .n { font-size: 11.5px; color: var(--text-3); margin-left: 4px; font-variant-numeric: tabular-nums; }
.seg button[aria-selected="true"] .n { color: var(--accent-ink); }

.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days button {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface);
  font-weight: 650; font-size: 14px; color: var(--text-2); cursor: pointer; transition: all .15s;
}
.days button[aria-pressed="true"] { background: var(--accent-solid); border-color: var(--accent-solid); color: #fff; }

/* ---------------------------------------------------------------- badges & chips */

.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 23px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 650; white-space: nowrap; line-height: 1; flex: none;
  background: var(--neutral-soft); color: var(--text-2);
}
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.t-ok { background: var(--ok-soft); color: var(--ok); }
.t-bad { background: var(--bad-soft); color: var(--bad); }
.t-warn { background: var(--warn-soft); color: var(--warn); }
.t-info { background: var(--info-soft); color: var(--info); }
.t-progress { background: var(--cyan-soft); color: var(--cyan-ink); }
.t-progress.dot::before { animation: pulse-cyan 1.6s infinite; }
.t-accent { background: var(--accent-soft); color: var(--accent-ink); }
.t-neutral { background: var(--neutral-soft); color: var(--text-2); }
.t-muted { background: transparent; color: var(--text-3); box-shadow: inset 0 0 0 1px var(--border-strong); }
.badge.sm { height: 20px; padding: 0 7px; font-size: 11.5px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px;
  background: var(--sunken); color: var(--text-2); max-width: 100%; overflow-wrap: anywhere; line-height: 1.4;
}
.chip.accent { background: var(--accent-soft); color: var(--accent-ink); }
.chip button { border: 0; background: none; padding: 0; margin-right: -3px; cursor: pointer; color: inherit; opacity: .7; display: inline-flex; }
.chip button:hover { opacity: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 650; white-space: nowrap; border: 0; cursor: pointer;
}
.pill:hover { text-decoration: none; filter: brightness(.97); }

/* ---------------------------------------------------------------- lists */

.list { display: flex; flex-direction: column; }
.list > .item + .item { border-top: 1px solid var(--border); }
.item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-width: 0; color: inherit;
  transition: background .15s;
}
a.item:hover, button.item:hover, .item.linked:hover { background: var(--surface-2); text-decoration: none; }
.item.linked { position: relative; }
.item .stretch { color: inherit; }
.item .stretch:hover { text-decoration: none; }
.item .stretch::after { content: ""; position: absolute; inset: 0; }
.item .stretch:focus-visible { outline: none; }
.item.linked:has(.stretch:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 10px; }
.item.linked .side-col { position: relative; z-index: 1; }
button.item { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; }
.item .main-col { flex: 1; min-width: 0; }
.item .t1 { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; min-width: 0; }
.item .t1 .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.item .t2 { color: var(--text-3); font-size: 12.5px; margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.item .t3 { color: var(--text-2); font-size: 13px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .side-col { flex: none; display: flex; align-items: center; gap: 8px; }
.item .ic-chev { color: var(--text-3); }
@media (max-width: 480px) { .hide-sm { display: none !important; } }
.sep-dot::before { content: "·"; margin-right: 6px; color: var(--border-strong); }
@media (min-width: 900px) { .item { padding: 12px 20px; } }

.load-more { display: flex; justify-content: center; padding: 14px; }
.list-foot { text-align: center; color: var(--text-3); font-size: 12.5px; padding: 12px; }

/* ---------------------------------------------------------------- stat tiles */

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2);
  border: 1px solid var(--border); color: inherit; min-width: 0;
}
a.stat:hover { text-decoration: none; border-color: var(--border-strong); }
.stat .v { font-size: 21px; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .k { font-size: 12px; color: var(--text-3); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat.hot { background: var(--accent-soft); border-color: transparent; }
.stat.hot .v, .stat.hot .k { color: var(--accent-ink); }
.kv { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--text-3); white-space: nowrap; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.meta-line { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--text-3); font-size: 13px; align-items: center; }
.meta-line > span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------------------------------------------------------------- overview */

.hero {
  display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 20px;
  background: linear-gradient(120deg, var(--hero-from), var(--surface) 55%, var(--hero-to));
  border: 1px solid var(--border); position: relative; overflow: hidden;
}
.hero.paused { background: linear-gradient(135deg, var(--warn-soft), var(--surface) 70%); }
.hero .crab-wrap { width: 58px; height: 58px; border-radius: 16px; background: var(--surface); display: grid; place-items: center; flex: none; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.hero .hero-text { flex: 1; min-width: 0; }
.hero .hero-k { font-size: 12.5px; color: var(--text-3); font-weight: 650; letter-spacing: .03em; }
.hero h2 { font-size: 20px; font-weight: 750; line-height: 1.3; margin-top: 1px; }
.hero .hero-hint { font-size: 13px; color: var(--text-2); margin-top: 4px; }
@media (max-width: 420px) { .hero { padding: 16px 14px; gap: 12px; } .hero .crab-wrap { width: 48px; height: 48px; } .hero h2 { font-size: 18px; } }

.svc-card .card-head { margin-bottom: 10px; }
.svc-line { display: flex; align-items: baseline; gap: 10px; font-size: 14px; padding: 5px 0; min-width: 0; }
.svc-line .k { color: var(--text-3); flex: none; width: 64px; font-size: 13px; }
.svc-line .v { flex: 1; min-width: 0; overflow-wrap: anywhere; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.svc-line .v.ellipsis { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini { display: flex; flex-direction: column; gap: 8px; }
.mini .who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.mini .who .name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: var(--accent-soft); color: var(--accent-ink); object-fit: cover; overflow: hidden; position: relative;
}
.avatar > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.hue { background: hsl(var(--h) 70% 50% / .16); color: hsl(var(--h) 60% var(--avatar-l)); }
.avatar.lg { width: 54px; height: 54px; font-size: 21px; }
.sys-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .sys-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sys-grid .stat .v { font-size: 18px; }

.danger-zone { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); border: 1px dashed color-mix(in srgb, var(--bad) 40%, var(--border)); flex-wrap: wrap; }
.danger-zone .text { flex: 1 1 220px; min-width: 0; }
.danger-zone .t { font-weight: 700; }
.danger-zone .h { color: var(--text-3); font-size: 13px; margin-top: 2px; }

/* ---------------------------------------------------------------- empty / skeleton */

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 34px 20px; color: var(--text-3); }
.empty .crab { margin-bottom: 6px; }
.empty .et { font-weight: 700; color: var(--text-2); font-size: 15px; }
.empty .ed { font-size: 13.5px; max-width: 340px; }
.empty .btn { margin-top: 8px; }
.sk { border-radius: 7px; height: 13px; background: var(--sunken); position: relative; overflow: hidden; }
.sk::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 55%, transparent), transparent);
  animation: shimmer 1.3s infinite;
}
.sk.h { height: 20px; width: 40%; }
.sk.w60 { width: 60%; } .sk.w80 { width: 80%; } .sk.w30 { width: 30%; }
.sk-card { display: flex; flex-direction: column; gap: 10px; }
@keyframes shimmer { to { transform: translateX(100%); } }

.boot { min-height: 100vh; display: grid; place-items: center; }
.boot .inner { display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--text-3); font-size: 14px; }

/* ---------------------------------------------------------------- toast */

.toasts {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 200;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px);
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: min(92vw, 440px);
  /* 用 popover 进顶层，打开的对话框也盖不住 toast；这里清掉浏览器给 [popover] 的默认样式 */
  top: auto; right: auto; height: auto; margin: 0; padding: 0; border: 0; background: none; overflow: visible; color: inherit;
}
@media (min-width: 900px) { .toasts { left: calc(50% + var(--sidebar-w) / 2); bottom: 26px; } }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 100%;
  background: var(--inverse); color: var(--inverse-text); padding: 10px 14px; border-radius: 13px;
  box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 550; animation: toast-in .24s var(--ease);
}
.toast .msg { min-width: 0; overflow-wrap: anywhere; }
.toast .ic { color: #3FCB7E; }
.toast.error .ic { color: #FF6B6B; }
.toast.info .ic { color: var(--cyan); }
:root[data-theme="light"] .toast.info .ic { color: #25C9C3; }
.toast.out { animation: toast-out .2s forwards; }
.toast-action { flex: none; border: 0; background: none; color: var(--accent); font-weight: 700; cursor: pointer; padding: 2px 4px; font-size: 14px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px) scale(.98); } }

/* ---------------------------------------------------------------- dialog */

dialog.dlg {
  border: 0; padding: 0; background: var(--surface); color: var(--text); border-radius: 20px; box-shadow: var(--shadow-lg);
  width: min(460px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 48px);
  display: flex; flex-direction: column; overflow: hidden;
}
dialog.dlg:not([open]) { display: none; }
dialog.dlg.wide { width: min(760px, calc(100vw - 32px)); }
dialog.dlg[open] { animation: dlg-in .24s var(--ease); }
dialog.dlg::backdrop { background: var(--overlay); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade .2s; }
.dlg-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 8px; }
.dlg-head .dlg-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-ink); }
.dlg-head .dlg-ic.danger { background: var(--bad-soft); color: var(--bad); }
.dlg-head h2 { font-size: 17px; font-weight: 750; line-height: 1.35; flex: 1; min-width: 0; padding-top: 7px; }
.dlg-head .btn-icon { margin: -2px -6px 0 0; }
.dlg-body { padding: 6px 20px 16px; overflow: auto; color: var(--text-2); font-size: 14.5px; min-height: 0; flex: 1; }
.dlg-body p + p { margin-top: 8px; }
.dlg-body strong { color: var(--text); }
.dlg-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 20px 18px; border-top: 1px solid transparent; flex-wrap: wrap; }
.dlg-quote { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: 14px; overflow-wrap: anywhere; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
@media (max-width: 599px) {
  dialog.dlg { width: 100%; max-height: calc(100dvh - 24px); margin: auto 0 0; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  dialog.dlg.wide { width: 100%; }
  dialog.dlg[open] { animation: sheet-in .3s var(--ease); }
  .dlg-foot .btn { flex: 1 0 0; min-width: max-content; }
  .dlg-head { padding-top: 22px; }
}
@keyframes sheet-in { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }

.sheet-nav { display: flex; flex-direction: column; gap: 4px; }
.sheet-nav .nav-item { padding: 13px 12px; font-size: 16px; }

/* ---------------------------------------------------------------- login */

.login {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(900px 480px at 15% -10%, var(--hero-from), transparent 70%), radial-gradient(900px 480px at 100% 110%, var(--hero-to), transparent 70%), var(--bg);
}
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 16px; animation: page-in .4s var(--ease); }
.login-card .logo { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 6px; text-align: center; }
.login-card .logo .crab-wrap { width: 84px; height: 84px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; box-shadow: var(--shadow); }
.login-card h1 { font-size: 24px; font-weight: 800; }
.login-card .sub { color: var(--text-3); font-size: 13.5px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card .err { color: var(--bad); font-size: 13.5px; font-weight: 550; min-height: 1em; }
.login-card .foot { color: var(--text-3); font-size: 12.5px; text-align: center; line-height: 1.6; }

/* ---------------------------------------------------------------- replies */

.side-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "panel" "list" "try"; align-items: start; }
.side-layout > * { min-width: 0; }
.area-panel { grid-area: panel; } .area-list { grid-area: list; } .area-try { grid-area: try; }
@media (min-width: 1100px) {
  .side-layout { grid-template-columns: minmax(0, 1fr) 380px; grid-template-areas: "list panel" "list try"; grid-template-rows: auto 1fr; gap: 16px 22px; }
}

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; min-width: 0; }
.toolbar .grow { flex: 1 1 200px; min-width: 0; }
.tabs-wrap { margin: 0 0 12px; min-width: 0; }
.bulkbar {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border); margin-bottom: 12px; flex-wrap: wrap;
}
.bulkbar label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.bulkbar .spacer { min-width: 4px; }
.cards { display: flex; flex-direction: column; gap: 12px; }

.rcard { padding: 0; overflow: hidden; transition: opacity .25s, transform .25s, max-height .3s; }
.rcard.leaving { opacity: 0; transform: translateX(24px) scale(.98); }
.rcard.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.rcard-top { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); font-size: 12.5px; color: var(--text-3); min-width: 0; }
.rcard-top .video { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--text-2); }
.rcard-body { padding: 13px 14px 14px; display: flex; flex-direction: column; gap: 11px; min-width: 0; }
.who { display: flex; align-items: center; gap: 9px; min-width: 0; flex-wrap: wrap; }
.who .nick { font-weight: 700; font-size: 14.5px; overflow-wrap: anywhere; }
.who .meta { color: var(--text-3); font-size: 12.5px; display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.likes { display: inline-flex; align-items: center; gap: 3px; color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.likes .ic { width: 14px; height: 14px; }
.comment { font-size: 16px; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.notes { display: flex; flex-wrap: wrap; gap: 6px; }
.thread { border-left: 2px solid var(--border-strong); padding: 2px 0 2px 11px; display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; color: var(--text-2); }
.thread .t-who { font-weight: 650; color: var(--text-2); }
.thread .me .t-who { color: var(--accent-ink); }
.thread .more-btn { align-self: flex-start; }
.thread-label { font-size: 12px; color: var(--text-3); font-weight: 650; display: flex; align-items: center; gap: 6px; }
.draft { border-radius: 13px; background: var(--accent-soft); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.draft-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--accent-ink); }
.draft-head .crab { margin-right: 1px; }
.draft textarea {
  border: 1px solid transparent; background: var(--surface); border-radius: 9px; resize: none; min-height: 44px; padding: 8px 10px;
  font: inherit; font-size: 15.5px; color: var(--text); line-height: 1.5; width: 100%; overflow: hidden; transition: border-color .15s, box-shadow .15s;
}
.draft textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.draft .final { font-size: 15.5px; color: var(--text); overflow-wrap: anywhere; white-space: pre-wrap; }
.draft-foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.draft-foot .edited { color: var(--accent-ink); font-weight: 650; }
.reason { font-size: 12.5px; color: var(--text-3); display: flex; flex-direction: column; gap: 3px; }
.reason b { color: var(--text-2); font-weight: 650; }
.rcard-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rcard-actions .spacer { min-width: 0; }
.err-box { padding: 9px 11px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-size: 13px; overflow-wrap: anywhere; }
.warn-box { padding: 9px 11px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 13px; overflow-wrap: anywhere; }
.info-box { padding: 10px 12px; border-radius: 10px; background: var(--info-soft); color: var(--info); font-size: 13px; overflow-wrap: anywhere; }

.bubble-row { display: flex; gap: 10px; align-items: flex-start; }
.bubble-row .crab-av { width: 36px; height: 36px; border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; flex: none; }
.bubble { padding: 10px 13px; border-radius: 4px 15px 15px 15px; background: var(--surface-2); border: 1px solid var(--border); font-size: 15.5px; overflow-wrap: anywhere; min-width: 0; }
.bubble.accent { background: var(--accent-soft); border-color: transparent; color: var(--text); }

/* ---------------------------------------------------------------- episodes */

.ep-day {
  width: 52px; height: 52px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; line-height: 1;
}
.ep-day .d1 { font-size: 10px; font-weight: 750; color: var(--text-3); letter-spacing: .06em; }
.ep-day .d2 { font-size: 19px; font-weight: 800; margin-top: 3px; font-variant-numeric: tabular-nums; }
.ep-day.active { background: var(--accent-soft); border-color: transparent; }
.ep-day.active .d1, .ep-day.active .d2 { color: var(--accent-ink); }

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.step { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.step-bar { height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; position: relative; }
.step-bar > i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--cyan); border-radius: 3px; transition: width .5s var(--ease); }
.step.done .step-bar > i { width: 100%; background: var(--ok); }
.step.active .step-bar > i { width: 100%; }
.step.active.indet .step-bar > i {
  width: 100%;
  background: repeating-linear-gradient(-45deg, var(--cyan) 0 8px, color-mix(in srgb, var(--cyan) 55%, transparent) 8px 16px);
  background-size: 22.6px 100%; animation: stripes .8s linear infinite;
}
.step.waiting .step-bar > i { width: 100%; background: var(--warn); }
.step.failed .step-bar > i { width: 100%; background: var(--bad); }
.step-label { font-size: 13px; font-weight: 700; color: var(--text-3); display: flex; align-items: center; gap: 5px; }
.step.done .step-label { color: var(--text-2); }
.step.active .step-label { color: var(--cyan-ink); }
.step.waiting .step-label { color: var(--warn); }
.step.failed .step-label { color: var(--bad); }
.step-sub { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
@keyframes stripes { to { background-position: 22.6px 0; } }
.callout { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: 14px; margin-top: 14px; }
.callout.info { background: var(--info-soft); color: var(--info); }
.callout.ok { background: var(--ok-soft); color: var(--ok); }
.callout.bad { background: var(--bad-soft); color: var(--bad); }
.callout .text { flex: 1; min-width: 0; overflow-wrap: anywhere; }

.media { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .media { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.video-box { background: #000; border-radius: 14px; overflow: hidden; display: grid; place-items: center; aspect-ratio: 9 / 16; width: min(100%, calc(72vh * 9 / 16)); margin: 0 auto; }
.video-box video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.ph {
  border-radius: 14px; border: 1.5px dashed var(--border-strong); display: grid; place-items: center; text-align: center;
  color: var(--text-3); font-size: 13px; padding: 20px; background: var(--surface-2); min-height: 120px;
}
.ph.tall { aspect-ratio: 9 / 16; width: min(100%, calc(60vh * 9 / 16)); margin: 0 auto; }
.thumbs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-content: start; }
.thumb { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.thumb .lbl { font-size: 12.5px; font-weight: 650; color: var(--text-3); }
.thumb img { width: 100%; border-radius: 10px; border: 1px solid var(--border); display: block; background: var(--surface-2); }
.thumb a { display: block; }
.thumb.full { grid-column: 1 / -1; }

.pick { display: flex; flex-direction: column; gap: 10px; }
.order {
  padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); position: relative;
}
.order .q { font-size: 18px; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; color: var(--text); }
.order .by { font-size: 13px; color: var(--accent-ink); margin-top: 6px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-weight: 600; }
.cand { display: flex; align-items: center; gap: 10px; padding: 10px 0; min-width: 0; }
.cand + .cand { border-top: 1px solid var(--border); }
.cand .ct { flex: 1; min-width: 0; }
.cand .ct .tx { font-size: 14.5px; overflow-wrap: anywhere; }
.cand .ct .mt { font-size: 12.5px; color: var(--text-3); display: flex; gap: 8px; align-items: center; margin-top: 2px; flex-wrap: wrap; }
.cand.done .tx { color: var(--text-3); }

.scenes { width: 100%; border-collapse: collapse; font-size: 14px; }
.scenes th { text-align: left; font-size: 12px; color: var(--text-3); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.scenes td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.scenes tr:last-child td { border-bottom: 0; }
.scenes .n { color: var(--text-3); font-variant-numeric: tabular-nums; width: 28px; }
.scene-cards { display: none; flex-direction: column; gap: 10px; }
.scene-card { border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px; display: flex; flex-direction: column; gap: 5px; background: var(--surface-2); }
.scene-card .sc-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); }
.scene-card .cap { font-weight: 700; font-size: 15px; }
.scene-card .sub { color: var(--text-2); font-size: 13.5px; }
.scene-card .say { font-size: 13.5px; color: var(--accent-ink); }
@media (max-width: 719px) { .scenes { display: none; } .scene-cards { display: flex; } }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 8px; min-height: 42px; border: 1px solid var(--border-strong); border-radius: var(--radius-xs); background: var(--surface-2); cursor: text; }
.tag-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); background: var(--surface); }
.tag-input input { border: 0; outline: 0; background: transparent; font: inherit; color: var(--text); flex: 1 1 90px; min-width: 60px; padding: 4px 2px; }
.save-state { font-size: 12.5px; color: var(--text-3); display: inline-flex; align-items: center; gap: 6px; }
.save-state.dirty { color: var(--warn); }
.save-state.err { color: var(--bad); }
.action-bar { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- log viewer */

.log { background: var(--log-bg); color: var(--log-text); border-radius: 14px; overflow: hidden; border: 1px solid var(--log-border); position: relative; min-width: 0; }
.log-bar { display: flex; align-items: center; gap: 6px; padding: 7px 8px 7px 12px; border-bottom: 1px solid var(--log-border); font-size: 12.5px; color: #A8A197; flex-wrap: wrap; }
.log-bar .state { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; margin-right: auto; }
.log-bar .state .d { width: 7px; height: 7px; border-radius: 50%; background: #6A645B; }
.log-bar .state.live .d { background: var(--cyan); animation: pulse-cyan 1.6s infinite; }
.log-bar button {
  border: 0; background: transparent; color: #CFC8BD; font-size: 12.5px; font-weight: 600; padding: 5px 8px; border-radius: 7px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
}
.log-bar button:hover { background: rgba(255, 255, 255, .07); }
.log-bar button[aria-pressed="true"] { color: var(--cyan); }
.log-body {
  height: 440px; max-height: 64vh; overflow: auto; padding: 10px 12px 14px; font: 12.5px/1.6 var(--mono);
  white-space: pre-wrap; overflow-wrap: anywhere; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.log.short .log-body { height: 280px; }
.log.nowrap .log-body { white-space: pre; overflow-wrap: normal; }
.log-body .ln-ev { color: #7FE9E5; }
.log-body .ln-res { color: #96D9AC; font-weight: 600; }
.log-body .ln-err { color: #FF9E92; }
.log-body .ln-note { color: #8C857B; font-style: italic; }
.log-body .tail { opacity: .8; }
.log-empty { color: #8C857B; }
.log-follow {
  position: absolute; right: 12px; bottom: 12px; border: 0; border-radius: 999px; padding: 7px 12px; font-size: 12.5px; font-weight: 700;
  background: var(--accent-solid); color: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .4); cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  animation: fade-up .2s var(--ease);
}

/* ---------------------------------------------------------------- jobs */

.job-ic {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--sunken); color: var(--text-2);
}
.job-ic.running { background: var(--cyan-soft); color: var(--cyan-ink); }
.job-ic.failed { background: var(--bad-soft); color: var(--bad); }
.job-ic.success { background: var(--ok-soft); color: var(--ok); }
.summary-line { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-line.err { color: var(--bad); }
.summary-box { display: flex; flex-wrap: wrap; gap: 8px; }
.summary-box .stat { flex: 1 1 54px; padding: 8px 10px; }
.summary-box .stat .v { font-size: 18px; }
.pre {
  font: 12.5px/1.55 var(--mono); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; margin: 0; color: var(--text-2);
}

/* ---------------------------------------------------------------- 修复 / diff */

.fix-state { margin-bottom: 14px; }
.fix-state > .callout { margin-top: 0; }
.fix-diag { margin: 0; font-size: 15.5px; line-height: 1.6; font-weight: 600; overflow-wrap: anywhere; }
.err-text { color: var(--bad); overflow-wrap: anywhere; }
code.sig { font: 12.5px/1.5 var(--mono); background: var(--surface-2); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.file-list { margin: 6px 0 10px; padding-left: 20px; font-size: 13.5px; }
.file-list code { font: 12.5px/1.5 var(--mono); overflow-wrap: anywhere; }
.diff { background: var(--log-bg); border: 1px solid var(--log-border); border-radius: 14px; overflow: hidden; min-width: 0; max-width: 100%; }
.diff-body { font: 12.5px/1.6 var(--mono); color: var(--log-text); overflow: auto; max-height: 70vh; padding: 8px 0; }
.diff-body:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.d-line { display: block; white-space: pre; padding: 0 14px; min-width: max-content; }
.d-ctx { color: #CFC9C0; }
.d-add { background: rgba(80, 200, 120, .15); color: #A8E6BC; }
.d-del { background: rgba(240, 90, 80, .15); color: #FFB3AA; }
.d-hunk { background: rgba(90, 145, 235, .12); color: #9DBEF5; }
.d-file { color: #E9A68A; font-weight: 650; }
.d-note { color: #8C857B; font-style: italic; }

/* ---------------------------------------------------------------- kb */

.kb-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.kb-tools .status { font-size: 12.5px; color: var(--text-3); display: inline-flex; align-items: center; gap: 6px; margin-right: auto; }
.kb-tools .status.dirty { color: var(--warn); font-weight: 600; }
.kb-editor {
  width: 100%; min-height: 420px; height: calc(100dvh - 300px); resize: vertical; font: 14px/1.7 var(--mono); padding: 16px 18px;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); tab-size: 2;
}
.kb-editor:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
@media (max-width: 899px) { .kb-editor { font-size: 14px; padding: 12px 13px; height: calc(100dvh - 330px); } }
.kb-preview { min-height: 420px; }
.kb-banner { margin-bottom: 12px; }
.bk-item { display: flex; align-items: center; gap: 10px; padding: 11px 0; }
.bk-item + .bk-item { border-top: 1px solid var(--border); }
.bk-item .nm { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.bk-item .mt { color: var(--text-3); font-size: 12.5px; }

.md { font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; color: var(--text); }
.md h1, .md h2, .md h3, .md h4 { line-height: 1.35; margin: 1.3em 0 .5em; font-weight: 750; }
.md h1 { font-size: 22px; } .md h2 { font-size: 18px; padding-bottom: 6px; border-bottom: 1px solid var(--border); } .md h3 { font-size: 16px; } .md h4 { font-size: 15px; }
.md > :first-child { margin-top: 0; }
.md p, .md ul, .md ol, .md blockquote, .md pre { margin: 0 0 .8em; }
.md ul, .md ol { padding-left: 1.4em; }
.md li + li { margin-top: .25em; }
.md li > ul, .md li > ol { margin: .3em 0 0; }
.md code { font-family: var(--mono); font-size: .88em; background: var(--sunken); padding: .1em .4em; border-radius: 5px; }
.md pre { background: var(--sunken); border-radius: 10px; padding: 12px 14px; overflow: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { border-left: 3px solid var(--accent); padding: 2px 0 2px 12px; color: var(--text-2); }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 1.4em 0; }
.md strong { font-weight: 700; }
.md del { color: var(--text-3); }

/* ---------------------------------------------------------------- users */

.utl { display: flex; flex-direction: column; gap: 10px; }
.utl .day { align-self: center; font-size: 12px; color: var(--text-3); font-weight: 650; padding: 3px 10px; border-radius: 999px; background: var(--sunken); margin: 8px 0 2px; }
.msg { display: flex; flex-direction: column; gap: 3px; max-width: min(86%, 560px); }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg .b { padding: 9px 13px; border-radius: 15px 15px 15px 5px; background: var(--surface-2); border: 1px solid var(--border); font-size: 14.5px; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.me .b { border-radius: 15px 15px 5px 15px; background: var(--accent-soft); border-color: transparent; }
.msg .m { font-size: 11.5px; color: var(--text-3); padding: 0 4px; overflow-wrap: anywhere; }
.note-row { display: flex; gap: 8px; align-items: center; }
.note-row + .note-row { margin-top: 8px; }
.note-row .input { flex: 1; }

/* ---------------------------------------------------------------- qr */

.qr-box { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.qr-frame {
  width: 236px; height: 236px; max-width: 100%; border-radius: 18px; background: #fff; border: 1px solid var(--border);
  display: grid; place-items: center; overflow: hidden; position: relative; padding: 10px;
}
.qr-frame img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.qr-frame .over { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .92); color: #2B7A4B; font-weight: 700; }
.qr-state { font-weight: 650; color: var(--text); font-size: 15px; display: flex; align-items: center; gap: 8px; }
.qr-tip { font-size: 12.5px; color: var(--text-3); max-width: 320px; }

/* ---------------------------------------------------------------- misc */

.kbd { font-family: var(--mono); font-size: 11.5px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-strong); color: var(--text-3); background: var(--surface-2); }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.secret-state { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.steps-list { margin: 0; padding-left: 1.2em; color: var(--text-2); font-size: 14px; }
.steps-list li + li { margin-top: 6px; }
.fade-in { animation: fade-up .25s var(--ease); }
.collapse-out { overflow: hidden; transition: max-height .28s var(--ease), opacity .2s, margin .28s, padding .28s; }

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

/* ================================================================ DY 托管：平台外壳 */

.sidebar { scrollbar-width: thin; }
@media (min-width: 900px) {
  .sidebar { overflow-y: auto; padding: 18px 12px 14px; gap: 2px; }
  .sidebar .brand { padding: 2px 8px 14px; }
}
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-sep { height: 1px; background: var(--border); margin: 10px 8px; }
.nav-item .ic { color: var(--text-3); transition: color .15s; }
.nav-item[aria-current="page"] .ic { color: var(--accent-ink); }
.nav-item:hover .ic { color: var(--text-2); }

.acct-switch {
  display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; text-align: left;
  padding: 9px 10px; margin: 0 0 10px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; transition: border-color .15s, background .15s; color: var(--text); box-shadow: var(--shadow-sm);
}
.acct-switch:hover { border-color: var(--border-strong); }
.acct-switch.compact { width: auto; max-width: 100%; margin: 0; padding: 4px 8px 4px 4px; border-radius: 999px; gap: 8px; box-shadow: none; background: var(--surface); }
.acct-av { position: relative; flex: none; display: grid; place-items: center; }
.acct-av-empty { width: 36px; height: 36px; padding: 0; border-radius: 50%; background: var(--sunken); color: var(--text-3); }
.acct-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--surface); background: currentColor; }
.acct-dot.t-ok { color: #2BC46C; } .acct-dot.t-bad { color: #F04A3C; } .acct-dot.t-warn { color: #E8A72A; } .acct-dot.t-progress { color: var(--cyan); } .acct-dot.t-muted { color: var(--text-3); }
.acct-dot[class*="t-"] { background: currentColor; box-shadow: none; }
.acct-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.acct-name { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-sub { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-chev { color: var(--text-3); flex: none; }
.acct-switch.compact .acct-name { font-size: 15px; max-width: 46vw; }

.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 6px; border-radius: 12px; color: var(--text); min-width: 0; }
.user-chip:hover { background: var(--sunken); text-decoration: none; }
.uc-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.uc-name { font-weight: 650; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-sub { font-size: 12px; color: var(--text-3); }
.sidebar-tools { justify-content: space-between; }

.top-left { min-width: 0; display: flex; align-items: center; flex: 0 1 auto; }
.top-bell { position: relative; flex: none; }
.top-bell .count { position: absolute; top: 3px; right: 1px; box-shadow: 0 0 0 2px var(--bg); }
.tabbar .tab[aria-current="page"] .ic { color: var(--accent); }
.tab[aria-current="page"] { color: var(--text); }

.more-group { margin-bottom: 14px; }
.more-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--text-3); margin: 0 2px 8px; }
.more-head .link-btn { margin-left: auto; font-size: 13px; }
.more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.more-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px 6px;
  border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 13px; font-weight: 650; text-align: center;
}
.more-tile:hover { text-decoration: none; border-color: var(--border-strong); color: var(--text); }
.more-tile .ic { width: 22px; height: 22px; }
.more-tile[aria-current="page"] { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.more-tile .badge-slot { position: absolute; top: 6px; right: 8px; }

.acct-list { display: flex; flex-direction: column; gap: 6px; }
.acct-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; color: var(--text); border: 1px solid transparent; }
.acct-row:hover { background: var(--surface-2); text-decoration: none; }
.acct-row.on { background: var(--accent-soft); }
.acct-row .ic { color: var(--text-3); }
.count-pill { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--accent-solid); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 通用小件 */

.empty-art {
  display: grid; place-items: center; border-radius: 22px; margin-bottom: 6px;
  background: linear-gradient(135deg, var(--accent-soft), var(--cyan-soft)); color: var(--accent-ink);
}
.empty-art .ic { width: 42%; height: 42%; }
.empty-art.bad { background: var(--bad-soft); color: var(--bad); }

.meter { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.meter-top { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.meter-k { color: var(--text-2); font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter-v { color: var(--text); font-weight: 650; white-space: nowrap; }
.meter-bar { height: 7px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.meter-bar > i { display: block; height: 100%; border-radius: 4px; background: var(--ok); transition: width .5s var(--ease); }
.meter-bar.warn > i { background: #E8A72A; }
.meter-bar.bad > i { background: var(--accent); }
.meters { display: grid; gap: 14px 22px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .meters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.tag-wrap { width: 100%; min-width: 0; }
.tag-chips { display: contents; }
.tag-input .chip { background: var(--surface); border: 1px solid var(--border); }
.tag-input input:disabled { opacity: .7; }

.subnav { margin: -4px 0 16px; min-width: 0; }
.subnav .seg { display: flex; width: 100%; }
.seg-link {
  flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 34px; padding: 0 14px;
  border-radius: 8px; font-size: 14px; font-weight: 650; color: var(--text-2); white-space: nowrap; transition: background .18s, color .18s;
}
.seg-link:hover { color: var(--text); text-decoration: none; }
.seg-link[aria-current="page"] { background: var(--seg-on); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 0 0 .5px var(--border); }
.seg-link .n { font-size: 11.5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent-solid); color: #fff; display: grid; place-items: center; }

.thin-progress { height: 4px; border-radius: 2px; background: var(--sunken); overflow: hidden; margin-top: 6px; max-width: 320px; }
.thin-progress > i { display: block; height: 100%; background: var(--cyan); border-radius: 2px; transition: width .4s var(--ease); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; min-width: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--text-3); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--border); }
.table tbody tr:hover td { background: var(--surface-2); }

.kpis { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi {
  display: flex; flex-direction: column; gap: 4px; padding: 13px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
  color: inherit; min-width: 0; box-shadow: var(--shadow-sm);
}
a.kpi:hover { text-decoration: none; border-color: var(--border-strong); }
.kpi .k { font-size: 12.5px; color: var(--text-3); font-weight: 650; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k .ic { width: 15px; height: 15px; }
.kpi .v { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; letter-spacing: -.01em; }
.kpi .d { font-size: 12px; color: var(--text-3); }
.kpi .d.up { color: var(--ok); } .kpi .d.down { color: var(--bad); }
.kpi.hot { background: var(--accent-soft); border-color: transparent; }
.kpi.hot .v, .kpi.hot .k { color: var(--accent-ink); }

/* ---------------------------------------------------------------- 图表（内联 SVG） */

.chart { position: relative; width: 100%; min-width: 0; touch-action: pan-y; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis text { fill: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .bar { fill: var(--accent); }
.chart .bar.dim { fill: var(--border-strong); }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .cross { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart-tip {
  position: absolute; top: 0; pointer-events: none; transform: translate(-50%, -100%); margin-top: -8px;
  background: var(--inverse); color: var(--inverse-text); padding: 6px 9px; border-radius: 9px; font-size: 12.5px; white-space: nowrap;
  box-shadow: var(--shadow-lg); font-variant-numeric: tabular-nums; z-index: 2;
}
.chart-tip b { font-size: 14px; }
.chart-empty { height: 160px; display: grid; place-items: center; color: var(--text-3); font-size: 13px; border: 1.5px dashed var(--border-strong); border-radius: 12px; }

/* ---------------------------------------------------------------- 登录 / 注册 */

.page.bare { animation: none; }
.auth {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 28px 16px calc(28px + env(safe-area-inset-bottom));
  background: radial-gradient(700px 420px at 10% -5%, var(--hero-from), transparent 70%), radial-gradient(700px 420px at 100% 105%, var(--hero-to), transparent 70%), var(--bg);
}
.auth-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 18px; animation: page-in .4s var(--ease); }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.auth-logo .mark { box-shadow: 0 10px 30px rgba(254, 44, 85, .25), 0 0 0 1px rgba(255, 255, 255, .06); border-radius: 18px; }
.auth-logo h1 { font-size: 26px; font-weight: 850; letter-spacing: .02em; }
.auth-logo h1 b { color: var(--accent-ink); }
.auth-logo .sub { color: var(--text-3); font-size: 14px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card .err { color: var(--bad); font-size: 13.5px; font-weight: 550; min-height: 1em; }
.auth-card .err:empty { display: none; }
.auth-card .foot { color: var(--text-3); font-size: 13px; text-align: center; line-height: 1.6; }
.auth-card .card { padding: 20px; }
.pw-meter { display: flex; gap: 4px; margin-top: 2px; }
.pw-meter i { flex: 1; height: 4px; border-radius: 2px; background: var(--sunken); }
.pw-meter[data-score="1"] i:nth-child(-n+1) { background: var(--bad); }
.pw-meter[data-score="2"] i:nth-child(-n+2) { background: #E8A72A; }
.pw-meter[data-score="3"] i:nth-child(-n+3) { background: var(--ok); }
.pw-meter[data-score="4"] i { background: var(--ok); }
.auth-points { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--text-2); }
.auth-points li { display: flex; gap: 8px; align-items: flex-start; }
.auth-points .ic { color: var(--accent-ink); width: 16px; height: 16px; margin-top: 2px; }

/* ---------------------------------------------------------------- 账号 */

.acct-cards { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .acct-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1240px) { .acct-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.acct-card { display: flex; flex-direction: column; gap: 14px; position: relative; transition: border-color .15s, transform .15s, box-shadow .15s; }
.acct-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.acct-card .top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.acct-card .nm { font-weight: 750; font-size: 16.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-card .nm-sub { font-size: 12.5px; color: var(--text-3); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.acct-card .main-link { color: inherit; flex: 1; min-width: 0; }
.acct-card .main-link:hover { text-decoration: none; }
.acct-card .main-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.acct-card .chips-row { display: flex; gap: 6px; flex-wrap: wrap; }
.acct-card .card-foot { margin-top: 0; position: relative; z-index: 1; }
.acct-card .mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.acct-card .mini-stats .stat .v { font-size: 18px; }
.acct-card.add {
  border-style: dashed; border-width: 1.5px; background: transparent; box-shadow: none; align-items: center; justify-content: center; text-align: center;
  min-height: 190px; color: var(--text-2);
}
.acct-card.add .plus { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }

.profile { display: flex; align-items: center; gap: 14px; min-width: 0; flex-wrap: wrap; }
.profile .who-text { flex: 1 1 200px; min-width: 0; }
.profile h1 { font-size: 24px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.profile .meta-line { margin-top: 6px; }
.profile .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.avatar.ring { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent-soft); }

.consent { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: c; }
.consent li { display: flex; gap: 12px; align-items: flex-start; counter-increment: c; }
.consent li::before {
  content: counter(c); flex: none; width: 26px; height: 26px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 800; font-size: 13px;
}
.consent .ct { font-weight: 700; font-size: 14.5px; }
.consent .cd { color: var(--text-2); font-size: 13.5px; margin-top: 2px; }
.agree { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; font-size: 14px; font-weight: 600; }
.agree input { margin-top: 2px; }
.bind-steps { display: flex; gap: 8px; align-items: center; color: var(--text-3); font-size: 13px; font-weight: 650; flex-wrap: wrap; }
.bind-steps .s { display: inline-flex; align-items: center; gap: 6px; }
.bind-steps .s i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; background: var(--sunken); color: var(--text-3); }
.bind-steps .s.on { color: var(--text); }
.bind-steps .s.on i { background: var(--accent-solid); color: #fff; }
.bind-steps .line { width: 24px; height: 2px; background: var(--border); border-radius: 1px; }

.video-row .thumb-ph { width: 44px; height: 58px; border-radius: 8px; flex: none; background: linear-gradient(160deg, var(--accent-soft), var(--cyan-soft)); display: grid; place-items: center; color: var(--accent-ink); }
.video-row .nums { display: flex; gap: 10px; color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.video-row .nums span { display: inline-flex; align-items: center; gap: 3px; }
.video-row .nums .ic { width: 13px; height: 13px; }
.next-line { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-size: 14px; min-width: 0; }
.next-line + .next-line { border-top: 1px solid var(--border); }
.next-line .ic { color: var(--text-3); }
.next-line .k { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-line .v { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13.5px; }

/* ---------------------------------------------------------------- 评论：规则 */

.rule-list { display: flex; flex-direction: column; gap: 10px; }
.rule-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px 12px 12px 6px; transition: opacity .2s, box-shadow .2s, transform .15s; }
.rule-card.off { opacity: .62; }
.rule-card.dragging { opacity: .9; box-shadow: var(--shadow-lg); transform: scale(1.01); z-index: 3; position: relative; }
.rule-card.drop-before { box-shadow: 0 -3px 0 0 var(--accent); }
.rule-card.drop-after { box-shadow: 0 3px 0 0 var(--accent); }
.rule-handle { flex: none; width: 28px; height: 40px; display: grid; place-items: center; color: var(--text-3); cursor: grab; touch-action: none; border-radius: 8px; border: 0; background: none; padding: 0; }
.rule-handle:hover { background: var(--sunken); color: var(--text-2); }
.rule-handle:active { cursor: grabbing; }
.rule-pos { font-size: 12px; font-weight: 800; color: var(--text-3); font-variant-numeric: tabular-nums; }
.rule-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rule-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; font-size: 15px; }
.rule-title .nm { overflow-wrap: anywhere; }
.rule-match { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--text-2); align-items: center; }
.rule-match .lbl { color: var(--text-3); font-weight: 650; }
.rule-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--text-3); font-size: 12.5px; }
.rule-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.rule-side .btn-row { gap: 2px; }
.rule-default { border-style: dashed; background: var(--surface-2); }
.fixed-list { display: flex; flex-direction: column; gap: 8px; }
.fixed-list .note-row .input { flex: 1; }
.match-grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .match-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.action-pick { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.action-pick button {
  text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer;
  display: flex; flex-direction: column; gap: 3px; font-size: 14px; font-weight: 700; color: var(--text); min-width: 0;
}
.action-pick button small { font-size: 12px; font-weight: 500; color: var(--text-3); line-height: 1.4; }
.action-pick button[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }

/* ---------------------------------------------------------------- 评论：人设向导 */

.wizard { display: flex; flex-direction: column; gap: 14px; }
.wsteps { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.wsteps::-webkit-scrollbar { display: none; }
.wstep {
  flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); font-size: 13px; font-weight: 650; color: var(--text-2); cursor: pointer;
}
.wstep i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; background: var(--sunken); color: var(--text-3); }
.wstep[aria-current="step"] { border-color: var(--accent); color: var(--text); }
.wstep[aria-current="step"] i { background: var(--accent-solid); color: #fff; }
.wstep.done i { background: var(--ok-soft); color: var(--ok); }
.faq-row { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr) auto; align-items: start; padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.faq-row .qa { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kb-preview-box { max-height: 60vh; overflow: auto; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.list-edit { display: flex; flex-direction: column; gap: 8px; }

/* ---------------------------------------------------------------- 管理后台 */

.admin-tiles { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .admin-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
a.card.admin-tile, .admin-tile { display: flex; flex-direction: column; gap: 8px; color: inherit; }
.admin-tile:hover { text-decoration: none; border-color: var(--border-strong); }
.admin-tile .ti { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.admin-tile .tt { font-weight: 750; font-size: 15px; }
.admin-tile .td { color: var(--text-3); font-size: 12.5px; }
.code-box { font: 15px/1.4 var(--mono); letter-spacing: .08em; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--border-strong); text-align: center; overflow-wrap: anywhere; color: var(--text); user-select: all; }
.price-grid { display: grid; gap: 8px; grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr)) auto; align-items: center; font-size: 13px; }
.price-grid .hd { font-size: 12px; color: var(--text-3); font-weight: 700; }
.price-grid .input { min-height: 36px; padding: 6px 8px; font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; }
.price-grid .mdl { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .price-grid .hd { display: none; }
  .price-grid .mdl { grid-column: 1 / -1; margin-top: 8px; font-weight: 700; }
  .price-grid .cell { display: flex; flex-direction: column; gap: 3px; }
  .price-grid .cell::before { content: attr(data-k); font-size: 11.5px; color: var(--text-3); font-weight: 650; }
  .price-grid .del { grid-column: 1 / -1; justify-self: end; }
}
.check-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; min-width: 0; }
.check-row + .check-row { border-top: 1px solid var(--border); }
.check-row .nm { font-weight: 650; font-family: var(--mono); font-size: 13.5px; flex: none; min-width: 110px; }
.check-row .dt { color: var(--text-3); font-size: 13px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sem-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.sem-row .nm { width: 64px; font-family: var(--mono); color: var(--text-2); }
.sem-row .meter-bar { flex: 1; }
.sem-row .v { width: 44px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.audio-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-width: 0; }
.audio-row + .audio-row { border-top: 1px solid var(--border); }
.audio-row audio { height: 34px; max-width: 240px; flex: 0 1 240px; min-width: 0; }
@media (max-width: 600px) { .audio-row { flex-wrap: wrap; } .audio-row audio { flex: 1 1 100%; max-width: none; } }
.once-secret { display: flex; gap: 8px; align-items: center; }
.once-secret .code-box { flex: 1; text-align: left; }

/* ---------------------------------------------------------------- 通知 */

.notif { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; position: relative; color: inherit; }
.notif + .notif { border-top: 1px solid var(--border); }
.notif.unread { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.notif .n-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.notif .n-main { flex: 1; min-width: 0; }
.notif .n-title { font-weight: 700; font-size: 14.5px; display: flex; gap: 8px; align-items: center; }
.notif .n-body { color: var(--text-2); font-size: 13.5px; margin-top: 2px; overflow-wrap: anywhere; }
.notif .n-meta { color: var(--text-3); font-size: 12px; margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.notif .unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
a.notif:hover { background: var(--surface-2); text-decoration: none; }

/* ---------------------------------------------------------------- 管理后台：用户、邀请码、审计、BGM */

.grow { flex: 1 1 auto; min-width: 0; }
@media (min-width: 1000px) { .grid-2-wide { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); } }
.panel-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-ink); }
.panel-ic .ic { width: 18px; height: 18px; }
.paused-card { border-color: color-mix(in srgb, var(--bad) 45%, var(--border)); background: color-mix(in srgb, var(--bad-soft) 55%, var(--surface)); }

.user-row, .inv-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; min-width: 0; }
.user-row + .user-row, .inv-row + .inv-row { border-top: 1px solid var(--border); }
.user-row.off, .inv-row.off { opacity: .62; }
.u-main, .inv-main { flex: 1; min-width: 0; }
.u-name { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.u-name b { font-size: 15px; overflow-wrap: anywhere; }
.u-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 5px; color: var(--text-3); font-size: 12.5px; min-width: 0; }
.u-act, .inv-act { display: flex; align-items: center; gap: 10px; flex: none; }
.inv-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inv-code { font: 600 14px/1.3 var(--mono); letter-spacing: .06em; color: var(--text); overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .user-row, .inv-row { flex-wrap: wrap; }
  .user-row > .avatar { align-self: flex-start; }
  .u-act, .inv-act { width: 100%; justify-content: flex-end; }
  .inv-act { justify-content: space-between; }
}
details.inv-quota > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; font-weight: 650; font-size: 14px; color: var(--text-2); }
details.inv-quota > summary::-webkit-details-marker { display: none; }
details.inv-quota > summary .ic-chev { transition: transform .2s var(--ease); color: var(--text-3); }
details.inv-quota[open] > summary .ic-chev { transform: rotate(90deg); }

.check-list { display: flex; flex-wrap: wrap; gap: 8px; }
.check-item { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); font-size: 14px; font-weight: 600; cursor: pointer; min-height: 40px; }
.check-item:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); background: var(--accent-soft); }

.audit-row { display: flex; gap: 14px; padding: 12px 16px; min-width: 0; }
.audit-row + .audit-row { border-top: 1px solid var(--border); }
.a-when { display: flex; flex-direction: column; gap: 2px; width: 92px; flex: none; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--text-2); }
.a-main { flex: 1; min-width: 0; }
.a-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.a-act { font-weight: 700; }
.a-act.bad { color: var(--bad); } .a-act.warn { color: var(--warn); } .a-act.ok { color: var(--ok); }
.a-target { font-size: 12px; padding: 1px 6px; border-radius: 6px; background: var(--sunken); color: var(--text-2); }
.a-detail { margin-top: 4px; font: 12px/1.5 var(--mono); color: var(--text-2); overflow-wrap: anywhere; }
.a-ip { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 12px; }
.a-ip .ic { width: 13px; height: 13px; }
.a-code { margin-left: 6px; font-family: var(--mono); opacity: .8; }
@media (max-width: 560px) {
  .audit-row { flex-direction: column; gap: 4px; }
  .a-when { width: auto; flex-direction: row; gap: 8px; }
}

.ck { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.ck.ok { background: var(--ok-soft); color: var(--ok); }
.ck.bad { background: var(--bad-soft); color: var(--bad); }
@media (max-width: 560px) { .check-row { flex-wrap: wrap; } .check-row .dt { flex-basis: 100%; padding-left: 34px; } }

.bgm-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--cyan-soft); color: var(--cyan-ink); }
.file-pick { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--border-strong); background: var(--surface-2); cursor: pointer; min-width: 0; }
.file-pick:hover { border-color: var(--accent); }
input[type="file"].sr-only:focus-visible + .file-pick { outline: 2px solid var(--accent); outline-offset: 2px; }
.file-pick .file-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.file-pick > .ic { color: var(--text-3); }
.chart-host { min-width: 0; }
@media (max-width: 560px) {
  .item .job-t2 { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }
  .item .job-t2 > span { flex: none; }
  .item .job-t2 > span:last-child { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}
.table .lbl { min-width: 96px; max-width: 240px; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .audio-row audio { order: 3; }
  .table th, .table td { padding: 10px 8px; }
  .table th:first-child, .table td:first-child { padding-left: 14px; }
  .table th:last-child, .table td:last-child { padding-right: 14px; }
}
