:root {
  color-scheme: light;
  --ink: #18201e;
  --paper: #f9faf7;
  --white: #fff;
  --muted: #4e5a54;
  --line: #cdd4cc;
  --accent: #f7d94b;
  --rail: 76px;
  --nav-h: 0px;
  --gutter: clamp(24px, 4.2vw, 92px);
  --wrap: 1550px;
  --sans: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  --mono: "Bahnschrift", "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.65 var(--sans); }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #687f27; outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p, dl, dd { margin: 0; }
.wrap { width: min(var(--wrap), calc(100% - 2 * var(--gutter))); margin-inline: auto; }
.site-content { margin-inline-start: var(--rail); }
.skip { position: fixed; z-index: 20; top: 12px; left: 12px; padding: 8px 14px; background: var(--accent); transform: translateY(-180%); }
.skip:focus { transform: none; }

.site-rail {
  position: fixed;
  z-index: 10;
  inset: 0 auto 0 0;
  width: var(--rail);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  background: var(--white);
  border-inline-end: 1px solid #dce1da;
  transition: width .22s ease, box-shadow .22s ease;
}
.brand { display: flex; align-items: center; gap: 11px; font-size: 22px; font-weight: 900; line-height: 1.1; white-space: nowrap; }
.brand img { flex: none; border-radius: 22%; }
.brand small { display: block; margin-top: 5px; font: 800 10px/1 var(--mono); letter-spacing: .13em; }
.site-rail .brand { min-height: 88px; padding-inline: 15px; }
.site-rail .brand span, .main-nav a > span, .nav-download span { opacity: 0; white-space: nowrap; transition: opacity .17s; }
.main-nav { display: grid; gap: 5px; width: 100%; margin-block: clamp(24px, 9vh, 110px) auto; }
.main-nav a { position: relative; display: flex; align-items: center; gap: 21px; min-height: clamp(48px, 8.3vh, 70px); padding-inline: 24px 10px; color: #566258; font-size: 15px; font-weight: 800; }
.main-nav a:hover, .main-nav a[aria-current] { color: var(--ink); background: #edf0e7; }
.main-nav a[aria-current]::before { position: absolute; content: ""; inset: 0 auto 0 0; width: 5px; background: #c09820; }
.nav-download { display: flex; align-items: center; gap: 15px; min-height: 58px; margin: 9px; padding-inline: 15px; background: var(--ink); color: var(--white); font-size: 14px; font-weight: 800; }
.nav-download:hover { background: #3a493d; }
.nav-download i { color: var(--accent); }
.menu-button { display: none; }
@media (min-width: 851px) {
  .site-rail:hover, .site-rail:focus-within { width: 215px; box-shadow: 6px 0 20px #18201e14; }
  .site-rail:hover span, .site-rail:focus-within span { opacity: 1; }
  .site-rail :focus-visible { outline-offset: -4px; }
  .site-content { transition: margin-inline-start .22s ease; }
  body:has(.site-rail:is(:hover, :focus-within)) .site-content { margin-inline-start: 215px; }
}

.nav-symbol { position: relative; display: block; width: 24px; height: 24px; flex: none; }
.nav-symbol::before, .nav-symbol::after { content: ""; position: absolute; }
.symbol-home::before { inset: 3px; border: 2px solid; transform: rotate(45deg); }
.symbol-home::after { inset: 9px; transform: rotate(45deg); background: currentColor; }
.symbol-characters::before { inset: 2px 0; border: 2px solid; }
.symbol-characters::after { width: 7px; height: 7px; top: 6px; left: 8.5px; border-radius: 50%; background: currentColor; box-shadow: 0 6px 0 1px currentColor; }
.symbol-gallery::before { inset: 2px 0; border: 2px solid; }
.symbol-gallery::after { inset: 9px 3px 4px; background: currentColor; clip-path: polygon(0 100%, 39% 0, 60% 55%, 78% 24%, 100% 100%); }
.symbol-world::before { inset: 1px; border: 2px solid; border-radius: 50%; }
.symbol-world::after { inset: 2px 7px; border: 1.5px solid; border-radius: 50%; }
.symbol-download::before { inset: 2px 5px 6px; background: currentColor; clip-path: polygon(36% 0,64% 0,64% 49%,100% 49%,50% 100%,0 49%,36% 49%); }
.symbol-download::after { inset: auto 3px 3px; height: 2px; background: currentColor; }
.symbol-menu::before { inset: 4px 1px; border-block: 2px solid; }
.symbol-menu::after { inset: 11px 1px auto; height: 2px; background: currentColor; }

.hero { position: relative; isolation: isolate; display: grid; overflow: hidden; }
.hero-image { position: absolute; z-index: -2; inset: 0 0 auto; height: 100%; }
.hero-image img { width: 100%; height: 100%; object-fit: cover; object-position: 82% 47%; transform: scaleX(-1); }
.hero-image::after { position: absolute; content: ""; inset: 0; background: linear-gradient(0deg, var(--paper) 0%, #f9faf7f6 8%, #f9faf7a0 19%, transparent 40%), linear-gradient(270deg,#111b1545,transparent 52%); }
.hero-inner { min-height: max(640px, 100svh); display: grid; grid-template-rows: 1fr auto; padding: 32px var(--gutter) clamp(18px, 4vh, 52px); }
.hero-content { justify-self: end; align-self: center; width: clamp(280px, 33%, 480px); padding-block: 20px 48px; color: #fafbf0; animation: rise-in .7s ease both; }
.hero-kicker { display: inline-block; background: var(--accent); color: var(--ink); padding: 6px 10px; }
.hero h1 { margin: 9px 0 3px -.045em; font-size: clamp(66px, 8.55vw, 170px); line-height: .99; font-weight: 950; letter-spacing: -.07em; text-shadow: 0 3px 30px #0f1b14ac; white-space: nowrap; }
.hero-roman { color: #f7e99b; font: 800 clamp(14px, 1.8vw, 24px)/1.2 var(--mono); letter-spacing: .34em; }
.hero-copy { margin-top: 19px; font-size: clamp(16px, 1.75vw, 26px); line-height: 1.55; font-weight: 700; text-shadow: 0 2px 10px #1a2218; }
.art-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 9px; font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.art-link:hover { color: var(--accent); }
.hero-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; }
.scroll-link { display: inline-flex; flex: none; align-items: center; gap: 11px; min-height: 44px; color: var(--ink); font-size: 14px; font-weight: 800; }
.scroll-link span { width: 9px; height: 9px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); }
.scroll-link:hover { text-decoration: underline; }
.download-panel { width: min(100%, 654px); padding: 13px; background: #24302df2; color: #fff; border-left: 4px solid var(--accent); box-shadow: 0 8px 26px #18201e26; }
.download-panel:target { outline: 2px solid #b69520; outline-offset: 3px; }
.download-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 10px; }
.download-head h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; line-height: 1.1; }
.download-head i { width: 22px; height: 22px; color: var(--ink); background: var(--accent); }
.download-head p { color: #e3e7df; font-size: 13px; }
.platforms { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.platform { display: grid; align-items: center; min-height: 38px; padding: 5px; border: 1px solid #62706b; border-radius: 3px; background: #151d1b; color: #fff; text-align: center; font: 650 14px/1.2 var(--mono); }
.platform:disabled { color: #dee3dc; cursor: default; }
.platform[href]:hover { background: var(--accent); border-color: var(--accent); color: var(--ink); }

.section { padding-block: clamp(60px, 8vw, 115px); }
.section-head { margin-bottom: 24px; }
.eyebrow { font: 800 13px/1.25 var(--mono); letter-spacing: .16em; }
.section-head h2 { margin-top: 6px; font-size: clamp(38px, 5vw, 78px); line-height: 1.08; letter-spacing: -.055em; font-weight: 900; }
.section-head > p { max-width: 310px; color: var(--muted); margin-top: 16px; font-size: 15px; }
.reveal.is-visible { animation: rise-in .52s ease-out both; }
@keyframes rise-in { from { opacity: .55; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.characters { padding-block: clamp(42px, 5vw, 80px) 24px; background-color: #fbfcfa; border-top: 1px solid var(--line); }
.characters .section-head { margin-bottom: 12px; }
.character-stage { --picker: clamp(90px, 11%, 146px); display: grid; position: relative; isolation: isolate; }
.character-stage:has(.character-picker:not([hidden])) { grid-template-columns: var(--picker) minmax(0, 1fr); }
.character-stage::before { position: absolute; content: ""; z-index: -2; inset: auto 0 0; height: 35%; background-image: repeating-linear-gradient(135deg,#53645715 0 1px,transparent 1px 8px); mask-image: linear-gradient(transparent,#000); }
.character-picker { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding-block: 15px; }
.character-tabs { display: grid; gap: clamp(14px, 2.1vh, 26px); }
.character-tabs button { display: grid; justify-items: center; gap: 3px; border: 0; background: transparent; padding: 3px 4px; color: var(--muted); font-size: 14px; line-height: 1.15; font-weight: 800; }
.character-tabs button small { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.character-tabs img { width: clamp(53px, 6vw, 89px); height: auto; aspect-ratio: 1; border: 3px solid #d5dbd3; border-radius: 50%; background: #fff; }
.character-tabs button[aria-selected="true"] { color: var(--ink); }
.character-tabs button[aria-selected="true"] img { border-color: #e0b514; box-shadow: 0 0 0 4px #f2da764a; }
.character-tabs button:hover img { border-color: #9f8725; }
.character-step, .scene-step button { display: grid; width: 39px; height: 39px; place-items: center; border: 1px solid #bdc7bd; border-radius: 50%; background: #fff; }
.character-step:hover, .scene-step button:hover { background: var(--accent); border-color: #ad942d; }
.character-step span, .scene-step span { width: 9px; height: 9px; border: solid currentColor; border-width: 2px 2px 0 0; transform: translateY(2px) rotate(-45deg); }
.character-step.step-next span { transform: translateY(-2px) rotate(135deg); }
.character-panel { --tone: #e7c948; display: grid; grid-template-columns: minmax(0, 44%) minmax(0, 56%); position: relative; align-items: center; min-height: clamp(510px, 80svh, 800px); }
.character-panel[role="tabpanel"] .character-art, .character-panel[role="tabpanel"] .character-copy { animation: rise-in .38s ease both; }
.character-panel#an { --tone: #c8d3c6; }
.character-panel#xiaoyuan { --tone: #ecc5a9; }
.character-art { position: relative; isolation: isolate; grid-area: 1 / 2; height: 100%; display: grid; place-items: center; background: #fbfcfa; }
.character-art::before { content: ""; position: absolute; z-index: -2; inset: 0 0 10% 8%; background: linear-gradient(110deg, var(--tone), #fbfcfa 28% 67%, var(--tone) 92%); clip-path: polygon(17% 0, 100% 0, 100% 68%, 63% 100%, 0 100%, 0 22%); }
.character-art::after { content: ""; position: absolute; z-index: -1; inset: 0 6% 8% 0; background-image: linear-gradient(#53645720 1px, transparent 1px), linear-gradient(90deg,#53645720 1px,transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(110deg,transparent,#000 50%, transparent 94%); }
.character-art img { width: min(100%, 468px); height: clamp(510px, 77svh, 790px); object-fit: contain; mix-blend-mode: multiply; }
.character-copy { grid-area: 1 / 1; align-self: center; padding: 24px clamp(16px, 3vw, 54px) 44px clamp(10px, 2vw, 34px); }
.character-roman { color: #556557; font: 800 clamp(25px, 5.8vw, 102px)/.9 var(--mono); letter-spacing: -.05em; overflow-wrap: anywhere; }
.character-copy h3 { font-size: clamp(60px, 7.2vw, 116px); font-weight: 950; line-height: 1.06; letter-spacing: -.075em; margin-top: 8px; }
.character-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; padding-top: 10px; margin-block: 19px 16px; border-top: 3px solid var(--tone); font-size: 14px; }
.character-facts div { display: flex; align-items: center; background: #eaf0e8; }
.character-facts dt { flex: none; padding: 5px 7px; background: #27342c; color: #fff; font-weight: 800; }
.character-facts dd { padding: 4px 6px; line-height: 1.3; }
.character-copy p + p { margin-top: 12px; }

.scenes { background: #f5f7f3; border-block: 1px solid var(--line); }
.scenes .wrap { display: grid; grid-template-columns: minmax(155px, 19%) minmax(0, 1fr); gap: clamp(18px, 4vw, 65px); align-items: start; }
.scenes .section-head h2 { font-size: clamp(34px, 3.3vw, 54px); }
.scenes .eyebrow { display: inline-block; border-bottom: 3px solid var(--accent); padding-bottom: 6px; }
.scene-gallery { position: relative; min-width: 0; }
.frames { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.scene-gallery.is-ready .frames { display: block; border-right: clamp(10px, 3.8vw, 70px) solid var(--accent); }
.frame { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 9; background: #414a3e; color: #fff; }
.frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.scene-gallery.is-ready .frame:not([hidden]) img { animation: frame-in .35s ease; }
@keyframes frame-in { from { opacity: .35; } to { opacity: 1; } }
.frame:hover img, .frame:focus-visible img { transform: scale(1.035); }
.frame-label, .enlarge { position: absolute; z-index: 1; bottom: 12px; padding: 4px 8px; background: #151d19e6; font-weight: 800; }
.frame-label { left: 12px; }
.scene-gallery.is-ready .frame-label { display: none; }
.enlarge { right: 12px; font-size: 18px; line-height: 1.1; }
.scene-step { position: relative; display: flex; width: max-content; gap: 6px; margin-top: -22px; margin-left: 15px; padding: 3px; background: #26312a; border-radius: 24px; }
.scene-step button:first-child span { transform: translateX(2px) rotate(-135deg); }
.scene-step button:last-child span { transform: translateX(-2px) rotate(45deg); }
.scene-caption { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 0 12px; margin-top: 15px; }
.scene-count { color: var(--muted); font: 750 13px/1 var(--mono); white-space: nowrap; }
.scene-caption h3 { font-size: clamp(23px, 2.8vw, 41px); line-height: 1.2; }
.scene-description { grid-column: 2; margin-top: 6px; }
.lightbox { width: min(1100px, 95vw); max-width: none; padding: 0; border: 1px solid #707a68; color: #f2f1e7; background: #192019; }
.lightbox::backdrop { background: #080d09e9; }
.lightbox-body { position: relative; }
.lightbox-image { width: 100%; max-height: 75dvh; object-fit: contain; }
.lightbox button { border: 1px solid #697363; background: #283328; color: #fff; padding: 7px 13px; }
.lightbox button:hover { background: #4d5d49; }
.lightbox-close { position: absolute; right: 10px; top: 10px; font-size: 22px; line-height: 1; min-height: 42px; }
.lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: center; padding: 12px; }

.world .section-head { background: var(--accent); padding: clamp(14px, 2.2vw, 36px); margin-bottom: 27px; }
.world-grid { display: grid; grid-template-columns: minmax(0, 1.37fr) minmax(0, 1fr); background: #edf0e8; }
.world-grid img { width: 100%; height: 100%; min-height: 340px; object-fit: cover; }
.world-copy { align-self: center; padding: clamp(24px, 4.5vw, 66px); }
.world-copy h3 { font-size: clamp(25px, 3vw, 39px); line-height: 1.25; margin-bottom: 20px; letter-spacing: -.04em; }
.world-copy p + p { margin-top: 15px; }
.world-notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); margin-top: 18px; }
.world-notes article { padding: clamp(20px, 3vw, 38px); }
.world-notes article + article { border-left: 1px solid var(--line); }
.world-notes h3 { font-size: 22px; margin-bottom: 8px; }
.world-notes p { color: var(--muted); }
.footer { background: var(--ink); color: #e8eee5; padding-block: 22px; }
.footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.footer .wrap > a:last-child { font-size: 14px; }
.footer a:hover { color: var(--accent); }

@media (max-width: 850px) {
  :root { --rail: 0px; --nav-h: 62px; }
  .site-rail { position: sticky; inset: 0 0 auto; width: 100%; min-height: var(--nav-h); flex-direction: row; align-items: center; gap: 12px; padding: 7px 14px; overflow: visible; border: 0; border-bottom: 1px solid var(--line); }
  .site-rail .brand { min-height: 0; padding: 0; margin-right: auto; font-size: 17px; }
  .site-rail .brand img { width: 38px; height: 38px; }
  .site-rail .brand span, .main-nav a > span, .nav-download span { opacity: 1; }
  .nav-download { min-height: 44px; margin: 0; gap: 5px; padding-inline: 8px; font-size: 13px; }
  .nav-download i { width: 19px; height: 19px; }
  .menu-button { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; padding: 0 3px; border: 0; background: transparent; font-size: 14px; }
  .menu-button i { width: 16px; }
  .main-nav { order: 4; margin: 0; gap: 1px; }
  .site-rail.has-menu .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; padding: 6px 14px 12px; background: #fff; border-bottom: 1px solid var(--line); }
  .site-rail.has-menu.menu-open .main-nav { display: grid; }
  .site-rail:not(.has-menu) { flex-wrap: wrap; }
  .main-nav a { min-height: 44px; padding-left: 10px; gap: 11px; }
  .hero-inner { min-height: max(640px, calc(100svh - var(--nav-h))); }
  .character-copy { padding-left: 8px; }
  .world-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .hero-inner { grid-template-rows: auto auto; padding: 0 var(--gutter) 18px; }
  .hero-image { height: min(620px, 119vw); }
  .hero-image img { transform: none; object-position: 50% 17%; }
  .hero-image::after { background: linear-gradient(0deg, var(--paper) 0%, #f9faf7f2 6%, #f9faf7a0 16%, transparent 39%); }
  .hero-content { align-self: end; justify-self: start; padding: clamp(218px, 70vw, 355px) 0 6px; width: 100%; color: var(--ink); }
  .hero h1 { font-size: clamp(68px, 15vw, 112px); text-shadow: 0 0 10px #f9faf7c0; }
  .hero-roman { color: var(--ink); }
  .hero-copy { margin-top: 9px; text-shadow: 0 0 6px #f9faf7; }
  .hero-copy br { display: none; }
  .art-link { margin-top: 2px; }
  .art-link:hover { color: #4f5c21; }
  .hero-bottom { flex-direction: column-reverse; align-items: stretch; gap: 3px; }
  .scroll-link { align-self: center; }
  .platforms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .download-panel { padding: 10px; }
  .section { padding-block: 52px; }
  .character-stage:has(.character-picker:not([hidden])) { grid-template-columns: 1fr; }
  .character-picker { flex-direction: row; gap: 9px; padding: 6px 0 16px; }
  .character-tabs { grid-auto-flow: column; gap: 4px; }
  .character-step.step-prev span { transform: translateX(2px) rotate(-135deg); }
  .character-step.step-next span { transform: translateX(-2px) rotate(45deg); }
  .character-panel { grid-template-columns: 1fr; min-height: 0; }
  .character-art { grid-area: 1 / 1; }
  .character-art img { height: min(114vw, 490px); }
  .character-copy { grid-area: 2 / 1; padding: 18px 7px 20px; }
  .character-roman { font-size: clamp(25px, 9vw, 45px); }
  .scenes .wrap, .world-grid, .world-notes { grid-template-columns: 1fr; gap: 0; }
  .world-grid img { min-height: 0; aspect-ratio: 16 / 10; }
  .world-notes article + article { border-left: 0; border-top: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
