:root {
  --ink: #193f25;
  --forest: #23582d;
  --leaf: #6b9148;
  --fire: #f7d65a;
  --paper: #f7efd5;
  --orange: #d95d26;
  --blue: #2c78ae;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: #07151f; }
body {
  margin: 0;
  color: #263328;
  background: #07151f;
  font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
a { color: inherit; }
img { display: block; max-width: 100%; }

.site-shell {
  width: min(100%, 540px);
  margin: 0 auto;
  min-height: 100vh;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 0 60px rgba(0,0,0,.45);
}

/* Night-river cover */
.hero {
  position: relative;
  min-height: 100svh;
  isolation: isolate;
  overflow: hidden;
  background: #071a22;
}
.hero-photo { object-fit: cover; object-position: 50% 50%; z-index: -3; }
.night-wash {
  position: absolute; inset: 0; z-index: -2;
  background: linear-gradient(180deg, rgba(2,10,24,.34) 0%, rgba(4,18,27,.12) 42%, rgba(3,13,14,.82) 100%);
}
.night-wash::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 50% 10%, rgba(255,255,255,.8) 0 1px, transparent 1.5px), radial-gradient(circle at 20% 24%, rgba(255,230,115,.8) 0 1px, transparent 1.8px);
  background-size: 58px 63px, 83px 79px; opacity: .45;
}
.moon {
  position: absolute; width: 42px; height: 42px; right: 8%; top: 5.5%;
  border-radius: 50%; background: #ffe993; box-shadow: 0 0 28px rgba(255,229,125,.62);
}
.moon::after { content: ''; position: absolute; width: 37px; height: 37px; left: -8px; top: -4px; border-radius: 50%; background: #12253a; }
.glow-dot {
  position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #f6ef76;
  box-shadow: 0 0 6px #eaff79, 0 0 16px #c9ed40, 0 0 26px rgba(213,246,75,.65);
  animation: blink 2.4s ease-in-out infinite;
}
@keyframes blink { 0%,100% { opacity: .25; transform: scale(.6); } 48% { opacity: 1; transform: scale(1.25); } }

.paper-title {
  position: absolute; left: 0; top: 9.5%; width: 92%; padding: 29px 24px 28px 31px;
  color: var(--ink); transform: rotate(-1.2deg);
  background-color: rgba(250,245,221,.96);
  background-image: linear-gradient(rgba(86,118,81,.09) 1px, transparent 1px), linear-gradient(90deg, rgba(86,118,81,.09) 1px, transparent 1px);
  background-size: 18px 18px;
  clip-path: polygon(0 3%, 18% 1%, 37% 3%, 58% 0, 75% 2%, 100% 0, 98% 92%, 84% 94%, 66% 92%, 48% 96%, 28% 93%, 0 97%);
  filter: drop-shadow(0 14px 16px rgba(0,0,0,.24));
}
.student-info {
  display: grid; gap: 2px; margin: 0 0 10px; padding: 0 0 9px;
  border-bottom: 1px dashed rgba(52,91,44,.35); font-family: 'KaiTi', 'STKaiti', serif; line-height: 1.35;
}
.student-info strong { color: var(--forest); font-size: 14px; letter-spacing: .08em; }
.student-info span { color: #657451; font-size: 12px; letter-spacing: .03em; }
.eyebrow { margin: 0 0 9px; font-size: 11px; font-weight: 700; letter-spacing: .13em; color: #6c7f50; }
.paper-title h1 {
  margin: 0; font: 900 clamp(46px, 15vw, 76px)/.98 'STKaiti', 'KaiTi', serif;
  letter-spacing: .02em; text-shadow: 1px 2px 0 rgba(36,90,44,.12);
}
.subtitle { margin: 12px 0 0; font: 700 18px/1.5 'KaiTi', serif; text-align: center; }
.scribble { display: block; height: 10px; margin: 5px auto 0; width: 76%; border-top: 4px solid rgba(41,101,43,.85); border-radius: 50%; transform: rotate(-1deg); }
.title-firefly { position: absolute; right: 14px; bottom: 31px; color: #dbab1b; font-size: 28px; text-shadow: 0 0 9px #f8df6d; transform: rotate(11deg); }
.hero-dialogues {
  position: absolute; left: 7%; right: 7%; top: 56%; display: grid; gap: 10px;
}
.hero-dialogues p {
  width: 78%; margin: 0; padding: 10px 13px; border: 2px solid rgba(255,252,226,.94);
  border-radius: 18px 18px 18px 4px; color: #263226; background: rgba(255,252,226,.92);
  font: 700 13px/1.55 'KaiTi', serif; box-shadow: 0 5px 15px rgba(0,0,0,.23);
}
.hero-dialogues p:nth-child(2) { justify-self: end; border-radius: 18px 18px 4px; }
.hero-dialogues b { color: var(--orange); margin-right: 5px; }
.hero-dialogues p:nth-child(2) b { color: var(--forest); }
.scroll-cue {
  position: absolute; left: 50%; bottom: 3.8%; display: grid; gap: 4px; justify-items: center;
  color: #fff8cd; text-decoration: none; transform: translateX(-50%); font-size: 12px; letter-spacing: .12em;
  text-shadow: 0 2px 8px #000;
}
.scroll-cue b { font-size: 24px; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(5px); } }

/* Notebook body */
.paper-page {
  position: relative; padding: 32px 20px 0 37px;
  background-color: var(--paper);
  background-image: linear-gradient(rgba(56,92,55,.075) 1px, transparent 1px), linear-gradient(90deg, rgba(56,92,55,.075) 1px, transparent 1px);
  background-size: 19px 19px;
}
.paper-page::before { content: ''; position: absolute; inset: 0 auto 0 23px; border-left: 2px dashed rgba(177,108,62,.24); }
.paper-page::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 26px;
  background: linear-gradient(180deg, rgba(28,42,23,.18), transparent); pointer-events: none;
}
.binding { position: absolute; z-index: 4; left: 2px; top: 62px; display: grid; gap: 168px; }
.binding i { display: block; width: 23px; height: 9px; border: 3px solid #78694a; border-left: 0; border-radius: 0 9px 9px 0; box-shadow: 1px 1px 1px rgba(0,0,0,.25); }
.chapter-nav {
  position: sticky; z-index: 8; top: 9px; display: flex; gap: 6px; width: max-content; max-width: 100%;
  margin: 0 auto 30px; padding: 5px; border: 1px solid rgba(51,87,44,.23); border-radius: 999px;
  background: rgba(251,247,225,.9); box-shadow: 0 5px 16px rgba(38,57,33,.12); backdrop-filter: blur(8px);
}
.chapter-nav a { min-width: 60px; padding: 7px 12px; border-radius: 999px; color: var(--forest); text-align: center; text-decoration: none; font-size: 12px; font-weight: 800; }
.chapter-nav a:active { color: white; background: var(--forest); }

.note-card {
  position: relative; scroll-margin-top: 78px; margin-bottom: 28px; padding: 22px 18px;
  background: rgba(255,252,232,.79); border: 1.5px solid rgba(49,90,48,.45);
  box-shadow: 3px 5px 0 rgba(74,91,50,.12);
}
.note-card::before { content: ''; position: absolute; width: 62px; height: 18px; top: -10px; right: 24px; background: rgba(209,174,103,.52); transform: rotate(4deg); }
.note-card:nth-of-type(odd)::before { left: 24px; right: auto; transform: rotate(-3deg); }
.section-heading { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; color: var(--forest); }
.section-heading > span { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 50%; color: white; background: var(--forest); font: 800 18px/1 'KaiTi', serif; }
.section-heading p { margin: 0 0 2px; color: #789056; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.section-heading h2 { margin: 0; font: 800 clamp(23px, 6.4vw, 28px)/1.22 'KaiTi', serif; }
.note-card > p { margin: 0; font-size: 15px; line-height: 1.9; }
blockquote { margin: 18px 0; padding: 12px 13px; color: var(--orange); border-left: 4px solid var(--orange); background: rgba(255,233,180,.43); font: 800 19px/1.55 'KaiTi', serif; }
.dialogue { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.dialogue span { padding: 5px 9px; border-radius: 999px; color: white; font-size: 11px; font-weight: 800; background: #dd6c35; }
.dialogue p { margin: 0; padding: 9px 12px; border-radius: 3px 14px 14px; background: white; font-size: 13px; line-height: 1.6; box-shadow: 0 2px 0 rgba(45,78,44,.14); }

/* Photos */
.photo-note, .chart-note { position: relative; margin: 5px 8px 36px; padding: 8px 8px 15px; background: #fffbed; box-shadow: 2px 5px 12px rgba(52,55,35,.18); }
.photo-note::before, .chart-note::before { content: ''; position: absolute; z-index: 2; top: -11px; left: 50%; width: 78px; height: 20px; background: rgba(204,164,99,.58); transform: translateX(-50%) rotate(-2deg); }
.photo-note img, .chart-note img { width: 100%; height: auto; aspect-ratio: 4/4.75; object-fit: cover; object-position: center; filter: saturate(.9) contrast(1.02); }
.photo-note figcaption { padding: 12px 7px 1px; color: #516143; text-align: center; font: 700 13px/1.5 'KaiTi', serif; }
.field-photo img { aspect-ratio: 4/4.5; object-position: 50% 57%; }
.split-photo img { aspect-ratio: 4/4.8; }
.tilt-left { transform: rotate(-1.2deg); }
.tilt-right { transform: rotate(1deg); }
.chart-note { margin-left: 0; margin-right: 0; padding: 7px; }
.chart-note img { aspect-ratio: auto; }

/* Questions and hypotheses */
.question-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.question-list li { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: center; padding: 10px 9px; border-bottom: 1px dashed rgba(49,90,48,.35); font: 700 15px/1.5 'KaiTi', serif; }
.question-list span { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; color: white; background: var(--forest); font-family: sans-serif; font-size: 12px; }
.sticky-grid { display: grid; gap: 11px; }
.sticky-note { padding: 12px 13px 15px; box-shadow: 2px 3px 0 rgba(61,63,32,.12); transform: rotate(-.8deg); }
.sticky-note:nth-child(2) { transform: rotate(.8deg); }
.sticky-note:nth-child(3) { transform: rotate(-.4deg); }
.sticky-a { background: #f7d9bd; }
.sticky-b { background: #dbe9bc; }
.sticky-c { background: #cee3ee; }
.sticky-note header { display: flex; gap: 8px; align-items: center; }
.sticky-note header b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: white; background: var(--orange); }
.sticky-b header b { background: #4e8b35; }
.sticky-c header b { background: var(--blue); }
.sticky-note header span { font: 800 17px/1 'KaiTi', serif; }
.sticky-note p { margin: 8px 0 0; font: 700 15px/1.55 'KaiTi', serif; }
.science-note { margin-top: 17px !important; padding: 11px 12px; color: #637049; border: 1px dashed #93a574; background: rgba(255,255,255,.45); font-size: 12px !important; line-height: 1.7 !important; }

/* Method */
.method-list { display: grid; gap: 13px; }
.method-list > div { display: grid; grid-template-columns: 42px 1fr; gap: 11px; align-items: center; }
.method-list > div > span { display: grid; place-items: center; width: 40px; height: 40px; border: 2px solid #5d824d; border-radius: 50%; color: var(--forest); background: #edf0cf; font-size: 22px; }
.method-list p { margin: 0; font-size: 13px; line-height: 1.55; }
.method-list b { display: block; color: var(--forest); font: 800 15px/1.4 'KaiTi', serif; }
.small-note { margin-top: 17px !important; padding-top: 13px; border-top: 1px dashed #788c60; color: #657356; font-size: 12px !important; line-height: 1.7 !important; }

/* Ledger */
.ledger-wrap { margin: 0 -8px; overflow-x: auto; overscroll-behavior-inline: contain; border: 1px solid #6f8457; background: rgba(255,255,255,.58); }
.ledger-wrap:focus-visible { outline: 3px solid #e0a526; outline-offset: 3px; }
table { width: 100%; min-width: 435px; border-collapse: collapse; font-size: 11px; }
th, td { padding: 8px 6px; border-right: 1px solid rgba(81,105,63,.35); border-bottom: 1px solid rgba(81,105,63,.28); text-align: center; white-space: nowrap; }
th { color: #203e25; background: rgba(151,178,105,.35); font-weight: 800; }
tbody tr:nth-child(even) { background: rgba(227,235,198,.34); }
.peak-row { color: #9e3e1c; font-weight: 800; background: rgba(250,217,149,.42) !important; }
.summary-strip { display: grid; grid-template-columns: 1fr 1px 1fr; gap: 10px; align-items: center; padding: 15px 2px 0; text-align: center; }
.summary-strip p { margin: 0; font-size: 12px; }
.summary-strip p span { display: block; color: #697951; font-size: 10px; letter-spacing: .14em; }
.summary-strip strong { color: var(--orange); font: 800 25px/1.2 'KaiTi', serif; }
.summary-strip i { height: 33px; background: rgba(77,102,56,.28); }

/* Comparisons */
.vertical-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: end; min-height: 222px; padding: 28px 18px 0; border-bottom: 2px solid #435e3c; }
.vertical-bars > div { display: grid; grid-template-rows: 145px auto; align-items: end; justify-items: center; height: 100%; }
.vertical-bars b { position: relative; display: block; width: 70px; min-height: 42px; color: white; background: var(--blue); border-radius: 3px 3px 0 0; box-shadow: inset 0 0 18px rgba(255,255,255,.18); }
.vertical-bars .green-bar { background: #5d983d; }
.vertical-bars b span { position: absolute; left: 50%; top: -27px; color: var(--forest); transform: translateX(-50%); font: 800 20px/1 'KaiTi', serif; }
.vertical-bars p { margin: 8px 0 0; text-align: center; font-size: 11px; line-height: 1.4; }
.big-result { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 5px 9px; margin-top: 18px; padding: 13px 15px; color: var(--forest); background: #e3edc5; border: 1px dashed #789458; }
.big-result span { font: 700 15px 'KaiTi', serif; }
.big-result strong { font: 900 30px/1 'KaiTi', serif; }
.big-result p { grid-column: 1/-1; margin: 0; font-size: 12px; }
details { margin-top: 13px; border-top: 1px dashed #809368; }
summary { padding: 12px 2px 5px; color: #5f704e; cursor: pointer; font-size: 12px; font-weight: 800; }
details p { margin: 4px 0 0; color: #56624d; font-size: 12px; line-height: 1.7; }
.horizontal-bars { display: grid; gap: 17px; }
.horizontal-bars > div > span { display: block; margin-bottom: 5px; color: #56684b; font-size: 11px; font-weight: 800; }
.horizontal-bars i { display: block; height: 31px; border-radius: 2px; background: rgba(70,94,64,.12); }
.horizontal-bars b { display: flex; align-items: center; justify-content: flex-end; height: 100%; min-width: 44px; padding-right: 8px; color: white; background: #e5a248; font-style: normal; }
.horizontal-bars .dark-bar { background: #396f43; }
.orange-result { color: #a8441e; background: #f6dfbb; border-color: #d7894c; }
.caution { margin-top: 13px !important; padding: 10px 12px; color: #5e624f; background: rgba(255,255,255,.5); font-size: 12px !important; line-height: 1.7 !important; }
.caution strong { color: var(--orange); }

/* Temperature and final result */
.temperature-compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin-bottom: 17px; }
.temperature-compare > p { margin: 0; padding: 13px 8px; text-align: center; border: 1px solid rgba(54,93,51,.28); background: rgba(255,255,255,.52); }
.temperature-compare span { display: block; color: #72865c; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.temperature-compare b { display: block; margin: 4px 0; color: var(--orange); font: 900 23px/1 'KaiTi', serif; }
.temperature-compare em { font-size: 11px; font-style: normal; }
.temperature-compare > i { color: #758361; font: 800 22px 'KaiTi', serif; }
.result-list { display: grid; gap: 10px; }
.result-row { display: grid; grid-template-columns: 42px 1fr; gap: 11px; align-items: center; padding: 10px; border: 1px solid rgba(63,91,53,.25); background: rgba(255,255,255,.58); }
.result-row > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: white; font-size: 24px; font-weight: 900; }
.result-row.no > span { background: #d65b2c; }
.result-row.yes > span { background: #3a8a48; }
.result-row p { margin: 0; }
.result-row b { display: block; color: #28442b; font: 800 14px/1.45 'KaiTi', serif; }
.result-row small { color: #728062; font-size: 11px; }
.final-answer { margin-bottom: 11px; color: var(--forest); border-left-color: #5e8e44; background: #e7edcb; }
.scope-note { padding-left: 21px; color: #6c735f; font-size: 11px !important; line-height: 1.7 !important; }
.scope-note::before { content: '※'; margin-left: -20px; margin-right: 7px; color: var(--orange); }

/* Extension and closing */
.question-stickers { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.question-stickers p { min-height: 104px; margin: 0; padding: 12px 10px; background: #f2dabd; font: 700 14px/1.55 'KaiTi', serif; box-shadow: 2px 3px 0 rgba(62,65,37,.13); transform: rotate(-.7deg); }
.question-stickers p:nth-child(2) { background: #f0e3ae; transform: rotate(.7deg); }
.question-stickers p:nth-child(3) { background: #dbe9c0; transform: rotate(.4deg); }
.question-stickers p:nth-child(4) { background: #cfe4ee; transform: rotate(-.5deg); }
.question-stickers p:nth-child(5) { grid-column: 1/-1; min-height: 78px; background: #e4d2dc; transform: rotate(.4deg); }
.question-stickers b { display: block; margin-bottom: 5px; color: var(--orange); font: 900 25px/1 'KaiTi', serif; }
.protect-note { display: grid; grid-template-columns: 42px 1fr; gap: 12px; margin: 4px 0 42px; padding: 18px 16px; color: #fff5bd; background: #173826; border: 1px solid #78904f; box-shadow: 4px 5px 0 rgba(50,70,40,.18); transform: rotate(-.5deg); }
.protect-note > span { display: grid; place-items: center; width: 42px; height: 42px; color: var(--fire); border: 1px solid #7d9a54; border-radius: 50%; font-size: 23px; text-shadow: 0 0 10px #e6ef55; }
.protect-note h2 { margin: 0 0 4px; font: 800 20px/1.35 'KaiTi', serif; }
.protect-note p { margin: 0; color: #e4e7bd; font-size: 12px; line-height: 1.65; }
footer { position: relative; margin: 0 -20px 0 -37px; padding: 52px 28px 42px 43px; color: #fff7cf; text-align: center; background: linear-gradient(180deg, #15372c, #071923); overflow: hidden; }
footer::before { content: ''; position: absolute; inset: 0; opacity: .58; background-image: radial-gradient(circle, #e7ed5d 0 2px, transparent 3px); background-size: 57px 63px; animation: drift 6s linear infinite; }
@keyframes drift { to { background-position: 57px -63px; } }
footer p, footer span { position: relative; z-index: 2; }
footer p { margin: 0; font: 700 17px/1.8 'KaiTi', serif; }
footer > span { display: block; margin-top: 15px; color: #b8c69a; font-size: 10px; letter-spacing: .18em; }
.jar { position: relative; z-index: 2; width: 63px; height: 72px; margin: 0 auto 18px; border: 3px solid rgba(233,229,182,.75); border-radius: 7px 7px 18px 18px; background: rgba(226,232,188,.1); }
.jar::before { content: ''; position: absolute; left: -5px; right: -5px; top: -9px; height: 10px; border: 3px solid #a48f61; border-radius: 5px; background: #655332; }
.jar i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #ecf471; box-shadow: 0 0 8px #e8f069, 0 0 15px #cfe53f; animation: blink 2.2s ease-in-out infinite; }
.jar i:nth-child(1) { left: 14px; top: 23px; }
.jar i:nth-child(2) { right: 13px; top: 39px; animation-delay: .6s; }
.jar i:nth-child(3) { left: 27px; bottom: 10px; animation-delay: 1.1s; }

@media (min-width: 541px) {
  body { padding: 24px 0; }
  .site-shell { border-radius: 24px; }
  .hero { min-height: 860px; }
}

@media (max-width: 370px) {
  .paper-title { padding-left: 24px; }
  .paper-title h1 { font-size: 43px; }
  .section-heading h2 { font-size: 21px; }
  .paper-page { padding-left: 34px; padding-right: 15px; }
  .chapter-nav a { min-width: 53px; padding-inline: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
