/* 谜题全覆盖动画库 - Ink & Amber（与主页 style.css 同一套配色纪律：
   中性暖墨黑 + 单一琥珀强调色；圆角：卡片 10px / 按钮 8px / 标签胶囊） */
:root {
  color-scheme: dark;
  --bg: #0d0e11;
  --bg-soft: #121317;
  --card: #16181d;
  --card-2: #1c1e24;
  --line: #272a32;
  --text: #ecebe3;
  --muted: #99968a;
  --accent: #e2ac4a;        /* 唯一强调色 */
  --accent-deep: #a97e2f;   /* 同色系深一档 */
  --no-fg: #141008;         /* 序号徽章文字，随模式翻转保证对比度 */
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
}

/* 亮色模式：跟随系统偏好，仅换 token；画布保持深色（黑板井） */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f3f2ec;
    --bg-soft: #ebe9e1;
    --card: #fcfbf8;
    --card-2: #f1efe7;
    --line: #d8d4c7;
    --text: #26251f;
    --muted: #6f6b5e;
    --accent: #9c6f21;
    --accent-deep: #7c5a1e;
    --no-fg: #fdfcf8;
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  line-height: 1.6;
}

/* ---------- 顶部 ---------- */
.pz-top { padding: 28px 32px 18px; border-bottom: 1px solid var(--line); }
.pz-top h1 { font-size: 26px; margin: 6px 0 8px; font-weight: 800; letter-spacing: .02em; }
.pz-top .pz-sub { color: var(--muted); font-size: 14px; max-width: 65ch; }
.pz-top .pz-sub b { color: var(--accent); font-weight: 600; }
.pz-home {
  color: var(--muted); text-decoration: none;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .06em;
}
.pz-home:hover { color: var(--accent); }

/* ---------- 布局 ---------- */
.pz-layout { display: flex; align-items: flex-start; }
.pz-side {
  width: 230px; min-width: 230px;
  max-height: calc(100vh - 0px);
  position: sticky; top: 0;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  padding: 12px 0 40px;
  background: var(--bg-soft);
}
.pz-main { flex: 1; padding: 24px 28px 80px; min-width: 0; }

/* ---------- 侧栏目录 ---------- */
.pz-group {
  font-family: var(--mono);
  font-size: 11.5px; font-weight: 700; color: var(--accent);
  padding: 14px 16px 6px; letter-spacing: .12em;
}
.pz-link {
  display: block; padding: 3px 16px;
  font-size: 12.5px; color: var(--muted); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pz-link:hover { color: var(--text); background: rgba(226, 172, 74, 0.06); }

/* ---------- 卡片 ---------- */
.pz-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px 16px;
  margin-bottom: 26px;
  scroll-margin-top: 16px;
}
.pz-card header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.pz-card header .no {
  font-family: var(--mono);
  font-size: 12px; font-weight: 700; color: var(--no-fg);
  background: var(--accent); border-radius: 4px; padding: 1px 8px;
  flex-shrink: 0;
}
.pz-card header h3 { font-size: 18px; }
.pz-card header .strat {
  margin-left: auto; font-size: 12px; color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 10px; white-space: nowrap;
}
.pz-canvas-wrap {
  background: #101114;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.pz-canvas-wrap canvas { display: block; width: 100%; height: auto; }

/* ---------- 控制条 ---------- */
.pz-ctrl { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; flex-wrap: wrap; }
.pz-ctrl button {
  background: var(--card-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 4px 14px; font-size: 13px; cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.pz-ctrl button:hover { border-color: var(--accent); color: var(--accent); }
.pz-ctrl button:active { transform: translateY(1px); }
.pz-ctrl label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.pz-ctrl input[type="range"] { width: 110px; accent-color: var(--accent); }
.pz-status {
  margin-left: auto; font-size: 12.5px; color: var(--accent);
  font-family: var(--mono); max-width: 46%; text-align: right;
}

/* ---------- 三段解读：大白话 / 生活类比 / 工程案例 ----------
   同一琥珀色系内分深浅，不引入第二强调色 */
.pz-plain, .pz-life, .pz-case {
  font-size: 13.5px; color: var(--muted);
  border-radius: 0 8px 8px 0;
  padding: 8px 12px;
}
.pz-plain {
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid #3d4048;
  margin-top: 10px;
}
.pz-life {
  background: rgba(226, 172, 74, 0.06);
  border-left: 3px solid var(--accent);
  margin-top: 8px;
}
.pz-case {
  background: rgba(169, 126, 47, 0.09);
  border-left: 3px solid var(--accent-deep);
  margin-top: 8px;
}
.pz-plain b, .pz-life b, .pz-case b { color: var(--text); font-weight: 600; }

/* 亮色模式下白调背景不可见，改用墨调浅底 */
@media (prefers-color-scheme: light) {
  .pz-plain { background: rgba(38, 37, 31, 0.045); }
}

/* ---------- 窄屏 ---------- */
@media (max-width: 900px) {
  .pz-layout { flex-direction: column; }
  .pz-side {
    width: 100%; min-width: 0; position: static;
    max-height: 220px; border-right: none; border-bottom: 1px solid var(--line);
  }
  .pz-status { max-width: 100%; text-align: left; margin-left: 0; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .pz-ctrl button:active { transform: none; }
}
