:root {
  color-scheme: light;
  --paper: #f4f0e7;
  --paper-soft: #fbf8f0;
  --ink: #1f2a2a;
  --muted: #66716d;
  --line: #d8d0c0;
  --deep: #123737;
  --deep-2: #1f5750;
  --rust: #b75e3d;
  --title: #8f3f2a;
  --title-2: #1f5750;
  --gold: #d4a94f;
  --sage: #dbe6dc;
  --shadow: 0 22px 55px rgba(31, 42, 42, 0.14);
  --shadow-hover: 0 24px 46px rgba(18, 55, 55, 0.18);
  --glow: 0 0 0 4px rgba(212, 169, 79, 0.16);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 8px;
  --side: 286px;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(18, 55, 55, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(18, 55, 55, 0.055) 1px, transparent 1px),
    var(--paper);
  background-size: 34px 34px;
  line-height: 1.72;
  letter-spacing: 0;
}

body.nav-locked {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

:focus-visible {
  outline: 3px solid rgba(183, 94, 61, 0.55);
  outline-offset: 4px;
}

p,
h1,
h2,
h3 {
  margin: 0;
}

p {
  color: var(--muted);
}

h1,
h2,
h3 {
  line-height: 1.18;
  letter-spacing: 0;
}

.jump-link {
  position: fixed;
  left: 14px;
  top: 14px;
  z-index: 30;
  transform: translateY(-150%);
  padding: 9px 13px;
  border-radius: 6px;
  background: var(--deep);
  color: #fff;
  font-size: 0.9rem;
}

.jump-link:focus {
  transform: translateY(0);
}

.page-shell {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  min-height: 100vh;
}

.side-index {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 22px;
  background:
    linear-gradient(180deg, rgba(212, 169, 79, 0.12), transparent 32%),
    #102d2d;
  color: #eef4ec;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow-y: auto;
  box-shadow: 14px 0 38px rgba(18, 55, 55, 0.12);
}

.mark {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border-radius: var(--radius);
  transition: transform 0.28s var(--ease);
}

.mark img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  object-fit: cover;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), border-color 0.28s ease;
}

.mark:hover {
  transform: translateX(3px);
}

.mark:hover img {
  border-color: rgba(212, 169, 79, 0.72);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
  transform: rotate(-3deg) scale(1.04);
}

.mark strong,
.mark small {
  display: block;
}

.mark strong {
  font-size: 0.96rem;
  color: #fff;
}

.mark small {
  color: rgba(238, 244, 236, 0.7);
  font-size: 0.78rem;
}

.index-switch {
  display: none;
}

.index-links {
  display: grid;
  gap: 7px;
}

.index-links a {
  position: relative;
  isolation: isolate;
  padding: 10px 12px 10px 18px;
  border-radius: 6px;
  color: rgba(238, 244, 236, 0.78);
  font-size: 0.95rem;
  overflow: hidden;
  transition: background 0.22s ease, color 0.22s ease, transform 0.22s var(--ease), box-shadow 0.22s ease;
}

.index-links a::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(238, 244, 236, 0.38);
  transform: translateY(-50%);
  transition: width 0.22s ease, height 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.index-links a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(212, 169, 79, 0.18), rgba(255, 255, 255, 0.08));
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.22s ease, transform 0.22s var(--ease);
}

.index-links a:hover,
.index-links a.is-current {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.index-links a:hover::after,
.index-links a.is-current::after {
  opacity: 1;
  transform: translateX(0);
}

.index-links a.is-current::before {
  height: 18px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(212, 169, 79, 0.55);
}

.index-links a:hover::before {
  width: 12px;
  background: var(--gold);
}

.download-box {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  transition: transform 0.28s var(--ease), border-color 0.28s ease, background 0.28s ease;
}

.download-box:hover {
  border-color: rgba(212, 169, 79, 0.52);
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-3px);
}

.download-box span,
.download-box strong,
.download-box a {
  display: block;
}

.download-box span {
  color: rgba(238, 244, 236, 0.68);
  font-size: 0.78rem;
}

.download-box strong {
  margin-top: 3px;
  color: #fff;
  font-size: 1.05rem;
}

.download-box a {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 6px;
  text-align: center;
  color: #162525;
  background: var(--gold);
  font-weight: 700;
  transition: transform 0.24s var(--ease), box-shadow 0.24s ease, background 0.24s ease;
}

.download-box a:hover {
  background: #e1b85d;
  box-shadow: 0 12px 24px rgba(212, 169, 79, 0.24);
  transform: translateY(-2px);
}

.content-pane {
  min-width: 0;
  padding: 40px clamp(24px, 5vw, 72px) 0;
}

.opening {
  min-height: min(720px, calc(100vh - 80px));
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(340px, 0.78fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
  padding: 30px 0 50px;
}

.opening-copy {
  max-width: 760px;
}

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--rust);
  font-size: 0.9rem;
  font-weight: 700;
}

.crumb::before {
  content: "";
  width: 24px;
  height: 2px;
  background: currentColor;
}

.opening h1 {
  margin-top: 18px;
  max-width: 820px;
  font-size: clamp(2rem, 4.1vw, 4.25rem);
  color: var(--title);
  text-decoration: underline;
  text-decoration-color: rgba(212, 169, 79, 0.62);
  text-decoration-thickness: 5px;
  text-underline-offset: 9px;
}

.summary {
  margin-top: 22px;
  max-width: 760px;
  font-size: 1.08rem;
  color: #53605b;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.solid-link,
.plain-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 6px;
  font-weight: 700;
  position: relative;
  overflow: hidden;
  transition: transform 0.24s var(--ease), box-shadow 0.24s ease, border-color 0.24s ease, background 0.24s ease, color 0.24s ease;
}

.solid-link::after,
.plain-link::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.28) 45%, transparent 72%);
  transform: translateX(-120%);
  transition: transform 0.55s var(--ease);
}

.solid-link:hover::after,
.plain-link:hover::after {
  transform: translateX(120%);
}

.solid-link {
  color: #fff;
  background: var(--deep);
  box-shadow: 0 14px 28px rgba(18, 55, 55, 0.2);
}

.solid-link:hover {
  background: #174646;
  box-shadow: 0 18px 34px rgba(18, 55, 55, 0.26);
  transform: translateY(-3px);
}

.plain-link {
  color: var(--deep);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
}

.plain-link:hover {
  color: #fff;
  border-color: var(--deep-2);
  background: var(--deep-2);
  box-shadow: 0 14px 28px rgba(31, 87, 80, 0.18);
  transform: translateY(-3px);
}

.cover-note {
  margin: 0;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: rotate(1.2deg);
  transition: transform 0.36s var(--ease), box-shadow 0.36s ease, border-color 0.36s ease;
}

.cover-note:hover {
  border-color: rgba(212, 169, 79, 0.64);
  box-shadow: 0 28px 68px rgba(18, 55, 55, 0.2);
  transform: rotate(0deg) translateY(-6px);
}

.cover-note img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.cover-note:hover img {
  transform: scale(1.035);
}

.cover-note figcaption {
  padding: 14px 16px 16px;
  color: #58635f;
  font-size: 0.92rem;
  background: #fffaf0;
}

.fact-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 34px;
  border: 1px solid var(--line);
  background: var(--line);
}

.fact-strip article {
  min-height: 112px;
  padding: 18px;
  background: rgba(251, 248, 240, 0.9);
  transition: transform 0.24s var(--ease), background 0.24s ease, box-shadow 0.24s ease;
}

.fact-strip article:hover {
  position: relative;
  z-index: 1;
  background: #fffaf0;
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.fact-strip span {
  display: block;
  color: var(--rust);
  font-size: 0.78rem;
  font-weight: 700;
}

.fact-strip strong {
  display: block;
  margin-top: 9px;
  color: var(--deep);
  font-size: 1.02rem;
  line-height: 1.38;
}

.reading-block {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  padding: 58px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 24px;
}

.section-label {
  position: sticky;
  top: 28px;
  align-self: start;
}

.section-label span {
  display: block;
  color: var(--rust);
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
}

.section-label p {
  margin-top: 8px;
  color: var(--deep);
  font-weight: 800;
}

.article-flow {
  max-width: 980px;
}

.article-flow h2,
.ledger-head h2,
.question-bank h2 {
  color: var(--title-2);
  font-size: clamp(1.45rem, 2.35vw, 2.35rem);
  border-left: 5px solid var(--gold);
  padding-left: 14px;
}

.article-flow > p {
  margin-top: 18px;
  font-size: 1.02rem;
  color: #4f5d58;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.note-grid article {
  padding: 20px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--deep-2);
  border-radius: var(--radius);
  background: rgba(251, 248, 240, 0.82);
  transition: transform 0.26s var(--ease), border-color 0.26s ease, box-shadow 0.26s ease, background 0.26s ease;
}

.note-grid article:hover {
  border-color: rgba(31, 87, 80, 0.35);
  border-left-color: var(--gold);
  background: #fffaf0;
  box-shadow: var(--shadow-hover);
  transform: translateY(-5px);
}

.note-grid b {
  display: block;
  color: var(--deep);
  font-size: 1.04rem;
}

.note-grid p {
  margin-top: 8px;
  color: #5a6863;
}

.route-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--line);
  gap: 1px;
  margin-top: 28px;
}

.route-board article {
  min-height: 238px;
  padding: 22px;
  background: var(--paper-soft);
  transition: transform 0.26s var(--ease), background 0.26s ease, box-shadow 0.26s ease;
}

.route-board article:hover {
  position: relative;
  z-index: 1;
  background: #fffaf0;
  box-shadow: var(--shadow-hover);
  transform: translateY(-5px);
}

.route-board span {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--rust);
  font-size: 0.78rem;
  font-weight: 800;
  transition: background 0.24s ease, box-shadow 0.24s ease;
}

.route-board article:hover span {
  background: var(--deep-2);
  box-shadow: var(--glow);
}

.route-board h3 {
  margin-top: 16px;
  color: var(--deep);
  font-size: 1.22rem;
}

.route-board p {
  margin-top: 10px;
  color: #5b6863;
}

.media-ledger,
.question-bank {
  padding: 58px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 24px;
}

.ledger-head {
  display: grid;
  grid-template-columns: minmax(0, 0.65fr) minmax(260px, 0.35fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 26px;
}

.ledger-head p:last-child {
  color: #596762;
}

.shot-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 34%);
  gap: 14px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding-bottom: 12px;
  scrollbar-color: var(--deep-2) rgba(18, 55, 55, 0.12);
}

.shot-row figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-soft);
  overflow: hidden;
  transition: transform 0.28s var(--ease), border-color 0.28s ease, box-shadow 0.28s ease;
}

.shot-row figure:hover {
  border-color: rgba(212, 169, 79, 0.64);
  box-shadow: var(--shadow-hover);
  transform: translateY(-5px);
}

.shot-row img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.5s var(--ease), filter 0.5s ease;
}

.shot-row figure:hover img {
  filter: saturate(1.08) contrast(1.04);
  transform: scale(1.045);
}

.shot-row figcaption {
  padding: 10px 12px;
  color: var(--deep);
  font-weight: 700;
}

.version-list {
  counter-reset: versions;
  display: grid;
  gap: 0;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.version-list li {
  counter-increment: versions;
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  transition: padding-inline 0.24s var(--ease), background 0.24s ease, box-shadow 0.24s ease;
}

.version-list li:hover {
  padding-inline: 12px;
  background: rgba(255, 250, 240, 0.76);
  box-shadow: inset 4px 0 0 var(--gold);
}

.version-list time {
  color: var(--rust);
  font-weight: 800;
}

.version-list p {
  color: #52605b;
}

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

.qa-list article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 248, 240, 0.86);
  transition: transform 0.26s var(--ease), border-color 0.26s ease, box-shadow 0.26s ease, background 0.26s ease;
}

.qa-list article:hover {
  border-color: rgba(183, 94, 61, 0.38);
  background: #fffaf0;
  box-shadow: var(--shadow-hover);
  transform: translateY(-5px);
}

.qa-list h3 {
  color: var(--deep);
  font-size: 1.12rem;
}

.qa-list p {
  margin-top: 10px;
  color: #5b6863;
}

.site-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 10px;
  padding: 28px 0 36px;
  border-top: 1px solid var(--line);
}

.site-foot p {
  color: #66716d;
}

.site-foot a {
  color: var(--deep);
  font-weight: 800;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.site-foot a:hover {
  color: var(--rust);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

@media (max-width: 1180px) {
  :root {
    --side: 250px;
  }

  .opening {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .cover-note {
    max-width: 720px;
    transform: none;
  }

  .cover-note:hover {
    transform: translateY(-4px);
  }

  .fact-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .route-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .page-shell {
    display: block;
  }

  .side-index {
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    padding: 12px 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    overflow: visible;
  }

  .mark {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .mark img {
    width: 40px;
    height: 40px;
  }

  .index-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 0 12px;
    font: inherit;
    font-weight: 700;
    transition: background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  }

  .index-switch:hover,
  .index-switch.is-open {
    border-color: rgba(212, 169, 79, 0.5);
    background: rgba(255, 255, 255, 0.14);
    box-shadow: var(--glow);
  }

  .index-switch i {
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
  }

  .index-switch.is-open i {
    transform: rotate(225deg) translateY(-2px);
  }

  .index-links {
    position: absolute;
    left: 12px;
    right: 12px;
    top: calc(100% + 8px);
    display: none;
    padding: 10px;
    border-radius: var(--radius);
    background: #102d2d;
    box-shadow: var(--shadow);
  }

  .index-links.is-open {
    display: grid;
    animation: menu-in 0.22s var(--ease);
  }

  .download-box {
    display: none;
  }

  .content-pane {
    padding: 28px 18px 0;
  }

  .opening h1 {
    font-size: clamp(1.85rem, 8.2vw, 3rem);
  }

  .fact-strip,
  .note-grid,
  .route-board,
  .qa-list,
  .ledger-head {
    grid-template-columns: 1fr;
  }

  .reading-block {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 46px 0;
  }

  .section-label {
    position: static;
    display: flex;
    align-items: baseline;
    gap: 10px;
  }

  .section-label span {
    font-size: 1.8rem;
  }

  .shot-row {
    grid-auto-columns: minmax(260px, 82%);
  }

  .version-list li {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .site-foot {
    display: block;
  }

  .site-foot a {
    display: inline-flex;
    margin-top: 12px;
  }
}

@media (max-width: 520px) {
  .side-index {
    padding-inline: 12px;
  }

  .index-switch span {
    display: none;
  }

  .quick-actions {
    display: grid;
  }

  .solid-link,
  .plain-link {
    width: 100%;
  }

  .fact-strip article,
  .note-grid article,
  .route-board article,
  .qa-list article {
    padding: 16px;
  }
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
