:root {
  --paper: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f7f7f5;
  --ink: #2f2f2c;
  --muted: #707068;
  --line: #e9e9e5;
  --link-line: #b6b6ac;
  --focus: #96968c;
  --selection: #e9e9e5;
  --accent: #d97757;
  --primary: #b45b3c;
  --primary-hover: #a65034;
  --primary-pressed: #91442c;
  --green: #39775d;
  --green-soft: #e7f2ec;
  --amber: #9a681e;
  --amber-soft: #f8eedb;
  --red: #a54a43;
  --red-soft: #f8e8e6;
  --radius: 6px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 28px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Inter", "Segoe UI", "Microsoft YaHei UI", "PingFang SC",
    "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

a { color: var(--ink); text-decoration-color: var(--link-line); text-underline-offset: 4px; }
a:hover { text-decoration-color: var(--ink); }
.brand-dot { color: var(--accent); }
.updated { color: var(--muted); font-size: 13px; }
.screenshot-detail { margin: 24px 0; border-block: 1px solid var(--line); background: var(--surface); }
.screenshot-detail > summary { cursor: pointer; color: var(--muted); padding: 12px 0; font-size: 13px; font-weight: 500; }
.screenshot-detail[open] > summary { color: var(--ink); }
.screenshot-detail .shot { margin: 0 12px 12px; box-shadow: none; }
.screenshot-detail > .two-col { padding: 4px 12px 12px; }
.compact-shot { max-width: 760px; }
main { min-width: 0; }
article[id] { scroll-margin-top: 28px; }
code {
  padding: 0.12em 0.4em;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  background: var(--surface-soft);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.92em;
}

.layout {
  display: grid;
  grid-template-columns: 216px minmax(0, 860px);
  gap: 64px;
  width: min(1140px, calc(100% - 64px));
  margin: 0 auto;
  padding: 32px 0 80px;
}

.sidebar {
  position: sticky;
  top: 28px;
  align-self: start;
  max-height: calc(100vh - 56px);
  overflow: auto;
  padding: 20px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.brand {
  display: block;
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 24px;
  font-size: 20px;
  font-weight: 600;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.sidebar nav a {
  display: block;
  margin: 3px 0;
  padding: 7px 10px;
  border-radius: 4px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.sidebar nav a:hover {
  color: var(--ink);
  background: #f0f0ed;
}

.sidebar .nav-group {
  margin: 0 10px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.nav-section + .nav-section { margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.nav-settings { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); }
.sidebar nav a[aria-current="location"] { background: var(--selection); color: var(--ink); font-weight: 600; }

.hero {
  padding: 32px 0 24px;
  border: 0;
  background: var(--surface);
  box-shadow: none;
}


.hero h1 {
  margin: 24px 0 16px;
  font-size: clamp(36px, 4.2vw, 56px);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.cover-name, .cover-handbook { display: inline-block; }
.cover-handbook {
  margin-left: 0.1em;
  color: var(--muted);
  font-weight: 400;
}
.cover-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.cover-label::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--link-line);
}
.cover-description {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.cover-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.status-pill.on { color: var(--muted); background: var(--surface-soft); }
.status-pill.off { color: var(--muted); background: var(--surface); border: 1px solid var(--line); }

section { margin-top: 48px; }
section > h2 {
  margin: 0 0 22px;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.3;
}

h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
}

h4 { margin: 0 0 5px; font-size: 15px; font-weight: 600; }
p { margin: 8px 0; }
ul, ol { margin: 8px 0 0; padding-left: 1.35em; }
li + li { margin-top: 5px; }

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 22px 0 24px;
  padding: 0;
  list-style: none;
  counter-reset: guide-step;
}

.steps li {
  counter-increment: guide-step;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 16px;
  margin: 0;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.steps li:first-child { padding-top: 0; }
.steps li:last-child { border-bottom: 0; padding-bottom: 0; }

.steps li::before {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  grid-row: 1 / span 2;
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface-soft);
  content: counter(guide-step);
  font-size: 13px;
  font-weight: 600;
}

.steps strong { display: block; grid-column: 2; margin-bottom: 4px; font-weight: 600; }
.steps span { grid-column: 2; color: #5d5d57; font-size: 14px; line-height: 1.8; }

.shot {
  margin: 24px 0 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
}

.shot img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  border-radius: 4px;
}

figcaption {
  padding: 9px 4px 2px;
  color: var(--muted);
  font-size: 12px;
}

.callout {
  margin: 20px 0;
  padding: 15px 17px;
  border-left: 2px solid var(--link-line);
  border-radius: 0 4px 4px 0;
  background: var(--surface-soft);
}

.callout strong { display: block; margin-bottom: 3px; }
.callout p { margin: 0; color: var(--muted); }
.callout.warn { border-color: #c28a34; background: var(--amber-soft); }
.callout.warn p { color: #6d511f; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  background: var(--surface-soft);
  font-weight: 600;
  white-space: nowrap;
}

tr:last-child td { border-bottom: 0; }

.check-grid, .two-col, .three-col {
  display: grid;
  gap: 20px 32px;
}
.check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  min-width: 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.card p, .card li { color: var(--muted); font-size: 14px; }
.direction-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 28px 0 40px; }
.direction-grid .card { border: 0; border-radius: var(--radius); padding: 22px 24px; background: var(--surface-soft); }
.direction-grid h3 { font-size: 18px; margin-bottom: 10px; }
.direction-grid p { margin: 0; }
.card .card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.group-label {
  margin: 30px 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.settings-block {
  margin-top: 24px;
  padding: 0;
}

.settings-block .shot { margin-top: 18px; box-shadow: none; }
.settings-block + .settings-block { margin-top: 18px; }

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.mini {
  padding: 13px 14px;
  border-left: 1px solid var(--line);
}
.mini strong { display: block; margin-bottom: 3px; font-size: 13px; }
.mini span { color: var(--muted); font-size: 14px; }

.report-preview {
  overflow: hidden;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.report-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 9px 10px 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}
.report-tabs span {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  color: var(--muted);
  background: var(--selection);
  font-size: 11px;
}
.report-tabs .active { color: var(--ink); background: var(--surface); }
.report-preview table { min-width: 720px; }
.report-preview .editable { background: #fff2cc; }

.flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 10px;
  margin-top: 20px;
}

.flow .node {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}
.flow .node strong { display: block; margin-bottom: 4px; }
.flow .node span { color: var(--muted); font-size: 12px; }
.flow .arrow { align-self: center; color: var(--muted); font-size: 22px; }

.faq details {
  margin-top: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.faq summary {
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 600;
}
.faq details div { padding: 0 16px 15px; color: var(--muted); }

.skip-link { position: fixed; top: -100px; left: 16px; z-index: 20; background: white; padding: 12px 18px; }
.skip-link:focus { top: 12px; }
:is(a, button, summary):focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
body { overflow-wrap: anywhere; }
.hero .updated { margin: 0; font-size: 11px; white-space: nowrap; }
.hero-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; font-size: 13px; }
.hero-links .primary-link { padding: 8px 14px; border-radius: 4px; color: #fff; background: var(--primary); text-decoration: none; font-weight: 600; }
.hero-links .primary-link:hover { background: var(--primary-hover); }
.hero-links .primary-link:active { background: var(--primary-pressed); }
.hero-links .primary-link:focus-visible { outline-color: var(--primary-pressed); }
.guide-tool { margin-top: 80px; padding-top: 48px; border-top: 1px solid var(--line); scroll-margin-top: 0; }
.tool-heading { margin-bottom: 32px; }
.tool-heading h2 { margin: 0 0 12px; font-size: 34px; font-weight: 650; line-height: 1.3; letter-spacing: -0.02em; }
.tool-intro { max-width: 760px; margin: 0; color: var(--muted); font-size: 16px; }
.guide-tool > section { margin-top: 36px; }
.guide-tool > section > h3, .guide-tool > h3 { margin: 36px 0 20px; font-size: 19px; }
.guide-tool > section:first-of-type > h3 { margin-top: 0; }
.card h4 { font-size: 16px; }
.local-toc { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; font-size: 14px; }
.local-toc a { padding: 3px 0; }
.reference-index { margin-top: 12px; font-size: 13px; color: var(--muted); }
.reference-index summary, .reference-detail summary { cursor: pointer; }
.reference-index nav { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 12px 0; }
.reference-detail { margin: 20px 0; border-block: 1px solid var(--line); }
.reference-detail + .reference-detail { margin-top: -21px; }
.reference-detail > summary { padding: 14px 0; font-size: 14px; font-weight: 500; }
.reference-detail > div { padding: 0 0 16px; color: var(--muted); font-size: 14px; }
.guide-support { margin-top: 64px; padding-top: 4px; border-top: 1px solid var(--line); }
.page-footer { margin-top: 52px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

@media (max-width: 940px) {
  .layout { grid-template-columns: 1fr; width: min(100% - 32px, 900px); gap: 26px; }
  .sidebar { position: static; max-height: none; }
  .sidebar nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .nav-section + .nav-section { margin: 0; padding: 0 0 0 12px; border-top: 0; border-left: 1px solid var(--line); }
  .nav-settings { grid-column: 1 / -1; margin: 0; padding-top: 8px; }
  .steps { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .layout { width: calc(100% - 24px); padding-top: 12px; }
  .sidebar { padding: 16px 12px; }
  .sidebar nav { grid-template-columns: 1fr; gap: 12px; }
  .nav-section { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 8px; }
  .sidebar .nav-group { grid-column: 1 / -1; }
  .nav-section + .nav-section { padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .hero { padding: 24px 4px; }
  .hero h1 { font-size: 36px; }
  .cover-handbook { margin-left: 0; }
  section { margin-top: 36px; }
  .guide-tool { margin-top: 38px; padding-top: 28px; }
  .tool-heading h2 { font-size: 28px; }
  .steps, .check-grid, .two-col, .three-col, .mini-grid, .direction-grid { grid-template-columns: 1fr; }
  .steps li { min-height: 0; }
  .flow { grid-template-columns: 1fr; }
  .flow .arrow { transform: rotate(90deg); justify-self: center; }
  .settings-block { padding: 0; }
  th, td { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  body { background: #fff; font-size: 11pt; }
  .layout { display: block; width: 100%; padding: 0; }
  .sidebar, .skip-link, .local-toc { display: none; }
  .hero, .card, .settings-block, .shot, .table-wrap, .report-preview { box-shadow: none; break-inside: avoid; }
  section { margin-top: 30px; }
  a { color: inherit; text-decoration: none; }
}
