/* 项目手册（#/manual）外壳，以及「规格包」「缺口问答」两页顶部的入口卡。
 * 中性色（底、线、字）一律用工作台的 :root 变量；只有「已过期」的琥珀色是这里自己定的，深浅两套都过 3:1。
 * 手册正文在 sandbox iframe 里，外壳固定传 theme=light，所以 iframe 本身不跟着深色走。
 * 没有动画和过渡。 */

:root {
  --pd-amber: #9a6200;      /* 已过期、签字已失效：与工作台 --warn 同色 */
  --pd-amber-bg: #fff8e8;
  --pd-amber-line: #f0d9a8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --pd-amber: #e0a33a; --pd-amber-bg: #2d2412; --pd-amber-line: #6b5220;
  }
}
:root[data-theme="dark"] {
  --pd-amber: #e0a33a; --pd-amber-bg: #2d2412; --pd-amber-line: #6b5220;
}

/* ---------------- 整页 ---------------- */
.pd-root { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pd-head { display: flex; flex-direction: column; gap: 4px; }
.pd-eyebrow { font: 11px var(--mono); color: var(--faint); letter-spacing: .04em; }
.pd-lead { margin: 0; font-size: 13px; line-height: 1.7; color: var(--muted); max-width: 78ch; }
.pd-note { font-size: 12px; color: var(--faint); margin: 0; }
.pd-hint { font-size: 12px; color: var(--faint); margin: 0; }

/* 生成状态 */
.pd-status { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 13px;
  border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 10px 14px;
  background: var(--panel); color: var(--ink); }
.pd-status-warn { border-left-color: var(--pd-amber); }
.pd-phase { color: var(--muted); font-size: 12.5px; }

/* 过期提示：琥珀色，列出原因 */
.pd-stale { border: 1px solid var(--pd-amber-line); border-left: 4px solid var(--pd-amber); border-radius: 8px;
  background: var(--pd-amber-bg); padding: 10px 14px; color: var(--ink); font-size: 13px; }
.pd-stale b { color: var(--pd-amber); }
.pd-stale ul { margin: 6px 0 8px; padding-left: 20px; }
.pd-stale li { margin: 2px 0; }

/* 没生成过 */
.pd-empty { border: 1px dashed var(--line); border-radius: 8px; background: var(--panel); padding: 18px 20px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.pd-empty b { font-size: 15px; color: var(--ink); }
.pd-empty p { margin: 0; font-size: 13px; color: var(--muted); }

/* 工具条：生成 · 下载 · 新窗口 · 版本 */
.pd-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.pd-open { font-size: 12.5px; text-decoration: none; color: var(--accent); padding: 5px 4px; }
.pd-open:hover { text-decoration: underline; }
.pd-version { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.pd-version select { font-size: 12px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px;
  background: var(--panel); color: var(--ink); max-width: 260px; }
.pd-meta { margin: 0; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* 「还可以补的」去做按钮 */
.pd-todo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12px; }
.pd-todo-label { color: var(--muted); }
.pd-todo-link { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; text-decoration: none;
  color: var(--accent); background: var(--panel); }
.pd-todo-link:hover { border-color: var(--accent); }

/* 手册预览：高度固定，在框内滚动（沙箱里没有脚本，撑不高 iframe） */
.pd-frame-box { border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.pd-frame { display: block; width: 100%; height: calc(100vh - 250px); min-height: 480px; border: 0; background: #fff; }

/* ---------------- 入口卡（规格包、缺口问答顶部） ---------------- */
.pd-entry { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap;
  border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; background: var(--panel);
  padding: 10px 14px; margin: 0 0 14px; }
.pd-entry-stale { border-left-color: var(--pd-amber); }
.pd-entry-none { border-left-color: var(--line); }
.pd-entry-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.pd-entry-main b { font-size: 13.5px; color: var(--ink); }
.pd-entry-note { font-size: 12px; color: var(--muted); }
.pd-entry-go { font-size: 12.5px; text-decoration: none; color: var(--accent); white-space: nowrap; }
.pd-entry-go:hover { text-decoration: underline; }
.pd-chip { font-size: 11.5px; border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; color: var(--muted); background: var(--panel); }
.pd-chip-ok { color: var(--ok); border-color: currentColor; }
.pd-chip-stale { color: var(--pd-amber); border-color: currentColor; }
.pd-chip-none { color: var(--faint); }

@media (max-width: 700px) {
  .pd-frame { height: calc(100vh - 200px); min-height: 360px; }
  .pd-version select { max-width: 100%; }
  .pd-entry { padding: 9px 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .pd-root *, .pd-entry * { transition: none; animation: none; }
}
@media print {
  .pd-toolbar, .pd-todo, .pd-hint, .pd-entry { display: none; }
}
