@font-face {
  font-family: "Lecture Serif";
  src: url("./fonts/lecture-serif.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}
:root {
  --leaf: #285C54;
  --type: #1C1B18;
  --type-soft: #5E5A53;
  --rule: #D8D1C4;
  --sheet: #F7F4EE;
  --stock: #EFE9DE;
  --seal: #B63A2B;
  --song: "Lecture Serif", "Noto Serif CJK SC", "Songti SC", "STSong", "SimSun", serif;
}
html { scrollbar-color: #9b9a8a var(--stock); }
body[data-view="archive"] {
  color-scheme: light;
  --paper: var(--stock);
  --ink: var(--type);
  --muted: var(--type-soft);
  --line: var(--rule);
  --panel: var(--sheet);
  --lime: var(--seal);
}
.mastinner, .main-shell { max-width: 1512px; }
body[data-view="archive"] .masthead {
  background: var(--stock);
  border-color: var(--rule);
}
.brand-icon {
  background: var(--seal);
  color: #fff6e5;
  border-radius: 3px;
  transform: none;
}
.brand strong { font-family: var(--song); font-weight: 700; letter-spacing: .06em; }
body[data-view="archive"] .brand small,
body[data-view="archive"] .tool-icon { color: var(--type-soft); }
body[data-view="archive"] .full-button { border-color: var(--rule); }
#mast-topic {
  min-width: 0;
  overflow: hidden;
  color: var(--type-soft);
  font: 550 14px/1.5 var(--sans);
  text-overflow: ellipsis;
  white-space: nowrap;
}
body[data-view="archive"] .main-shell { padding-top: clamp(14px, 1.8vw, 29px); }
.screen-group, .screen-group:has(#intro:not([hidden])) {
  background: var(--sheet);
  border-color: var(--rule);
  border-radius: 3px;
}
#intro {
  min-height: 484px;
  height: clamp(484px, calc(100svh - 182px), 775px);
  background: var(--sheet);
}
#intro:before, .corner { display: none; }
#intro:after { opacity: .1; mix-blend-mode: multiply; }
.hero-copy {
  max-width: 55%;
  margin-left: clamp(36px, 5.2vw, 88px);
  padding: 28px 0;
  pointer-events: auto;
}
.overline {
  margin-bottom: clamp(16px, 1.8vw, 28px);
  color: var(--seal);
  font: 650 13px/1.3 var(--sans);
  letter-spacing: .15em;
}
.signal-line { width: 28px; height: 2px; background: var(--seal); }
.hero-copy h1 {
  color: var(--type);
  font-family: var(--song);
  font-size: clamp(53px, 5.9vw, 98px);
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: 1.21;
  text-shadow: none;
}
.hero-copy h1 em { color: var(--type); }
.hero-comma { color: var(--seal); }
.subtitle {
  color: var(--type);
  font-size: clamp(16px, 1.35vw, 22px);
  font-weight: 530;
  line-height: 1.45;
  letter-spacing: .025em;
  margin: clamp(17px, 1.6vw, 24px) 0 0;
}
.lecture-question {
  max-width: 29em;
  color: var(--type-soft);
  font-size: clamp(14px, 1.1vw, 17px);
  line-height: 1.7;
  margin: 9px 0 0;
}
.hero-actions { margin-top: clamp(21px, 2.3vw, 35px); }
.primary, .secondary { min-height: 43px; padding: 0 17px; border-radius: 3px; }
.primary { background: var(--seal); color: #fff9ed; }
.primary:hover { background: #822d26; box-shadow: none; }
.secondary { background: transparent; color: var(--type); border-color: #9c9c8f; }
.secondary:hover { background: #eeeade; border-color: var(--type); }
#art-home { inset: 3% 2% 3% 51%; }
#art { display: grid; place-items: center; }
.art-field {
  inset: 0;
  background: radial-gradient(ellipse 36% 5% at 50% 85%, #534c3729, transparent 100%);
}
#art .archive-fruit {
  position: relative;
  width: 96%;
  height: 92%;
  mix-blend-mode: normal;
  object-fit: contain;
  filter: drop-shadow(0 13px 10px #42351316);
}
.lecture-question { font-family: var(--song); font-weight: 600; }
.art-field::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 12%;
  bottom: 9%;
  border-bottom: 1px solid var(--rule);
}
#scene {
  background: var(--sheet);
  min-height: clamp(460px, 38vw, 610px);
  height: auto;
  overflow: visible;
}
.ch-scene {
  min-height: inherit;
  height: auto;
  overflow: visible;
  --ch-accent: var(--leaf);
  --ch-text: var(--type);
  --ch-dim: var(--type-soft);
  --ch-line: var(--rule);
  --ch-surface: var(--sheet);
  padding: clamp(24px, 2.8vw, 46px) clamp(28px, 4.6vw, 74px);
  gap: clamp(18px, 2.3vw, 34px);
}
.ch-header { align-items: flex-start; }
.ch-title, .ch-card-title, .ch-legal-kind, .ch-result-number, .ch-big-outcome, .ch-closing-question {
  font-family: var(--song);
  font-weight: 700;
  letter-spacing: -.028em;
}
.ch-title { font-size: clamp(34px, 4cqw, 64px); line-height: 1.24; }
.ch-eyebrow {
  font: 650 12px/1.3 var(--sans);
  color: var(--seal);
  margin-bottom: 10px;
  letter-spacing: .12em;
}
.ch-eyebrow i { width: 22px; }
.ch-scene .ch-source { color: var(--type-soft); }
.ch-copy, .ch-choice-description { line-height: 1.75; }
.ch-subhead { font-weight: 650; }
.ch-choice[aria-pressed="true"], .ch-category[aria-pressed="true"] { color: var(--leaf); }
.ch-case-card, .ch-case-card:nth-child(2) {
  background: #efece4;
  border-top-width: 2px;
  border-top-color: var(--leaf);
}
.ch-case-card:nth-child(2) { background: #f1e8de; border-top-color: var(--seal); }
.ch-case-card:nth-child(2) .ch-type { color: var(--seal); }
.ch-type, .ch-result-title { font-family: var(--sans); font-weight: 600; }
.ch-timeline-step[aria-pressed="true"] .ch-marker { box-shadow: 0 0 0 3px #d4dfd8; }
.ch-check[aria-pressed="true"] .ch-check-mark { color: #fff; }
.ch-media .ch-media-frame { border-radius: 2px; }
.ch-panda .ch-media-frame { transform: none; box-shadow: 4px 4px 0 #e5ddcf; }
.ch-media .ch-play {
  left: auto;
  top: auto;
  right: 12px;
  bottom: 12px;
  transform: none;
  width: clamp(40px, 3.6cqw, 58px);
  color: #fff9ef;
  background: #243c35ef;
  border: 1px solid #fff8;
}
.ch-media .ch-media-frame:hover .ch-play { background: var(--leaf); }
.ch-media .ch-play svg { width: 40%; height: 40%; }
.transport {
  gap: clamp(12px, 2.3vw, 36px);
  background: var(--sheet);
  border-color: var(--rule);
}
.counter, .counter i { color: var(--type-soft); }
.counter #page-num { color: var(--seal); }
.transport-title { color: var(--type-soft); border-color: var(--rule); }
#segments button:before { height: 2px; background: #d8d2c5; }
#segments button.done:before { background: #b4806b; }
#segments button.current:before, #segments button:hover:before { background: var(--seal); }
.turn button { color: var(--type); border-radius: 2px; border-color: #bdb8ab; }
#lecture-contents {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 6px 9px;
  color: var(--leaf);
  border: 1px solid var(--rule);
  border-radius: 2px;
  font: 550 12px/1.4 var(--sans);
}
#lecture-contents:hover { background: #e8e7db; }
#lecture-contents svg { width: 14px; height: 14px; }
.dialog-top h2 { font-family: var(--song); font-weight: 700; letter-spacing: .015em; }
.chapter-card, .chapter-card.active {
  border-radius: 2px;
  border: 0;
  background: transparent;
}
.chapter-card .thumb { border-top: 2px solid #beb7a8; background: #e6e0d3; }
.chapter-card.active .thumb { border-color: var(--seal); }
.chapter-card .atlas-art { filter: grayscale(.9) invert(1) contrast(.91); mix-blend-mode: multiply; }
.chapter-card .atlas-art > path[stroke-width="0.38"],
.chapter-card .atlas-art > path[stroke-width="0.75"][opacity="0.42"] { display: none; }
.thumb .number, .chapter-card.active .number {
  background: var(--sheet);
  border: 0;
  border-radius: 1px;
  color: var(--type-soft);
  font: 600 12px/1.2 var(--mono);
}
.chapter-card.active .number { background: var(--seal); color: white; }
.card-label { padding: 10px 2px; border-top: 0; color: var(--type); }
.chapter-card.active .card-label, .chapter-card.active .card-label svg { color: var(--seal); }
.card-label svg { color: var(--type-soft); }
#panel {
  color-scheme: light;
  color: var(--type);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 3px;
}
#panel .eyebrow { display: none; }
#panel .dialog-top { border-color: var(--rule); }
#panel .close {
  color: var(--type);
  background: transparent;
  border-color: var(--rule);
  border-radius: 2px;
}
#panel :is(.sourcelead, .sourcegroup p, .sourcegroup a) { color: var(--type-soft); }
#panel :is(.sourcegroup h3, .sourcegroup a:hover, .keylines kbd) { color: var(--leaf); }
#panel :is(.sourcegroup, .keylines > div, .keylines kbd) { border-color: var(--rule); }
#media-view { --ink: #f7f4ee; color-scheme: dark; color: var(--ink); }

.ch-case-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.ch-scene .ch-body .ch-source { position: static; align-self: flex-start; }

#chapter-activity {
  margin: 0 clamp(28px, 4.6vw, 74px);
  border-top: 1px solid var(--rule);
}
.activity-toggle {
  display: flex;
  align-items: baseline;
  gap: 13px;
  list-style: none;
  cursor: pointer;
  color: var(--type);
  padding: 16px 0;
}
.activity-toggle::-webkit-details-marker { display: none; }
.activity-toggle:focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; }
.activity-kind { white-space: nowrap; color: var(--leaf); font: 650 12px/1.4 var(--sans); letter-spacing: .07em; }
#activity-title { font: 700 clamp(20px, 2.2vw, 31px)/1.3 var(--song); }
.activity-chevron { white-space: nowrap; display: inline-flex; align-items: center; align-self: center; gap: 6px; margin-left: auto; color: var(--type-soft); }
.activity-chevron::before { content: "展开"; font: 550 12px var(--sans); }
#chapter-activity[open] .activity-chevron::before { content: "收起"; }
.activity-chevron svg { width: 14px; height: 14px; transition: transform .2s; }
#chapter-activity[open] .activity-chevron svg { transform: rotate(180deg); }

#chapter-activity #gallery {
  --night-tone: #76c9ba;
  --lime: var(--night-tone);
  color-scheme: dark;
  margin-bottom: 24px;
}
#chapter-activity #gallery[data-station="privacy"] { --night-tone: #e39885; }
#chapter-activity #gallery[data-station="verdict"] { --night-tone: #ddc497; }
#chapter-activity #gallery[data-station="melon"] { --night-tone: #bbc99a; }
.g-hero, .g-console { --station: var(--night-tone); }
#chapter-activity .g-hero {
  display: grid;
  grid-template-areas: "copy model";
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.35fr);
  grid-template-rows: minmax(0, 1fr);
  min-height: 300px;
  height: clamp(300px, 23vw, 390px);
  border: 1px solid #3c4744;
  border-radius: 2px 2px 0 0;
  background: #11161a;
}
.g-starfield, .g-led { display: none; }
#chapter-activity .g-copy {
  position: relative;
  inset: auto;
  grid-area: copy;
  align-self: center;
  z-index: 3;
  width: auto;
  min-width: 0;
  transform: none;
  padding: 16px 0 16px clamp(18px, 2.6vw, 41px);
}
#chapter-activity #g-note {
  font: 600 clamp(17px, 1.6vw, 24px)/1.58 var(--song);
  letter-spacing: .005em;
  color: #f7f4ee;
  margin: 0;
}
.g-actions { flex-wrap: wrap; margin-top: 19px; }
.g-actions button, .g-selectors, .g-selectors button,
.g-micro button, #fruit-modes, #fruit-modes button { border-radius: 2px; }
.g-actions button { background: #1a2526ba; border-color: #79807e; color: #f3f1e9; }
.g-actions #g-act { color: #122a24; }
#chapter-activity .g-geometry {
  position: relative;
  inset: auto;
  grid-area: model;
  min-width: 0;
  min-height: 0;
}
#chapter-activity .g-fade { background: linear-gradient(90deg, #101619ee, #11171ce0 28%, #11171c28 48%, transparent 63%); }
#gallery .g-ambient { filter: saturate(.78); }
#chapter-activity #g-marker { right: 14px; bottom: 12px; max-width: 46%; }
#chapter-activity #g-result { margin-top: 13px; }
.g-console {
  height: auto;
  min-height: 49px;
  padding: 8px clamp(14px, 2vw, 32px);
  border-color: #3b4544;
  border-radius: 0 0 2px 2px;
  background: #171e20;
}
.g-micro { margin-left: auto; }
.g-micro button { color: #dbe6df; }
.main-shell { padding-bottom: clamp(18px, 2.5vw, 38px); }
:is(:fullscreen, .immersive) { overflow-y: auto; }
:is(:fullscreen, .immersive) .screen-group { border-radius: 2px; }
.screen-group { overflow: clip; }
.transport {
  position: sticky;
  bottom: 0;
  z-index: 5;
}

@media (min-width: 761px) {
  :is(:fullscreen, .immersive) #scene { min-height: calc(100dvh - 132px); height: auto; }
  .screen-group:has(#chapter-activity:not([hidden])) #scene { min-height: clamp(405px, 34vw, 540px); height: auto; }
  :is(:fullscreen, .immersive) .hero-copy h1 { font-size: clamp(62px, 6.3vw, 118px); }
}
@media (max-width: 960px) {
  .hero-copy { margin-left: 30px; }
  .hero-copy h1 { font-size: clamp(49px, 6.2vw, 62px); }
  .g-console { flex-wrap: wrap; }
}
@media (max-width: 760px) {
  #scene { min-height: 0; height: auto; }
  .ch-scene { padding: 24px 20px; gap: 24px; }
  .ch-title { font-size: clamp(30px, 6.3vw, 42px); }
  .ch-scene .ch-header .ch-source { top: -6px; }
  .ch-copy, .ch-choice-description, .ch-remedy-item { font-size: 16px; }
}
@media (max-width: 670px) {
  .mastinner, .main-shell { width: calc(100% - 32px); }
  .mastinner { gap: 10px; }
  .brand { gap: 6px; }
  .brand small { display: none; }
  .brand strong { font-size: 14px; white-space: nowrap; }
  .brand-icon { width: 26px; height: 26px; }
  .brand-icon svg { width: 25px; height: 25px; }
  #mast-topic { flex: 1; text-align: center; font-size: 11px; }
  .top-tools .tool-icon { display: inline-flex; width: 28px; height: 31px; }
  body[data-view="archive"], body[data-view="archive"] .masthead { background: var(--sheet); }
  body[data-view="archive"] .main-shell { padding-top: 0; }
  .screen-group, .screen-group:has(#intro:not([hidden])) { border: 0; border-radius: 0; }
  #intro { display: block; min-height: 0; height: auto; padding-bottom: 5px; }
  .hero-copy { max-width: none; margin: 0; padding: 31px 3px 0; }
  .overline { margin-bottom: 17px; font-size: 12px; }
  .hero-copy h1 { font-size: clamp(43px, 10.8vw, 62px); line-height: 1.24; }
  .subtitle { font-size: 16px; margin-top: 15px; }
  .lecture-question { font-size: 14px; max-width: 25em; }
  .hero-actions { margin-top: 18px; gap: 10px; }
  .hero-actions button { min-height: 39px; }
  #art-home { position: relative; inset: auto; height: clamp(175px, 51vw, 255px); margin: 6px 0 2px; }
  #art .archive-fruit { width: 84%; height: 100%; }
  .art-field::after { left: 21%; right: 21%; bottom: 3%; }
  .transport { min-height: 49px; height: auto; padding: 6px 0; gap: 8px; border-bottom: 1px solid var(--rule); }
  #lecture-contents { gap: 4px; font-size: 11px; }
  .turn button { width: 44px; height: 44px; }
  #scene { min-height: 0; }
  .ch-scene { padding: 26px 1px 25px; }
  .ch-eyebrow { margin-bottom: 12px; }
  .ch-media .ch-play { width: 39px; right: 8px; bottom: 8px; }
  .ch-title { font-size: clamp(29px, 7.2vw, 39px); }
  .ch-case-card { min-height: 195px; }
  .card-label { font-size: 12px; padding: 8px 1px; }
  #chapter-activity { margin: 0; }
  .activity-toggle {
    display: grid;
    grid-template: "kind state" auto "title title" auto / 1fr auto;
    gap: 5px 10px;
    padding: 15px 0;
  }
  .activity-kind { grid-area: kind; }
  .activity-chevron { grid-area: state; }
  #activity-title { grid-area: title; font-size: 22px; }
  #chapter-activity #gallery { margin-bottom: 14px; }
  #chapter-activity .g-hero {
    grid-template-areas: "copy" "model";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(205px, 50vw);
    min-height: 0;
    height: auto;
  }
  #chapter-activity .g-copy { padding: 16px 14px 0; }
  #chapter-activity #g-note { font-size: 17px; }
  .g-actions { margin-top: 11px; }
  .g-actions button { min-height: 34px; font-size: 12px; }
  #chapter-activity .g-fade { background: linear-gradient(180deg, #11161bd9, #11161b48 32%, transparent 55%); }
  #chapter-activity #g-result { margin-top: 10px; }
  #chapter-activity #g-result-text { font-size: 13px; }
  #chapter-activity #g-marker { right: 8px; bottom: 7px; max-width: 75%; }
  .g-console { gap: 7px; padding: 8px; }
  .g-knob { font-size: 11px; }
  .g-micro { gap: 4px; }
  .g-micro button { width: 29px; height: 29px; }
  :is(:fullscreen, .immersive) .hero-copy h1 { font-size: clamp(43px, 10.8vw, 62px); }
}
@media (max-width: 355px) {
  .mastinner,.main-shell { width: calc(100% - 24px); }
  .brand strong { font-size: 12px; }
  .brand-icon { width: 22px; height: 22px; }
  .top-tools { gap: 1px; }
}
@media (min-width: 761px) and (max-height: 680px) {
  .ch-scene { padding-block: 15px; gap: 12px; }
  .ch-title { font-size: clamp(30px, 3.7cqw, 53px); }
}

/* A single red rule ties the chapter markers to the contents and activities. */
.overline .signal-line, .ch-eyebrow i, .activity-kind::before,
#panel .dialog-top h2::before {
  display: inline-block;
  width: 1.65rem;
  height: 2px;
  background: var(--seal);
}
.activity-kind::before, #panel .dialog-top h2::before {
  content: "";
  margin-inline-end: .55em;
  vertical-align: middle;
}
.activity-kind { color: var(--seal); }
#panel .chapter-card:focus-visible, .turn button:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .ch-detail-panel > :first-child { animation: point-arrival 140ms ease-out both; }
  .ch-detail-panel > :nth-child(2) { animation: point-arrival 160ms 35ms ease-out both; }
}
@keyframes point-arrival {
  from { opacity: .74; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}
