:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --ink: #18212f;
  --muted: #667085;
  --line: #d9e1dc;
  --green: #1f8f72;
  --green-dark: #126351;
  --blue: #3d6fb6;
  --coral: #ef7c5b;
  --amber: #f2b84b;
  --shadow: 0 10px 28px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

body.preview-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.skip-link,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.manual-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(217, 225, 220, 0.8);
  background: rgba(246, 247, 244, 0.94);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(260px, 420px) auto;
  align-items: center;
  gap: 14px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0;
}

.platform-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.platform-brand img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.platform-brand strong,
.platform-brand small {
  display: block;
}

.platform-brand strong {
  font-size: 17px;
  line-height: 1.25;
}

.platform-brand small,
.content-heading p,
.directory-support small,
.hero-copy p,
.tip-card p,
.status-grid p,
.important-notice p,
.operation-list p,
.quick-grid p,
.faq-list p {
  color: var(--muted);
  line-height: 1.55;
}

.manual-search {
  position: relative;
  display: flex;
  min-width: 0;
  gap: 8px;
}

.manual-search input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.manual-search button,
.top-navigation button,
.top-navigation a,
.hero-actions a,
.toc-toggle,
.drawer-close {
  min-height: 38px;
  border-radius: 7px;
  font-weight: 700;
}

.manual-search button {
  flex: 0 0 auto;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 50;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.search-results header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.search-results ul {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.search-results a {
  display: block;
  padding: 8px;
  border-radius: 7px;
  background: #f4faf7;
  color: var(--green-dark);
  font-weight: 700;
}

.top-navigation {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.top-navigation a,
.top-navigation button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.top-navigation .back-link {
  border-color: rgba(31, 143, 114, 0.28);
  background: #eef8f2;
  color: var(--green-dark);
}

.top-navigation .back-link::before {
  content: "<";
  margin-right: 6px;
  font-weight: 900;
}

.mobile-manual-bar {
  display: none;
}

.manual-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto 40px;
}

.chapter-directory {
  position: sticky;
  top: 78px;
  align-self: start;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.directory-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.directory-heading span {
  display: block;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.directory-heading strong {
  display: block;
  margin-top: 2px;
}

.drawer-close {
  display: none;
  width: 34px;
  background: #f3f6f4;
  color: var(--muted);
}

.chapter-directory nav {
  display: grid;
  gap: 6px;
}

.chapter-directory nav a {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 700;
}

.chapter-directory nav a span {
  color: var(--green);
  font-size: 11px;
}

.chapter-directory nav a.active {
  background: var(--green-dark);
  color: #fff;
}

.chapter-directory nav a.active span {
  color: #c9f3dd;
}

.directory-support {
  display: flex;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(61, 111, 182, 0.18);
  border-radius: 8px;
  background: #f1f6fc;
}

.directory-support > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
}

.manual-content {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.manual-section {
  scroll-margin-top: 96px;
}

.hero-section,
.content-section,
.workflow-section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(220px, 0.9fr);
  align-items: center;
  gap: 18px;
  overflow: hidden;
}

.hero-section img {
  width: 100%;
  height: 220px;
  border-radius: 8px;
  object-fit: cover;
  object-position: right center;
}

.section-kicker,
.content-heading span {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.hero-copy h1,
.content-heading h2 {
  margin: 6px 0 0;
  line-height: 1.2;
  letter-spacing: 0;
}

.hero-copy h1 {
  font-size: clamp(28px, 5vw, 44px);
}

.hero-copy p,
.content-heading p {
  margin: 10px 0 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.hero-actions a {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.hero-actions .primary-action {
  border-color: var(--green-dark);
  background: var(--green-dark);
  color: #fff;
}

.quick-grid,
.status-grid,
.important-notice {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.quick-grid article,
.status-grid article,
.important-notice article,
.tip-card {
  min-height: 120px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.quick-grid article span,
.status-grid article span,
.operation-list span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e6f5ed;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.quick-grid strong,
.status-grid strong,
.important-notice strong,
.tip-card strong {
  display: block;
  margin-top: 8px;
  line-height: 1.3;
}

.quick-grid p,
.status-grid p,
.important-notice p {
  margin: 8px 0 0;
}

.workflow-list,
.operation-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.workflow-list {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.workflow-list li {
  min-height: 86px;
  padding: 12px;
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: #f7fbf8;
}

.workflow-list span {
  display: block;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.workflow-list strong {
  display: block;
  margin-top: 8px;
  line-height: 1.35;
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 14px;
  margin-top: 14px;
}

.operation-list li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.operation-list p {
  margin: 0;
}

.tip-card {
  background: #f1f6fc;
}

.tip-card.warning {
  background: #fff8eb;
}

.screenshot-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.screenshot-gallery.single {
  grid-template-columns: minmax(0, 520px);
}

.screenshot-card {
  margin: 0;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.screenshot-trigger {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(24, 33, 47, 0.08);
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.screenshot-trigger:focus-visible {
  outline: 3px solid rgba(31, 143, 114, 0.32);
  outline-offset: 3px;
}

.screenshot-trigger img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.18s ease;
}

.screenshot-trigger span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(18, 99, 81, 0.92);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.screenshot-trigger:hover img {
  transform: scale(1.015);
}

.screenshot-card figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.image-preview {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 24, 40, 0.72);
}

.image-preview[hidden] {
  display: none;
}

.image-preview-dialog {
  display: grid;
  gap: 10px;
  max-width: min(1120px, 100%);
  max-height: calc(100vh - 48px);
  margin: 0;
}

.image-preview-dialog img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 104px);
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.image-preview-dialog figcaption {
  color: #fff;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
}

.image-preview-close {
  position: fixed;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  box-shadow: var(--shadow);
}

.faq-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.faq-list summary {
  cursor: pointer;
  padding: 12px;
  font-weight: 800;
}

.faq-list summary span {
  margin-right: 8px;
  color: var(--green);
}

.faq-list p {
  margin: 0;
  padding: 0 12px 12px;
}

@media (max-width: 860px) {
  .header-inner {
    grid-template-columns: 1fr;
    width: min(100% - 28px, 480px);
  }

  .top-navigation {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .mobile-manual-bar {
    position: sticky;
    top: 126px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(100% - 28px, 480px);
    margin: 10px auto 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  .toc-toggle {
    padding: 0 12px;
    background: var(--green-dark);
    color: #fff;
  }

  .manual-shell {
    display: block;
    width: min(100% - 28px, 480px);
    margin-top: 12px;
  }

  .chapter-directory {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 60;
    width: min(320px, 86vw);
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    transform: translateX(-105%);
    transition: transform 0.18s ease;
  }

  body.drawer-open .chapter-directory {
    transform: translateX(0);
  }

  .drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(16, 24, 40, 0.28);
  }

  .hero-section,
  .guide-layout {
    grid-template-columns: 1fr;
  }

  .hero-section img {
    height: 160px;
  }

  .screenshot-gallery,
  .screenshot-gallery.single {
    grid-template-columns: 1fr;
  }

  .image-preview {
    padding: 14px;
  }

  .image-preview-dialog {
    max-height: calc(100vh - 28px);
  }

  .image-preview-dialog img {
    max-height: calc(100vh - 86px);
  }
}

@media print {
  .manual-header,
  .mobile-manual-bar,
  .chapter-directory,
  .drawer-overlay,
  .image-preview {
    display: none !important;
  }

  .manual-shell {
    display: block;
    width: 100%;
    margin: 0;
  }

  .manual-section {
    break-inside: avoid;
    box-shadow: none;
  }
}
