/* ---------- view tabs（卡片 / 每周分析 切换）---------- */
.view-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 14px;
  background: var(--accent-tint);
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
}
.view-tab {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}
.view-tab:hover { background: rgba(217, 119, 87, 0.08); border-color: transparent; }
.view-tab.active { background: var(--panel); color: var(--accent); box-shadow: var(--shadow); }

/* 视图切换：分析视图与卡片视图互斥 */
#cards.hidden, #cardToolbar.hidden, #analysis.hidden { display: none; }

/* ---------- 每周分析视图 ---------- */
.wk-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.wk-toolbar .toolbar-count strong { font-family: var(--serif); font-size: 20px; }
.wk-gen { margin-left: auto; white-space: nowrap; }

.wk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}
.wk-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 14px 16px;
}
.wk-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.wk-sec-head strong { font-family: var(--serif); font-size: 15px; }
.wk-sec-head .muted { font-size: 11.5px; text-align: right; }
.wk-bars { display: grid; gap: 7px; }
.wk-empty { font-size: 12.5px; padding: 6px 0; }

.wk-bar-row { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(60px, 1fr) auto auto; align-items: center; gap: 9px; }
.wk-label { min-width: 0; font-size: 12.5px; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-etype { margin-left: 5px; color: var(--muted); font-size: 10.5px; }
.wk-srcs { margin-left: 5px; color: var(--follow); font-size: 10.5px; }
.wk-track { height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.wk-bar { display: block; height: 100%; min-width: 3px; border-radius: 999px; background: var(--accent); }
.wk-count { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--text-soft); min-width: 24px; text-align: right; }

.wk-nudge-group { display: inline-flex; gap: 4px; }
.wk-nudge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--muted);
  background: var(--panel);
  white-space: nowrap;
}
.wk-nudge.more:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }
.wk-nudge.less:hover { border-color: var(--hot); color: var(--hot); background: var(--hot-soft); }
.wk-nudge.done { border-color: transparent; background: #e3f1e8; color: #2f8a5b; cursor: default; }

/* 行业痛点 + 观点综述（生成本周分析的产物）*/
.wk-digest { margin-top: 20px; }
.wk-digest-empty { padding: 14px; border: 1px dashed var(--line); border-radius: var(--radius); }
.wk-summary {
  border-left: 3px solid var(--accent);
  padding: 6px 0 6px 12px;
  margin-bottom: 16px;
  color: var(--text-soft);
  font-size: 14px;
}
.wk-block { margin-bottom: 16px; }
.wk-block-title { font-family: var(--serif); font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.wk-pain, .wk-view {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  margin-bottom: 9px;
  background: var(--panel);
}
.wk-pain-head, .wk-view-head { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 5px; }
.wk-pain-head strong, .wk-view-head strong { font-size: 13.5px; }
.wk-pain-head .wk-nudge { margin-left: auto; }
.wk-pain .muted, .wk-view div { font-size: 12.5px; line-height: 1.55; }
.wk-vtag { font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 1px 7px; margin-right: 4px; }
.wk-vtag.c { background: #e3f1e8; color: #2f8a5b; }
.wk-vtag.d { background: var(--hot-soft); color: var(--hot); }

@media (max-width: 1040px) {
  body { grid-template-columns: 1fr; }
  body.detail-closed { grid-template-columns: 1fr; }
  .sidebar, .main { height: auto; min-height: auto; }
  body.detail-closed .detail { display: none; }
  body:not(.detail-closed) { overflow: hidden; }
  body:not(.detail-closed) .detail {
    position: fixed;
    inset: 0;
    z-index: 80;
    height: 100dvh;
    min-height: 100vh;
    width: 100vw;
    overflow: auto;
    border-left: 0;
    border-top: 0;
  }
}

/* ── 深度卡要点高亮 ──────────────────────────────────────────────── */
/* 列表项开头的短标签（能力：/支撑：/用法示例：/强｜…/依据：） */
.content .li-key {
  font-weight: 700;
  color: var(--accent);
}
/* 整段加粗的小标题（如「能力域 1：…」「强｜…」） */
.content p.lead-label {
  margin: 14px 0 6px;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
  line-height: 1.5;
}
.content p.lead-label strong { color: var(--text); font-weight: 700; }
/* 列表项里整条以加粗开头的（如「- **能力域 1 · …**」嵌套写法）也突出首段 */
.content li > strong:first-child { color: var(--text); }

/* ── 架构图：放大提示 + 全屏浮层 ─────────────────────────────────── */
.mermaid-block.mermaid-rendered { position: relative; cursor: zoom-in; }
.mermaid-zoom-hint {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 9px;
  font-size: 12px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: zoom-in;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.mermaid-block.mermaid-rendered:hover .mermaid-zoom-hint { opacity: 1; }

.diagram-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: rgba(20, 16, 12, 0.82);
  backdrop-filter: blur(2px);
}
.diagram-lightbox.hidden { display: none; }
.dlb-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 14px;
}
.dlb-toolbar button {
  min-width: 40px;
  height: 34px;
  padding: 0 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
}
.dlb-toolbar button:hover { background: var(--sidebar); }
.dlb-stage {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
}
.dlb-stage.grabbing { cursor: grabbing; }
.dlb-canvas {
  transform-origin: center center;
  will-change: transform;
}
.dlb-canvas svg {
  display: block;
  max-width: 92vw;
  max-height: 82vh;
  width: auto;
  height: auto;
  background: #fff;
  border-radius: 8px;
  padding: 12px;
}

/* ── GitHub star 增速排行榜（Claude 风：克制、留白、暖灰） ───────────────────── */
.lb {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.lb-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: none;
  padding: 11px 14px;
  cursor: pointer;
  text-align: left;
}
.lb-head:hover { background: var(--accent-tint); border-color: transparent; }
.lb-title {
  font-weight: 650;
  font-size: 13px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.lb-head-meta {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.lb-chevron {
  margin-left: auto;
  width: 14px;
  height: 14px;
  flex: none;
  border-right: 1.6px solid var(--muted);
  border-bottom: 1.6px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .2s ease;
  margin-top: -3px;
}
.lb.collapsed .lb-chevron { transform: rotate(-45deg); margin-top: 3px; }
.lb-panel {
  padding: 0 8px 8px;
  max-height: 60vh;
  overflow: auto;
}
.lb.collapsed .lb-panel { display: none; }

.lb-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 10px;
}
.lb-seg {
  display: inline-flex;
  background: var(--line-soft);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.lb-seg.hidden { display: none; }
.lb-seg-btn {
  border: 0;
  background: none;
  border-radius: 6px;
  padding: 4px 13px;
  font-size: 12px;
  font-weight: 550;
  color: var(--muted);
  min-width: 34px;
}
.lb-seg-btn:hover { color: var(--text-soft); border-color: transparent; }
.lb-seg-btn.active {
  background: var(--panel);
  color: var(--accent);
  box-shadow: var(--shadow);
}
.lb.estimating .lb-seg { opacity: .5; }
.lb.estimating .lb-seg-btn:not(.active) { color: var(--muted); }
.lb-ai {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.lb-ai input { width: auto; accent-color: var(--accent); }

.lb-note, .lb-empty {
  font-size: 11.5px;
  line-height: 1.5;
  padding: 0 6px 8px;
}
.lb-note b { color: var(--text-soft); font-weight: 650; }

.lb-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 8px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
}
.lb-row:hover { background: var(--accent-tint); }
.lb-row + .lb-row { box-shadow: inset 0 1px 0 var(--line-soft); }
.lb-rank {
  flex: none;
  width: 18px;
  padding-top: 2px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.lb-rank.top { color: var(--accent); font-weight: 700; }
.lb-rank.lb-dot { color: var(--line); }

/* 分层：估算档（历史不足）整体弱化，与实测拉开层次 */
.lb-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 6px 4px;
  font-size: 11px;
  color: var(--muted);
}
.lb-divider::before, .lb-divider::after { content: ""; height: 1px; flex: 1; background: var(--line-soft); }
.lb-divider span { white-space: nowrap; }
.lb-row.est:hover { background: var(--line-soft); }
.lb-row.est .lb-name { font-weight: 550; color: var(--text-soft); }
.lb-grow.est { color: var(--muted); font-weight: 600; font-size: 12px; }
.lb-main { min-width: 0; flex: 1; display: grid; gap: 1px; }
.lb-name {
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-fire { font-size: 11px; }
.lb-sub { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-pitch {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.35;
}
.lb-grow {
  flex: none;
  padding-top: 2px;
  font-weight: 700;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.lb-grow.up { color: var(--accent-hover); }
.lb-grow.down { color: var(--muted); }
