/* =========================================================
   沃尔玛模板填充工具 · 图文教程
   纯静态样式表，无外部字体 / 图标库
   ========================================================= */

:root,
:root[data-theme="light"] {
  --bg: #f3f7f6;
  --bg-soft: #e9f1ef;
  --card: #ffffff;
  --card-2: #f7fbfa;
  --ink: #10201d;
  --ink-2: #3f544f;
  --ink-3: #6d827d;
  --line: #dde8e5;
  --line-strong: #c8d9d5;
  --brand: #009c78;
  --brand-2: #12b48a;
  --brand-ink: #ffffff;
  --brand-soft: #e4f7f1;
  --brand-line: #b6e6d8;
  --tip-bg: #ecfaf5;
  --tip-line: #b9e8da;
  --tip-ink: #0a6351;
  --warn-bg: #fff7ec;
  --warn-line: #f6d3a6;
  --warn-ink: #8a4b0f;
  --danger-bg: #fef3f2;
  --danger-line: #f7c9c4;
  --danger-ink: #9f261c;
  --shadow-sm: 0 1px 2px rgba(15, 42, 37, .05);
  --shadow: 0 1px 2px rgba(15, 42, 37, .04), 0 18px 40px -24px rgba(15, 42, 37, .35);
  --shadow-lg: 0 30px 70px -30px rgba(15, 42, 37, .45);
  --dot-ring: #ffffff;
  --mask: rgba(9, 26, 23, .42);
  --code-bg: #0f1c1a;
  --code-ink: #d7f3ec;
  --hero-a: #dff6ee;
  --hero-b: #eef4ff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1211;
    --bg-soft: #0f1a19;
    --card: #121e1d;
    --card-2: #162423;
    --ink: #e8f3f0;
    --ink-2: #b6c9c4;
    --ink-3: #8ba09b;
    --line: #223330;
    --line-strong: #2d423e;
    --brand: #2ed3ab;
    --brand-2: #47e0b8;
    --brand-ink: #04231c;
    --brand-soft: rgba(46, 211, 171, .12);
    --brand-line: rgba(46, 211, 171, .35);
    --tip-bg: rgba(46, 211, 171, .09);
    --tip-line: rgba(46, 211, 171, .28);
    --tip-ink: #8fe8d2;
    --warn-bg: rgba(245, 165, 36, .1);
    --warn-line: rgba(245, 165, 36, .3);
    --warn-ink: #f6c07a;
    --danger-bg: rgba(240, 90, 74, .1);
    --danger-line: rgba(240, 90, 74, .3);
    --danger-ink: #f4a19a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 24px 50px -30px rgba(0, 0, 0, .8);
    --shadow-lg: 0 40px 80px -30px rgba(0, 0, 0, .85);
    --dot-ring: #0a1211;
    --mask: rgba(0, 0, 0, .6);
    --code-bg: #07100f;
    --code-ink: #c8ece3;
    --hero-a: #12312b;
    --hero-b: #14243a;
  }
}

:root[data-theme="dark"] {
  --bg: #0a1211;
  --bg-soft: #0f1a19;
  --card: #121e1d;
  --card-2: #162423;
  --ink: #e8f3f0;
  --ink-2: #b6c9c4;
  --ink-3: #8ba09b;
  --line: #223330;
  --line-strong: #2d423e;
  --brand: #2ed3ab;
  --brand-2: #47e0b8;
  --brand-ink: #04231c;
  --brand-soft: rgba(46, 211, 171, .12);
  --brand-line: rgba(46, 211, 171, .35);
  --tip-bg: rgba(46, 211, 171, .09);
  --tip-line: rgba(46, 211, 171, .28);
  --tip-ink: #8fe8d2;
  --warn-bg: rgba(245, 165, 36, .1);
  --warn-line: rgba(245, 165, 36, .3);
  --warn-ink: #f6c07a;
  --danger-bg: rgba(240, 90, 74, .1);
  --danger-line: rgba(240, 90, 74, .3);
  --danger-ink: #f4a19a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 24px 50px -30px rgba(0, 0, 0, .8);
  --shadow-lg: 0 40px 80px -30px rgba(0, 0, 0, .85);
  --dot-ring: #0a1211;
  --mask: rgba(0, 0, 0, .6);
  --code-bg: #07100f;
  --code-ink: #c8ece3;
  --hero-a: #12312b;
  --hero-b: #14243a;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.35; color: var(--ink); }
p { margin: 0 0 .8em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code, kbd, samp, pre { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; }
code {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .08em .38em;
  font-size: .88em;
  color: var(--ink-2);
  word-break: break-word;
}
img { max-width: 100%; }
button { font: inherit; color: inherit; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
  transition: top .18s;
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------------- Topbar ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}

@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .topbar { background: var(--bg); }
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 1460px;
  margin: 0 auto;
  padding: 10px 24px;
  min-height: 58px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  flex: none;
}
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(160deg, var(--brand-2), var(--brand));
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: .02em;
  box-shadow: 0 4px 12px -4px rgba(0, 156, 120, .7);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__text strong { font-size: 14.5px; letter-spacing: .01em; }
.brand__text small { color: var(--ink-3); font-size: 11.5px; letter-spacing: .08em; }

.search { position: relative; flex: 1 1 auto; max-width: 460px; margin-left: auto; }
.search input {
  width: 100%;
  height: 38px;
  padding: 0 34px 0 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236d827d' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m16 16 4.5 4.5'/%3E%3C/svg%3E") no-repeat 13px center / 16px 16px;
  color: var(--ink);
  font-size: 13.5px;
  transition: border-color .16s, box-shadow .16s;
}
.search input::placeholder { color: var(--ink-3); }
.search input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.search input::-webkit-search-cancel-button { display: none; }

.search__clear {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  border: 0;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--ink-3);
  cursor: pointer;
  line-height: 1;
  font-size: 15px;
}
.search__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(460px, 86vw);
  max-height: min(62vh, 520px);
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 60;
}
.search__empty { padding: 16px; color: var(--ink-3); font-size: 13.5px; }
.search__item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 9px 11px;
  cursor: pointer;
}
.search__item:hover, .search__item:focus-visible { background: var(--bg-soft); text-decoration: none; }
.search__item b { display: block; font-size: 13.5px; color: var(--ink); font-weight: 600; }
.search__item span { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.search__item em { font-style: normal; color: var(--brand); font-weight: 600; }
.search__head {
  padding: 8px 11px 4px;
  font-size: 11.5px;
  letter-spacing: .08em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.topbar__actions { display: flex; align-items: center; gap: 8px; flex: none; }
.version {
  font: 600 11.5px/1 ui-monospace, monospace;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  white-space: nowrap;
}
.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .16s, color .16s, background .16s;
}
.icon-btn:hover { border-color: var(--brand-line); color: var(--brand); background: var(--brand-soft); }
.menu-btn { display: none; }

.scrollbar { height: 3px; background: transparent; }
.scrollbar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width .08s linear;
}

/* ---------------- Layout ---------------- */

.shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 34px;
  max-width: 1460px;
  margin: 0 auto;
  padding: 0 24px;
}

.sidebar {
  position: sticky;
  top: 74px;
  height: calc(100vh - 96px);
  overflow: auto;
  padding: 22px 4px 40px 0;
  scrollbar-width: thin;
}
.sidebar__inner { display: flex; flex-direction: column; gap: 18px; min-height: 100%; }

.toc { display: flex; flex-direction: column; gap: 4px; }
.toc__home {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
}
.toc__home:hover { background: var(--bg-soft); text-decoration: none; color: var(--brand); }
.toc__home.is-active { background: var(--brand-soft); color: var(--brand); }

.toc__part {
  margin: 16px 0 6px;
  padding: 0 12px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.toc__link {
  display: flex;
  gap: 9px;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.5;
  border-left: 2px solid transparent;
}
.toc__link:hover { background: var(--bg-soft); color: var(--ink); text-decoration: none; }
.toc__link.is-active {
  background: var(--brand-soft);
  color: var(--brand);
  border-left-color: var(--brand);
  font-weight: 600;
}
.toc__link span {
  font: 600 11px/1.7 ui-monospace, monospace;
  color: var(--ink-3);
  flex: none;
  min-width: 24px;
}
.toc__link.is-active span { color: var(--brand); }

.readbox {
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.readbox__top { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--ink-3); }
.readbox__top strong { color: var(--brand); font-size: 14px; }
.readbox__bar { height: 5px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; margin: 8px 0 10px; }
.readbox__bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .25s; }
.readbox__hint { font-size: 11.5px; color: var(--ink-3); line-height: 1.6; margin: 0 0 6px; }
.link-btn {
  border: 0; background: none; padding: 0;
  color: var(--ink-3); font-size: 12px;
  text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:hover { color: var(--brand); }

.content { padding: 26px 0 90px; min-width: 0; }

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 42px 40px 32px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
  scroll-margin-top: 80px;
}
.hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(760px 320px at 88% -12%, var(--hero-a), transparent 68%),
    radial-gradient(520px 260px at 100% 110%, var(--hero-b), transparent 70%);
  pointer-events: none;
}
.hero > * { position: relative; }
.hero__eyebrow {
  font: 700 11.5px/1.4 ui-monospace, monospace;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 14px;
}
.hero h1 {
  font-size: clamp(30px, 3.6vw, 44px);
  letter-spacing: -.02em;
  margin: 0 0 16px;
  font-weight: 800;
}
.hero__lead {
  max-width: 640px;
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.85;
  margin: 0 0 22px;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }

.hero__stats {
  display: flex;
  gap: 34px;
  margin: 0 0 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.hero__stats > div { display: flex; align-items: baseline; gap: 8px; }
.hero__stats dt { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.hero__stats dd { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.hero__note {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.7;
  max-width: 720px;
  margin: 0;
}

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .16s, background .16s, color .16s, transform .16s;
}
.btn:hover { border-color: var(--brand-line); color: var(--brand); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: linear-gradient(160deg, var(--brand-2), var(--brand));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px -12px rgba(0, 156, 120, .9);
}
.btn--primary:hover { color: #fff; filter: brightness(1.05); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: var(--bg-soft); }
.btn--sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------------- Chapter ---------------- */

.chapter {
  margin-top: 46px;
  scroll-margin-top: 84px;
}
.chapter__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.chapter__num {
  flex: none;
  margin-top: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--brand);
  font: 700 11.5px/1.5 ui-monospace, monospace;
  letter-spacing: .04em;
  background: var(--card);
}
.chapter h2 {
  font-size: clamp(21px, 2.1vw, 26px);
  letter-spacing: -.015em;
  margin: 0 0 8px;
  font-weight: 750;
}
.chapter__lead {
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.85;
  margin: 0 0 6px;
  max-width: 820px;
}
.chapter__body { margin-top: 16px; }

/* ---------------- Shot + hotspots ---------------- */

.shot {
  margin: 18px 0 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.shot__frame {
  position: relative;
  background: #f0f4f3;
  line-height: 0;
  /* 截图统一为 1920×1029，先占位避免懒加载时页面跳动 */
  aspect-ratio: 1920 / 1029;
}
:root[data-theme="dark"] .shot__frame { background: #0b1413; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .shot__frame { background: #0b1413; }
}
.shot__frame > img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}
.shot__cap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  background: var(--card);
  line-height: 1.6;
  font-size: 12.5px;
  color: var(--ink-3);
}
.shot__cap b { color: var(--ink-2); font-weight: 600; }
.shot__cap a { font-size: 12px; white-space: nowrap; }

.hotspots { position: absolute; inset: 0; }

/* 区域热区：一个编号代表一块界面，点开里面可能有多条讲解 */
.region {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 1.5px dashed transparent;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
  z-index: 2;
}
.region:hover,
.region:focus-visible {
  border-color: rgba(0, 156, 120, .78);
  background: rgba(0, 161, 123, .12);
  box-shadow: 0 0 0 3px rgba(0, 161, 123, .10);
  outline: none;
}
:root[data-theme="dark"] .region:hover,
:root[data-theme="dark"] .region:focus-visible,
:root:not([data-theme="light"]) .region:hover {
  border-color: rgba(64, 226, 186, .8);
  background: rgba(46, 211, 171, .18);
}

.region__num {
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--dot-ring);
  background: linear-gradient(160deg, #17c79c, #008f70);
  color: #fff;
  font: 700 12px/1 ui-monospace, monospace;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .28);
  pointer-events: none;
}
.region--solo .region__num {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.region.is-read .region__num {
  background: var(--card);
  color: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .16);
}

.region__label {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(12, 26, 24, .92);
  color: #fff;
  font-size: 11.5px;
  line-height: 1.6;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity .14s ease, transform .14s ease;
  pointer-events: none;
}
.region--solo .region__label { left: 50%; top: -6px; transform: translate(-50%, -100%); }
.region:hover .region__label,
.region:focus-visible .region__label { opacity: 1; transform: translateY(-50%); }
.region--solo:hover .region__label,
.region--solo:focus-visible .region__label { transform: translate(-50%, -100%); }

/* 抽屉里的分条内容 */
.entry { padding: 4px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.entry:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 4px; }
.drawer__body .entry__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16.5px;
  letter-spacing: 0;
  text-transform: none;
  margin: 4px 0;
  color: var(--ink);
  font-weight: 700;
}
.drawer__body h4 {
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 14px 0 6px;
  font-weight: 700;
}
.entry__num {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  font: 700 11px/1 ui-monospace, monospace;
}
.entry__where { margin: 0 0 10px; font-size: 12px; color: var(--ink-3); }
.entry--flash { animation: entryFlash 1.4s ease; }
@keyframes entryFlash {
  0%, 100% { background: transparent; }
  18%, 60% { background: var(--brand-soft); }
}
.drawer__hint {
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.7;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

/* 热点提示条 */
.shot__hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.shot__hint::before {
  content: "";
  width: 16px; height: 16px;
  border-radius: 50%;
  background: linear-gradient(160deg, #17c79c, #008f70);
  box-shadow: 0 0 0 3px var(--brand-soft);
  flex: none;
}

/* 图下操作：折叠讲解列表 */
.spot-list {
  margin: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  overflow: hidden;
}
.spot-list > summary {
  cursor: pointer;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.spot-list > summary::-webkit-details-marker { display: none; }
.spot-list > summary::after { content: "展开"; color: var(--ink-3); font-weight: 400; font-size: 12px; }
.spot-list[open] > summary::after { content: "收起"; }
.spot-list__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2px;
  padding: 4px 8px 12px;
  border-top: 1px solid var(--line);
}
.spot-list__item {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 8px 9px;
  border: 0;
  border-radius: 8px;
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
}
.spot-list__item:hover { background: var(--bg-soft); color: var(--ink); }
.spot-list__item i {
  flex: none;
  min-width: 19px;
  height: 19px;
  margin-top: 1px;
  padding: 0 4px;
  border-radius: 5px;
  display: grid; place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  font: 700 9.5px/1 ui-monospace, monospace;
  font-style: normal;
  white-space: nowrap;
}
.spot-list__item.is-read i { background: var(--brand); color: #fff; }

/* ---------------- Prose blocks ---------------- */

.notice {
  display: flex;
  gap: 10px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-2);
  margin: 14px 0;
}
.notice b { color: var(--ink); }
.notice--tip { background: var(--tip-bg); border-color: var(--tip-line); color: var(--tip-ink); }
.notice--warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.notice--info { background: var(--card-2); }
.notice__icon { flex: none; font-weight: 800; line-height: 1.6; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.card {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
  padding: 16px 17px;
  box-shadow: var(--shadow-sm);
}
.card h3 {
  font-size: 14.5px;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h3 .num {
  display: inline-grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  font: 700 11px/1 ui-monospace, monospace;
}
.card p { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.75; }
.card ul { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--ink-2); }
.card li { margin: 3px 0; }

.steps {
  counter-reset: st;
  list-style: none;
  margin: 16px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.steps li {
  position: relative;
  padding: 11px 15px 11px 46px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.75;
}
.steps li::before {
  counter-increment: st;
  content: counter(st);
  position: absolute;
  left: 13px; top: 12px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font: 700 11px/1 ui-monospace, monospace;
}
.steps li b { color: var(--ink); }

.flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}
.flow__step {
  flex: 1 1 150px;
  min-width: 140px;
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--card-2);
  border: 1px solid var(--line);
}
.flow__step b { display: block; font-size: 13px; margin-bottom: 3px; }
.flow__step span { font-size: 12px; color: var(--ink-3); line-height: 1.6; display: block; }
.flow__arrow { align-self: center; color: var(--line-strong); font-size: 17px; padding: 0 1px; }
.flow__step--key { border-color: var(--brand-line); background: var(--brand-soft); }
.flow__step--key b { color: var(--brand); }

.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.65; }
th { font-size: 12px; letter-spacing: .04em; color: var(--ink-3); font-weight: 700; background: var(--card-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td b { color: var(--ink); }

.code-block { margin: 14px 0; }
.code__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  margin: 0 0 6px 2px;
}
pre.code {
  position: relative;
  margin: 0;
  padding: 15px 16px;
  border-radius: 12px;
  background: var(--code-bg);
  color: var(--code-ink);
  font-size: 12.5px;
  line-height: 1.75;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
pre.code code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.code__copy {
  position: absolute;
  top: 8px; right: 8px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08);
  color: #d7f3ec;
  border-radius: 6px;
  font-size: 11.5px;
  padding: 3px 9px;
  cursor: pointer;
}
.code__copy:hover { background: rgba(255, 255, 255, .18); }

details.faq {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  margin: 9px 0;
  overflow: hidden;
}
details.faq > summary {
  cursor: pointer;
  padding: 12px 16px;
  font-size: 13.8px;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
details.faq > summary::-webkit-details-marker { display: none; }
details.faq > summary::before {
  content: "?";
  flex: none;
  width: 19px; height: 19px;
  margin-top: 1px;
  border-radius: 5px;
  display: grid; place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  font: 700 11px/1 ui-monospace, monospace;
}
details.faq > summary::after { content: "+"; margin-left: auto; color: var(--ink-3); font-weight: 400; }
details.faq[open] > summary::after { content: "−"; }
details.faq .faq__body { padding: 0 16px 14px 45px; font-size: 13.5px; color: var(--ink-2); line-height: 1.8; }
details.faq .faq__body p:last-child { margin-bottom: 0; }

/* ---------------- Endcap / footer ---------------- */

.endcap {
  margin-top: 54px;
  padding: 32px 34px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, var(--card), var(--card-2));
  box-shadow: var(--shadow-sm);
}
.endcap h2 { font-size: 22px; margin: 0 0 8px; }
.endcap p { color: var(--ink-2); font-size: 14px; max-width: 660px; margin: 0 0 18px; }
.endcap__links { display: flex; flex-wrap: wrap; gap: 10px; }

.footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}
.footer__inner {
  max-width: 1460px;
  margin: 0 auto;
  padding: 26px 24px 34px;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.8;
}
.footer__inner p { margin: 0 0 6px; }
.footer__inner strong { color: var(--ink-2); }
.footer code { font-size: .92em; }

/* ---------------- Drawer ---------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--mask);
  opacity: 0;
  transition: opacity .22s ease;
}
.overlay.is-open { opacity: 1; }

.drawer {
  position: fixed;
  top: 0; right: 0;
  z-index: 80;
  width: min(540px, 100vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  transform: translateX(102%);
  transition: transform .26s cubic-bezier(.32, .72, .3, 1);
  visibility: hidden;
}
.drawer.is-open { transform: none; visibility: visible; }

.drawer__head {
  position: relative;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--card-2), var(--card));
}
.drawer__badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font: 700 11px/1.7 ui-monospace, monospace;
  letter-spacing: .04em;
}
.drawer__head h2 {
  font-size: 21px;
  margin: 8px 0 4px;
  padding-right: 36px;
  letter-spacing: -.01em;
}
.drawer__where {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.6;
  padding-right: 30px;
}
.drawer__close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  color: var(--ink-3);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.drawer__close:hover { color: var(--ink); border-color: var(--line-strong); }

.drawer__body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 18px 24px 26px;
  font-size: 14px;
  color: var(--ink-2);
}
.drawer__body > p:first-child { margin-top: 0; }
.drawer__summary {
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ink);
  margin: 0 0 16px;
}
.drawer__body h3 {
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 20px 0 8px;
}
.drawer__body ol, .drawer__body ul { margin: 0 0 12px; padding-left: 20px; }
.drawer__body li { margin: 5px 0; line-height: 1.8; }
.drawer__body li::marker { color: var(--brand); font-weight: 700; }
.drawer__body .callout { margin: 12px 0; }
.drawer__body pre.code { font-size: 12px; }
.drawer__body code { font-size: .87em; }

.mini {
  margin: 2px 0 18px;
  height: 172px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background-color: #f0f4f3;
  background-repeat: no-repeat;
  background-size: 185% auto;
  position: relative;
  overflow: hidden;
}
:root[data-theme="dark"] .mini { background-color: #0b1413; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mini { background-color: #0b1413; }
}
.mini::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 156, 120, .35);
  border-radius: 11px;
  pointer-events: none;
}
.mini__pin {
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #17c79c;
  border: 2px solid #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 5px rgba(23, 199, 156, .28);
}

.drawer__foot {
  flex: none;
  display: flex;
  gap: 8px;
  padding: 12px 24px;
  border-top: 1px solid var(--line);
  background: var(--card);
}
.drawer__foot .btn--primary { margin-left: auto; }

/* ---------------- Misc ---------------- */

.to-top {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 45;
  width: 40px; height: 40px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
}
.to-top:hover { color: var(--brand); border-color: var(--brand-line); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 10px);
  z-index: 120;
  max-width: min(520px, 90vw);
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(12, 26, 24, .94);
  color: #fff;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity .18s, transform .18s;
  pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.editor-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  width: min(1100px, 100%);
  padding: 10px 18px;
  border: 1px solid var(--warn-line);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: 12.5px;
  line-height: 1.6;
  box-shadow: var(--shadow);
}
.editor-bar strong { font-size: 12.5px; }
.editor-bar code { background: rgba(255, 255, 255, .5); border-color: transparent; color: inherit; }
.editor-bar .btn { margin-left: auto; }

body.editor-mode .shot__frame { cursor: crosshair; }
.editor-tip {
  position: fixed;
  z-index: 110;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(12, 26, 24, .92);
  color: #fff;
  font: 600 11.5px/1.5 ui-monospace, monospace;
  pointer-events: none;
  white-space: nowrap;
}

body.drawer-open { overflow: hidden; }

/* ---------------- Responsive ---------------- */

@media (max-width: 1180px) {
  .shell { grid-template-columns: 250px minmax(0, 1fr); gap: 26px; }
  .brand__text strong { font-size: 13.5px; }
  .search { max-width: 330px; }
}

@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 18px; }
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    z-index: 85;
    width: min(310px, 84vw);
    height: 100%;
    padding: 78px 16px 30px;
    background: var(--card);
    border-right: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    transform: translateX(-102%);
    transition: transform .25s cubic-bezier(.32, .72, .3, 1);
    visibility: hidden;
  }
  .sidebar.is-open { transform: none; visibility: visible; }
  .content { padding-top: 18px; }
  .menu-btn { display: grid; }
  .topbar__inner { padding: 10px 16px; gap: 10px; }
  .brand__text small { display: none; }
  .search { max-width: none; }
  .version { display: none; }
  .hero { padding: 30px 22px 24px; border-radius: 20px; }
  .hero__stats { gap: 20px; flex-wrap: wrap; }
  .chapter { margin-top: 38px; }
  .drawer { width: 100vw; }
  .drawer__foot { padding: 10px 16px; }
  .editor-bar { border-radius: 0; font-size: 11.5px; }
}

@media (max-width: 620px) {
  body { font-size: 14.5px; }
  .topbar__inner { padding: 9px 12px; }
  .brand__text { display: none; }
  .shell { padding: 0 12px; }
  .hero h1 { font-size: 30px; }
  .hero__actions .btn { flex: 1 1 100%; }
  .hero__stats dt { font-size: 22px; }
  .shot { border-radius: 12px; }
  .spot__dot { width: 24px; height: 24px; font-size: 11px; }
  .spot__tip { display: none; }
  .flow__arrow { display: none; }
  .flow__step { flex: 1 1 100%; }
  .endcap { padding: 24px 20px; }
  .search__panel { width: calc(100vw - 24px); right: -6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  .topbar, .sidebar, .drawer, .overlay, .to-top, .toast, .editor-bar, .hero__actions { display: none !important; }
  .shell { display: block; }
  .chapter { break-inside: avoid; }
  .shot { box-shadow: none; }
  body { background: #fff; }
}
