:root {
  --paper: #fffefa;
  --background: #f8f6fa;
  --ink: #32263e;
  --muted: #706475;
  --primary: #ac285f;
  --purple: #70509c;
  --line: #e8dfe8;
  --soft: #f6eff8;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; color: var(--ink); background: var(--background); font: 16px/1.8 "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; }
a { color: var(--purple); text-underline-offset: 4px; }
button, input { font: inherit; }
button, summary { cursor: pointer; }
button, input, summary, a { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; background: white; padding: 12px; }
.skip-link:focus { top: 8px; }
.manual-topbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 76px; padding: 12px max(24px, calc((100vw - 1300px)/2)); background: var(--paper); border-bottom: 1px solid var(--line); }
.manual-brand { color: var(--ink); font-weight: 800; font-size: 21px; text-decoration: none; white-space: nowrap; }
.manual-brand span { font-size: 13px; font-weight: 400; color: var(--muted); border-left: 1px solid var(--line); margin-left: 12px; padding-left: 12px; }
.manual-topbar nav { display: flex; gap: 12px; align-items: center; }
.manual-topbar nav a { display: inline-flex; min-height: 44px; padding: 6px 12px; align-items: center; font-size: 14px; text-decoration: none; white-space: nowrap; border-radius: 12px; }
.manual-topbar nav a:hover { background: var(--soft); }
.manual-topbar .primary-link { color: white; background: var(--primary); }
.manual-topbar .primary-link:hover { background: #8e204e; }
.manual-layout { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 44px; max-width: 1300px; margin: 0 auto; padding: 32px 24px 72px; align-items: start; }
.sidebar { position: sticky; top: 100px; max-height: calc(100dvh - 124px); overflow-y: auto; padding-right: 16px; scrollbar-width: thin; }
.sidebar-heading { display: flex; align-items: center; gap: 12px; margin: 0 0 24px; }
.sidebar-heading strong { font-size: 19px; }
.sidebar-heading span { font-size: 12px; border-radius: 6px; padding: 1px 8px; color: var(--purple); background: #eee6f6; }
.sidebar label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.search-row { display: flex; border: 1px solid #cbbdce; border-radius: 12px; background: white; overflow: hidden; }
.search-row input { width: 100%; min-width: 0; min-height: 46px; padding: 8px 10px; border: 0; background: transparent; font-size: 16px; color: var(--ink); }
.search-row button { flex-shrink: 0; border: 0; border-left: 1px solid var(--line); min-width: 44px; padding: 6px; background: transparent; color: var(--purple); font-size: 13px; }
.search-row:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.search-status { font-size: 12px; color: var(--muted); margin: 8px 0 18px; }
.contents > summary { min-height: 44px; padding: 8px 0; font-weight: 700; }
.nav-group { padding-top: 12px; }
.nav-group h3 { font-size: 12px; letter-spacing: .04em; color: var(--muted); margin: 4px 10px; }
#chapterNav a { display: block; padding: 9px 10px; min-height: 44px; font-size: 14px; line-height: 1.8; border-radius: 9px; color: var(--ink); text-decoration: none; }
#chapterNav a:hover { background: var(--soft); }
#chapterNav a[aria-current="location"] { color: var(--primary); background: #fcebf2; font-weight: 700; box-shadow: inset 3px 0 var(--primary); }
.sidebar-note { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 18px; margin-top: 24px; }
main { min-width: 0; }
.manual-intro { background: linear-gradient(120deg, #fff5f2, #f3eefb); border: 1px solid var(--line); border-radius: 24px; padding: 32px; margin-bottom: 28px; }
.eyebrow { color: var(--primary); font-size: 13px; font-weight: 700; margin: 0 0 10px; }
h1 { font-size: clamp(27px, 3vw, 38px); line-height: 1.35; margin: 0 0 14px; letter-spacing: -.04em; }
.intro-desc { max-width: 38em; color: var(--muted); margin: 0; }
.intro-meta { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.intro-meta span { font-size: 12px; padding: 3px 10px; border-radius: 20px; background: #ffffffb8; color: var(--purple); }
.start-path { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.start-path a { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 600; min-height: 52px; }
.start-path a:hover { border-color: var(--primary); }
.start-path small { color: var(--primary); font-weight: 700; }
.intro-tip { font-size: 13px; color: var(--muted); margin: 18px 0 0; }
.chapter { scroll-margin-top: 20px; padding: 28px 32px; margin-bottom: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; overflow-wrap: anywhere; }
.chapter-kicker { margin: 0 0 4px; color: var(--purple); font-size: 12px; font-weight: 700; }
.chapter h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 23px; line-height: 1.5; }
.chapter-link { font-size: 12px; font-weight: 400; min-height: 44px; padding: 8px; margin-left: auto; display: inline-flex; align-items: center; text-decoration: none; color: var(--muted); }
.entry { color: var(--purple); background: var(--soft); border-radius: 9px; padding: 10px 14px; margin: 12px 0 20px; font-size: 14px; }
ol { padding-left: 24px; margin: 16px 0; }
li { padding-left: 5px; margin-bottom: 10px; }
li::marker { color: var(--primary); font-weight: 700; }
.notice { padding: 12px 16px; border-left: 3px solid #ca8e43; border-radius: 0 8px 8px 0; background: #fff7e9; color: #705021; font-size: 14px; }
.shot-needed { padding-top: 14px; border-top: 1px dashed var(--line); margin: 20px 0 0; color: var(--muted); font-size: 12px; }
.sample { border: 1px dashed var(--line); background: white; padding: 14px 20px; border-radius: 12px; font: inherit; }
dl { margin: 20px 0; }
dt { font-weight: 700; margin-top: 14px; }
dd { margin: 2px 0 12px; color: var(--muted); }
figure { margin: 24px 0 12px; }
.figure-button { display: block; padding: 0; background: white; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; width: 100%; cursor: zoom-in; }
.figure-button img { display: block; width: 100%; height: auto; }
figcaption { font-size: 12px; color: var(--muted); margin-top: 8px; }
.related-links { display: flex; gap: 12px; flex-wrap: wrap; }
.related-links a { min-height: 44px; padding-block: 8px; }
.chapter details { border-top: 1px solid var(--line); padding: 8px 0; }
.chapter summary { padding: 10px 4px; min-height: 44px; font-weight: 600; }
.chapter details p { padding: 0 4px; color: var(--muted); }
.empty-state { background: white; border: 1px dashed #b69cc4; border-radius: 16px; padding: 32px; color: var(--muted); }
.manual-footer { font-size: 13px; text-align: center; color: var(--muted); padding: 28px 12px; }
.manual-footer a { display: block; padding: 8px; min-height: 44px; }
dialog { width: min(1200px, 94vw); max-height: 90dvh; border: 0; border-radius: 16px; padding: 16px; background: var(--paper); color: var(--ink); }
dialog::backdrop { background: #22182bcc; }
dialog img { width: 100%; height: auto; display: block; }
dialog button { min-height: 44px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; margin-bottom: 12px; }
dialog p { font-size: 13px; margin-bottom: 0; }
@media (max-width: 900px) {
  html { scroll-padding-top: 20px; }
  .manual-topbar { position: static; padding: max(12px, env(safe-area-inset-top)) 18px 12px; flex-wrap: wrap; gap: 8px; }
  .manual-topbar nav { gap: 6px; flex-wrap: wrap; }
  .manual-topbar nav a { padding-inline: 8px; font-size: 13px; }
  .manual-layout { display: block; padding: 18px max(16px, env(safe-area-inset-left)) max(80px, env(safe-area-inset-bottom)); }
  .sidebar { position: static; max-height: none; overflow: visible; padding: 0; margin-bottom: 20px; }
  .sidebar-heading { margin-bottom: 12px; }
  .sidebar-note { display: none; }
  .contents { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); padding: 0 14px; }
  #chapterNav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-bottom: 14px; }
  .manual-intro { padding: 24px 20px; }
  .chapter { padding: 24px 20px; }
  .chapter h2 { font-size: 21px; }
  .start-path { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .manual-brand { font-size: 19px; }
  #chapterNav { grid-template-columns: minmax(0, 1fr); }
  .start-path a { padding: 10px; gap: 7px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  html { scroll-behavior: auto; }
  body { background: white; color: black; font-size: 11pt; }
  .manual-topbar, .sidebar, .skip-link, .chapter-link, .mobile-level-back, dialog, .shot-needed, .start-path, .manual-footer a, #noResults { display: none !important; }
  .manual-layout { display: block; max-width: none; padding: 0; }
  .manual-intro, .chapter { border: 0; border-radius: 0; background: white; padding: 10pt 0; }
  .chapter[hidden] { display: block !important; }
  h2, h3, .entry { break-after: avoid; }
  li, figure, .notice { break-inside: avoid; }
  .chapter details > p { display: block !important; }
  .chapter details::details-content { content-visibility: visible; display: block; }
  a { color: inherit; }
}
