:root {
  --bg: #f5f8fc;
  --bg-2: #eef3fa;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --surface-3: #f1f5fb;
  --line: #e3eaf4;
  --line-strong: #d2dded;
  --text: #10213f;
  --text-2: #4b5c78;
  --text-3: #7b8ba5;
  --primary: #1e40af;
  --primary-2: #2563eb;
  --primary-3: #3b82f6;
  --primary-soft: #eaf1ff;
  --primary-soft-2: #f3f7ff;
  --accent: #c2740a;
  --accent-soft: #fff5e6;
  --ok: #07835f;
  --ok-soft: #e6f7f0;
  --warn: #b45309;
  --warn-soft: #fef3e2;
  --bad: #d13333;
  --bad-soft: #fdeeee;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(16, 33, 63, 0.04), 0 6px 16px rgba(16, 33, 63, 0.04);
  --shadow-md: 0 18px 44px rgba(16, 33, 63, 0.1);
  --font: "Fira Sans", "Segoe UI Variable", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "Fira Code", "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary-2); }
h1, h2, h3, h4, p { margin: 0; }
svg { display: block; }
:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.28); outline-offset: 2px; }

.app-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.app-bg .glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
}
.app-bg .glow-a {
  width: 520px;
  height: 520px;
  top: -240px;
  right: -140px;
  background: radial-gradient(circle, #dbeafe 0%, rgba(219, 234, 254, 0) 70%);
}
.app-bg .glow-b {
  width: 460px;
  height: 460px;
  bottom: -260px;
  left: -160px;
  background: radial-gradient(circle, #fef3c7 0%, rgba(254, 243, 199, 0) 70%);
}

/* ============ 激活门禁 ============ */
.gate {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  background: linear-gradient(135deg, #f8fbff 0%, #f2f6fd 52%, #fbfcfe 100%);
  overflow: auto;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.gate.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.gate-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 56px clamp(36px, 6vw, 96px);
  border-right: 1px solid rgba(210, 221, 237, 0.7);
  background:
    radial-gradient(720px 420px at 80% 10%, rgba(37, 99, 235, 0.09), transparent 65%),
    radial-gradient(560px 380px at 10% 90%, rgba(217, 119, 6, 0.07), transparent 70%);
}
.gate-brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 21px;
  color: #fff;
  background: linear-gradient(145deg, #2563eb, #1e40af);
  box-shadow: 0 10px 22px rgba(30, 64, 175, 0.26);
}
.gate-brand strong { display: block; font-size: 17px; letter-spacing: 0.01em; }
.gate-brand div > span { display: block; font-size: 11px; color: var(--text-3); letter-spacing: 0.18em; }
.gate-hero { max-width: 540px; margin-top: 8vh; }
.gate-hero h1 {
  margin: 14px 0 18px;
  font-size: clamp(34px, 4vw, 50px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 650;
}
.gate-hero h1 em { font-style: normal; color: var(--primary-2); }
.gate-hero p { color: var(--text-2); font-size: 15px; line-height: 1.7; max-width: 440px; }
.gate-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; max-width: 480px; }
.gate-points li { display: flex; gap: 14px; align-items: flex-start; }
.point-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  color: var(--primary-2);
}
.point-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.gate-points b { display: block; font-size: 14px; margin-bottom: 2px; }
.gate-points span { color: var(--text-3); font-size: 12.5px; line-height: 1.55; }
.gate-note { color: var(--text-3); font-size: 12px; }

.gate-form-wrap {
  display: grid;
  place-items: center;
  padding: 48px 32px;
}
.gate-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 34px;
  box-shadow: var(--shadow-md);
}
.gate-card h2 { font-size: 26px; letter-spacing: -0.01em; margin: 10px 0 8px; }
.gate-desc { color: var(--text-2); font-size: 13.5px; line-height: 1.65; margin-bottom: 22px; }
.machine-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 13px;
  background: var(--primary-soft-2);
  border: 1px dashed #cbd9f0;
  margin-bottom: 18px;
}
.machine-copy { min-width: 0; flex: 1; }
.machine-copy > span { display: block; font-size: 11.5px; color: var(--text-3); margin-bottom: 4px; }
.machine-copy code {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--primary);
  letter-spacing: 0.04em;
  line-height: 1.6;
  word-break: break-all;
}
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.input::placeholder { color: #a5b2c6; }
.input:hover { border-color: #bfcde2; }
.input:focus {
  outline: none;
  border-color: var(--primary-3);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}
.code-input {
  height: 48px;
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.gate-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bad-soft);
  border: 1px solid #f3cccc;
  color: #a32323;
  font-size: 12.5px;
  line-height: 1.55;
}
.gate-error[hidden] { display: none; }
.gate-foot {
  margin-top: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
}
.gate-help { margin-top: 12px; font-size: 11.5px; color: var(--text-3); line-height: 1.6; }
.gate-card.is-busy .btn.primary { opacity: 0.75; cursor: progress; }

/* ============ 基础组件 ============ */
.eyebrow {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.17em;
  color: var(--text-3);
  text-transform: uppercase;
}
.eyebrow.accent { color: var(--accent); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--surface-3);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.15s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(145deg, #2f6bf0, #1e40af);
  color: #fff;
  box-shadow: 0 8px 20px rgba(30, 64, 175, 0.24);
}
.btn.primary:hover { box-shadow: 0 12px 26px rgba(30, 64, 175, 0.3); }
.btn.ghost {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--text-2);
}
.btn.ghost:hover { border-color: #b9c9e3; color: var(--primary); background: var(--primary-soft-2); }
.btn.danger {
  background: #fff;
  border-color: #f0caca;
  color: var(--bad);
}
.btn.danger:hover { background: var(--bad-soft); }
.btn.large { height: 46px; padding: 0 22px; font-size: 14px; border-radius: 12px; }
.btn.small { height: 32px; padding: 0 12px; font-size: 12px; border-radius: 9px; }
.btn.block { width: 100%; height: 46px; border-radius: 12px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a9b7ca;
}
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(7, 131, 95, 0.12); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.12); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(209, 51, 51, 0.12); }
.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 7px;
  background: var(--surface-3);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
}
.badge.good { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.link-btn {
  border: 0;
  background: none;
  color: var(--primary-2);
  font-size: 12px;
  font-weight: 600;
  padding: 4px;
}
.muted { color: var(--text-3); font-size: 12px; }
.fineprint { color: var(--text-3); font-size: 11.5px; line-height: 1.65; margin-top: 12px; }
.hint { color: var(--text-3); font-size: 12px; }

/* ============ 主框架 ============ */
.shell.app-shell { display: none; position: relative; z-index: 1; min-height: 100vh; }
.shell.app-shell.ready { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px 18px;
  background: rgba(255, 255, 255, 0.82);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px 8px; }
.logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #2f6bf0, #1e40af);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 8px 18px rgba(30, 64, 175, 0.24);
}
.brand-text strong { display: block; font-size: 15px; }
.brand-text span { display: block; font-size: 9.5px; color: var(--text-3); letter-spacing: 0.16em; }
.nav { display: grid; gap: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: none;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 550;
  text-align: left;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.nav-item svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active {
  background: var(--primary-soft);
  border-color: #d6e3fb;
  color: var(--primary);
  font-weight: 650;
}
.side-card {
  margin-top: auto;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(160deg, #f8fbff, #f1f6fe);
  border: 1px solid var(--line);
}
.side-card-title { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 650; color: var(--text-2); margin-bottom: 10px; }
.side-code {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--primary);
  letter-spacing: 0.03em;
  margin-bottom: 9px;
}
.side-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 11.5px; color: var(--text-3); }
.side-row b { color: var(--text-2); font-weight: 600; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot { display: flex; align-items: center; gap: 7px; padding: 0 6px; font-size: 11px; color: var(--text-3); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 14px clamp(20px, 3vw, 36px);
  background: rgba(245, 248, 252, 0.86);
  border-bottom: 1px solid rgba(227, 234, 244, 0.9);
  backdrop-filter: blur(12px);
}
.topbar-title h2 { font-size: 21px; letter-spacing: -0.01em; margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 11.5px;
  white-space: nowrap;
}
.pill-btn { cursor: pointer; font-family: inherit; transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease; }
.pill-btn:hover { border-color: #c6d5ec; color: var(--primary); background: var(--primary-soft-2); }
.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { color: var(--primary); border-color: #c6d5ec; background: var(--primary-soft-2); }

.content { padding: clamp(20px, 3vw, 34px); max-width: 1480px; width: 100%; margin: 0 auto; }
.view { display: none; animation: rise 0.32s ease both; }
.view.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
}
.card-head h3 { font-size: 15px; font-weight: 650; letter-spacing: -0.005em; }
.card-head + * { margin-top: 0; }

/* 概览 */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
  gap: 24px;
  padding: clamp(24px, 3vw, 38px);
  overflow: hidden;
  background:
    radial-gradient(600px 320px at 88% -10%, rgba(37, 99, 235, 0.09), transparent 65%),
    linear-gradient(135deg, #ffffff, #f8fbff 58%, #f5f9ff);
}
.hero-copy h1 { font-size: clamp(28px, 3vw, 38px); line-height: 1.15; letter-spacing: -0.025em; margin: 12px 0 14px; font-weight: 650; }
.hero-copy h1 em { font-style: normal; color: var(--primary-2); }
.hero-copy p { color: var(--text-2); font-size: 13.5px; line-height: 1.7; max-width: 560px; }
.hero-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.hero-visual { position: relative; min-height: 210px; display: grid; place-items: center; }
.ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(37, 99, 235, 0.16);
}
.ring-a { width: 210px; height: 210px; }
.ring-b { width: 156px; height: 156px; border-color: rgba(217, 119, 6, 0.22); }
.ring-c { width: 102px; height: 102px; background: radial-gradient(circle, rgba(37, 99, 235, 0.08), transparent 70%); border-color: rgba(37, 99, 235, 0.24); }
.hero-badge {
  position: absolute;
  top: 6px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
}
.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(7, 131, 95, 0.35);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(7, 131, 95, 0.3); }
  70% { box-shadow: 0 0 0 9px rgba(7, 131, 95, 0); }
  100% { box-shadow: 0 0 0 0 rgba(7, 131, 95, 0); }
}
.hero-metric { text-align: center; position: relative; z-index: 2; }
.hero-metric b { display: block; font-size: 44px; line-height: 1; letter-spacing: -0.03em; color: var(--primary); font-variant-numeric: tabular-nums; }
.hero-metric span { display: block; margin-top: 6px; font-size: 11.5px; color: var(--text-3); }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.stat { display: flex; align-items: center; gap: 13px; padding: 17px 18px; min-width: 0; }
.stat-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}
.stat-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stat-icon.wait { background: var(--primary-soft); color: var(--primary-2); }
.stat-icon.run { background: var(--warn-soft); color: var(--warn); }
.stat-icon.ok { background: var(--ok-soft); color: var(--ok); }
.stat-icon.items { background: #f1efff; color: #5b4bc4; }
.stat-body { min-width: 0; }
.stat-body span { display: block; font-size: 11.5px; color: var(--text-3); }
.stat-body b { display: block; font-size: 24px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 1px; }
.stat-spark { margin-left: auto; display: flex; align-items: flex-end; gap: 3px; height: 34px; opacity: 0.7; }
.stat-spark i { display: block; width: 3px; border-radius: 3px; background: #cfdcf1; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 14px; margin-top: 14px; }
.donut-row { display: flex; align-items: center; gap: 26px; padding: 4px 20px 24px; flex-wrap: wrap; }
.donut {
  width: 146px;
  height: 146px;
  border-radius: 50%;
  position: relative;
  flex: 0 0 auto;
  background: conic-gradient(#e7eef8 0 100%);
}
.donut::after {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  background: #fff;
}
.donut-center { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; text-align: center; }
.donut-center b { display: block; font-size: 27px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.donut-center span { display: block; font-size: 10.5px; color: var(--text-3); }
.legend { display: grid; gap: 9px; min-width: 140px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.legend-row i { width: 9px; height: 9px; border-radius: 3px; }
.legend-row b { margin-left: auto; font-variant-numeric: tabular-nums; }
.recent-list { display: grid; gap: 2px; padding: 0 10px 12px; }
.recent-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.16s ease;
}
.recent-row:hover { background: var(--surface-3); }
.recent-main { min-width: 0; flex: 1; }
.recent-main b { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-main span { display: block; font-size: 11px; color: var(--text-3); margin-top: 1px; }
.recent-items { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.empty { padding: 36px 20px; text-align: center; color: var(--text-3); font-size: 12.5px; }
.empty.small { padding: 22px 10px; }
.platforms-strip { margin-top: 14px; padding-bottom: 18px; }
.platform-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px 0 7px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--text-2);
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}
.chip:hover { border-color: #c4d4ec; background: #fff; transform: translateY(-1px); }

.tile {
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  flex: 0 0 auto;
}

/* 新建采集 */
.new-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr); gap: 14px; align-items: start; }
.form-card { padding-bottom: 22px; }
.form-card > .field-label, .form-card > .platform-select, .form-card > .action-select,
.form-card > .param-grid, .form-card > .input, .form-card > .submit-row { margin-left: 20px; margin-right: 20px; }
.field-label { font-size: 11.5px; font-weight: 650; color: var(--text-2); margin-top: 17px; margin-bottom: 8px; letter-spacing: 0.02em; }
.platform-select { display: flex; flex-wrap: wrap; gap: 8px; }
.platform-tile {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px 0 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--text-2);
  transition: all 0.16s ease;
}
.platform-tile:hover { border-color: #c4d4ec; background: #fff; }
.platform-tile.active { border-color: #bcd0f2; background: var(--primary-soft); color: var(--primary); font-weight: 650; }
.action-select { display: flex; flex-wrap: wrap; gap: 7px; }
.action-chip {
  height: 32px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
  color: var(--text-2);
  transition: all 0.16s ease;
}
.action-chip:hover { border-color: #c4d4ec; }
.action-chip.active { border-color: #bcd0f2; background: var(--primary-soft); color: var(--primary); font-weight: 650; }
.action-chip:disabled { opacity: 0.45; cursor: not-allowed; }
.param-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.param { display: flex; flex-direction: column; gap: 6px; }
.param label { font-size: 12px; color: var(--text-2); font-weight: 550; }
.param input, .param select {
  height: 38px;
  width: 100%;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 13px;
  color: var(--text);
}
.param input:focus, .param select:focus { outline: none; border-color: var(--primary-3); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14); }
.param .help { font-size: 11px; color: var(--text-3); line-height: 1.5; }
.switch { display: inline-flex; align-items: center; gap: 8px; height: 38px; font-size: 12.5px; color: var(--text-2); }
.switch input { width: 16px; height: 16px; accent-color: var(--primary-2); }
.submit-row { display: flex; align-items: center; gap: 14px; margin-top: 20px; flex-wrap: wrap; }
.side-stack { display: grid; gap: 14px; }
.summary-card, .cms-card { padding-bottom: 16px; }
.kv { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 9px 20px; font-size: 12px; }
.kv > span { color: var(--text-3); flex: 0 0 auto; }
.kv > b { font-weight: 600; color: var(--text-2); text-align: right; word-break: break-all; font-variant-numeric: tabular-nums; }
.cat-list { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 20px; }
.cat-list.inline { padding: 8px 0 0; }
.cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--surface-3);
  font-size: 11px;
  color: var(--text-2);
}
.cat b { color: var(--primary); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.cms-card .fineprint { padding: 0 20px; }

/* 任务中心 */
.jobs-card { padding-bottom: 8px; }
.jobs-head { flex-wrap: wrap; gap: 12px; }
.jobs-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tabs { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--line); }
.tab {
  height: 27px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 550;
}
.tab:hover { color: var(--text-2); }
.tab.active { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(16, 33, 63, 0.1); font-weight: 650; }
.input.search { width: 190px; height: 34px; font-size: 12px; }
.table-wrap { overflow-x: auto; }
.job-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.job-table th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 600;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}
.job-table td { padding: 12px 16px; border-bottom: 1px solid #eef3f9; font-size: 12.5px; color: var(--text-2); vertical-align: middle; }
.job-table tbody tr { cursor: pointer; transition: background 0.15s ease; }
.job-table tbody tr:hover { background: var(--primary-soft-2); }
.job-title { font-weight: 600; color: var(--text); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-id { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); margin-top: 1px; }
.platform-badge { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.status .mini { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.queued { background: var(--primary-soft); color: #2b5bb5; }
.status.running { background: var(--warn-soft); color: var(--warn); }
.status.success { background: var(--ok-soft); color: var(--ok); }
.status.failed { background: var(--bad-soft); color: var(--bad); }
.status.canceled { background: var(--surface-3); color: var(--text-3); }
.row-go { color: var(--text-3); font-size: 17px; text-align: right; }

/* 平台模块 */
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h3 { font-size: 17px; }
.section-head p { color: var(--text-3); font-size: 12.5px; }
.platform-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.platform-card { padding: 18px; }
.platform-card-head { display: flex; align-items: center; gap: 12px; }
.platform-card-head > div { min-width: 0; }
.platform-card-head > div > b { display: block; font-size: 14.5px; }
.platform-card-head > div > span { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.platform-card .desc { font-size: 12px; color: var(--text-2); margin-top: 14px; }
.module-path {
  margin: 8px 0 12px;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.action-list { display: flex; flex-wrap: wrap; gap: 6px; }
.platform-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.platform-card-foot > span { color: var(--text-3); font-size: 11.5px; }

/* 设置 */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.settings-grid .card { padding-bottom: 16px; }
.settings-grid .wide { grid-column: 1 / -1; }
.kv-list { padding: 0 0 4px; }
.kv-list .kv { padding: 8px 20px; }
.license-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.machine-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 20px 0;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--primary-soft-2);
  border: 1px dashed #cbd9f0;
  font-size: 11px;
}
.machine-line span { color: var(--text-3); flex: 0 0 auto; }
.machine-line code { font-family: var(--mono); font-size: 10.5px; color: var(--primary); word-break: break-all; }
.path-line {
  margin: 9px 20px 0;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
  word-break: break-all;
}
.license-card .fineprint, .update-card .fineprint { padding: 0 20px; }
.license-actions { display: flex; gap: 8px; padding: 12px 20px 0; flex-wrap: wrap; }
#update-download[hidden] { display: none; }
.license-card .badge { height: 24px; }

/* 配置卡片 */
.config-note {
  margin: 0 20px 18px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid #d8e5fb;
  background: linear-gradient(135deg, #f7faff, #eef4ff);
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.65;
}
.config-note.is-warn {
  border-color: #f3d9b3;
  background: linear-gradient(135deg, #fffaf2, #fef3e2);
  color: #8a5310;
}
.config-section { padding: 0 20px 18px; }
.config-section + .config-section { border-top: 1px solid var(--line); padding-top: 18px; }
.config-section-head { margin-bottom: 12px; }
.config-section-head h4 { margin: 3px 0 4px; font-size: 13.5px; letter-spacing: -0.01em; }
.config-section-head p { color: var(--text-3); font-size: 12px; line-height: 1.6; }
.config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.config-grid .field { margin: 0; }
.config-grid .span-2 { grid-column: 1 / -1; }
.config-card .field { margin-bottom: 0; }
.config-card .input { font-family: var(--mono); font-size: 12.5px; }
.config-card textarea.input { height: auto; padding: 9px 12px; line-height: 1.6; resize: vertical; }
.config-param-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.config-param-grid .empty { grid-column: 1 / -1; color: var(--text-3); font-size: 12px; }
.config-param-item {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  transition: border-color 0.18s ease, background 0.18s ease;
}
.config-param-item:hover { border-color: #c8d8ef; background: #fff; }
.config-param-name { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.config-param-name code {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-3);
  background: rgba(16, 33, 63, 0.05);
  padding: 1px 5px;
  border-radius: 5px;
}
.config-param-item input {
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-family: var(--mono);
  font-size: 12.5px;
}
.config-param-item input:focus {
  outline: none;
  border-color: var(--primary-3);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}
.config-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius) var(--radius);
}
.config-meta { padding: 14px 20px 18px; border-top: 1px dashed var(--line); }

/* 定时采集 */
.schedule-form { padding: 0 20px 14px; }
.schedule-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.schedule-form .field { margin-bottom: 10px; }
.schedule-form .input { font-family: var(--mono); font-size: 12.5px; }
.schedule-form .btn { width: 100%; }
.schedule-hint { margin: 9px 0 0; color: var(--text-3); font-size: 11.5px; line-height: 1.65; }
.schedule-list {
  padding: 14px 20px 16px;
  display: grid;
  gap: 8px;
  border-top: 1px dashed var(--line);
}
.schedule-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  transition: border-color 0.18s ease, background 0.18s ease;
}
.schedule-item:hover { border-color: #c8d8ef; background: #fff; }
.schedule-clock {
  flex: 0 0 auto;
  min-width: 54px;
  text-align: center;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
}
.schedule-main { flex: 1; min-width: 0; }
.schedule-main b { display: block; font-size: 12.5px; }
.schedule-main span { font-size: 11.5px; color: var(--text-3); }
.schedule-actions { display: flex; gap: 2px; }
.link-btn.danger { color: var(--bad); }
.schedule-list .empty { padding: 6px 0; font-size: 12px; }

/* 使用说明 */
.help-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 18px; align-items: start; }
.help-stack { display: grid; gap: 18px; }
.step-list { padding: 0 20px 18px; display: grid; gap: 13px; }
.step { display: flex; align-items: center; gap: 12px; }
.step > div { min-width: 0; }
.step-no {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}
.step b { display: block; font-size: 13px; margin-bottom: 2px; }
.step span { display: block; color: var(--text-3); font-size: 12px; line-height: 1.6; }
.faq { padding: 2px 20px 12px; }
.faq details { border-bottom: 1px solid var(--line); padding: 11px 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  font-size: 12.5px;
  font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-3); font-weight: 500; }
.faq details[open] summary::after { content: "−"; }
.faq p { margin-top: 7px; color: var(--text-2); font-size: 12px; line-height: 1.7; }
.help-card code, .faq code {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface-3);
  padding: 1px 5px;
  border-radius: 4px;
}
.field-table { padding: 0 20px 14px; }
.field-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 12px;
}
.field-row:last-child { border-bottom: 0; }
.field-row b { font-family: var(--mono); font-size: 11.5px; color: var(--primary); }
.field-row span { color: var(--text-2); line-height: 1.6; }
.help-tip {
  margin: 0 20px 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--primary-soft-2);
  border: 1px solid #dce8fa;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.65;
}
@media (max-width: 1080px) {
  .help-grid { grid-template-columns: 1fr; }
}

/* 抽屉 */
.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(16, 33, 63, 0.18);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.drawer-mask.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  width: min(640px, 94vw);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 60px rgba(16, 33, 63, 0.14);
  transform: translateX(103%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px 20px 14px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { font-size: 16px; margin-top: 3px; }
.drawer-meta { display: flex; flex-wrap: wrap; gap: 7px; padding: 13px 20px; border-bottom: 1px solid var(--line); }
.meta-pill { display: inline-flex; align-items: center; gap: 5px; height: 25px; padding: 0 9px; border-radius: 7px; background: var(--surface-3); font-size: 11px; color: var(--text-2); }
.meta-pill b { color: var(--text); }
.terminal { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 16px 20px; }
.terminal-head { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--text-3); margin-bottom: 8px; }
.terminal-head span { display: inline-flex; align-items: center; gap: 6px; }
.terminal-head i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.terminal pre {
  flex: 1;
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f7f9fd;
  color: #24344f;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.75;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.log-time { color: #92a1b8; }
.drawer-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 20px 18px; border-top: 1px solid var(--line); }

/* Toast */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 70; display: grid; gap: 8px; }
.toast {
  min-width: 220px;
  max-width: 360px;
  padding: 11px 14px;
  border-radius: 11px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  font-size: 12.5px;
  color: var(--text-2);
}
.toast.ok { border-color: #bfe8d7; background: #f4fcf8; color: #0a6b50; }
.toast.bad { border-color: #f2cbcb; background: #fff7f7; color: #a32323; }
.toast.warn { border-color: #f3ddbd; background: #fffaf2; color: #8a5a10; }

/* 响应式 */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .new-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .gate { grid-template-columns: minmax(0, 0.9fr) minmax(380px, 1.1fr); }
  .gate-visual { padding: 44px 40px; }
}
@media (max-width: 900px) {
  .gate { grid-template-columns: minmax(0, 1fr); }
  .gate-visual { display: none; }
  .gate-form-wrap { padding: 32px 20px; }
  .shell.app-shell.ready { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding-bottom: 0; }
  .nav { display: flex; flex-wrap: wrap; }
  .nav-item { height: 36px; padding: 0 10px; }
  .side-card, .side-foot { display: none; }
  .topbar { position: static; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-visual { min-height: 160px; }
  .platform-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: minmax(0, 1fr); }
  .license-grid { grid-template-columns: minmax(0, 1fr); }
  .topbar { flex-wrap: wrap; }
  .topbar-actions { justify-content: flex-start; }
  .content { padding: 16px; }
  .gate-card { padding: 24px; }
  .hero-copy h1 { font-size: 27px; }
  .input.search { width: 100%; }
  .jobs-tools { width: 100%; }
}

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