/* ==========================================================================
   my-docs-site — ZGCM-1 系列文档（apps/zgcm1/）的站点统一主题
   --------------------------------------------------------------------------
   适用：apps/zgcm1/ 下三份手写自包含 HTML（论文解读 / 仓库梳理 / 数据处理
   全流程）。它们各自带一套「亮色优先」的设计系统（变量名一致：
   --fg --muted --bd --bg --code-bg --accent --accent2 --ok --bad --warn
   --th-bg --note-bg --note-bd ...），这里把它们映射到站点暗色令牌。

   注入方式：build.py 依据 site.config.json → appsOverrides 命中 `zgcm1/` 子树：
     - theme: "zgcm1-theme.css"  → 注入本表
     - favicon: true             → 注入站点 favicon
     - siteBar: true             → 注入站点顶栏（返回 + 标题 + 明暗开关）
                                   与主站共用 localStorage['theme']
   带 `<!--hw:own-header-->` 的页面（zgcm1-repo-data-process-flow.html 自带顶栏）
   不注入，保持原样。

   约定：暗色覆盖全部写在 [data-theme="dark"] 下，因此页面在亮色模式下仍是
   它原本的亮色设计；顶栏自身的两套配色同时给出。
   ========================================================================== */

/* ===== 站点顶栏（与主站同款：返回 / 标题 / 明暗开关） ===== */
.hw-topbar{
  position:sticky;top:0;z-index:60;display:flex;align-items:center;gap:.6rem;
  padding:.5rem 1rem;background:rgba(11,16,32,.9);backdrop-filter:blur(10px);
  border-bottom:1px solid #24304f;
}
[data-theme="light"] .hw-topbar{background:rgba(247,249,252,.92);border-bottom-color:#dde4f0}
.hw-back{
  display:inline-grid;place-items:center;width:2rem;height:2rem;flex:none;
  color:#5eead4;background:rgba(94,234,212,.12);border:1px solid #24304f;
  border-radius:.55rem;text-decoration:none;font-size:1rem;transition:.15s;
}
.hw-back:hover{border-color:#5eead4}
[data-theme="light"] .hw-back{color:#0d9488;background:rgba(13,148,136,.1);border-color:#dde4f0}
.hw-title{font-weight:700;font-size:.95rem;color:#5eead4;letter-spacing:.02em}
[data-theme="light"] .hw-title{color:#0d9488}
.hw-spacer{flex:1}
.hw-theme{
  width:2.25rem;height:2.25rem;flex:none;display:inline-grid;place-items:center;
  background:transparent;color:#93a0bd;border:1px solid #24304f;border-radius:.55rem;
  font-size:1.05rem;cursor:pointer;transition:.15s;
}
.hw-theme:hover{color:#dbe3f4;border-color:#5eead4;background:rgba(94,234,212,.12)}
[data-theme="light"] .hw-theme{color:#5a6780;border-color:#dde4f0}
[data-theme="light"] .hw-theme:hover{color:#1a2233;border-color:#0d9488;background:rgba(13,148,136,.1)}
/* 顶栏是 sticky 的：锚点跳转要留出高度，否则标题会被顶栏盖住 */
h2,h3,h4{scroll-margin-top:4rem}

/* ===== 暗色覆盖层（站点令牌 = static/style.css 的暗色值） ===== */
[data-theme="dark"]{
  --fg:#dbe3f4; --muted:#93a0bd; --bd:#24304f; --bg:#0b1020;
  --code-bg:#0a1122; --accent:#5eead4; --accent2:#7dd3fc;
  --ok:#4ade80; --bad:#f87171; --warn:#fbbf24;
  --th-bg:#121c38; --note-bg:rgba(251,191,36,.10); --note-bd:#8a6d1f;
  --paper-bg:rgba(125,211,252,.10); --paper-bd:#2b5876;
  --key-bg:rgba(74,222,128,.10); --key-bd:#2f6b45;
  --find-bg:rgba(125,211,252,.10); --find-bd:#2b5876;
  --fig-bg:#0f1730;
}

/* 统一页头：三份文档在暗色下共用站点青色的深色渐层 */
[data-theme="dark"] header{background:linear-gradient(135deg,#06222a 0%,#0a3a42 48%,#0d5c56 100%)}
[data-theme="dark"] h2{color:#7ff0dd}
[data-theme="dark"] h3{color:#5eead4}
[data-theme="dark"] h4{color:#9adbd0}
[data-theme="dark"] code{border-color:#24304f}
[data-theme="dark"] pre code{color:#dbe3f4}
[data-theme="dark"] tbody tr:nth-child(even){background:#0f1730}
[data-theme="dark"] nav.toc h2{color:#5eead4}
[data-theme="dark"] .mut{color:var(--muted)}

/* 提示块 */
[data-theme="dark"] .note strong{color:#fcd34d}
[data-theme="dark"] .paper strong{color:#7dd3fc}
[data-theme="dark"] .key strong{color:#86efac}
[data-theme="dark"] .insight{background:rgba(125,211,252,.10);border-color:#2b5876;border-left-color:var(--accent)}
[data-theme="dark"] .insight strong{color:#7dd3fc}

/* 标签胶囊 */
[data-theme="dark"] .kicker{background:rgba(125,211,252,.14);color:#7dd3fc;border-color:#2b5876}
[data-theme="dark"] .kicker.p{background:rgba(94,234,212,.12);color:#5eead4;border-color:#2f6b60}
[data-theme="dark"] .kicker.ok{background:rgba(74,222,128,.12);color:#4ade80;border-color:#2f6b45}
[data-theme="dark"] .kicker.warn{background:rgba(251,191,36,.12);color:#fbbf24;border-color:#8a6d1f}

/* 论文解读页：KPI 卡片 / findings / 流程条 / 图注 / 表格高亮 */
[data-theme="dark"] .kpi .card{background:linear-gradient(160deg,#121c38,#0f1730);border-color:#24304f}
[data-theme="dark"] .kpi .v{color:#5eead4}
[data-theme="dark"] .kpi .l{color:#93a0bd}
[data-theme="dark"] .finding{background:var(--find-bg);border-color:var(--find-bd)}
[data-theme="dark"] .finding .h{color:#7dd3fc}
[data-theme="dark"] .finding .h em{color:#93a0bd}
[data-theme="dark"] .flow .step{background:#0f1730;border-color:#24304f;border-top-color:#0d9488}
[data-theme="dark"] .flow .step b{color:#5eead4}
[data-theme="dark"] td.best{background:rgba(94,234,212,.16);color:#7ff0dd}
[data-theme="dark"] td.second{background:rgba(125,211,252,.08)}
[data-theme="dark"] figure{border-color:var(--bd)}
/* 论文原图自带白底：给它们留一圈白框，避免在暗色页上显得像破图 */
[data-theme="dark"] figure img{background:#fff;padding:.4rem;border-radius:6px}
[data-theme="dark"] figcaption b{color:#9adbd0}
[data-theme="dark"] .src{color:#6b7899}

/* 数据处理页：交互演示 / 位带示意 / 按钮 */
[data-theme="dark"] .chain{background:#042b30;color:#d9f2f0}
[data-theme="dark"] .demo{background:#0f1730}
[data-theme="dark"] .bandbox{background:#121c38}
[data-theme="dark"] .bandbox.hit{background:rgba(74,222,128,.14);border-color:#2f6b45}
[data-theme="dark"] .bandbox.miss{background:rgba(248,113,113,.14);border-color:#7f3b3b}
[data-theme="dark"] button{background:#121c38;color:#dbe3f4}
[data-theme="dark"] button:hover{background:#1a2745}
[data-theme="dark"] button.primary{background:#0d9488;border-color:#0d9488;color:#04201c}
[data-theme="dark"] button.primary:hover{background:#0fb3a5}