:root {
  /* 默认浅色；深色只在用户通过 data-theme="dark" 主动选择后启用 */
  color-scheme: light;
  accent-color: var(--control-accent);
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  --control-accent: #d9a05f;
  --scrollbar-thumb: #8b96a5;
  --scrollbar-track: #1c232d;
  --focus-ring: #d9a05f;
  --bg: #171c23;
  --surface: #1f262f;
  --surface-2: #28313b;
  --line: #343e49;
  --line-2: #414c58;
  --text: #eef2f6;
  --text-2: #c4cdd8;
  --muted: #8b96a5;
  --muted-2: #5e6875;
  --accent: #d9a05f;
  --accent-2: #c78c4c;
  --accent-weak: rgba(217, 160, 95, 0.14);
  --violet: #6b8afd;
  --indigo: #5b8def;
  --ok: #5fbf8f;
  --ok-bg: rgba(95, 191, 143, 0.13);
  --warn: #d9b25f;
  --warn-bg: rgba(217, 178, 95, 0.13);
  --bad: #d97b6c;
  --bad-bg: rgba(217, 123, 108, 0.13);
  --info: #7f9cc4;
  --info-bg: rgba(127, 156, 196, 0.14);
  /* 组件兼容别名：对齐 ops 主题变量，保留模块内组件样式 */
  --surface-3: var(--surface-2);
  --line-soft: var(--line);
  --ink: var(--text);
  --radius: 14px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 10px 30px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.55);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sidebar: 236px;
}

* {
  box-sizing: border-box;
}
.clay-bg {
  display: none;
}
html,
body {
  margin: 0;
  min-height: 100%;
}
body {
  background:
    radial-gradient(900px 520px at 8% -10%, rgba(217, 120, 69, 0.07), transparent 62%),
    radial-gradient(820px 500px at 100% 0%, rgba(116, 165, 138, 0.035), transparent 58%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 0.875rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}
::selection {
  background: rgba(217, 120, 69, 0.3);
  color: #fff;
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow: auto;
  background: var(--surface);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--line);
  padding: 18px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px 16px;
}
.brand-mark {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  background: #b8542a;
  color: #23160a;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}
.brand-mark svg {
  width: 17px;
  height: 17px;
}
.brand-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.brand-text strong {
  font-size: 0.9375rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.brand-text span {
  color: var(--muted);
  font-size: 0.71875rem;
  white-space: nowrap;
}
.brand .tag {
  margin-left: auto;
  font: 600 0.625rem/1 var(--mono);
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 7px;
  white-space: nowrap;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-label {
  margin: 10px 8px 5px;
  font-size: 0.625rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
nav button {
  position: relative;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  min-block-size: 2.125rem;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-2);
  font: 500 0.84375rem var(--font);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
nav button svg {
  width: 17px;
  height: 17px;
  flex: none;
  color: var(--muted);
  transition: color 0.15s;
}
nav button:hover {
  background: var(--surface-2);
  color: var(--text);
}
nav button:hover svg {
  color: var(--text-2);
}
nav button.on,
nav button[aria-current="page"] {
  background: var(--accent-weak);
  color: var(--text);
  font-weight: 600;
}
nav button.on svg,
nav button[aria-current="page"] svg {
  color: var(--accent);
}
nav button.on::before,
nav button[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
nav button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.side-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.75rem;
}
.status .dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--muted-2);
}
.status.ok .dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}
.status.err .dot {
  background: var(--bad);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16);
}
.side-meta {
  padding: 0 10px;
  font: 0.6875rem/1.5 var(--mono);
  color: var(--muted-2);
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

main {
  min-width: 0;
  padding: 30px 36px 80px;
}
.view {
  max-width: 1240px;
  margin: 0 auto;
}
.hide {
  display: none;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.eyebrow {
  margin: 0 0 7px;
  font-size: 0.65625rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.page-head h2 {
  margin: 0;
  font-size: 1.5625rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.lede {
  margin: 7px 0 0;
  font-size: 0.84375rem;
  color: var(--muted);
  max-width: 62ch;
}
.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.pill-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.75rem;
  white-space: nowrap;
  box-shadow: var(--shadow);
}
.pill-live .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 15px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
}
.card:hover::before {
  opacity: 1;
}
.card-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}
.card b {
  display: block;
  margin: 6px 0 4px;
  font-size: 1.875rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.71875rem;
  color: var(--muted);
}
.trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.trend.up {
  color: var(--ok);
  background: var(--ok-bg);
}
.trend.down {
  color: var(--bad);
  background: var(--bad-bg);
}
.trend.flat {
  color: var(--muted);
  background: var(--surface-2);
}

.block {
  margin-top: 28px;
}
.block-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 11px;
  flex-wrap: wrap;
}
.block-head h3 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.hint {
  font-size: 0.75rem;
  color: var(--muted);
}
h3 {
  font-size: 0.9375rem;
  font-weight: 650;
  margin: 28px 0 11px;
}
h4 {
  margin: 0 0 14px;
  font-size: 0.84375rem;
  font-weight: 650;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.75rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.panel.flush {
  padding: 0;
  overflow: hidden;
}
.panel.flush > p:not(.table-foot),
.panel.flush > .empty {
  margin: 16px 18px;
}
.panel.pad-sm {
  padding: 14px 16px;
}
/* 面板标题从 h4 提升到 h3 以消除标题层级跳级，视觉保持原有小标题规格 */
.panel-title {
  margin: 0 0 0.875rem;
  font-size: 0.84375rem;
  font-weight: 650;
  line-height: 1.45;
}
.panel > h4:only-child + p {
  margin-bottom: 0;
}
.grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.71875rem;
  font-weight: 500;
  color: var(--muted);
}
label.inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 0.78125rem;
  color: var(--text-2);
}
input,
select,
textarea {
  width: 100%;
  min-block-size: 2.25rem;
  margin-top: 5px;
  padding: 0 11px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--text);
  font: 0.84375rem var(--font);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea {
  height: auto;
  padding: 10px 12px;
  line-height: 1.65;
  resize: vertical;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
  opacity: 1;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--focus-ring);
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}
select {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}
input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--control-accent);
  cursor: pointer;
}
label.inline input {
  width: auto;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-block-size: 2.25rem;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--text);
  font: 500 0.8125rem var(--font);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.05s;
}
button:hover {
  background: var(--surface-2);
}
button:active {
  transform: translateY(1px);
}
button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
button.primary {
  background: linear-gradient(180deg, #e08a52, #c26134);
  border-color: rgba(255, 255, 255, 0.08);
  color: #1f1208;
  font-weight: 650;
  box-shadow: 0 6px 18px rgba(150, 98, 50, 0.24);
}
button.primary:hover {
  filter: brightness(1.12);
}
button.ghost {
  background: transparent;
  border-color: var(--line-2);
  color: var(--text-2);
}
button.ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}
button.tiny {
  min-block-size: 1.6875rem;
  padding: 0 9px;
  font-size: 0.75rem;
  border-radius: 6px;
}
button.tiny.accent {
  background: var(--accent-weak);
  border-color: rgba(217, 120, 69, 0.42);
  color: #f0b68e;
  font-weight: 600;
}
button.tiny.accent:hover {
  background: rgba(217, 120, 69, 0.22);
}

.bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.bar input,
.bar select {
  width: auto;
  min-width: 128px;
  margin-top: 0;
}
.bar input[type="checkbox"] {
  width: 15px;
  min-width: 0;
}
td.nowrap {
  white-space: nowrap;
}
.bar .grow {
  flex: 1;
}
.bar.callout {
  padding: 12px 14px;
  border: 1px solid rgba(217, 120, 69, 0.3);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(217, 120, 69, 0.09), rgba(22, 18, 14, 0.55));
}
.callout-label {
  font-size: 0.65625rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-right: 2px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
/* 窄屏保留可读列宽，交给 .table-wrap 横向滚动；否则中文标题会被压成逐字换行 */
#hotTable table,
#jobList table,
#claimTable table {
  min-inline-size: 760px;
}
thead th {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.65625rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}
tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-2);
  vertical-align: middle;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr {
  transition: background 0.12s;
}
tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}
td a {
  color: var(--text);
  font-weight: 500;
  /* 原生下划线替代 border-bottom：不参与盒模型、随文字换行，且可用 offset/thickness 精调 */
  text-decoration-line: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.15s;
}
td a:hover {
  text-decoration-color: var(--accent);
}
.num,
td.num {
  font-variant-numeric: tabular-nums;
}
.panel.flush table thead th:first-child,
.panel.flush table tbody td:first-child {
  padding-left: 18px;
}
.panel.flush table thead th:last-child,
.panel.flush table tbody td:last-child {
  padding-right: 18px;
}
.table-foot {
  margin: 0;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--muted);
}
.cell-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 220px;
}
.cell-title span {
  font-size: 0.71875rem;
  color: var(--muted);
}
.mono {
  font-family: var(--mono);
  font-size: 0.75rem;
}
.srctag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text-2);
  font: 500 0.71875rem var(--mono);
}
.srctag.logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 1px 8px 1px 5px;
  font-family: var(--font);
  font-size: 0.71875rem;
  white-space: nowrap;
}
.tag-logo {
  width: 14px;
  height: 14px;
  flex: none;
  border-radius: 3px;
  object-fit: contain;
  background: #f7f2e9;
  padding: 1px;
}
.bar-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}
.bar-cell .track {
  position: relative;
  height: 6px;
  width: 74px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.bar-cell .track i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #a84c2b, #e08a52);
}
.bar-cell .track i.low {
  background: var(--warn);
}
.bar-cell .track i.zero {
  background: var(--line-2);
}
.bar-cell b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-block-size: 1.375rem;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.71875rem;
  font-weight: 500;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--text-2);
}
.chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}
.chip.available,
.chip.succeeded {
  background: var(--ok-bg);
  color: var(--ok);
}
.chip.claimed,
.chip.partial,
.chip.needs_review,
.chip.pending {
  background: var(--warn-bg);
  color: var(--warn);
}
.chip.delivered,
.chip.running {
  background: var(--info-bg);
  color: var(--info);
}
.chip.expired,
.chip.queued {
  background: var(--surface-2);
  color: var(--muted);
}
.chip.failed {
  background: var(--bad-bg);
  color: var(--bad);
}
.chip.pri {
  background: var(--accent-weak);
  color: var(--accent-2);
}
.chip.plain::before {
  display: none;
}

.code {
  margin: 0;
  padding: 14px 16px;
  background: #18130f;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-2);
  font: 0.75rem/1.7 var(--mono);
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.editor {
  min-block-size: 35rem;
  font: 0.78125rem/1.7 var(--mono);
  white-space: pre;
  tab-size: 2;
  background: var(--surface);
}

.drawer {
  position: relative;
  margin-top: 18px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}
.drawer h3 {
  margin: 0 0 8px;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}
.drawer-close {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 28px;
  min-block-size: 1.75rem;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
}
.drawer-close:hover {
  background: var(--surface-2);
  color: var(--text);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.article-body {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  max-height: 480px;
  overflow: auto;
  color: var(--text-2);
  font-size: 0.90625rem;
  line-height: 1.95;
  white-space: pre-wrap;
}
.article-body p {
  margin: 0 0 12px;
}
.article-figure {
  margin: 16px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  white-space: normal;
}
.article-figure img {
  display: block;
  width: 100%;
  height: auto;
}
.article-figure figcaption {
  padding: 7px 10px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}
.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 34px 20px;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
  color: var(--muted);
  text-align: center;
}
.empty svg {
  width: 22px;
  height: 22px;
  color: var(--muted-2);
  margin-bottom: 2px;
}
.empty strong {
  font-size: 0.84375rem;
  font-weight: 600;
  color: var(--text-2);
}
.empty span {
  font-size: 0.78125rem;
}

.chart {
  padding: 16px 18px 10px;
}
.chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.chart-head strong {
  font-size: 0.78125rem;
  font-weight: 600;
}
.chart-head span {
  font-size: 0.71875rem;
  color: var(--muted);
}
.chart-plot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 7px;
  height: 124px;
  border-bottom: 1px solid var(--line);
  background-image: repeating-linear-gradient(to top, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 31px);
}
.chart-col {
  flex: 1;
  min-width: 0;
  max-width: 72px;
  height: 100%;
  display: flex;
  align-items: flex-end;
}
.chart-col i {
  display: block;
  width: 100%;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: rgba(127, 156, 196, 0.42);
  transition: background 0.15s;
}
.chart-col:hover i {
  background: rgba(127, 156, 196, 0.8);
}
.chart-col i.today {
  background: var(--accent);
}
.chart-labels {
  display: flex;
  justify-content: space-between;
  gap: 7px;
  margin-top: 6px;
}
.chart-labels span {
  flex: 1;
  min-width: 0;
  max-width: 72px;
  text-align: center;
  font: 0.59375rem var(--mono);
  color: var(--muted-2);
  white-space: nowrap;
}

.steps {
  margin: 0;
  padding-left: 18px;
  color: var(--text-2);
  font-size: 0.8125rem;
  line-height: 1.95;
}
.steps li {
  margin-bottom: 4px;
}
.steps code,
.panel code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-2);
  font: 0.75rem var(--mono);
  color: var(--text);
}
.keybox {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(217, 120, 69, 0.3);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(217, 120, 69, 0.09), rgba(22, 18, 14, 0.55));
}
.keybox strong {
  font-size: 0.84375rem;
}
.keyline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.keyline code {
  flex: 1;
  min-width: 240px;
  padding: 9px 11px;
  border: 1px solid rgba(217, 120, 69, 0.3);
  border-radius: 8px;
  background: #1a212a;
  font: 0.78125rem/1.5 var(--mono);
  color: var(--text);
  word-break: break-all;
}
.keybox .hint {
  margin: 10px 0 0;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 420px;
  padding: 11px 16px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 0.8125rem;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}
.toast::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  flex: none;
}
.toast.err::before {
  background: var(--bad);
}

body.busy::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 999;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
@keyframes scan {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 1180px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 980px) {
  body {
    display: block;
  }
  .side {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    /* 品牌与主题按钮固定在左侧，只有导航条横向滚动 */
    overflow: visible;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    padding: 0 8px 0 0;
    flex: none;
  }
  .brand .theme-toggle {
    inline-size: 44px;
    block-size: 44px;
  }
  .brand .tag,
  .nav-label,
  .side-foot {
    display: none;
  }
  nav {
    flex-direction: row;
    gap: 2px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
  }
  nav button {
    white-space: nowrap;
    padding: 0 9px;
    min-height: 44px;
  }
  nav button svg {
    display: none;
  }
  nav button.on::before {
    display: none;
  }
  /* 触控目标统一到 44px；表格行的“查看/领取”等次要操作也同步放大 */
  button,
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    min-block-size: 2.75rem;
  }
  input[type="checkbox"],
  input[type="radio"] {
    inline-size: 1.5rem;
    block-size: 1.5rem;
    min-block-size: 1.5rem;
  }
  button.tiny {
    min-block-size: 2.75rem;
  }
  .src-filter button {
    height: 2.75rem;
  }
  main {
    padding: 22px 20px 64px;
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .cards {
    grid-template-columns: 1fr;
  }
  .page-head {
    flex-direction: column;
    gap: 12px;
  }
  .page-head h2 {
    font-size: 1.375rem;
  }
  main {
    padding: 18px 14px 56px;
  }
}

.content-preview {
  margin: 12px 0 0;
  max-height: 440px;
  overflow: auto;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 0.78125rem;
  line-height: 1.9;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- Graph overview ---------- */
.overview-view {
  max-width: 1500px;
}
.graph-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.graph-title {
  min-width: 260px;
}
.graph-title h2 {
  margin: 0;
  font-size: 1.8125rem;
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--text);
}
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(104px, 1fr));
  gap: 9px;
  flex: 1;
  max-width: 660px;
}
.stat-strip .card {
  padding: 11px 13px 10px;
  background: rgba(31, 38, 47, 0.66);
  border: 1px solid var(--line);
  box-shadow: none;
}
.stat-strip .card::before {
  background: linear-gradient(180deg, #e08a52, #a84c2b);
}
.stat-strip .card-label {
  font-size: 0.625rem;
  white-space: nowrap;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.stat-strip .card b {
  margin: 3px 0 1px;
  font-size: 1.4375rem;
  font-variant-numeric: tabular-nums;
}
.stat-strip .card-meta {
  font-size: 0.65625rem;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.graph-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  height: min(70vh, 740px);
  height: min(70dvh, 740px);
  min-height: 500px;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(900px 420px at 50% -6%, rgba(255, 255, 255, 0.04), transparent 62%),
    linear-gradient(180deg, #1c1712, #16120e);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.graph-toolbar {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
  background: rgba(24, 30, 39, 0.74);
  backdrop-filter: blur(14px);
  flex-wrap: wrap;
}
.graph-toolbar .grow {
  flex: 1;
}
.graph-search {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0;
}
.graph-search svg {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--muted);
  pointer-events: none;
}
.graph-search input {
  width: 208px;
  min-block-size: 1.875rem;
  margin: 0;
  padding: 0 10px 0 30px;
  font-size: 0.78125rem;
  background: #1a212a;
  border-color: var(--line);
}
.src-filter {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.src-filter button {
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  border-color: var(--line-2);
  background: transparent;
  color: var(--muted);
  font-size: 0.71875rem;
}
.src-filter .src-logo {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  object-fit: contain;
  background: #f7f2e9;
  padding: 1px;
}
.src-filter button:hover {
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.04);
}
.src-filter button.on {
  background: rgba(217, 120, 69, 0.14);
  border-color: rgba(217, 120, 69, 0.44);
  color: #f0b68e;
}
.zoom-group {
  display: flex;
  gap: 4px;
}
.graph-body {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
}
.graph-canvas-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
#graphCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
#graphCanvas.dragging {
  cursor: grabbing;
}
.graph-crumb {
  position: absolute;
  left: 13px;
  top: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 26px);
  min-block-size: 2rem;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(24, 30, 39, 0.85);
  backdrop-filter: blur(12px);
  font-size: 0.71875rem;
  line-height: 1.875rem;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
}
.graph-crumb.hide {
  display: none;
}
.graph-crumb button {
  border: 0;
  padding: 0;
  background: none;
  color: var(--muted);
  font: 500 0.71875rem var(--font);
  cursor: pointer;
  white-space: nowrap;
}
.graph-crumb button:hover {
  color: var(--text);
}
.graph-crumb button:active {
  transform: scale(0.96);
}
.graph-crumb button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}
.graph-crumb span {
  color: var(--muted-2);
}
.graph-crumb b {
  min-width: 0;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.graph-crumb i {
  font-style: normal;
  color: var(--muted-2);
  white-space: nowrap;
}

.graph-legend {
  position: absolute;
  left: 13px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(24, 30, 39, 0.78);
  backdrop-filter: blur(10px);
  font-size: 0.65625rem;
  color: var(--muted);
  pointer-events: none;
  flex-wrap: wrap;
}
.graph-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.lg {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.lg-src {
  background: #d97845;
}
.lg-hot {
  background: #9b8b78;
}
.lg-ready {
  background: #74a58a;
}
.lg-art {
  background: #a3937f;
}
.lg-fusion {
  background: #e08a52;
}
.graph-hint {
  position: absolute;
  right: 13px;
  bottom: 12px;
  z-index: 2;
  font-size: 0.65625rem;
  color: var(--muted-2);
  pointer-events: none;
}
.graph-tip {
  position: absolute;
  z-index: 7;
  max-width: 280px;
  padding: 6px 9px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: rgba(31, 38, 47, 0.96);
  color: var(--text-2);
  font-size: 0.71875rem;
  line-height: 1.5;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.graph-tip b {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 2px;
}
.graph-detail {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 8;
  width: min(356px, calc(100% - 24px));
  overflow: auto;
  padding: 18px 18px 20px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: rgba(31, 38, 47, 0.93);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
}
.graph-detail.hide {
  display: none;
}
@keyframes slidein {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.graph-detail .g-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 0.65625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.graph-detail .g-kicker .kicker-logo {
  width: 15px;
  height: 15px;
  border-radius: 3px;
  object-fit: contain;
  background: #f7f2e9;
  padding: 1px;
}
.graph-detail h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.45;
}
.graph-detail p {
  margin: 0 0 8px;
  font-size: 0.78125rem;
  color: var(--muted);
  word-break: break-word;
}
.graph-detail .g-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.graph-detail .g-section {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.graph-detail .g-section h4 {
  margin: 0 0 8px;
}
.graph-detail .g-pre {
  max-height: 260px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #1a212a;
  font: 0.71875rem/1.7 var(--mono);
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}
.graph-detail .drawer-close {
  top: 10px;
  right: 10px;
}
.graph-ctx {
  position: absolute;
  z-index: 9;
  min-width: 174px;
  padding: 5px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: rgba(28, 35, 44, 0.98);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
}
.graph-ctx button {
  display: flex;
  width: 100%;
  min-block-size: 1.875rem;
  justify-content: flex-start;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-2);
  font-size: 0.78125rem;
}
.graph-ctx button:hover {
  background: rgba(217, 120, 69, 0.14);
  color: var(--text);
}
.graph-ctx hr {
  margin: 4px 3px;
  border: 0;
  border-top: 1px solid var(--line);
}
.graph-empty {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78125rem;
  pointer-events: none;
}
.graph-empty.hide {
  display: none;
}
.graph-empty strong {
  font-size: 0.9375rem;
  color: var(--text-2);
}

.overview-data {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(31, 38, 47, 0.55);
  overflow: hidden;
}
.overview-data > summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 15px 18px;
  cursor: pointer;
  font-size: 0.84375rem;
  font-weight: 600;
  color: var(--text-2);
  list-style: none;
  user-select: none;
}
.overview-data > summary::-webkit-details-marker {
  display: none;
}
.overview-data > summary::before {
  content: "▸";
  color: var(--muted);
  font-size: 0.6875rem;
  transition: transform 0.15s;
}
.overview-data[open] > summary::before {
  transform: rotate(90deg);
}
.overview-data > summary span {
  font-size: 0.71875rem;
  font-weight: 400;
  color: var(--muted);
}
.data-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  padding: 0 18px 18px;
  border-top: 1px solid var(--line);
}
.data-grid .block {
  margin-top: 18px;
}

@media (max-width: 1180px) {
  .graph-toolbar {
    gap: 6px;
  }
  .graph-search input {
    width: 160px;
  }
  .src-filter button {
    padding: 0 7px;
  }
  .stat-strip {
    max-width: none;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .stat-strip .card-meta {
    display: none;
  }
  .graph-head {
    align-items: flex-start;
  }
}
@media (max-width: 980px) {
  .graph-shell {
    height: 68vh;
    height: 68dvh;
    min-height: 430px;
  }
  .graph-title h2 {
    font-size: 1.5rem;
  }
  .data-grid {
    grid-template-columns: 1fr;
  }
  .graph-hint {
    display: none;
  }
}
@media (max-width: 720px) {
  .stat-strip {
    flex: 1 0 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .stat-strip .card {
    padding: 9px 9px 8px;
  }
  .stat-strip .card-label {
    font-size: 0.5625rem;
    letter-spacing: 0.04em;
  }
  .stat-strip .card b {
    font-size: 1.1875rem;
  }
  .stat-strip .card-meta {
    display: none;
  }
  .graph-search input {
    width: 150px;
  }
  .graph-detail {
    position: fixed;
    inset: 12px;
    width: auto;
    border: 1px solid var(--line-2);
    border-radius: 14px;
    background: rgba(31, 38, 47, 0.97);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  }
  .graph-legend {
    gap: 8px;
    font-size: 0.59375rem;
  }
}

.theme-toggle {
  margin-left: auto;
  width: 30px;
  min-block-size: 1.875rem;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.theme-toggle:hover {
  color: var(--text);
  border-color: var(--line-2);
}
.theme-toggle svg {
  width: 15px;
  height: 15px;
}
.theme-toggle .icon-moon {
  display: none;
}
:root:not([data-theme="dark"]) .theme-toggle .icon-sun {
  display: none;
}
:root:not([data-theme="dark"]) .theme-toggle .icon-moon {
  display: block;
}

:root:not([data-theme="dark"]) {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --accent: #0f172a;
  --accent-2: #1e293b;
  --accent-weak: rgba(15, 23, 42, 0.12);
  --violet: #2563eb;
  --indigo: #1d4ed8;
  --ok: #2e7d5b;
  --ok-bg: rgba(46, 125, 91, 0.12);
  --warn: #8a6a1f;
  --warn-bg: rgba(138, 106, 31, 0.12);
  --bad: #b0473a;
  --bad-bg: rgba(176, 71, 58, 0.1);
  --info: #4a6f9e;
  --info-bg: rgba(74, 111, 158, 0.12);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.7), 0 10px 28px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.16);
}
:root:not([data-theme="dark"]) body {
  background:
    radial-gradient(900px 520px at 8% -10%, rgba(15, 23, 42, 0.09), transparent 60%),
    radial-gradient(820px 500px at 100% 0%, rgba(79, 111, 216, 0.07), transparent 55%),
    var(--bg);
}
:root:not([data-theme="dark"]) ::selection {
  background: rgba(15, 23, 42, 0.22);
  color: var(--text);
}
:root:not([data-theme="dark"]) .side {
  background: rgba(255, 255, 255, 0.9);
}
:root:not([data-theme="dark"]) .toast {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
}
:root:not([data-theme="dark"]) thead th {
  background: rgba(15, 23, 42, 0.025);
}
:root:not([data-theme="dark"]) tbody td {
  border-bottom-color: rgba(15, 23, 42, 0.07);
}
:root:not([data-theme="dark"]) tbody tr:hover {
  background: rgba(15, 23, 42, 0.03);
}
:root:not([data-theme="dark"]) .empty {
  background: rgba(15, 23, 42, 0.02);
}
:root:not([data-theme="dark"]) .chart-plot {
  background-image: repeating-linear-gradient(to top, rgba(15, 23, 42, 0.07) 0 1px, transparent 1px 31px);
}
:root:not([data-theme="dark"]) .bar.callout,
:root:not([data-theme="dark"]) .keybox {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.07), rgba(255, 253, 249, 0.78));
}
:root:not([data-theme="dark"]) .code,
:root:not([data-theme="dark"]) .graph-detail .g-pre,
:root:not([data-theme="dark"]) .keyline code,
:root:not([data-theme="dark"]) .graph-search input {
  background: #f8fafc;
}
:root:not([data-theme="dark"]) .stat-strip .card {
  background: rgba(255, 253, 249, 0.78);
}
:root:not([data-theme="dark"]) .overview-data {
  background: rgba(255, 253, 249, 0.66);
}
:root:not([data-theme="dark"]) .graph-shell {
  background:
    radial-gradient(900px 420px at 50% -6%, rgba(255, 255, 255, 0.85), transparent 62%),
    linear-gradient(180deg, #fdfaf4, #f6f1e7);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
:root:not([data-theme="dark"]) .graph-toolbar {
  background: rgba(255, 255, 255, 0.82);
}
:root:not([data-theme="dark"]) .src-filter button:hover {
  background: rgba(15, 23, 42, 0.05);
}
:root:not([data-theme="dark"]) .src-filter button.on {
  background: rgba(79, 70, 229, 0.12);
  border-color: rgba(79, 70, 229, 0.42);
  color: #4338ca;
}
:root:not([data-theme="dark"]) .graph-crumb {
  background: rgba(255, 253, 249, 0.9);
}
:root:not([data-theme="dark"]) .graph-legend {
  background: rgba(255, 253, 249, 0.82);
}
:root:not([data-theme="dark"]) .graph-tip {
  background: rgba(255, 253, 249, 0.97);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}
:root:not([data-theme="dark"]) .graph-detail {
  background: rgba(255, 253, 249, 0.96);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
}
:root:not([data-theme="dark"]) .graph-ctx {
  background: rgba(255, 253, 249, 0.98);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
}

/* ---------- 百智云运营工作台嵌入适配 ---------- */

/* 嵌入壳层时，导航由工作台承担，产品内只保留功能入口与品牌图标 */
html.baizhi-embed .brand-text,
html.baizhi-embed .brand .tag,
html.baizhi-embed .side-meta {
  display: none;
}
html.baizhi-embed .brand {
  justify-content: center;
  padding-inline: 0;
}
html.baizhi-embed .side-foot {
  justify-content: center;
}
html.baizhi-embed .side-foot .status {
  font-size: 0.75rem;
}

/* 原生 <dialog> 门禁：遮罩交给 ::backdrop，卡片仍在视口内居中 */
dialog.baizhi-gate {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 24px;
  border: 0;
  background: transparent;
  color: inherit;
  overflow: auto;
}
/* 只在打开时声明 display，避免覆盖 <dialog> 关闭态的 display: none */
dialog.baizhi-gate[open] {
  display: grid;
  place-items: center;
}
dialog.baizhi-gate::backdrop {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(6px);
}
.baizhi-gate-card {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.baizhi-gate-card strong {
  display: block;
  font-size: 1rem;
  color: var(--text);
}
.baizhi-gate-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.7;
}
.baizhi-gate-card .baizhi-gate-hint {
  color: var(--bad);
  font-size: 0.75rem;
}
.baizhi-gate-actions {
  margin-top: 20px;
}
.baizhi-gate-actions button {
  padding: 8px 18px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: var(--accent-weak);
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.baizhi-gate-actions button:hover {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}

/* ============================================================
   统一设计语言（与 baizhi-ops 壳层、KOL Scout 对齐）
   浅色 slate 底 + 白卡片；主操作深墨色按钮；品牌强调靛蓝；链接蓝。
   ============================================================ */

:root:not([data-theme="dark"]) {
  color-scheme: light;
  --control-accent: #0f172a;
  --scrollbar-thumb: #64748b;
  --scrollbar-track: #e2e8f0;
  --focus-ring: #2563eb;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --accent: #0f172a;
  --accent-2: #1e293b;
  --accent-weak: #f1f5f9;
  --violet: #2563eb;
  --indigo: #2563eb;
  --ok: #047857;
  --ok-bg: #ecfdf5;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --bad: #b91c1c;
  --bad-bg: #fef2f2;
  --info: #1d4ed8;
  --info-bg: #eff6ff;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 20px 50px -24px rgba(15, 23, 42, 0.24);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --control-accent: #93b4ff;
  --scrollbar-thumb: #8b96a5;
  --scrollbar-track: #1c232d;
  --focus-ring: #93b4ff;
  --bg: #020617;
  --surface: #0f172a;
  --surface-2: #1e293b;
  --line: #1e293b;
  --line-2: #334155;
  --text: #e2e8f0;
  --text-2: #cbd5e1;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --accent: #f1f5f9;
  --accent-2: #e2e8f0;
  --accent-weak: #1e293b;
  --violet: #60a5fa;
  --indigo: #60a5fa;
  --ok: #34d399;
  --ok-bg: rgba(52, 211, 153, 0.12);
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.12);
  --bad: #f87171;
  --bad-bg: rgba(248, 113, 113, 0.12);
  --info: #93c5fd;
  --info-bg: rgba(147, 197, 253, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
}

/* 去掉暖色光晕，统一成干净的浅色画布 */
:root:not([data-theme="dark"]) body {
  background: var(--bg);
}
:root[data-theme="dark"] body {
  background: var(--bg);
}

/* 侧栏与导航：白底 + 靛蓝高亮 */
:root:not([data-theme="dark"]) .side {
  background: #ffffff;
  border-right: 1px solid var(--line);
}
:root:not([data-theme="dark"]) nav button.on,
:root:not([data-theme="dark"]) nav button[aria-current="page"] {
  background: #eef2ff;
  color: #4338ca;
}
:root:not([data-theme="dark"]) nav button.on::before,
:root:not([data-theme="dark"]) nav button[aria-current="page"]::before {
  background: #6366f1;
}
:root:not([data-theme="dark"]) nav button:hover {
  background: #f8fafc;
  color: #0f172a;
}

/* 卡片与按钮 */
:root:not([data-theme="dark"]) .card,
:root:not([data-theme="dark"]) .panel,
:root:not([data-theme="dark"]) .graph-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
:root:not([data-theme="dark"]) button {
  border-radius: 10px;
  border-color: var(--line-2);
  background: #ffffff;
  color: var(--text-2);
}
:root:not([data-theme="dark"]) button:hover {
  background: #f8fafc;
  color: #0f172a;
}
:root:not([data-theme="dark"]) button.primary {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.16);
}
:root:not([data-theme="dark"]) button.primary:hover {
  background: #1e293b;
  border-color: #1e293b;
  color: #ffffff;
}
:root:not([data-theme="dark"]) button.tiny.accent {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}
:root:not([data-theme="dark"]) input,
:root:not([data-theme="dark"]) select,
:root:not([data-theme="dark"]) textarea {
  border-radius: 10px;
  border-color: var(--line-2);
  background: #ffffff;
}
:root:not([data-theme="dark"]) input[type="checkbox"] {
  accent-color: #0f172a;
}
:root:not([data-theme="dark"]) thead th {
  background: #f8fafc;
  color: #64748b;
}
:root:not([data-theme="dark"]) tbody td {
  border-bottom-color: #f1f5f9;
}
:root:not([data-theme="dark"]) tbody tr:hover {
  background: #f8fafc;
}
:root:not([data-theme="dark"]) ::selection {
  background: #dbeafe;
  color: #0f172a;
}

/* 标题层级对齐 KOL */
:root:not([data-theme="dark"]) h1,
:root:not([data-theme="dark"]) .page-title {
  letter-spacing: -0.025em;
  font-weight: 750;
}


/* ============================================================
   现代 Web 平台能力（按 modern-web-guidance 指南增量加固）
   ============================================================ */

/* 视觉隐藏但保留给读屏（skip link、控件标签、表格 caption 用） */
.sr-only:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  inline-size: 1px !important;
  block-size: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* 跳到主内容：键盘聚焦时才出现，避免挤占首屏 */
.skip-link {
  position: fixed;
  inset-block-start: 0.75rem;
  inset-inline-start: 0.75rem;
  z-index: 100;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transform: translateY(-200%);
  transition: transform 0.15s ease-out;
}
.skip-link:focus-visible {
  transform: none;
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* 焦点指示统一走 outline，避免 outline: none 后只剩 box-shadow（强制配色下会丢失） */
:where(a, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
@media (forced-colors: active) {
  :focus-visible {
    outline: 2px solid Highlight;
  }
}

/* 标题均衡换行、正文避免孤行（不作用于 *，避免性能开销） */
h1,
h2,
h3 {
  text-wrap: balance;
}
p,
li,
blockquote,
.lede,
.hint,
.table-foot {
  text-wrap: pretty;
}

/* 滚动条：标准 scrollbar-color/width，WebKit 旧内核用伪元素回退 */
:where(.side, .table-wrap, .code, .content-preview, .article-body, .editor, .graph-detail) {
  /* 明确用 scrollbar-width 替代 WebKit 伪元素；保持 auto，thumb 小于可达尺寸会伤可用性 */
  scrollbar-width: auto;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
@supports not (scrollbar-color: auto) {
  :where(.side, .table-wrap, .code, .content-preview, .article-body, .editor, .graph-detail)::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  :where(.side, .table-wrap, .code, .content-preview, .article-body, .editor, .graph-detail)::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: var(--scrollbar-thumb);
  }
  :where(.side, .table-wrap, .code, .content-preview, .article-body, .editor, .graph-detail)::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
  }
}

/* 卡片栅格：按容器宽度（而非仅视口）自适应 */
.overview-view {
  container-type: inline-size;
}
@container (width < 900px) {
  .stat-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }
}
@container (width < 480px) {
  .stat-strip {
    /* 窄屏仍两列，指标之后的核心图表更早进入首屏 */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .stat-strip .card {
    padding: 10px;
  }
  .stat-strip .card b {
    font-size: 1.375rem;
  }
  .stat-strip .card-meta {
    display: none;
  }
}

/* 动效只在用户没有要求减少动态效果时开启；静态状态下内容仍处于最终可见态 */
@media (prefers-reduced-motion: no-preference) {
  .status.ok .dot,
  .pill-live .dot {
    animation: pulse 2.4s ease-in-out infinite;
  }
  .drawer {
    animation: rise 0.22s ease-out;
  }
  .toast {
    animation: rise 0.2s ease-out;
  }
  .graph-detail {
    animation: slidein 0.18s ease-out;
  }
  body.busy::after {
    animation: scan 1.1s linear infinite;
  }
}
@media (prefers-reduced-motion: reduce) {
  .skip-link {
    transition: none;
  }
  button:active,
  .graph-crumb button:active {
    transform: none;
  }
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
}
a.srctag {
  text-decoration: none;
}
a.srctag:hover {
  border-color: var(--accent);
  color: var(--text);
}
.srctag .ext {
  font-size: 10px;
  color: var(--muted);
  margin-left: 2px;
}
body.modal-open {
  overflow: hidden;
}
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(14, 11, 8, 0.64);
  backdrop-filter: blur(7px);
  animation: fade 0.16s ease-out;
}
.modal-card {
  position: relative;
  width: min(880px, 100%);
  max-height: min(88vh, 940px);
  overflow: auto;
  padding: 26px 28px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  animation: rise 0.2s ease-out;
}
.modal-card .drawer-close {
  top: 16px;
  right: 16px;
}
.modal-head h3 {
  margin: 6px 0 10px;
  padding-right: 40px;
  font-size: 22px;
  line-height: 1.35;
  letter-spacing: -0.02em;
}
.modal-chips {
  gap: 8px;
  flex-wrap: wrap;
}
.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 12.5px;
}
.source-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin: 12px 0;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}
.source-box strong {
  font-size: 13.5px;
  font-weight: 600;
}
.source-kicker {
  margin: 0 0 3px;
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.quality-box {
  margin: 12px 0;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.08);
}
:root[data-theme="light"] .quality-box {
  background: rgba(74, 58, 38, 0.035);
}
.quality-box summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-2);
}
.quality-box ul {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}
.quality-box li.ok {
  color: var(--ok);
}
.quality-box li.bad {
  color: var(--bad);
}
.modal-card .article-body {
  max-height: none;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.doc-callout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(217, 120, 69, 0.28);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(217, 120, 69, 0.09), transparent);
}
.doc-callout strong {
  font-size: 14px;
}
.doc-callout p {
  margin: 4px 0 0;
}
.doc-link {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 12.5px;
  white-space: nowrap;
}
.doc-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.profile-summary {
  display: grid;
  gap: 16px;
}
.profile-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
}
.profile-title {
  display: flex;
  align-items: center;
  gap: 14px;
}
.profile-title h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.profile-title p {
  margin: 2px 0 0;
}
.spec-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.spec-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.spec-card span {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.spec-card strong {
  font-size: 20px;
  letter-spacing: -0.02em;
}
.spec-card small {
  font-size: 11px;
  color: var(--muted-2);
}
.profile-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.profile-cols .panel {
  padding: 16px 18px;
}
.profile-cols h4 {
  margin: 0;
}
.spec-list {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.9;
}
.spec-list li::marker {
  color: var(--accent);
  font-weight: 650;
}
.spec-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}
.spec-inline strong {
  color: var(--text);
}
.chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.chip.bad {
  color: var(--bad);
  border-color: var(--bad-bg);
  background: var(--bad-bg);
}
.advanced {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}
.advanced summary {
  cursor: pointer;
  padding: 12px 16px;
  font-size: 12.5px;
  color: var(--muted);
}
.advanced summary:hover {
  color: var(--text);
}
.advanced .editor {
  min-height: 320px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}
@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (max-width: 980px) {
  .spec-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-cols {
    grid-template-columns: 1fr;
  }
  .doc-callout,
  .source-box {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (max-width: 640px) {
  .modal-mask {
    padding: 10px;
  }
  .modal-card {
    padding: 20px 16px 16px;
    border-radius: 14px;
    max-height: 94vh;
  }
  .modal-head h3 {
    font-size: 18px;
  }
  .spec-grid {
    grid-template-columns: 1fr;
  }
}

.api-test {
  margin-bottom: 16px;
}
.api-test .code {
  margin: 0;
  min-height: 86px;
  white-space: pre-wrap;
}


/* Source coverage, cover cards and expanded graph sources */
.srctag .tag-fallback,
.src-initial {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 5px;
  background: var(--accent-weak);
  color: var(--accent-2);
  font: 700 9px/1 var(--font);
  letter-spacing: 0;
}
.srctag .tag-fallback {
  width: 15px;
  height: 15px;
  font-size: 8px;
}
.src-filter {
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: min(62vw, 820px);
  padding: 2px 1px 5px;
  scrollbar-width: thin;
}
.src-filter button {
  flex: 0 0 auto;
  white-space: nowrap;
}
.src-count {
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font: 600 9.5px/1.5 var(--mono);
}
.src-filter button.on .src-count {
  background: rgba(240, 160, 128, 0.18);
  color: var(--accent-2);
}
.source-board {
  margin-top: 14px;
  padding: 15px 16px 14px;
}
.source-coverage {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 8px;
  max-height: 214px;
  overflow: auto;
  padding: 2px 2px 4px;
  scrollbar-width: thin;
}
.source-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 8px 10px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  transition: transform 0.14s, border-color 0.14s, background 0.14s;
}
.source-pill:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: var(--surface-3);
}
.source-pill-logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--accent-2);
  font: 700 11px/1 var(--font);
  overflow: hidden;
}
.source-pill-logo img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}
.source-pill-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.source-pill-text strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source-pill-text small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
  padding: 16px;
}
.article-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-2);
  transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
}
.article-card:hover {
  transform: translateY(-2px);
  border-color: rgba(240, 160, 128, 0.48);
  box-shadow: 0 12px 26px rgba(15, 10, 7, 0.22);
}
.article-cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    radial-gradient(280px 160px at 76% 8%, rgba(241, 200, 118, 0.24), transparent 66%),
    linear-gradient(145deg, var(--surface-3), var(--surface));
  color: var(--accent-2);
  text-decoration: none;
}
.article-card:nth-child(3n + 2) .article-cover {
  background:
    radial-gradient(280px 160px at 22% 0%, rgba(183, 166, 214, 0.24), transparent 66%),
    linear-gradient(145deg, var(--surface-3), var(--surface));
}
.article-card:nth-child(3n) .article-cover {
  background:
    radial-gradient(280px 160px at 70% 100%, rgba(169, 189, 130, 0.22), transparent 66%),
    linear-gradient(145deg, var(--surface-3), var(--surface));
}
.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.article-card:hover .article-cover img {
  transform: scale(1.035);
}
.article-cover-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 700 38px/1 var(--font);
  letter-spacing: 0.04em;
  opacity: 0.6;
}
.article-cover-info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 16px 16px;
}
.article-cover-info b {
  font: 700 17px/1.45 var(--font);
  color: var(--ink);
  letter-spacing: 0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-cover-info span {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.article-cover-info em {
  font: 500 10px/1 var(--font);
  font-style: normal;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(23, 18, 14, 0.5);
  color: var(--accent-2);
  backdrop-filter: blur(4px);
}
.article-hero-info {
  padding: 22px 20px;
  background:
    radial-gradient(320px 180px at 80% 10%, rgba(241, 200, 118, 0.2), transparent 66%),
    linear-gradient(145deg, var(--surface-3), var(--surface));
}
.article-hero-info .article-cover-info {
  position: static;
  padding: 0;
}
.article-hero-info .article-cover-info b {
  font-size: 22px;
  -webkit-line-clamp: 2;
}
.article-cover-chip {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 1;
}
.article-cover-chip .chip {
  background: rgba(23, 18, 14, 0.78);
  backdrop-filter: blur(4px);
}
.article-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 12px 13px 13px;
}
.article-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.article-card-body h4 {
  margin: 0;
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.45;
  letter-spacing: -0.01em;
}
.article-card-body h4 a {
  color: inherit;
  text-decoration: none;
}
.article-card-body h4 a:hover {
  color: var(--accent-2);
}
.article-card-summary {
  display: -webkit-box;
  min-height: 36px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.article-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 11px;
}
.article-card-foot .grow {
  flex: 1;
}
.article-hero {
  margin: 0 0 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
}
.article-hero img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: cover;
}
.article-hero figcaption {
  padding: 7px 10px;
  color: var(--muted);
  font-size: 10.5px;
}
:root[data-theme="light"] .src-count,
:root[data-theme="light"] .source-pill {
  background: rgba(74, 58, 38, 0.04);
}
:root[data-theme="light"] .article-card:hover {
  box-shadow: 0 12px 26px rgba(74, 58, 38, 0.14);
}
@media (max-width: 760px) {
  .src-filter {
    max-width: 100%;
  }
  .article-grid {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .source-coverage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 260px;
  }
}

/* Article kind and freshness chips */
.chip.kind-hotspot {
  border-color: rgba(169, 189, 130, 0.38);
  background: rgba(169, 189, 130, 0.12);
  color: #b9cf91;
}
.chip.kind-product {
  border-color: rgba(240, 160, 128, 0.45);
  background: rgba(240, 160, 128, 0.14);
  color: #f0a080;
}
.chip.fresh {
  border-color: rgba(127, 183, 168, 0.42);
  background: rgba(127, 183, 168, 0.12);
  color: #8fc8ba;
}
.chip.stale {
  border-color: rgba(189, 165, 143, 0.34);
  background: rgba(189, 165, 143, 0.1);
  color: #bda58f;
}
:root[data-theme="light"] .chip.kind-hotspot {
  color: #5f7442;
}
:root[data-theme="light"] .chip.kind-product {
  color: #b56646;
}
:root[data-theme="light"] .chip.fresh {
  color: #568f80;
}
:root[data-theme="light"] .chip.stale {
  color: #8b6d58;
}
.stock-kinds {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0;
}

.check-row { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.check-row input[type="checkbox"] { width: auto; margin: 0; }
.tool-list { display: grid; gap: 6px; margin-top: 12px; max-height: 260px; overflow: auto; }
.tool-list .tool-row { display: flex; gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: 10px; background: color-mix(in srgb, currentColor 6%, transparent); }
.tool-list code { font-size: 0.78rem; white-space: nowrap; }
.tool-list span { font-size: 0.78rem; opacity: 0.72; line-height: 1.35; }

/* Settings connection overview */
.conn-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}
.conn-card {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), 0 4px 0 rgba(196, 146, 108, 0.09),
    0 12px 24px rgba(133, 88, 57, 0.07);
}
:root[data-theme="dark"] .conn-card {
  border-color: rgba(255, 241, 224, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 0 rgba(20, 13, 9, 0.2),
    0 12px 24px rgba(20, 13, 9, 0.22);
}
.conn-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--accent-2);
  font: 800 10px/1 var(--mono);
  overflow: hidden;
}
.conn-icon img {
  width: 25px;
  height: 25px;
  object-fit: contain;
}
.conn-icon-news {
  background: var(--ok-bg);
  color: var(--ok);
}
.conn-icon-cover {
  background: var(--warn-bg);
  color: var(--warn);
}
.conn-icon-queue {
  background: var(--info-bg);
  color: var(--info);
}
.conn-card small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.conn-card strong {
  display: block;
  margin: 1px 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.3;
}
.conn-card > div > span {
  display: block;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conn-card.ok .conn-icon {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 32%, transparent);
}
.conn-card.warn .conn-icon {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 34%, transparent);
}
.conn-card.bad .conn-icon {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 38%, transparent);
}
.conn-card.ok strong {
  color: var(--ok);
}
.conn-card.bad strong {
  color: var(--bad);
}

.connection-panel {
  min-width: 0;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 4px;
}
.panel-head-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.panel-logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.42);
  overflow: hidden;
}
.panel-logo img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}
.panel-logo-cover {
  background: var(--accent-weak);
  color: var(--accent-2);
  font: 800 10.5px/1 var(--mono);
}
.panel-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}
.state-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.state-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-2);
}
.state-pill.ok {
  border-color: color-mix(in srgb, var(--ok) 34%, var(--line));
  background: var(--ok-bg);
  color: var(--ok);
}
.state-pill.ok::before {
  background: var(--ok);
}
.state-pill.warn {
  border-color: color-mix(in srgb, var(--warn) 36%, var(--line));
  background: var(--warn-bg);
  color: var(--warn);
}
.state-pill.warn::before {
  background: var(--warn);
}
.state-pill.bad {
  border-color: color-mix(in srgb, var(--bad) 38%, var(--line));
  background: var(--bad-bg);
  color: var(--bad);
}
.state-pill.bad::before {
  background: var(--bad);
}
.muted-pill::before {
  background: var(--muted-2);
}
.form-note {
  margin: 8px 0 14px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}
.inline-state {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 2px;
}
.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.core-tools-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.core-tools-head strong {
  color: var(--text-2);
  font-size: 12.5px;
}
.core-tools-head span {
  color: var(--muted-2);
  font-size: 10.5px;
}
.core-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.core-tool {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}
.core-tool-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-bg);
}
.core-tool b {
  display: block;
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.35;
}
.core-tool code {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: var(--muted-2);
  font: 500 9.5px/1.35 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tool-drawer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.tool-drawer summary {
  color: var(--text-2);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.tool-drawer summary span {
  color: var(--muted-2);
  font-weight: 600;
}
.tool-drawer-bar {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.tool-drawer-bar input {
  flex: 1;
  height: 34px;
}
.tool-drawer-bar button {
  height: 34px;
}
.source-pill-logo {
  position: relative;
}
.source-pill-initials {
  color: var(--accent-2);
  font: 750 10.5px/1 var(--font);
}
.source-pill-logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 4px;
  border-radius: 8px;
  background: var(--surface);
  object-fit: contain;
}
@media (max-width: 1100px) {
  .conn-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .conn-strip {
    grid-template-columns: 1fr;
  }
  .core-tools {
    grid-template-columns: 1fr;
  }
}
.source-pill-state {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--surface-2);
  background: var(--muted-2);
}
.source-pill-state.ok {
  background: var(--ok);
}
.source-pill-state.warn {
  background: var(--warn);
}
.source-pill-state.bad {
  background: var(--bad);
}
.core-tool-dot.off {
  background: var(--muted-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--muted-2) 15%, transparent);
}
