:root {
  --docs-ink: #27211b;
  --docs-muted: #71665a;
  --docs-line: rgba(126, 87, 48, 0.17);
  --docs-paper: #fffdf8;
  --docs-warm: #f4e6d2;
  --docs-accent: #b86f2f;
  --docs-accent-strong: #8f4e1d;
  --docs-green: #1e725d;
  --docs-header-height: 76px;
}

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

.tutorial-page {
  min-width: 0;
  /* Unlike hidden, clip does not create an ancestor scroll container for sticky navigation. */
  overflow-x: clip;
  color: var(--docs-ink);
  background: radial-gradient(ellipse at 80% 0%, #f4e8d7, transparent 42rem), #f8f6f1;
  overflow-wrap: anywhere;
}

.tutorial-page [hidden] { display: none !important; }
.tutorial-page.has-tutorial-lightbox { overflow: hidden; }
.docs-search-card input::-webkit-search-cancel-button { -webkit-appearance: none; }
.tutorial-page :is(a, button, input, summary):focus-visible { outline: 2px solid var(--docs-accent); outline-offset: 4px; }

.tutorial-site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  max-width: none;
  min-height: var(--docs-header-height);
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 24px;
  padding: 12px max(24px, calc((100vw - 1320px) / 2));
  border-radius: 0;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 1px 0 var(--docs-line);
  backdrop-filter: blur(18px);
}

.tutorial-page main {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
}
.tutorial-site-header .brand img { width: 40px; height: 40px; border-radius: 12px; }
.tutorial-site-header .site-nav { display: flex; }

.docs-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 390px);
  gap: 48px;
  align-items: center;
  padding: 54px 0 40px;
}

.docs-eyebrow,
.docs-kicker {
  color: var(--docs-accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.docs-hero h1 {
  max-width: 800px;
  margin: 16px 0;
  font-family: inherit;
  font-size: clamp(2rem, 3.3vw, 3rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.045em;
}

.docs-hero-copy > p {
  max-width: 760px;
  margin: 0;
  color: var(--docs-muted);
  font-size: 0.98rem;
  line-height: 1.8;
}

.docs-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
}

.docs-meta span,
.docs-highlights span {
  border: 1px solid var(--docs-line);
  border-radius: 999px;
  padding: 7px 11px;
  color: #6f5035;
  background: rgba(255, 253, 248, 0.72);
  font-size: 0.77rem;
  font-weight: 700;
}

.docs-search-card {
  border: 1px solid rgba(157, 96, 42, 0.22);
  border-radius: 18px;
  padding: 22px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: 0 10px 30px rgba(82, 51, 24, 0.05);
}

.docs-search-card > label {
  display: block;
  margin-bottom: 10px;
  color: #4a392a;
  font-size: 0.82rem;
  font-weight: 800;
}

.docs-search-card > div:first-of-type {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(152, 102, 53, 0.22);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
}

.docs-search-card input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--docs-ink);
  background: transparent;
  font: inherit;
  width: 100%;
  font-size: 16px;
}
.docs-search-field:focus-within { border-color: var(--docs-accent); box-shadow: 0 0 0 3px #b86f2f15; }
.docs-search-clear { width: 30px; height: 30px; border: 0; border-radius: 8px; background: #f4efe7; color: var(--docs-muted); font-size: 20px; cursor: pointer; }

.docs-search-card p {
  min-height: 1.4em;
  margin: 10px 2px 0;
  color: #8b7d6d;
  font-size: 0.76rem;
  line-height: 1.5;
}

.docs-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.docs-quick-links a {
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--docs-accent-strong);
  background: var(--docs-warm);
  font-size: 0.72rem;
  font-weight: 750;
}

.docs-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  padding-bottom: 90px;
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--docs-header-height) + 20px);
  max-height: calc(100vh - var(--docs-header-height) - 40px);
  overflow: auto;
  border: 1px solid var(--docs-line);
  border-radius: 18px;
  padding: 17px 13px;
  background: #fffdf8;
  scrollbar-width: thin;
}

.docs-sidebar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 12px;
}

.docs-sidebar-title strong {
  font-family: inherit;
  font-size: 1.05rem;
}

.docs-sidebar-title span {
  color: #9b8065;
  font-size: 0.68rem;
}

.docs-sidebar nav,
.docs-sidebar nav section {
  display: grid;
  gap: 3px;
}

.docs-sidebar nav {
  gap: 13px;
}

.docs-sidebar nav section > span {
  padding: 0 9px 4px;
  color: #aa8a69;
  font-size: 0.63rem;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.docs-sidebar a {
  display: block;
  border-radius: 10px;
  padding: 8px 10px;
  color: #6f6256;
  font-size: 0.86rem;
  font-weight: 650;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}
.docs-directory-toggle { display: none; }

.docs-sidebar a:hover,
.docs-sidebar a.is-active {
  color: #6f3c17;
  background: #f2dec1;
  transform: translateX(2px);
}

.docs-content {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.docs-chapter {
  scroll-margin-top: 0;
  overflow: hidden;
  border: 1px solid var(--docs-line);
  border-radius: 20px;
  padding: clamp(24px, 3vw, 36px);
  background: var(--docs-paper);
  box-shadow: 0 4px 18px rgba(70, 48, 29, 0.035);
}

.docs-chapter[hidden] {
  display: none;
}

.docs-chapter-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 26px;
  align-items: start;
}

.docs-chapter h2 {
  margin: 8px 0 10px;
  font-family: inherit;
  font-size: clamp(1.4rem, 2.3vw, 1.85rem);
  line-height: 1.45;
  letter-spacing: -0.025em;
}

.docs-chapter-header p {
  max-width: 850px;
  margin: 0;
  color: var(--docs-muted);
  line-height: 1.75;
}

.docs-duration {
  border-radius: 999px;
  padding: 8px 12px;
  color: #7a5230;
  background: var(--docs-warm);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.docs-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 22px;
}

.docs-download-callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  margin-top: 24px;
  border: 1px solid rgba(30, 114, 93, 0.24);
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(125deg, rgba(225, 243, 235, 0.85), rgba(255, 253, 248, 0.95));
}

.docs-download-callout > div:first-child {
  display: grid;
  gap: 4px;
}

.docs-download-callout span {
  color: var(--docs-green);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.docs-download-callout strong {
  font-size: 1rem;
}

.docs-download-callout p {
  margin: 0;
  color: #64776d;
  font-size: 0.75rem;
}

.docs-download-callout > div:last-child {
  display: flex;
  gap: 8px;
}

.docs-download-callout a {
  border: 1px solid rgba(30, 114, 93, 0.25);
  border-radius: 10px;
  padding: 9px 11px;
  color: #fff;
  background: var(--docs-green);
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.docs-download-callout a + a {
  color: var(--docs-green);
  background: #fff;
}

.docs-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 14px;
  margin-top: 28px;
}

.docs-media-card {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--docs-line);
  border-radius: 18px;
  background: #efe4d4;
}

.docs-media-open {
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.docs-media-card img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  object-position: top center;
  transition: transform 240ms ease;
}
.docs-media-zoom { position: absolute; right: 12px; bottom: 12px; border: 1px solid var(--docs-line); border-radius: 8px; padding: 5px 10px; color: var(--docs-ink); background: #fffdf8ee; font-size: 12px; box-shadow: 0 3px 12px #27211b12; }

.docs-media-open:hover img {
  transform: scale(1.012);
}

.docs-media-card figcaption {
  border-top: 1px solid var(--docs-line);
  padding: 10px 13px;
  color: #76695c;
  background: #fffdfa;
  font-size: 0.75rem;
  line-height: 1.55;
}

.docs-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 32px 0 12px;
}

.docs-section-title span {
  font-family: "Songti SC", "STSong", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.docs-section-title strong {
  color: var(--docs-accent);
  font-size: 0.72rem;
}

.docs-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.docs-steps > li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 13px;
  border: 1px solid var(--docs-line);
  border-radius: 16px;
  padding: 17px;
  background: rgba(249, 243, 234, 0.58);
}

.docs-step-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: #7a431b;
  background: #edc48d;
  font-size: 0.7rem;
  font-weight: 850;
}

.docs-steps h3 {
  margin: 1px 0 7px;
  font-size: 0.95rem;
}

.docs-steps p,
.docs-steps ul {
  color: var(--docs-muted);
  font-size: 0.9rem;
  line-height: 1.85;
}

.docs-steps p {
  margin: 0;
}

.docs-steps ul {
  display: grid;
  gap: 4px;
  margin: 9px 0 0;
  padding-left: 17px;
  color: #8b7968;
}

.docs-tips {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 15px;
  margin-top: 16px;
  border: 1px solid rgba(159, 103, 50, 0.2);
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(120deg, #f3dfc2, #fffaf2);
}

.docs-tips strong {
  color: #74431e;
  font-size: 0.8rem;
}

.docs-tips ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 17px;
  color: #705f50;
  font-size: 0.86rem;
  line-height: 1.6;
}

.docs-related {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  border-top: 1px solid var(--docs-line);
  padding-top: 16px;
}

.docs-related span {
  margin-right: 4px;
  color: #756655;
  font-size: 0.75rem;
  font-weight: 800;
}

.docs-related a {
  border: 1px solid var(--docs-line);
  border-radius: 999px;
  padding: 6px 10px;
  color: #794b25;
  background: #fffaf3;
  font-size: 0.72rem;
  font-weight: 700;
}

.docs-faq-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 24px 0 16px;
}

.docs-faq-filters button {
  border: 1px solid var(--docs-line);
  border-radius: 999px;
  padding: 7px 11px;
  color: #77695c;
  background: #fffaf3;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.docs-faq-filters button.is-active {
  border-color: #b77a40;
  color: #fff;
  background: #a96329;
}

.docs-faq-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.docs-faq-list details {
  align-self: start;
  border: 1px solid var(--docs-line);
  border-radius: 14px;
  background: #fffefa;
}

.docs-faq-list details[hidden] {
  display: none;
}

.docs-faq-list summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}

.docs-faq-list summary::-webkit-details-marker {
  display: none;
}

.docs-faq-list summary span {
  display: grid;
  gap: 4px;
  color: #46382c;
  font-size: 0.82rem;
  font-weight: 800;
}

.docs-faq-list summary small {
  color: #b4783e;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
}

.docs-faq-list summary b {
  color: #a06029;
  font-size: 1.15rem;
  transition: transform 160ms ease;
}

.docs-faq-list details[open] summary b {
  transform: rotate(45deg);
}

.docs-faq-list details > p {
  margin: 0;
  border-top: 1px solid var(--docs-line);
  padding: 13px 14px 15px;
  color: var(--docs-muted);
  font-size: 0.9rem;
  line-height: 1.75;
}

.docs-empty {
  border: 1px dashed rgba(166, 101, 43, 0.32);
  border-radius: 18px;
  padding: 28px;
  color: #806c59;
  text-align: center;
  background: #fffaf2;
}

.docs-lightbox {
  width: min(1500px, calc(100vw - 40px));
  max-width: none;
  border: 0;
  border-radius: 18px;
  padding: 10px;
  background: #1e1a16;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.42);
}

.docs-lightbox::backdrop {
  background: rgba(20, 17, 14, 0.8);
  backdrop-filter: blur(8px);
}

.docs-lightbox img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 80px);
  border-radius: 12px;
  object-fit: contain;
}

.docs-lightbox button {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  color: #fff;
  background: rgba(22, 18, 15, 0.7);
  font-size: 1.3rem;
  cursor: pointer;
}

.tutorial-footer {
  margin-top: 0;
}
.docs-back-top { position: fixed; right: 24px; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 30; display: grid; place-items: center; gap: 1px; min-width: 64px; min-height: 64px; padding: 8px; border: 1px solid var(--docs-line); border-radius: 14px; background: #fffdf8f5; color: var(--docs-accent-strong); box-shadow: 0 5px 20px #27211b12; font-size: 10px; }
.docs-back-top > span:first-child { font-size: 22px; line-height: 1; }

@media (max-width: 960px) {
  .tutorial-page main {
    width: min(100% - 28px, 980px);
  }

  .docs-hero {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 36px;
  }

  .docs-shell {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: sticky;
    top: var(--docs-header-height);
    z-index: 20;
    max-height: calc(100vh - var(--docs-header-height) - 16px);
    overflow: auto;
    border-radius: 14px;
    padding: 10px 12px;
  }

  .tutorial-page[data-tutorial-ready="true"] .docs-sidebar-title,
  .tutorial-page[data-tutorial-ready="true"] .docs-sidebar:not(.is-open) nav {
    display: none;
  }

  .tutorial-page:not([data-tutorial-ready="true"]) .docs-sidebar {
    position: static;
    max-height: none;
  }

  .docs-directory-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 40px; border: 0; padding: 2px 6px; background: transparent; color: var(--docs-ink); font: inherit; font-size: 14px; cursor: pointer; }
  .docs-directory-toggle strong { margin-left: 12px; color: var(--docs-accent-strong); font-size: 12px; font-weight: 500; }
  .docs-directory-toggle > span:last-child { transition: transform 150ms ease; }
  .docs-directory-toggle[aria-expanded="true"] > span:last-child { transform: rotate(180deg); }
  .docs-sidebar nav { gap: 16px; padding: 12px 5px 6px; }
  .docs-sidebar a { min-height: 42px; }
  html { scroll-padding-top: calc(var(--docs-header-height) + 80px); }
}

@media (max-width: 720px) {
  :root { --docs-header-height: 64px; }
  .tutorial-site-header { padding: 10px 16px; }
  .tutorial-site-header .brand { font-size: 18px; }
  .tutorial-site-header .brand img { width: 36px; height: 36px; }
  .tutorial-site-header .site-nav a:not(.nav-contact) {
    display: none;
  }

  .docs-hero {
    padding: 28px 2px;
  }

  .docs-hero h1 {
    font-size: clamp(1.85rem, 7.6vw, 2.5rem);
  }
  .docs-hero h1 span { display: block; }

  .docs-chapter {
    border-radius: 18px;
    padding: 22px 16px;
  }

  .docs-chapter-header {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .docs-duration {
    justify-self: start;
  }

  .docs-download-callout {
    grid-template-columns: 1fr;
  }

  .docs-download-callout > div:last-child {
    flex-wrap: wrap;
  }

  .docs-media-zoom { right: 7px; bottom: 7px; padding: 3px 7px; font-size: 10px; }
  .docs-back-top { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); min-width: 52px; min-height: 52px; }

  .docs-steps,
  .docs-faq-list {
    grid-template-columns: 1fr;
  }

  .docs-tips {
    grid-template-columns: 1fr;
  }
}

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

  .docs-sidebar a,
  .docs-media-card img,
  .docs-faq-list summary b {
    transition: none;
  }
}
