:root {
  /* ── Surfaces (light) ─────────────────────────────────────────────── */
  --bg: #f5f5f7;            /* app canvas — Apple neutral */
  --bg-grad-1: #f5f5f7;
  --bg-grad-2: #f5f5f7;
  --panel: #ffffff;         /* cards */
  --panel-soft: #f5f5f7;    /* inset / chips */
  --sidebar-bg: rgba(251, 251, 253, 0.82);   /* frosted material */
  --topbar-bg: rgba(255, 255, 255, 0.72);    /* frosted material */

  /* ── Text ─────────────────────────────────────────────────────────── */
  --fg: #1d1d1f;
  --muted: #6e6e73;
  --faint: #86868b;

  /* ── Lines & depth ────────────────────────────────────────────────── */
  --line: rgba(0, 0, 0, 0.09);       /* hairline */
  --line-soft: rgba(0, 0, 0, 0.05);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 980px;
  --shadow: 0 1px 1px rgba(0, 0, 0, 0.03), 0 8px 24px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.04), 0 20px 48px rgba(0, 0, 0, 0.10);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-jelly: cubic-bezier(0.34, 1.45, 0.64, 1);  /* subtle overshoot — momentum only */

  /* ── Brand blue ───────────────────────────────────────────────────── */
  --accent: #1a66cc;
  --accent-strong: #114a99;
  --accent-glow: #3b8bff;
  --accent-soft: #e8f0fc;
  --accent-soft-2: #d7e6fb;
  --accent-fg: #ffffff;
  --blue: #1a66cc;
  --ink: #0a1f3d;
  --ink-2: #0e2c55;

  /* ── Semantic ─────────────────────────────────────────────────────── */
  --warn: #9a5a13;
  --error: #b42318;
  --ok: #147a4b;

  --sidebar-w: 244px;
  --topbar-h: 58px;

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

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #090d16;
    --bg-grad-1: #090d16;
    --bg-grad-2: #090d16;
    --panel: #111827;
    --panel-soft: #1f293d;
    --sidebar-bg: rgba(17, 24, 39, 0.85);
    --topbar-bg: rgba(17, 24, 39, 0.82);

    --fg: #f3f4f6;
    --muted: #9ca3af;
    --faint: #6b7280;

    --line: rgba(255, 255, 255, 0.10);
    --line-soft: rgba(255, 255, 255, 0.06);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 20px 48px rgba(0, 0, 0, 0.5);

    --accent: #3b82f6;
    --accent-strong: #60a5fa;
    --accent-glow: #38bdf8;
    --accent-soft: rgba(59, 130, 246, 0.15);
    --accent-soft-2: rgba(59, 130, 246, 0.25);
    --accent-fg: #ffffff;

    --ink: #030712;
    --ink-2: #0b1329;

    --warn: #f59e0b;
    --error: #ef4444;
    --ok: #10b981;
  }
}

html[data-theme="dark"] {
  --bg: #090d16;
  --bg-grad-1: #090d16;
  --bg-grad-2: #090d16;
  --panel: #111827;
  --panel-soft: #1f293d;
  --sidebar-bg: rgba(17, 24, 39, 0.85);
  --topbar-bg: rgba(17, 24, 39, 0.82);

  --fg: #f3f4f6;
  --muted: #9ca3af;
  --faint: #6b7280;

  --line: rgba(255, 255, 255, 0.10);
  --line-soft: rgba(255, 255, 255, 0.06);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 20px 48px rgba(0, 0, 0, 0.5);

  --accent: #3b82f6;
  --accent-strong: #60a5fa;
  --accent-glow: #38bdf8;
  --accent-soft: rgba(59, 130, 246, 0.15);
  --accent-soft-2: rgba(59, 130, 246, 0.25);
  --accent-fg: #ffffff;

  --ink: #030712;
  --ink-2: #0b1329;

  --warn: #f59e0b;
  --error: #ef4444;
  --ok: #10b981;
}

* { box-sizing: border-box; }

/* Web Interface Guidelines: Tabular Numbers on numeric metrics */
.stat strong, .chip .v, .table td, .tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Web Interface Guidelines: Visible focus states */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Headings title text-pretty */
h1, h2, h3 {
  text-wrap: balance;
}

/* Heroicons base — explicit box even without a sized parent (giant-SVG guard) */
svg.hi { flex: none; display: inline-block; vertical-align: -0.18em; max-width: 24px; max-height: 24px; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.55 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ── Top bar (full width) ─────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--topbar-h);
  padding: 0 20px 0 18px;
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: background 240ms var(--ease-out),
              border-color 240ms var(--ease-out),
              box-shadow 240ms var(--ease-out),
              -webkit-backdrop-filter 240ms var(--ease-out),
              backdrop-filter 240ms var(--ease-out);
}
.topbar.scrolled {
  background: var(--topbar-bg);
  -webkit-backdrop-filter: blur(22px) saturate(190%);
  backdrop-filter: blur(22px) saturate(190%);
  border-bottom-color: var(--line-soft);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.05);
}
.topbar-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.topbar-brand:hover { text-decoration: none; }
.topbar-logo { display: block; height: 30px; width: auto; }
.topbar-spacer { flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.topbar-chip .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(20, 122, 75, 0.16);
}
.topbar-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-glow) 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* ── Layout: top bar + fixed sidebar + fluid content ──────────────────── */
.layout { min-height: 100vh; }

.sidebar {
  position: fixed;
  top: var(--topbar-h);
  bottom: 0;
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  padding: 16px 14px 14px;
  background: var(--sidebar-bg);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border-right: 1px solid var(--line-soft);
}

.content {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-width: 0;
}

/* Workspace switcher */
.workspace {
  position: relative;
  margin: 2px 2px 12px;
}
.workspace::after {
  content: "▾";
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  font-size: 11px;
  pointer-events: none;
}
.workspace-select {
  width: 100%;
  height: 42px;
  min-height: 42px;
  padding: 0 30px 0 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font: 700 13px/1 var(--font-ui);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.workspace-select:hover { border-color: var(--accent-soft-2); }
.workspace-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26, 102, 204, 0.14);
  outline: none;
}

/* Primary CTA in the sidebar */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  margin: 0 0 8px;
  padding: 0 14px;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius-pill);
  color: #fff;
  font: 600 14px/1 var(--font-ui);
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: filter 160ms var(--ease-out), transform 340ms var(--ease-jelly);
}
.cta:hover { color: #fff; text-decoration: none; filter: brightness(1.08); }
.cta:active { transform: scale(0.96); transition: transform 90ms var(--ease-out); }
.cta .cta-ico { display: inline-flex; align-items: center; }

.side-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  margin-top: 6px;
  padding: 0 2px;
}

.nav-group {
  margin: 16px 10px 6px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nav-group:first-child { margin-top: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.14s ease, color 0.14s ease;
}
.nav-item:hover {
  background: var(--panel-soft);
  color: var(--fg);
  text-decoration: none;
}
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav-item.active .nav-ico { color: var(--accent); opacity: 1; }
.nav-item.paused { opacity: 0.5; }

.nav-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  color: var(--faint);
  opacity: 0.9;
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 10px;
  margin-top: 8px;
  border-top: 1px solid var(--line-soft);
}
.sidebar-ver {
  margin: 8px 10px 2px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
}

.container { max-width: 1240px; margin: 26px auto 64px; padding: 0 28px; }

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 8px;
  font-size: clamp(23px, 2.6vw, 30px);
  line-height: 1.12;
  letter-spacing: -0.022em;
  font-weight: 700;
}
h2 { margin-bottom: 6px; font-size: 17px; line-height: 1.25; letter-spacing: -0.014em; font-weight: 650; }
h3 { margin-bottom: 12px; font-size: 15px; letter-spacing: -0.01em; font-weight: 650; }
small, .hint { color: var(--muted); font-size: 12px; }
.hint { margin-bottom: 0; }
.lede { max-width: 720px; color: var(--muted); font-size: 14.5px; }
.eyebrow {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

code {
  background: var(--panel-soft);
  color: #1c3a63;
  padding: 2px 6px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 12px;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 14px;
  background: var(--ink);
  color: #e8f0fb;
  border-radius: var(--radius);
  font-size: 12px;
}
pre.md { white-space: pre-wrap; }

/* ── Welcome hero ─────────────────────────────────────────────────────── */
.welcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin: 2px 0 18px;
}
.welcome h1 { margin-bottom: 4px; }
.welcome .wave { display: inline-block; transform: translateY(1px); }
.welcome .lede { margin: 0; }

.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 104px;
  padding: 11px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.chip .k {
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.chip .v { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: var(--fg); }
.chip .v.accent { color: var(--accent); }

/* ── Section header (title + 查看全部) ───────────────────────────────── */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 12px;
}
.section-head h2 { margin: 0; }
.section-head .more { font-size: 13px; font-weight: 700; }

/* ── Quick-start cards ────────────────────────────────────────────────── */
.quickstart {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 26px;
}
.qs-card {
  position: relative;
  display: block;
  padding: 18px 16px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--fg);
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.qs-card { transition: transform 340ms var(--ease-jelly), box-shadow 200ms var(--ease-out), border-color 200ms var(--ease-out); }
.qs-card:active { transform: scale(0.98); transition: transform 90ms var(--ease-out); }
.qs-ico {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  margin-bottom: 12px;
  border-radius: 11px;
  font-size: 18px;
  color: #fff;
}
.qs-ico.c1 { background: linear-gradient(135deg, #1a66cc, #3b8bff); }
.qs-ico.c2 { background: linear-gradient(135deg, #0e9f6e, #34d399); }
.qs-ico.c3 { background: linear-gradient(135deg, #7c4dff, #a385ff); }
.qs-ico.c4 { background: linear-gradient(135deg, #e8643c, #f59e0b); }
.qs-card h3 { margin: 0 0 6px; font-size: 14.5px; }
.qs-card p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.qs-card .qs-arrow {
  position: absolute; right: 14px; top: 16px;
  color: var(--faint); font-size: 14px;
  opacity: 0; transform: translateX(-4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

/* ── Stat grid (legacy, used on home + site pages) ───────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
}
.stat-grid.compact { min-width: 560px; }
.stat {
  min-height: 94px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stat-label {
  display: block;
  margin-bottom: 4px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.stat strong {
  display: block;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.stat small { display: block; margin-top: 4px; }

/* ── Panels ───────────────────────────────────────────────────────────── */
.panel,
.primary-panel,
.secondary-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel { padding: 22px; margin: 16px 0; }
.primary-panel { padding: 22px; }
.secondary-panel { padding: 20px; }

#jobs-table-wrap { max-width: 100%; overflow-x: auto; }
#jobs-table-wrap .data-table { min-width: 760px; }

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.panel-head h2 { margin-bottom: 4px; }

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.8fr);
  gap: 16px;
  margin-bottom: 16px;
}

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

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}
.status-strip > div {
  min-height: 96px;
  padding: 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.status-text { display: block; margin: 2px 0 3px; font-size: 16px; font-weight: 700; }
.status-text.ok { color: var(--ok); }
.status-text.warn { color: var(--warn); }
.status-text.danger { color: var(--error); }
.status-text.neutral { color: var(--muted); }

.action-stack { display: flex; align-items: center; gap: 8px; }

.form-grid {
  display: grid;
  /* auto-fit so columns wrap to fit the panel and never overflow it,
     regardless of how wide the panel/viewport is */
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  align-items: end;
}
.form-grid > label { min-width: 0; }
.form-grid .wide { grid-column: span 2; }

form .row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 39px;
  padding: 9px 11px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { min-height: 120px; resize: vertical; }
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26, 102, 204, 0.15);
}
input:disabled,
select:disabled,
button:disabled { cursor: not-allowed; opacity: 0.55; }

.mono-input,
textarea[name="block2_body_md"] { font-family: var(--font-mono); font-size: 12px; }

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid #ccd9ea;
  border-radius: var(--radius-pill);
  color: var(--fg);
  cursor: pointer;
  font: 590 13px/1.2 var(--font-ui);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 160ms var(--ease-out), color 160ms var(--ease-out),
              background 160ms var(--ease-out), transform 340ms var(--ease-jelly);
}
.btn:hover {
  border-color: rgba(0, 0, 0, 0.22);
  color: var(--fg);
  background: var(--panel-soft);
  text-decoration: none;
}
.btn:active { transform: scale(0.96); transition: transform 90ms var(--ease-out); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}
.btn.primary:hover {
  background: var(--accent);
  color: var(--accent-fg);
  filter: brightness(1.08);
}
.btn.ghost {
  min-height: 34px;
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}
.btn.ghost:hover {
  background: var(--panel-soft);
  border-color: var(--accent-soft-2);
  color: var(--accent-strong);
  box-shadow: none;
}
.btn.small { min-height: 30px; padding: 6px 10px; font-size: 12px; }
.btn.full { width: 100%; margin-top: 14px; }
.sidebar-foot .btn.full { margin-top: 0; }

.inline-result { color: var(--muted); font-size: 12px; font-weight: 700; }
.inline-result.is-ok { color: var(--ok); }
.inline-result.is-error { color: var(--error); }

/* ── Gate progress bar (intent gate + write-job polling) ─────────────── */
.gate-progress { display: block; margin: 6px 0 2px; max-width: 520px; }
.gate-progress-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; font-size: 13px; font-weight: 650; color: var(--ink);
  margin-bottom: 7px;
}
.gate-progress-pct { font-variant-numeric: tabular-nums; color: var(--accent); }
.gate-progress-track {
  height: 6px; border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.07); overflow: hidden;
}
.gate-progress-fill {
  height: 100%; border-radius: var(--radius-pill); background: var(--accent);
  transition: width 0.7s var(--ease-out);
}
.gate-progress-fill.is-indeterminate { animation: gate-slide 1.5s var(--ease-in-out) infinite; }
@keyframes gate-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(320%); }
}
.gate-progress-meta { display: block; margin-top: 7px; font-size: 12px; font-weight: 500; color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  .gate-progress-fill.is-indeterminate { animation: none; }
}

/* Interview choice chips: undo the global input sizing for the tiny
   radio/checkbox inside each chip (same fix family as .check-row input). */
.gate-iv-opt {
  width: 15px; height: 15px; min-height: 0; padding: 0; margin: 0;
  flex: none; accent-color: var(--accent);
}

/* ── Site list ────────────────────────────────────────────────────────── */
.site-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
}
.site-list.site-list-wide {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  max-height: none;
  overflow: auto;
  padding-right: 2px;
}
.site-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  color: var(--fg);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.site-row:hover {
  border-color: var(--accent-soft-2);
  background: #fff;
  transform: translateY(-1px);
  text-decoration: none;
}
.site-row strong,
.data-table strong { display: block; color: var(--fg); }
.site-row small,
.data-table small { display: block; margin-top: 2px; }
.muted-row { opacity: 0.62; }

/* ── Data table ───────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0 0;
  font-size: 13px;
}
.data-table th,
.data-table td {
  padding: 11px 9px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}
.data-table th {
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background 0.12s ease; }
.data-table tbody tr:hover { background: var(--panel-soft); }
.data-table .empty,
.empty { color: var(--muted); text-align: center; padding: 20px 10px; }

/* ── Status pills ─────────────────────────────────────────────────────── */
.status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.status-pending { background: #fff1cc; color: #7b470f; }
.status-in_progress,
.status-running { background: #dbeafe; color: #1f4f92; }
.status-queued { background: #e3ecfa; color: #2a4f86; }
.status-done,
.status-published { background: #d9f3e5; color: var(--ok); }
.status-draft { background: #e8eef6; color: #3d4b5c; }
.status-failed { background: #ffe0dc; color: var(--error); }
.status-skipped { background: #e9edf2; color: var(--muted); }

.progress-cell { display: flex; align-items: center; gap: 8px; }
.bar {
  width: 120px;
  height: 7px;
  overflow: hidden;
  background: #dbe6f4;
  border-radius: 999px;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-glow));
  transition: width 0.3s ease;
}

details summary { cursor: pointer; user-select: none; }
.panel > details > summary { font-weight: 700; }
.inline-details { position: relative; }
.inline-details form {
  position: absolute;
  right: 0;
  z-index: 10;
  width: min(360px, 88vw);
  margin-top: 8px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.check-row { flex-direction: row; align-items: center; margin: 10px 0; }
.check-row input { width: auto; min-height: auto; }

.article-actions,
.row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ── Modal dialog ─────────────────────────────────────────────────────── */
.modal {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0;
}
.modal[open] {
  animation: materialize 380ms var(--ease-jelly) both;
}
@keyframes materialize {
  from { opacity: 0; transform: scale(0.94); filter: blur(6px); }
  60%  { filter: blur(0); }
  to   { opacity: 1; transform: scale(1); filter: blur(0); }
}
.modal::backdrop {
  background: rgba(29, 29, 31, 0.32);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  backdrop-filter: blur(8px) saturate(140%);
  animation: backdrop-in 320ms var(--ease-out) both;
}
@keyframes backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.modal .panel { margin: 0; box-shadow: none; border: 0; }

/* ── Calendar grid ────────────────────────────────────────────────────── */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.cal-dow {
  padding: 8px 6px;
  background: var(--ink);
  color: #e8f0fb;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.cal-cell { position: relative; min-height: 120px; padding: 6px; background: var(--panel); }
.cal-cell.empty { background: #eef3fa; }
.cal-cell.today { background: var(--accent-soft); }
.cal-date { position: absolute; top: 5px; right: 7px; color: var(--muted); font-size: 11px; }
.cal-card {
  margin-top: 22px;
  padding: 7px;
  background: var(--panel-soft);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  font-size: 11px;
}
.cal-card + .cal-card { margin-top: 6px; }
.cal-card.status-pending { border-left-color: var(--warn); background: #fff1cc; }
.cal-card.status-in_progress { border-left-color: var(--blue); background: #dbeafe; }
.cal-card.status-published { border-left-color: var(--ok); background: #d9f3e5; }
.cal-card.status-failed { border-left-color: var(--error); background: #ffe0dc; }
.cal-type { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.cal-kw { margin: 2px 0; color: var(--fg); font-weight: 700; line-height: 1.25; }
.cal-meta { color: var(--muted); font-size: 10px; }

/* ── Page-load reveal ─────────────────────────────────────────────────── */
@keyframes rise {
  0%   { opacity: 0; transform: translateY(10px); }
  70%  { opacity: 1; transform: translateY(-2px); }
  100% { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: no-preference) {
  .container > * { animation: rise 0.32s var(--ease-out) both; }
  .container > *:nth-child(1) { animation-delay: 0s; }
  .container > *:nth-child(2) { animation-delay: 0.04s; }
  .container > *:nth-child(3) { animation-delay: 0.08s; }
  .container > *:nth-child(4) { animation-delay: 0.12s; }
  .container > *:nth-child(5) { animation-delay: 0.16s; }
}

/* ── Hover lifts only on real pointers (touch taps misfire hover) ────── */
@media (hover: hover) and (pointer: fine) {
  .qs-card:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 0, 0, 0.14);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
  }
  .qs-card:hover .qs-arrow { opacity: 1; transform: translateX(0); color: var(--accent); }
}

/* ── Accessibility: motion & transparency preferences ─────────────────── */
@media (prefers-reduced-motion: reduce) {
  .container > * { animation: none; }
  .qs-card, .site-row, .btn, .cta, .stat, .topbar { transition: none; }
  .qs-card:hover, .site-row:hover, .btn:active, .cta:active { transform: none; }
  .modal[open] { animation: backdrop-in 200ms ease both; }
  .modal::backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar, .sidebar {
    background: #ffffff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .quickstart { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1040px) {
  .welcome,
  .page-head,
  .workbench,
  .dashboard-grid,
  .split-panels { grid-template-columns: 1fr; }
  .welcome { align-items: start; }
  .stat-grid.compact { min-width: 0; }
  .status-strip { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .topbar { padding: 0 14px; }
  .sidebar {
    top: var(--topbar-h);
    width: 100%;
    height: auto;
    bottom: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .workspace { margin: 0; flex: 1 1 180px; }
  .cta { width: auto; flex: 0 0 auto; margin: 0; height: 40px; }
  .side-nav {
    flex: 1 1 100%;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-top: 4px;
    gap: 4px;
  }
  .nav-group, .sidebar-ver { display: none; }
  .nav-item { padding: 7px 10px; white-space: nowrap; }
  .sidebar-foot {
    flex-direction: row;
    padding: 0;
    margin: 0 0 0 auto;
    border-top: 0;
  }
  .content { margin-left: 0; padding-top: 0; }
}

@media (max-width: 760px) {
  .container { margin-top: 18px; padding: 0 16px; }
  .quickstart,
  .stat-grid,
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .status-strip { grid-template-columns: 1fr; }
  .panel-head,
  .action-stack { align-items: stretch; flex-direction: column; }
  .data-table { display: block; overflow-x: auto; white-space: nowrap; }
  .cal-grid { min-width: 720px; }
  .topbar-chip { display: none; }
}

/* ── Pipeline (文章排期) ─────────────────────────────────────────── */
.pl-table td { vertical-align: top; }
.pl-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: 980px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  background: var(--panel-soft); color: #6e6e73;
}
.pl-awaiting_confirm { background: #fff3e0; color: #b45309; }
.pl-publishing, .pl-generating { background: #e8f0fe; color: #1a66cc; }
.pl-published { background: #e6f6ec; color: #15803d; }
.pl-publish_failed, .pl-generate_failed { background: #fdecec; color: #b91c1c; }
.pl-paused { background: #ececf0; color: #6e6e73; }
.pl-dim { color: #b0b0b6; }
.pl-err { color: #b91c1c; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-sm { padding: 4px 12px; font-size: 13px; }
.pl-table td:nth-child(5) { white-space: nowrap; }
.pl-edit { border: none; background: transparent; box-shadow: none; padding: 0 4px; font-size: 12px; vertical-align: baseline; }
.pl-edit:hover { background: var(--panel-soft); }
a.chip-link { text-decoration: none; cursor: pointer;
  transition: border-color .18s var(--ease-out, ease), box-shadow .18s var(--ease-out, ease); }
a.chip-link:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(26,102,204,.14); }
a.chip-link .v.accent::after { content: " →"; font-size: .7em; opacity: .55; }
.topbar-logo { height: 24px; }
.topbar-wordmark { font-size: 17px; font-weight: 800; letter-spacing: -0.022em; color: var(--fg); }

/* GSC insights — three-column responsive grid */
.gsc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.gsc-col h3 { font-size: 14px; margin: 0 0 8px; }
.gsc-col h3 small { font-weight: 400; }
@media (max-width: 1100px) { .gsc-grid { grid-template-columns: 1fr; } }
.gsc-add.is-ok { color:#15803d; border-color:#cde5cd; }
/* Content audit verdict pills */
.pl-audit-update, .pl-audit-rewrite { background:#fff3e0; color:#b45309; }
.pl-audit-index { background:#fdecec; color:#b91c1c; }
.pl-audit-keep { background:#e6f6ec; color:#15803d; }
.pl-audit-prune { background:#ececf0; color:#6e6e73; }
.pl-audit-new { background:#e8f0fe; color:#1a66cc; }
/* GSC insights tabs */
.gsc-tabs { display:flex; gap:4px; border-bottom:1px solid var(--border,#e5e7eb); margin-bottom:12px; }
.gsc-tab { border:none; background:transparent; padding:8px 16px; cursor:pointer; font-size:14px;
  color:#6e6e73; border-bottom:2px solid transparent; margin-bottom:-1px; }
.gsc-tab.is-active { color:var(--accent,#1a66cc); border-bottom-color:var(--accent,#1a66cc); font-weight:600; }
.gsc-tab-n { font-size:11px; color:#b0b0b6; }
.gsc-tab.is-active .gsc-tab-n { color:var(--accent,#1a66cc); }
.pl-date { min-height:26px; padding:2px 4px; }
