:root { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

html { scroll-behavior: smooth; }

body.guide-page {
  min-height: 100vh;
  margin: 0;
  background: var(--secondary-bg);
  color: var(--secondary-ink);
  font-family: Inter, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  transition: color 240ms ease, background-color 240ms ease;
}

.guide-page .guide-shell {
  width: min(1240px, calc(100% - 80px));
  max-width: none;
  margin: 0 auto;
  padding: 74px 0 100px;
}

.guide-page .guide-header {
  max-width: 920px;
  margin-bottom: 66px;
  animation: refmuse-soft-enter 520ms 60ms ease both;
}

.guide-eyebrow {
  margin: 0 0 22px;
  color: var(--secondary-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
}

.guide-page .guide-title {
  margin: 0 0 22px;
  color: var(--secondary-ink);
  font-size: clamp(44px, 6vw, 78px);
  font-weight: 560;
  letter-spacing: -0.065em;
  line-height: 1.04;
}

.guide-page .guide-subtitle {
  max-width: 650px;
  margin: 0;
  color: var(--secondary-muted);
  font-size: 14px;
  line-height: 1.9;
}

.guide-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 820px);
  justify-content: space-between;
  align-items: start;
  gap: 72px;
}

.guide-toc-column { min-width: 0; }

.guide-page .guide-toc {
  position: sticky;
  top: 110px;
  max-height: calc(100vh - 140px);
  margin: 0;
  padding: 0 20px 0 0;
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  scrollbar-width: thin;
  scrollbar-color: var(--secondary-line) transparent;
}

.guide-page .guide-toc-title {
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--secondary-line);
  color: var(--secondary-muted);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.guide-page .guide-toc-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  counter-reset: guide-toc;
}

.guide-page .guide-toc-list li { counter-increment: guide-toc; }

.guide-page .guide-toc-list a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 0 0 20px;
  color: var(--secondary-muted);
  font-size: 12px;
  text-decoration: none;
  transition: color 160ms ease, transform 160ms ease;
}

.guide-page .guide-toc-list a::before {
  content: counter(guide-toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  color: var(--secondary-muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 8px;
  opacity: 0.65;
}

.guide-page .guide-toc-list a:hover { color: var(--secondary-ink); text-decoration: none; transform: translateX(2px); }
.guide-page .guide-toc-list a.is-current { color: var(--secondary-ink); font-weight: 600; }
.guide-page .guide-toc-list a.is-current::after {
  content: "";
  position: absolute;
  right: 0;
  width: 14px;
  height: 1px;
  background: currentColor;
}

.guide-content { min-width: 0; }

.guide-page .guide-section {
  margin-bottom: 78px;
  scroll-margin-top: 118px;
  transition: opacity 420ms ease, transform 420ms ease;
}

.guide-page .guide-section.guide-reveal { opacity: 0; transform: translateY(16px); }
.guide-page .guide-section.guide-reveal.is-visible { opacity: 1; transform: translateY(0); }

.guide-page .guide-section-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 30px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--secondary-line);
  color: var(--secondary-ink);
  font-size: 25px;
  font-weight: 580;
  letter-spacing: -0.035em;
}

.guide-page .guide-section-title::before {
  content: "↳";
  color: var(--secondary-muted);
  font-family: ui-monospace, monospace;
  font-size: 15px;
  font-weight: 400;
}

.guide-page .guide-step-list { gap: 24px; }
.guide-page .guide-step { gap: 18px; }

.guide-page .guide-step-num {
  width: 30px;
  height: 30px;
  border: 1px solid var(--secondary-line);
  border-radius: 50%;
  background: transparent;
  color: var(--secondary-muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
  font-weight: 500;
}

.guide-page .guide-step-body strong {
  margin-bottom: 7px;
  color: var(--secondary-ink);
  font-size: 14px;
}

.guide-page .guide-step-body p,
.guide-page .guide-section > p {
  color: var(--secondary-muted) !important;
  font-size: 13px !important;
  line-height: 1.9 !important;
}

.guide-page .guide-feature-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--secondary-line);
  border-radius: 5px;
  background: var(--secondary-line);
}

.guide-page .guide-feature-card {
  min-height: 130px;
  padding: 24px;
  border-radius: 0;
  background: var(--secondary-panel);
  transition: background-color 180ms ease;
}

.guide-page .guide-feature-card:hover { background: var(--secondary-soft); }

.guide-page .guide-feature-card-title {
  margin-bottom: 12px;
  color: var(--secondary-ink);
  font-size: 13px;
}

.guide-page .guide-feature-card p {
  color: var(--secondary-muted);
  font-size: 12px;
  line-height: 1.85;
}

.guide-page .guide-callout {
  gap: 14px;
  margin-bottom: 30px;
  padding: 18px 20px;
  border: 1px solid var(--secondary-line);
  border-left: 2px solid var(--secondary-ink);
  border-radius: 3px;
  background: var(--secondary-panel);
  color: var(--secondary-muted);
  font-size: 12px;
  line-height: 1.85;
}

.guide-page .guide-callout-icon {
  color: var(--secondary-ink);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.guide-page .guide-model-table,
.guide-page .guide-kbd-table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--secondary-line);
  border-radius: 4px;
  background: var(--secondary-panel);
  font-size: 12px;
  white-space: nowrap;
}

.guide-page .guide-model-table thead,
.guide-page .guide-model-table tbody,
.guide-page .guide-kbd-table thead,
.guide-page .guide-kbd-table tbody { width: 100%; }

.guide-page .guide-model-table th,
.guide-page .guide-kbd-table th {
  padding: 14px 16px;
  border-bottom: 1px solid var(--secondary-line);
  color: var(--secondary-muted);
  font-size: 9px;
}

.guide-page .guide-model-table td,
.guide-page .guide-kbd-table td {
  min-width: 110px;
  padding: 16px;
  border-bottom: 1px solid var(--secondary-line);
  color: var(--secondary-muted);
  white-space: normal;
  line-height: 1.75;
}

.guide-page .guide-model-name { color: var(--secondary-ink); }
.guide-page .guide-model-desc { color: var(--secondary-muted); }

.guide-page .guide-badge,
.guide-page .guide-badge.blue,
.guide-page .guide-badge.green,
.guide-page .guide-badge.orange {
  margin-left: 6px;
  padding: 2px 7px;
  border: 1px solid var(--secondary-line);
  border-radius: 3px;
  background: var(--secondary-soft);
  color: var(--secondary-ink);
  font-size: 9px;
}

.guide-page kbd {
  padding: 2px 7px;
  border: 1px solid var(--secondary-line);
  border-radius: 3px;
  background: var(--secondary-soft);
  color: var(--secondary-ink);
  box-shadow: 0 1px 0 var(--secondary-line);
}

.guide-page code { color: var(--secondary-ink); }

@media (max-width: 960px) {
  .guide-page .guide-shell { width: calc(100% - 48px); }
  .guide-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 40px; }
}

@media (max-width: 720px) {
  .guide-page .guide-shell { width: calc(100% - 32px); padding: 46px 0 70px; }
  .guide-page .guide-header { margin-bottom: 42px; }
  .guide-page .guide-title { font-size: 44px; }
  .guide-layout { display: block; }
  .guide-toc-column { margin-bottom: 52px; }
  .guide-page .guide-toc { position: static; max-height: none; padding: 0; overflow: visible; }
  .guide-page .guide-toc-title { margin-bottom: 10px; }
  .guide-page .guide-toc-list { flex-direction: row; flex-wrap: wrap; gap: 4px 16px; }
  .guide-page .guide-toc-list a { min-height: 30px; padding-left: 0; }
  .guide-page .guide-toc-list a::before,
  .guide-page .guide-toc-list a.is-current::after { display: none; }
  .guide-page .guide-toc-list a.is-current { text-decoration: underline; text-underline-offset: 5px; }
  .guide-page .guide-section { margin-bottom: 58px; scroll-margin-top: 140px; }
  .guide-page .guide-section-title { font-size: 23px; }
}

@media (max-width: 520px) {
  .guide-page .guide-feature-grid { grid-template-columns: 1fr; }
  .guide-page .guide-feature-card { min-height: 0; padding: 20px; }
  .guide-page .guide-step { gap: 13px; }
  .guide-page .guide-callout { padding: 16px; }
  .guide-page .guide-model-table td,
  .guide-page .guide-kbd-table td { min-width: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .guide-page .guide-header,
  .guide-page .guide-section { animation: none !important; transition: none !important; }
  .guide-page .guide-section.guide-reveal { opacity: 1; transform: none; }
  .guide-page .guide-toc-list a,
  .guide-page .guide-feature-card { transition: none !important; }
}
