/* nb.css —— NewsBlur 风格层(2026-09-06 全站重设计第一期)。
   叠在 sd-ui-kit.css + app.css 之上:先用 token 覆盖把黑头酸绿等宽字的
   Signal Desk 换成白底细灰线蓝色当前态,再给壳(顶栏/左栏/列表行)新组件。
   分析类面板(.sd-dashboard/.sd-table/...)只吃 token 变化,结构暂不动 ——
   「先模仿再优化」,一期只换壳与快讯列表。 */

.sd {
  --sd-paper: #ffffff;
  --sd-surface: #ffffff;
  --sd-panel: #f6f7f9;
  --sd-console: #f6f7f9;
  --sd-ink: #22282e;
  --sd-muted: #69737e;
  --sd-line: #e3e7ec;
  --sd-line-strong: #cfd5db;
  --sd-acid: #dbe7fb;          /* 旧「酸绿」全部变成软蓝:当前态 / 高亮 */
  --sd-link: #2c66c9;
  --sd-ok: #2f8a4f;
  --sd-warn: #9a6a12;
  --sd-alert: #c2453a;
  --nb-accent: #2c66c9;
  --nb-side-w: 208px;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background: var(--sd-paper);
  color: var(--sd-ink);
}
.sd a { color: var(--sd-link); }

/* ---- 顶栏 ---- */
.nb-top {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px;
  height: 46px; padding: 0 16px; background: var(--sd-console);
  border-bottom: 1px solid var(--sd-line-strong);
}
.nb-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--sd-ink); text-decoration: none; font-size: 15px; }
.nb-brand b { font-weight: 800; letter-spacing: .01em; }
.nb-build { font: 500 10px ui-monospace, Menlo, monospace; color: var(--sd-muted); padding: 2px 5px; border: 1px solid var(--sd-line-strong); border-radius: 3px; }
.nb-build[hidden] { display: none; }
.nb-nav { display: flex; gap: 2px; }
.nb-nav button {
  padding: 6px 12px; border-radius: 4px; background: none; color: var(--sd-ink);
  cursor: pointer; font: 500 13px/1.2 var(--sd-sans);
}
.nb-nav button:hover { background: #e9edf2; }
.nb-nav button[aria-current="page"] { background: var(--nb-accent); color: #fff; font-weight: 700; }
.nb-nav button[hidden] { display: none; }
.nb-right { display: flex; align-items: center; gap: 12px; }
.nb-status { color: var(--sd-muted); font-size: 12px; white-space: nowrap; }
.sd-menu__btn { border: 1px solid var(--sd-line-strong); background: #fff; color: var(--sd-ink); border-radius: 4px; padding: 5px 10px; font: 500 12px var(--sd-sans); cursor: pointer; }
.sd-menu__btn:hover, .sd-menu__btn[aria-expanded="true"] { background: var(--sd-acid); color: var(--sd-ink); border-color: var(--sd-line-strong); }
.sd-menu__btn--in { border-color: var(--nb-accent); color: var(--nb-accent); }
.sd-menu__pop { border: 1px solid var(--sd-line-strong); border-radius: 4px; box-shadow: 0 6px 20px #0002; background: #fff; }
.sd-menu__group button, .sd-menu__group a { font: 500 12px var(--sd-sans); color: var(--sd-ink); }
.sd-menu__group button:hover, .sd-menu__group a:hover { background: var(--sd-acid); }

/* ---- 三栏壳:左栏 + 主区 ---- */
.nb-app { display: grid; grid-template-columns: var(--nb-side-w) minmax(0, 1fr); min-height: calc(100vh - 46px); }
.nb-side {
  position: sticky; top: 46px; align-self: start; max-height: calc(100vh - 46px); overflow-y: auto;
  padding: 12px 8px 24px; background: var(--sd-panel); border-right: 1px solid var(--sd-line);
}
.nb-side__group { margin: 12px 8px 4px; font: 600 10px/1 ui-monospace, Menlo, monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--sd-muted); }
.nb-side__group:first-child { margin-top: 2px; }
.nb-side__item {
  display: flex; align-items: center; gap: 7px; width: 100%; box-sizing: border-box;
  padding: 5px 8px; border-radius: 4px; background: none; color: var(--sd-ink);
  cursor: pointer; text-align: left; font: 400 13px/1.3 var(--sd-sans); text-decoration: none;
}
.nb-side__item:hover { background: #e9edf2; }
.nb-side__item.is-on { background: var(--sd-acid); color: var(--nb-accent); font-weight: 700; }
.nb-side__item i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.nb-side__item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-side__item em { font: 500 11px ui-monospace, Menlo, monospace; font-style: normal; color: var(--sd-muted); }
.nb-side__item.is-on em { color: var(--nb-accent); }
.nb-main { min-width: 0; padding: 0 0 60px; }
.nb-main > section { padding: 0 20px; }
body[data-tab="library"] .nb-main > section { padding: 0; }
body[data-tab="library"] .nb-app { grid-template-columns: 1fr; }
body[data-tab="library"] .nb-side { display: none; }

/* ---- 快讯工具条 + 列表 ---- */
.nb-toolbar { display: flex; align-items: center; gap: 12px; padding: 10px 0; position: sticky; top: 46px; z-index: 10; background: var(--sd-paper); border-bottom: 1px solid var(--sd-line); }
.nb-toolbar input[type="search"] {
  flex: 1; max-width: 420px; padding: 6px 10px; border: 1px solid var(--sd-line-strong); border-radius: 4px;
  background: #fff; font: 400 13px var(--sd-sans); color: var(--sd-ink);
}
.nb-toolbar input[type="search"]:focus { outline: 2px solid var(--sd-acid); border-color: var(--nb-accent); }
.nb-toolbar__count { margin-left: auto; color: var(--sd-muted); font: 500 12px var(--sd-sans); white-space: nowrap; }
#controls.sd-hide { display: none; }
.nb-list.sd-stream { margin-top: 0; border-top: 0; }
.nb-day { padding: 14px 0 4px 12px; font: 600 11px ui-monospace, Menlo, monospace; letter-spacing: .08em; color: var(--sd-muted); text-transform: uppercase; }

.nb-row {
  display: grid; grid-template-columns: 56px 4px 150px minmax(0, 1fr); gap: 0 12px; align-items: start;
  padding: 0 0 0 4px; border-bottom: 1px solid var(--sd-line);
}
.nb-row:hover { background: #fafbfc; }
.nb-row > * { padding-top: 8px; padding-bottom: 8px; }
/* 时间河(time river)在最左:时间列 + 一条连续的分类色轴,行行首尾相接;
   轴上的圆点是节点(2026-09-06 站长:「时间线还是要放左面」)。 */
.nb-time { order: -1; padding-top: 11px; }
.nb-rail { display: block; position: relative; width: 4px; align-self: stretch; padding: 0; opacity: .9; }
.nb-rail::after {
  content: ""; position: absolute; top: 12px; left: -3px; width: 10px; height: 10px; border-radius: 50%;
  background: #fff; border: 2px solid currentColor; box-sizing: border-box;
}
.nb-row--hot .nb-rail::after { background: currentColor; }
.nb-src { display: flex; align-items: center; gap: 6px; min-width: 0; padding-top: 2px; font-size: 12px; color: var(--sd-muted); }
.nb-src a, .nb-subsrc { color: var(--sd-muted); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-src a:hover { color: var(--nb-accent); }
.nb-ico { display: inline-grid; place-items: center; width: 16px; height: 16px; flex: none; border-radius: 3px; overflow: hidden; background: #e9edf2; font: 700 9px var(--sd-sans); color: var(--sd-muted); }
.nb-ico img { width: 16px; height: 16px; display: block; }
.nb-body { min-width: 0; }
.nb-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.sd a.nb-title { font-size: 15px; font-weight: 700; line-height: 1.4; color: var(--sd-ink); text-decoration: none; }
.nb-title:hover { text-decoration: underline; }
.sd .nb-row--must a.nb-title { color: #8f2a1e; }
.sd .nb-row--hidden a.nb-title { opacity: .5; text-decoration: line-through; }
.nb-excerpt { margin-top: 2px; color: var(--sd-muted); font-size: 12.5px; line-height: 1.45; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; color: var(--sd-muted); font-size: 11.5px; }
.nb-chip { border: 0; background: none; padding: 0; color: var(--sd-muted); cursor: pointer; font: 500 11.5px var(--sd-sans); }
.nb-chip:hover { color: var(--nb-accent); text-decoration: underline; }
.nb-first { color: var(--sd-ok); font-weight: 600; }
.nb-time { text-align: right; color: var(--sd-muted); font: 500 12px ui-monospace, Menlo, monospace; }
.nb-row--hot .nb-time { color: var(--nb-accent); }
.nb-row .sd-badge { font-size: 9px; padding: 2px 6px; }
.sd-badge--acid { background: var(--sd-acid); color: var(--nb-accent); }
.nb-dup { border: 1px solid var(--sd-line-strong); background: #fff; border-radius: 999px; padding: 1px 8px; cursor: pointer; font: 600 10.5px var(--sd-sans); color: var(--sd-muted); }
.nb-dup:hover { border-color: var(--nb-accent); color: var(--nb-accent); }
.nb-editbar { display: inline-flex; gap: 6px; margin-left: 4px; }
.sd-edit { padding: 2px 8px; border-radius: 3px; font: 600 11px var(--sd-sans); letter-spacing: 0; }

/* 同题展开:NewsBlur 的 related 样式,缩进小行 */
.nb-sub { background: var(--sd-panel); border-bottom: 1px solid var(--sd-line); }
.nb-subrow { display: grid; grid-template-columns: 56px 4px 150px minmax(0, 1fr); gap: 0 12px; align-items: center; padding: 0 0 0 4px; font-size: 12.5px; }
.nb-subrow > * { padding-top: 4px; padding-bottom: 4px; }
.nb-subtime { order: -1; padding-right: 0; }
.nb-subrow .nb-rail { background: var(--sd-line-strong); height: 100%; min-height: 22px; padding: 0; }
.nb-subrow .nb-rail::after { top: 9px; width: 8px; height: 8px; left: -2px; border-width: 2px; }
.nb-subrow--first .nb-rail { background: var(--sd-ok); }
.nb-subsrc { display: flex; align-items: center; gap: 6px; font-size: 11.5px; }
.sd .nb-subbody { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.nb-subbody a { flex: 0 1 auto; }
.sd .nb-subrow a { color: var(--sd-ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-subrow a:hover { text-decoration: underline; }
.nb-subtime { text-align: right; color: var(--sd-muted); font: 400 11px ui-monospace, Menlo, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-subrow--first .nb-subtime { color: var(--sd-ok); }

/* ---- 简报 ---- */
.nb-brief__head { display: flex; align-items: baseline; gap: 14px; padding: 18px 0 8px; border-bottom: 1px solid var(--sd-line); }
.nb-brief__head h2 { margin: 0; font-size: 18px; }
.nb-brief__head span { color: var(--sd-muted); font-size: 12.5px; }
.nb-brief { display: grid; }
.nb-brief__item { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--sd-line); }
.nb-brief__n { font: 600 18px ui-monospace, Menlo, monospace; color: var(--sd-line-strong); padding-top: 2px; }
.nb-brief__kicker { display: flex; gap: 8px; align-items: center; font-size: 11px; color: var(--sd-muted); text-transform: uppercase; letter-spacing: .06em; }
.sd a.nb-brief__title { display: block; margin: 3px 0 4px; font-size: 17px; font-weight: 700; line-height: 1.35; color: var(--sd-ink); text-decoration: none; }
.nb-brief__title:hover { text-decoration: underline; }
.nb-brief__meta { display: flex; gap: 10px; align-items: center; color: var(--sd-muted); font-size: 12px; }
.nb-brief__item .nb-sub { grid-column: 1 / -1; }
.nb-brief__counts { display: flex; flex-wrap: wrap; gap: 10px; padding: 18px 0; }
.nb-count { display: grid; gap: 2px; min-width: 96px; padding: 10px 12px; border: 1px solid var(--sd-line); border-radius: 4px; background: #fff; cursor: pointer; text-align: left; }
.nb-count b { font: 700 20px ui-monospace, Menlo, monospace; color: var(--sd-ink); }
.nb-count span { font-size: 11px; color: var(--sd-muted); }
.nb-count:hover { border-color: var(--nb-accent); }

/* ---- 原文库:嵌入静态页 ---- */
.nb-frame { display: block; width: 100%; height: calc(100vh - 46px); border: 0; background: #fff; }

/* ---- 分析 / 系统:沿用旧面板,只把标题条改成白底 ---- */
.sd-kicker { border-bottom: 1px solid var(--sd-line-strong); font: 700 13px/1.2 var(--sd-sans); letter-spacing: 0; padding: 20px 0 8px; margin: 10px 0 0; }
body[data-tab] .sd-kicker { margin-bottom: 12px; }
.sd-dashboard { border-color: var(--sd-line); background: #fff; }
.sd-dashboard__head { border-color: var(--sd-line); font: 700 12px var(--sd-sans); letter-spacing: 0; }
.sd-metric { border-color: var(--sd-line); }
.sd-metric strong { font-family: ui-monospace, Menlo, monospace; font-weight: 700; }
.sd-metric span { font: 500 11px var(--sd-sans); letter-spacing: 0; }
.sd-table th { font: 600 11px var(--sd-sans); letter-spacing: 0; text-transform: none; border-bottom-color: var(--sd-line-strong); }
.sd-genre-pill { border-color: var(--sd-line-strong); background: #fff; color: var(--sd-ink); }
.sd-genre-pill em { color: var(--sd-muted); }
.sd-genre-pill.is-on { background: var(--nb-accent); color: #fff; border-color: var(--nb-accent); }
.sd-genre-pill.is-on em { color: #fff; }
.sd-toc a:hover, .sd-genre-pill:hover { border-color: var(--nb-accent); }
.sd-gate { padding: 60px 0; text-align: center; }
.sd-primary { background: var(--nb-accent); color: #fff; border-radius: 4px; padding: 8px 16px; font: 600 13px var(--sd-sans); cursor: pointer; }
.sd-modal__box { border-radius: 6px; border-color: var(--sd-line-strong); }
.sd-modal__head { background: var(--sd-panel); color: var(--sd-ink); }
.sd-modal__x { color: var(--sd-ink); }

@media (max-width: 800px) {
  .nb-app { grid-template-columns: 1fr; }
  .nb-side { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 2px; padding: 8px; border-right: 0; border-bottom: 1px solid var(--sd-line); }
  .nb-side__group { width: 100%; margin: 6px 6px 2px; }
  .nb-side__item { width: auto; }
  .nb-row { grid-template-columns: 44px 4px minmax(0, 1fr); }
  .nb-src { grid-column: 3; order: 3; padding-top: 0; }
  .nb-subrow { grid-template-columns: 44px 4px minmax(0, 1fr); }
  .nb-subsrc { display: none; }
  .nb-top { gap: 10px; padding: 0 10px; }
  .nb-status { display: none; }
}
