:root {
  --ink: #161310;
  --paper: #f5efe2;
  --paper-strong: #fffaf0;
  --line: rgba(45, 34, 22, 0.18);
  --muted: #756a5d;
  --cinnabar: #b83a2f;
  --jade: #2f7b67;
  --cyan: #2b9ca3;
  --gold: #c59b3f;
  --white: #ffffff;
  --shadow: 0 24px 76px rgba(40, 26, 16, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.58;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.topbar {
  align-items: center;
  background: rgba(245, 239, 226, 0.9);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr auto 1fr;
  left: 0;
  padding: 16px clamp(18px, 4vw, 56px);
  position: fixed;
  right: 0;
  top: 0;
  z-index: 20;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-weight: 900;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 8px;
  color: var(--paper-strong);
  display: inline-flex;
  font-family: "Noto Serif SC", serif;
  font-size: 1rem;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.nav {
  display: flex;
  gap: clamp(12px, 1.8vw, 28px);
  justify-content: center;
}

.nav a,
.ghost-button {
  color: #3a3026;
  font-size: 0.92rem;
  font-weight: 800;
}

.ghost-button,
.primary-button,
.mode-options button,
.chips button,
.genre-list button,
.code-head button {
  border: 0;
}

.ghost-button {
  background: transparent;
  justify-self: end;
  padding: 8px 0;
}

.mobile-jump-nav {
  display: none;
}

.reader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 370px);
  min-height: 100vh;
  overflow: hidden;
  padding: 112px clamp(18px, 4vw, 56px) 52px;
  position: relative;
}

.reader-bg,
.reader-shade {
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
}

.reader-bg {
  object-fit: cover;
  object-position: center;
}

.reader-shade {
  background:
    linear-gradient(90deg, rgba(249, 247, 239, 0.26) 0%, rgba(249, 247, 239, 0.1) 46%, rgba(249, 247, 239, 0) 67%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03) 55%, rgba(24, 22, 17, 0.14) 100%);
  pointer-events: none;
  z-index: 1;
}

.hero-smoke,
.bamboo-drift {
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.hero-smoke {
  bottom: 30%;
  height: 34%;
  left: 8.5%;
  width: 9%;
}

.hero-smoke span {
  animation: hero-smoke-rise 8s ease-in-out infinite;
  border-left: 3px solid rgba(116, 125, 114, 0.3);
  border-radius: 48% 52% 42% 58%;
  bottom: 0;
  filter: blur(3px);
  height: 70%;
  left: 48%;
  opacity: 0;
  position: absolute;
  transform-origin: bottom;
  width: 46%;
}

.hero-smoke span:nth-child(2) {
  animation-delay: -2.8s;
  height: 86%;
  left: 35%;
}

.hero-smoke span:nth-child(3) {
  animation-delay: -5.4s;
  height: 62%;
  left: 58%;
}

.bamboo-drift {
  height: 72%;
  overflow: hidden;
  right: 0;
  top: 8%;
  width: 47%;
}

.bamboo-drift span {
  animation: bamboo-leaf-drift 12s linear infinite;
  background: rgba(61, 85, 61, 0.58);
  clip-path: polygon(0 50%, 38% 8%, 100% 50%, 38% 92%);
  height: 7px;
  opacity: 0;
  position: absolute;
  right: -8%;
  top: 12%;
  width: 34px;
}

.bamboo-drift span:nth-child(2) { animation-delay: -2s; animation-duration: 15s; top: 26%; }
.bamboo-drift span:nth-child(3) { animation-delay: -4.5s; animation-duration: 11s; top: 7%; }
.bamboo-drift span:nth-child(4) { animation-delay: -6.5s; animation-duration: 17s; top: 42%; }
.bamboo-drift span:nth-child(5) { animation-delay: -8s; animation-duration: 13s; top: 19%; }
.bamboo-drift span:nth-child(6) { animation-delay: -10.5s; animation-duration: 18s; top: 54%; }
.bamboo-drift span:nth-child(7) { animation-delay: -12s; animation-duration: 14s; top: 33%; }
.bamboo-drift span:nth-child(8) { animation-delay: -14s; animation-duration: 19s; top: 63%; }

@keyframes hero-smoke-rise {
  0% { opacity: 0; transform: translate3d(0, 8%, 0) scale(0.72, 0.48) rotate(-5deg); }
  18% { opacity: 0.48; }
  52% { opacity: 0.26; transform: translate3d(16%, -38%, 0) scale(0.9, 0.86) rotate(7deg); }
  100% { opacity: 0; transform: translate3d(-12%, -92%, 0) scale(1.3, 1.18) rotate(-8deg); }
}

@keyframes bamboo-leaf-drift {
  0% { opacity: 0; transform: translate3d(0, -16px, 0) rotate(12deg); }
  10% { opacity: 0.62; }
  46% { transform: translate3d(-18vw, 34px, 0) rotate(190deg); }
  82% { opacity: 0.48; }
  100% { opacity: 0; transform: translate3d(-43vw, 118px, 0) rotate(390deg); }
}

.hero-copy,
.control-panel {
  position: relative;
  z-index: 2;
}

.hero-copy {
  align-content: center;
  display: grid;
  gap: 20px;
  max-width: 620px;
  min-width: 0;
}

.hero-copy::before {
  background: linear-gradient(90deg, #8d2d24 0 42px, rgba(81, 105, 90, 0.72) 42px 108px, transparent 108px);
  content: "";
  height: 2px;
  width: 140px;
}

.eyebrow {
  color: var(--jade);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 12px;
  text-transform: uppercase;
}

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

h1,
h2,
.classic-head strong {
  font-family: "Noto Serif SC", serif;
}

h1 {
  color: #20241f;
  font-size: clamp(4rem, 7vw, 6.2rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  margin-bottom: 12px;
  max-width: 620px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.58);
}

h2 {
  font-size: clamp(2rem, 4.5vw, 4.2rem);
  letter-spacing: 0;
  line-height: 1.04;
  margin-bottom: 0;
}

h3 {
  font-size: 1.24rem;
  margin-bottom: 10px;
}

.lede {
  color: #4b5149;
  font-size: 1.08rem;
  line-height: 1.9;
  max-width: 570px;
}

.hero-verse {
  color: #6f2a23;
  font-family: "Noto Serif SC", serif;
  font-size: 1.16rem;
  letter-spacing: 0;
  margin: 4px 0 0 220px;
  white-space: nowrap;
}

.classic-card,
.control-panel,
.prompt-panel,
.result-card,
.code-card {
  background: rgba(255, 250, 240, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.classic-card {
  background: rgba(250, 248, 239, 0.64);
  border-color: rgba(96, 105, 91, 0.28);
  border-width: 1px 0;
  box-shadow: none;
  max-width: 560px;
  padding: 16px 4px;
}

.classic-head,
.panel-head,
.prompt-head,
.code-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.classic-head span,
.panel-head span,
.prompt-head span:last-child,
.result-label,
.code-head span {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
}

.classic-head strong {
  color: #8d2d24;
  font-size: 1.42rem;
}

.classic-card p {
  color: #50554c;
  line-height: 1.75;
  margin: 10px 0 0;
}

.control-panel {
  align-self: center;
  backdrop-filter: blur(14px);
  background: rgba(247, 246, 237, 0.88);
  border-color: rgba(107, 112, 95, 0.34);
  box-shadow: 0 18px 48px rgba(22, 27, 23, 0.16);
  display: grid;
  gap: 18px;
  padding: 22px;
}

.rhyme-portal {
  gap: 14px;
}

.portal-rhyme {
  color: #5a685c;
  font-family: "Noto Serif SC", serif;
  font-size: 1.08rem;
  margin: -2px 0 0;
}

.portal-selection {
  border-bottom: 1px solid rgba(96, 105, 91, 0.25);
  border-top: 1px solid rgba(96, 105, 91, 0.25);
  min-height: 128px;
  padding: 16px 0;
}

.portal-selection p {
  color: #51584f;
  line-height: 1.72;
  margin: 10px 0 0;
}

.portal-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.panel-head strong {
  color: var(--cinnabar);
  font-family: "Noto Serif SC", serif;
  font-size: 1.5rem;
}

.mode-options,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mode-options button,
.chips button,
.genre-list button {
  border-radius: 8px;
  font-weight: 900;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.mode-options button {
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 10px 14px;
}

.mode-options button.is-active {
  background: var(--ink);
  color: var(--paper-strong);
}

.mode-options button:hover,
.chips button:hover,
.genre-list button:hover {
  transform: translateY(-2px);
}

.range-label {
  color: #3a3026;
  display: grid;
  font-weight: 900;
  gap: 10px;
}

input[type="range"] {
  accent-color: var(--cinnabar);
}

.primary-button {
  background: var(--cinnabar);
  border-radius: 8px;
  color: var(--paper-strong);
  font-weight: 900;
  min-height: 52px;
}

.portal-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 0.8fr 1.2fr;
}

.portal-actions button {
  border-radius: 6px;
  min-height: 48px;
}

.portal-actions button:first-child {
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(82, 94, 81, 0.34);
  color: #37443a;
  font-weight: 800;
}

@media (prefers-reduced-motion: reduce) {
  .hero-smoke span,
  .bamboo-drift span {
    animation: none;
    opacity: 0;
  }
}

.generator,
.library,
.map,
.flow {
  padding: clamp(58px, 8vw, 106px) clamp(18px, 6vw, 80px);
}

.volume-atlas {
  background: #111816;
  color: #f3eddb;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  position: relative;
}

.archive-scene {
  aspect-ratio: 1672 / 941;
  isolation: isolate;
  margin: 0 auto;
  max-width: 1920px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.archive-scene-image,
.archive-vignette,
.incense-smoke {
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
}

.archive-scene-image {
  display: block;
  object-fit: contain;
  user-select: none;
  z-index: 0;
}

.archive-vignette {
  background:
    linear-gradient(90deg, rgba(7, 16, 17, 0.52) 0%, rgba(7, 16, 17, 0.12) 25%, transparent 42%),
    linear-gradient(180deg, rgba(5, 12, 13, 0.24), transparent 26%, transparent 82%, rgba(5, 11, 10, 0.18));
  pointer-events: none;
  z-index: 1;
}

.incense-smoke {
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 2;
}

.incense-wisps {
  bottom: 56.2%;
  height: 25%;
  left: 6.6%;
  mix-blend-mode: screen;
  pointer-events: none;
  position: absolute;
  width: 5.4%;
  z-index: 3;
}

.incense-wisps span {
  animation: incense-wisp 6.2s ease-in-out infinite;
  border-left: 3px solid rgba(226, 230, 219, 0.72);
  border-radius: 58% 0 0 46%;
  bottom: -2%;
  filter: blur(0.8px);
  height: 68%;
  left: 46%;
  opacity: 0;
  position: absolute;
  transform-origin: 50% 100%;
  width: 35%;
}

.incense-wisps span::after {
  border-radius: 0 58% 46% 0;
  border-right: 2px solid rgba(221, 226, 218, 0.44);
  content: "";
  height: 66%;
  left: 12%;
  position: absolute;
  top: -42%;
  transform: rotate(-9deg);
  width: 120%;
}

.incense-wisps span:nth-child(2) {
  animation-delay: -2.1s;
  height: 78%;
  left: 31%;
  opacity: 0;
  transform: scale(0.82);
}

.incense-wisps span:nth-child(3) {
  animation-delay: -4.2s;
  height: 58%;
  left: 58%;
  transform: scale(0.68);
}

@keyframes incense-wisp {
  0% { opacity: 0; transform: translate(0, 9px) rotate(2deg) scale(0.72); }
  18% { opacity: 0.72; }
  62% { opacity: 0.46; }
  100% { opacity: 0; transform: translate(12px, -28px) rotate(-8deg) scale(1.2); }
}

.archive-title {
  left: 4.2%;
  position: absolute;
  text-shadow: 0 2px 18px rgba(2, 9, 10, 0.82);
  top: 7.5%;
  z-index: 4;
}

.archive-title p {
  color: rgba(229, 220, 190, 0.76);
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(0.62rem, 0.76vw, 0.9rem);
  font-weight: 700;
  margin: 0 0 0.65rem;
  text-transform: uppercase;
}

.archive-title h2 {
  color: #f2ead3;
  font-size: clamp(2.1rem, 3.55vw, 4.25rem);
  font-weight: 500;
  line-height: 1.06;
  margin: 0;
}

.zhaoming-seal {
  filter: drop-shadow(0 9px 18px rgba(5, 9, 8, 0.34));
  height: clamp(52px, 5.2vw, 86px);
  margin-top: 16px;
  opacity: 0.92;
  transform: rotate(-7deg);
  width: clamp(52px, 5.2vw, 86px);
}

.archive-index {
  background:
    repeating-linear-gradient(0deg, rgba(82, 65, 39, 0.025) 0 1px, transparent 1px 4px),
    rgba(241, 235, 214, 0.93);
  border: 1px solid rgba(188, 162, 105, 0.72);
  box-shadow: 0 14px 38px rgba(8, 15, 13, 0.24), inset 0 0 0 3px rgba(255, 252, 235, 0.34);
  display: grid;
  gap: clamp(5px, 0.44vw, 8px);
  grid-template-rows: auto auto minmax(0, 1fr);
  height: 20.1%;
  left: 29.2%;
  padding: clamp(8px, 0.72vw, 13px);
  position: absolute;
  top: 8.6%;
  width: 68.2%;
  z-index: 7;
}

.archive-index-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-width: 0;
}

.archive-index-heading strong {
  color: #783026;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(0.88rem, 1vw, 1.18rem);
}

.archive-index-heading output {
  color: #5b4e3a;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(0.64rem, 0.7vw, 0.82rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-index-toggle {
  display: none;
}

.archive-index-search {
  background: rgba(255, 253, 240, 0.72);
  border: 0;
  border-bottom: 1px solid rgba(108, 82, 48, 0.34);
  border-radius: 0;
  color: #272018;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(0.76rem, 0.82vw, 0.96rem);
  height: clamp(27px, 2.2vw, 36px);
  outline: none;
  padding: 0 0.65em;
  width: 100%;
}

.archive-index-search:focus {
  border-bottom-color: #9c3a2e;
  box-shadow: inset 0 -1px #9c3a2e;
}

.archive-index-search::placeholder {
  color: #8c806a;
}

.archive-index-grid {
  display: grid;
  gap: clamp(3px, 0.3vw, 6px);
  grid-template-columns: repeat(20, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  min-height: 0;
}

.archive-index-button {
  background: rgba(255, 253, 240, 0.58);
  border: 1px solid rgba(88, 70, 43, 0.18);
  border-radius: 2px;
  color: #34483f;
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(0.78rem, 1vw, 0.98rem);
  font-weight: 700;
  min-height: 0;
  padding: 0;
  position: relative;
  transform: translateY(0) scale(1);
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease, opacity 150ms ease, transform 180ms ease;
}

.archive-index-button::after {
  border: 1px solid transparent;
  content: "";
  inset: 2px;
  pointer-events: none;
  position: absolute;
}

.archive-index-button:hover,
.archive-index-button:focus-visible,
.archive-index-button.is-match {
  background: rgba(151, 59, 45, 0.12);
  border-color: rgba(151, 59, 45, 0.62);
  color: #8f3127;
  outline: none;
  transform: translateY(-1px);
}

.archive-index-button.is-active {
  background: linear-gradient(145deg, #a04736, #812b25 72%);
  border-color: #7e2c24;
  box-shadow: 0 3px 8px rgba(90, 35, 28, 0.25), inset 0 0 0 1px rgba(255, 226, 165, 0.18);
  color: #fff2d5;
}

.archive-index-button.is-active::after {
  border-color: rgba(245, 216, 146, 0.54);
}

.archive-index-button.is-struck {
  animation: index-seal-settle 520ms cubic-bezier(0.2, 0.82, 0.28, 1) both;
}

.archive-index-button:active {
  transform: translateY(1px) scale(0.94);
}

@keyframes index-seal-settle {
  0% { box-shadow: 0 0 0 rgba(218, 176, 87, 0); transform: translateY(-3px) scale(1.08); }
  48% { box-shadow: 0 0 0 4px rgba(218, 176, 87, 0.2), 0 5px 12px rgba(90, 35, 28, 0.28); transform: translateY(1px) scale(0.96); }
  100% { box-shadow: 0 3px 8px rgba(90, 35, 28, 0.25), inset 0 0 0 1px rgba(255, 226, 165, 0.18); transform: translateY(0) scale(1); }
}

.archive-index-button.is-dimmed {
  opacity: 0.22;
}

.archive-preface {
  background: rgba(129, 48, 37, 0.82);
  border: 1px solid rgba(241, 222, 177, 0.72);
  border-radius: 2px;
  box-shadow: 0 6px 18px rgba(15, 11, 7, 0.3);
  color: #f5e8c8;
  cursor: pointer;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(0.72rem, 0.92vw, 1rem);
  height: clamp(28px, 2.6vw, 42px);
  left: 23.4%;
  padding: 0;
  position: absolute;
  top: 48.8%;
  width: clamp(28px, 2.6vw, 42px);
  z-index: 6;
}

.archive-preface:hover,
.archive-preface.is-active {
  background: #8e382d;
  box-shadow: 0 0 0 3px rgba(224, 190, 117, 0.28), 0 7px 20px rgba(15, 11, 7, 0.34);
}

.archive-shelf {
  column-gap: 0.18%;
  display: grid;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  height: 27.2%;
  left: 28.2%;
  position: absolute;
  row-gap: 7.5%;
  top: 29.6%;
  width: 70.4%;
  z-index: 5;
}

.archive-volume-button {
  appearance: none;
  background: transparent;
  border: 0;
  color: rgba(247, 237, 205, 0.86);
  cursor: pointer;
  isolation: isolate;
  min-height: 0;
  padding: 0;
  position: relative;
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.archive-volume-button::after {
  background:
    radial-gradient(circle at 42% 38%, rgba(247, 231, 192, 0.96) 0 18%, rgba(199, 172, 116, 0.96) 34%, rgba(111, 81, 47, 0.98) 56%, rgba(43, 31, 23, 0.98) 67%, rgba(184, 148, 78, 0.94) 71%, rgba(33, 25, 19, 0.98) 76%);
  border: 1px solid rgba(229, 199, 130, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(15, 10, 6, 0);
  content: "";
  height: 76%;
  left: 12%;
  opacity: 0;
  position: absolute;
  top: 12%;
  transform: translateY(-6%) scale(0.72);
  transition: opacity 180ms ease, transform 320ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 320ms ease;
  width: 76%;
  z-index: 1;
}

.archive-volume-button::before {
  border: 1px solid rgba(240, 211, 139, 0);
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(230, 195, 110, 0);
  content: "";
  height: 72%;
  left: 10%;
  position: absolute;
  top: 16%;
  transform: scale(0.78);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  width: 80%;
  z-index: 2;
}

.archive-volume-button span {
  align-items: center;
  background: rgba(24, 24, 18, 0.62);
  border: 1px solid rgba(227, 210, 165, 0.2);
  border-radius: 50%;
  display: flex;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(0.58rem, 0.66vw, 0.78rem);
  height: clamp(19px, 1.75vw, 29px);
  justify-content: center;
  left: 50%;
  line-height: 1;
  position: absolute;
  top: 48%;
  transform: translate(-50%, -50%);
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
  width: clamp(19px, 1.75vw, 29px);
  z-index: 3;
}

.archive-volume-button.is-active {
  animation: selected-scroll-pull 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
  z-index: 9;
}

.archive-volume-button.is-active::after {
  box-shadow: 0 12px 15px rgba(15, 10, 6, 0.62), 0 3px 5px rgba(15, 10, 6, 0.38), inset 0 0 5px rgba(250, 226, 171, 0.28);
  opacity: 1;
  transform: translateY(12%) scale(1.08);
}

@keyframes selected-scroll-pull {
  0% { transform: translateY(0) scale(0.94); }
  68% { transform: translateY(14%) scale(1.17); }
  100% { transform: translateY(10%) scale(1.1); }
}

.archive-volume-button:hover::before,
.archive-volume-button:focus-visible::before,
.archive-volume-button.is-active::before {
  border-color: rgba(245, 218, 145, 0.9);
  box-shadow: 0 0 12px rgba(232, 199, 112, 0.72), inset 0 0 8px rgba(245, 225, 170, 0.22);
  transform: scale(1);
}

.archive-volume-button:focus-visible {
  outline: none;
}

.archive-volume-button.is-active::before {
  animation: selected-scroll-breath 2.6s ease-in-out infinite;
}

@keyframes selected-scroll-breath {
  0%, 100% { box-shadow: 0 0 8px rgba(232, 199, 112, 0.54), inset 0 0 6px rgba(245, 225, 170, 0.18); }
  50% { box-shadow: 0 0 17px rgba(232, 199, 112, 0.86), inset 0 0 10px rgba(245, 225, 170, 0.32); }
}

.archive-volume-button:hover span,
.archive-volume-button:focus-visible span,
.archive-volume-button.is-active span {
  background: rgba(119, 47, 35, 0.92);
  color: #fff3cf;
  transform: translate(-50%, -50%) scale(1.08);
}

.archive-preface:focus-visible,
.volume-work-list button:focus-visible {
  outline: 2px solid #f1d385;
  outline-offset: 2px;
}

.archive-volume-hint {
  background: rgba(17, 23, 20, 0.78);
  border-left: 2px solid rgba(211, 177, 99, 0.82);
  color: rgba(245, 235, 204, 0.9);
  font-family: "Noto Serif SC", serif;
  font-size: clamp(0.72rem, 0.82vw, 0.95rem);
  left: 29%;
  min-height: 1.5em;
  opacity: 0;
  padding: 0.24em 0.65em;
  pointer-events: none;
  position: absolute;
  top: 28%;
  transform: translateY(5px);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 6;
}

.archive-volume-hint.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-paper {
  align-items: stretch;
  background:
    linear-gradient(90deg, rgba(247, 240, 218, 0.05), rgba(252, 247, 230, 0.16) 22%, rgba(250, 244, 225, 0.14) 82%, rgba(242, 233, 207, 0.04));
  border-bottom: 1px solid rgba(92, 75, 43, 0.08);
  border-top: 1px solid rgba(111, 91, 53, 0.07);
  color: #241f18;
  display: grid;
  gap: clamp(10px, 1.2vw, 22px);
  grid-template-columns: minmax(176px, 0.29fr) 1px minmax(0, 1fr) clamp(44px, 4vw, 68px);
  height: 27.8%;
  left: 22.2%;
  padding: 1.15% 1.4% 1.05% 1.8%;
  position: absolute;
  top: 59.2%;
  transform: rotate(-0.22deg);
  transform-origin: 50% 50%;
  width: 62.8%;
  z-index: 6;
}

.scroll-paper > :not(.scroll-paper-aura) {
  position: relative;
  z-index: 1;
}

.scroll-paper-aura {
  inset: -17% -4% -14%;
  overflow: visible;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.scroll-paper-aura::before {
  animation: paper-ribbon-left 6.4s ease-in-out infinite;
  background: linear-gradient(90deg, transparent, rgba(67, 126, 109, 0.56), rgba(224, 186, 98, 0.74), transparent);
  box-shadow: 0 0 5px rgba(205, 164, 79, 0.28);
  content: "";
  height: 2px;
  left: -1.5%;
  opacity: 0.64;
  position: absolute;
  top: 32%;
  transform: rotate(5deg);
  transform-origin: left center;
  width: 21%;
}

.scroll-paper-aura span {
  animation: paper-cloud-drift 8s ease-in-out infinite;
  border-radius: 50%;
  border-top: 2px solid rgba(178, 139, 67, 0.64);
  filter: drop-shadow(0 0 3px rgba(202, 157, 73, 0.24));
  height: 34%;
  left: -1%;
  opacity: 0.38;
  position: absolute;
  top: 40%;
  width: 18%;
}

.scroll-paper-aura span::before,
.scroll-paper-aura span::after {
  border-radius: 50%;
  border-top: 1px solid currentColor;
  content: "";
  height: 72%;
  position: absolute;
  width: 48%;
}

.scroll-paper-aura span::before {
  color: rgba(88, 130, 115, 0.32);
  left: 14%;
  top: -22%;
}

.scroll-paper-aura span::after {
  color: rgba(199, 154, 72, 0.32);
  right: 5%;
  top: 18%;
}

.scroll-paper-aura span:nth-child(2) {
  animation-delay: -3.2s;
  height: 27%;
  left: auto;
  right: -1.5%;
  top: 20%;
  transform: scaleX(-1);
  width: 14%;
}

.scroll-paper-aura span:nth-child(3) {
  animation-delay: -5.8s;
  border-top-color: rgba(75, 126, 111, 0.34);
  height: 22%;
  left: auto;
  right: 4%;
  top: 67%;
  width: 11%;
}

.scroll-paper-aura i {
  animation: paper-ribbon-flow 5.6s ease-in-out infinite;
  background: linear-gradient(90deg, transparent, rgba(192, 145, 57, 0.12), rgba(225, 190, 105, 0.7), rgba(80, 133, 117, 0.48), transparent);
  bottom: 18%;
  box-shadow: 0 0 5px rgba(205, 164, 79, 0.24);
  height: 2px;
  opacity: 0.62;
  position: absolute;
  right: -2%;
  transform: rotate(-4deg);
  transform-origin: right center;
  width: 27%;
}

.scroll-paper-aura i::after {
  background: inherit;
  content: "";
  height: 1px;
  left: 18%;
  opacity: 0.58;
  position: absolute;
  top: 7px;
  transform: rotate(3deg);
  width: 72%;
}

.scroll-paper.is-turning .scroll-paper-aura {
  animation: paper-aura-bloom 1.2s ease both;
}

@keyframes paper-cloud-drift {
  0%, 100% { opacity: 0.44; transform: translate3d(0, 0, 0) scale(0.96); }
  50% { opacity: 0.72; transform: translate3d(7px, -3px, 0) scale(1.04); }
}

@keyframes paper-ribbon-flow {
  0%, 100% { opacity: 0.46; transform: rotate(-4deg) scaleX(0.72); }
  50% { opacity: 0.78; transform: rotate(-2deg) scaleX(1); }
}

@keyframes paper-ribbon-left {
  0%, 100% { opacity: 0.42; transform: rotate(5deg) scaleX(0.68); }
  50% { opacity: 0.76; transform: rotate(2deg) scaleX(1); }
}

@keyframes paper-aura-bloom {
  0% { filter: saturate(0.72); opacity: 0; transform: scaleX(0.9); }
  45% { filter: saturate(1.18); opacity: 1; transform: scaleX(1.02); }
  100% { filter: saturate(1); opacity: 1; transform: scaleX(1); }
}

.scroll-paper.is-turning > * {
  animation: paper-ink-in 360ms ease both;
}

@keyframes paper-ink-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.scroll-paper-heading {
  align-self: start;
  isolation: isolate;
  min-width: 0;
  padding-top: 0.2em;
  position: relative;
}

.scroll-paper-heading::before {
  background: linear-gradient(90deg, rgba(249, 244, 226, 0.96), rgba(249, 244, 226, 0.91) 76%, rgba(249, 244, 226, 0.66) 91%, transparent);
  content: "";
  inset: -8% -8% -10% -10%;
  pointer-events: none;
  position: absolute;
  z-index: -1;
}

.scroll-paper-heading > span {
  color: #81372d;
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(0.72rem, 0.76vw, 0.88rem);
  font-weight: 700;
  margin-bottom: 0.28em;
}

.scroll-paper-heading > strong {
  color: #a2372c;
  display: block;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(2rem, 2.72vw, 3.2rem);
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 0.36em;
}

.scroll-paper-heading > p {
  color: #7f2e26;
  display: -webkit-box;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(0.875rem, 0.9vw, 1.02rem);
  font-weight: 700;
  line-height: 1.55;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.scroll-paper-rule {
  background: linear-gradient(180deg, transparent, rgba(103, 88, 56, 0.34) 12%, rgba(103, 88, 56, 0.34) 88%, transparent);
}

.volume-work-list {
  align-content: start;
  display: grid;
  gap: 0 clamp(13px, 1.1vw, 22px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: 100%;
  overflow: auto;
  padding: 0 8px 6px 0;
  scrollbar-color: rgba(91, 81, 59, 0.42) transparent;
  scrollbar-width: thin;
}

.volume-work-list button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #272119;
  cursor: pointer;
  display: grid;
  font-family: "Noto Serif SC", serif;
  gap: clamp(7px, 0.55vw, 11px);
  grid-template-columns: auto minmax(0, 1fr);
  isolation: isolate;
  min-height: clamp(48px, 3.25vw, 58px);
  overflow: hidden;
  padding: 0.34em 0.28em 0.38em;
  position: relative;
  text-align: left;
  transform: translateX(0);
  transition: background-color 220ms ease, transform 220ms ease;
}

.volume-work-list button::after {
  background: linear-gradient(90deg, rgba(136, 91, 35, 0.62), rgba(217, 176, 85, 0.76) 48%, rgba(136, 91, 35, 0.08));
  bottom: 0;
  content: "";
  height: 1px;
  left: 0;
  opacity: 0.46;
  position: absolute;
  right: 0;
  transform: scaleX(0.28);
  transform-origin: left center;
  transition: opacity 260ms ease, transform 340ms ease;
}

.volume-work-number {
  color: #986b34;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(0.62rem, 0.61vw, 0.72rem);
  font-weight: 700;
  letter-spacing: 0;
  opacity: 0.78;
}

.volume-work-title {
  background-image: linear-gradient(100deg, #30271c 0 43%, #8b5c23 47%, #efd082 50%, #9d702f 53%, #30271c 57% 100%);
  background-position: 100% 50%;
  background-size: 250% 100%;
  color: #30271c;
  display: -webkit-box;
  font-size: clamp(1.18rem, 1.6vw, 1.52rem);
  font-weight: 700;
  line-height: 1.34;
  overflow: hidden;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  -webkit-text-fill-color: transparent;
}

.volume-work-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.volume-work-guide {
  color: rgba(67, 54, 36, 0.72);
  display: -webkit-box;
  font-size: clamp(0.68rem, 0.7vw, 0.78rem);
  font-weight: 700;
  line-height: 1.45;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.volume-work-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.volume-work-badges em {
  background: rgba(151, 106, 42, 0.12);
  border: 1px solid rgba(151, 106, 42, 0.2);
  color: #7b5522;
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  padding: 3px 5px;
}

.volume-work-list button.has-guide {
  min-height: clamp(86px, 5.9vw, 108px);
}

.volume-work-list button:hover,
.volume-work-list button:focus-visible {
  background: linear-gradient(90deg, rgba(151, 106, 42, 0.1), rgba(151, 106, 42, 0.025));
  transform: translateX(3px);
}

.volume-work-list button:hover::after,
.volume-work-list button:focus-visible::after {
  opacity: 0.9;
  transform: scaleX(1);
}

.volume-work-list button:hover .volume-work-title,
.volume-work-list button:focus-visible .volume-work-title {
  animation: chapter-gold-sweep 1.25s ease both;
}

.volume-work-list button:active .volume-work-title {
  filter: brightness(1.12);
}

.scroll-paper.is-turning .volume-work-list button {
  animation: chapter-ink-in 520ms ease both;
  animation-delay: var(--work-delay, 0ms);
}

.scroll-paper.is-turning .volume-work-title {
  animation: chapter-gold-sweep 1.15s ease both;
  animation-delay: var(--work-delay, 0ms);
}

@keyframes chapter-ink-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes chapter-gold-sweep {
  0% { background-position: 100% 50%; }
  48% { background-position: 48% 50%; }
  100% { background-position: 0 50%; }
}

.scroll-paper-meta {
  align-items: center;
  border-left: 1px solid rgba(92, 78, 52, 0.18);
  display: flex;
  flex-direction: column;
  gap: clamp(7px, 0.7vw, 12px);
  justify-content: center;
}

.scroll-paper-meta span {
  color: #4d4232;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(0.52rem, 0.62vw, 0.76rem);
  writing-mode: vertical-rl;
}

.scroll-paper-meta em {
  align-items: center;
  background:
    repeating-linear-gradient(45deg, rgba(255, 238, 200, 0.045) 0 1px, transparent 1px 3px),
    #9a352b;
  border: 2px solid rgba(247, 225, 181, 0.82);
  box-shadow: 0 0 0 1px #8d2e26, inset 0 0 0 2px rgba(121, 29, 23, 0.34);
  color: #f8e8c4;
  display: flex;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(0.66rem, 0.72vw, 0.86rem);
  font-style: normal;
  font-weight: 700;
  height: clamp(44px, 3.65vw, 60px);
  justify-content: center;
  line-height: 1.18;
  text-align: center;
  width: clamp(44px, 3.65vw, 60px);
}

@media (max-width: 1600px) {
  .volume-work-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1280px) {
  .scroll-paper {
    grid-template-columns: minmax(168px, 0.28fr) 1px minmax(0, 1fr) 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .archive-index-button.is-struck,
  .scroll-paper-aura,
  .scroll-paper-aura::before,
  .scroll-paper-aura span,
  .scroll-paper-aura i,
  .scroll-paper.is-turning .volume-work-list button,
  .scroll-paper.is-turning .volume-work-title,
  .volume-work-list button:hover .volume-work-title,
  .volume-work-list button:focus-visible .volume-work-title {
    animation: none;
  }
}

.anthology-orbit {
  background:
    radial-gradient(circle at 50% 48%, rgba(223, 189, 107, 0.12), transparent 28%),
    linear-gradient(135deg, #121821 0%, #172722 38%, #251b22 72%, #141922 100%);
  color: #f7eed6;
  height: max(760px, 100svh);
  min-height: 760px;
  overflow: hidden;
  position: relative;
}

.anthology-orbit canvas,
.orbit-vignette {
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
}

.anthology-orbit canvas {
  cursor: crosshair;
  display: block;
  filter: saturate(1.08) contrast(1.03);
  outline: none;
  touch-action: none;
}

.orbit-vignette {
  background:
    linear-gradient(180deg, rgba(10, 13, 18, 0.45), transparent 28%, transparent 66%, rgba(7, 10, 14, 0.72)),
    linear-gradient(90deg, rgba(7, 10, 14, 0.56), transparent 28%, transparent 72%, rgba(7, 10, 14, 0.5));
  pointer-events: none;
}

.orbit-heading,
.orbit-panel,
.orbit-filters,
.orbit-count,
.orbit-fallback {
  position: absolute;
  z-index: 3;
}

.orbit-heading {
  left: clamp(24px, 5vw, 76px);
  max-width: 520px;
  top: clamp(96px, 12vh, 132px);
}

.orbit-heading h2 {
  color: #fff4d8;
  font-size: clamp(3.8rem, 8vw, 7rem);
  font-weight: 500;
  line-height: 0.96;
  margin: 4px 0 16px;
  text-shadow: 0 8px 34px rgba(0, 0, 0, 0.36);
}

.orbit-heading p:last-child {
  color: rgba(248, 236, 207, 0.78);
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.78;
  margin: 0;
}

.orbit-panel {
  backdrop-filter: blur(20px);
  background:
    linear-gradient(135deg, rgba(32, 43, 45, 0.78), rgba(48, 33, 38, 0.68)),
    linear-gradient(180deg, rgba(255, 244, 202, 0.1), transparent);
  border: 1px solid rgba(238, 210, 142, 0.26);
  border-radius: 8px;
  bottom: clamp(40px, 7vh, 74px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  display: grid;
  gap: 9px;
  max-width: 440px;
  padding: 20px 22px 22px;
  right: clamp(24px, 5vw, 76px);
  width: min(440px, calc(100% - 48px));
}

.orbit-panel > span,
.orbit-count {
  color: #d7bd72;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
  font-weight: 900;
}

.orbit-panel strong {
  color: #fff7de;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  font-weight: 500;
  line-height: 1.05;
}

.orbit-panel p {
  color: rgba(248, 236, 207, 0.75);
  font-weight: 800;
  margin: 0;
}

.orbit-panel blockquote {
  border-left: 3px solid rgba(213, 186, 105, 0.74);
  color: #f3e5bd;
  font-family: "Noto Serif SC", serif;
  font-size: 1.05rem;
  line-height: 1.74;
  margin: 7px 0 2px;
  padding-left: 13px;
}

.orbit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 4px;
}

.orbit-actions button {
  border-radius: 4px;
  font-weight: 900;
  min-height: 42px;
  padding: 0 16px;
}

.orbit-actions button:not(.primary-button) {
  background: rgba(238, 221, 174, 0.12);
  border: 1px solid rgba(238, 221, 174, 0.34);
  color: #f7eed6;
}

.orbit-filters {
  align-items: center;
  background: rgba(15, 20, 25, 0.46);
  border: 1px solid rgba(238, 221, 174, 0.2);
  border-radius: 999px;
  display: flex;
  gap: 4px;
  left: 50%;
  padding: 5px;
  top: clamp(96px, 12vh, 132px);
  transform: translateX(-50%);
}

.orbit-filters button {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: rgba(248, 236, 207, 0.7);
  font-family: "Noto Serif SC", serif;
  font-weight: 900;
  height: 34px;
  padding: 0;
  width: 40px;
}

.orbit-filters button.is-active {
  background: linear-gradient(135deg, #d8b45f, #bc4e40);
  color: #fff7dc;
}

.orbit-count {
  bottom: clamp(42px, 7vh, 76px);
  left: clamp(24px, 5vw, 76px);
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.5);
}

.orbit-fallback {
  color: #f7eed6;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.poem-realm {
  background: #b8ccc2;
  color: #f6f0dd;
  height: max(720px, 100svh);
  min-height: 720px;
  overflow: hidden;
  position: relative;
}

.poem-realm canvas,
.realm-vignette {
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
}

.poem-realm canvas {
  cursor: crosshair;
  display: block;
  filter: brightness(1.08) contrast(1.02) saturate(1.14);
  outline: none;
  transition: filter 160ms ease;
  touch-action: none;
}

.poem-realm.is-running canvas {
  filter: brightness(1.13) contrast(1.05) saturate(1.18);
}

.realm-vignette {
  background:
    linear-gradient(180deg, rgba(70, 101, 91, 0.18), transparent 30%, transparent 70%, rgba(44, 68, 59, 0.32)),
    linear-gradient(90deg, rgba(58, 82, 72, 0.14), transparent 24%, transparent 76%, rgba(58, 82, 72, 0.14));
  pointer-events: none;
}

.realm-title,
.realm-progress,
.realm-hud,
.realm-compass,
.realm-action-tip,
.realm-entry,
.realm-tools,
.realm-controls-hint,
.realm-verse {
  position: absolute;
  z-index: 3;
}

.realm-title {
  left: clamp(20px, 5vw, 72px);
  top: clamp(96px, 13vh, 138px);
}

.realm-title p,
.realm-entry > span,
.realm-verse > span {
  color: #d9c17b;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.realm-title h2 {
  color: #fff8df;
  font-size: 4.5rem;
  font-weight: 500;
  line-height: 1;
  margin-bottom: 10px;
  text-shadow: 0 3px 24px rgba(9, 25, 22, 0.58);
}

.realm-title > span {
  color: rgba(249, 242, 218, 0.78);
  font-family: "Noto Serif SC", serif;
  font-size: 1rem;
}

.realm-progress {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  right: clamp(20px, 5vw, 72px);
  top: clamp(100px, 13vh, 142px);
}

.realm-progress span,
.realm-progress strong {
  text-shadow: 0 2px 14px rgba(7, 20, 18, 0.72);
}

.realm-progress > span {
  color: rgba(249, 242, 218, 0.8);
  font-family: "Noto Serif SC", serif;
  margin-bottom: 3px;
}

.realm-progress strong {
  color: #e8ce81;
  font-size: 0.82rem;
}

.realm-hud {
  backdrop-filter: blur(14px);
  background:
    linear-gradient(135deg, rgba(19, 43, 38, 0.78), rgba(43, 78, 66, 0.56)),
    radial-gradient(circle at 12% 18%, rgba(232, 206, 129, 0.18), transparent 38%);
  border: 1px solid rgba(238, 218, 160, 0.32);
  border-radius: 6px;
  box-shadow: 0 16px 48px rgba(8, 24, 21, 0.24);
  display: grid;
  gap: 12px;
  max-width: 278px;
  padding: 14px;
  right: clamp(20px, 5vw, 72px);
  top: clamp(164px, 23vh, 230px);
}

.realm-hud-head {
  align-items: baseline;
  border-bottom: 1px solid rgba(238, 218, 160, 0.2);
  display: flex;
  justify-content: space-between;
  padding-bottom: 10px;
}

.realm-hud-head span,
.realm-quests span,
.realm-hud p,
.realm-compass strong,
.realm-action-tip {
  text-shadow: 0 2px 12px rgba(7, 20, 18, 0.56);
}

.realm-hud-head span {
  color: #e8ce81;
  font-family: "Noto Serif SC", serif;
  font-size: 0.95rem;
  font-weight: 800;
}

.realm-hud-head strong {
  color: #fff4cf;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
}

.realm-quests {
  display: grid;
  gap: 7px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.realm-quests li {
  align-items: center;
  background: rgba(255, 248, 223, 0.08);
  border: 1px solid rgba(255, 239, 190, 0.14);
  border-radius: 4px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-height: 34px;
  padding: 0 10px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.realm-quests li.is-complete {
  background: rgba(216, 183, 92, 0.18);
  border-color: rgba(255, 238, 181, 0.38);
}

.realm-quests span {
  color: rgba(249, 242, 218, 0.84);
  font-size: 0.82rem;
  font-weight: 800;
}

.realm-quests strong {
  color: #e8ce81;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
}

.realm-minimap {
  background:
    linear-gradient(rgba(255, 246, 210, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 246, 210, 0.08) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(156, 233, 220, 0.16), transparent 62%);
  background-size: 18px 18px, 18px 18px, 100% 100%;
  border: 1px solid rgba(238, 218, 160, 0.24);
  border-radius: 4px;
  height: 84px;
  overflow: hidden;
  position: relative;
}

.realm-minimap::before,
.realm-minimap::after {
  background: rgba(255, 248, 223, 0.13);
  content: "";
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.realm-minimap::before {
  height: 1px;
  width: 100%;
}

.realm-minimap::after {
  height: 100%;
  width: 1px;
}

.realm-minimap span {
  border-radius: 50%;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.realm-minimap [data-realm-player-dot] {
  background: #fff8df;
  box-shadow: 0 0 0 4px rgba(255, 248, 223, 0.16), 0 0 18px rgba(255, 248, 223, 0.64);
  height: 8px;
  width: 8px;
  z-index: 2;
}

.realm-minimap [data-realm-target-dot] {
  background: #e8ce81;
  box-shadow: 0 0 0 5px rgba(232, 206, 129, 0.16), 0 0 18px rgba(232, 206, 129, 0.74);
  height: 10px;
  width: 10px;
  z-index: 1;
}

.realm-hud p {
  color: rgba(249, 242, 218, 0.78);
  font-size: 0.78rem;
  line-height: 1.55;
  margin: 0;
}

.realm-compass {
  align-items: center;
  backdrop-filter: blur(12px);
  background: rgba(18, 39, 35, 0.42);
  border: 1px solid rgba(238, 218, 160, 0.22);
  border-radius: 999px;
  display: flex;
  gap: 10px;
  left: 50%;
  max-width: min(420px, calc(100% - 40px));
  padding: 7px 13px 7px 9px;
  top: clamp(90px, 10vh, 118px);
  transform: translateX(-50%);
}

.realm-compass span {
  background:
    linear-gradient(180deg, #fff8df 0%, #e8ce81 52%, transparent 53%),
    radial-gradient(circle, rgba(255, 248, 223, 0.18), transparent 58%);
  border: 1px solid rgba(255, 248, 223, 0.36);
  border-radius: 50%;
  height: 25px;
  position: relative;
  transform: rotate(0deg);
  transition: transform 120ms linear;
  width: 25px;
}

.realm-compass strong {
  color: rgba(255, 248, 223, 0.88);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.realm-action-tip {
  background: rgba(17, 37, 32, 0.82);
  border: 1px solid rgba(238, 218, 160, 0.34);
  border-radius: 4px;
  color: #fff4cf;
  font-size: 0.86rem;
  font-weight: 800;
  left: 50%;
  max-width: min(520px, calc(100% - 40px));
  padding: 9px 13px;
  pointer-events: none;
  top: calc(50% + 34px);
  transform: translateX(-50%);
  z-index: 4;
}

.realm-controls-hint {
  align-items: center;
  background: rgba(13, 31, 28, 0.34);
  border: 1px solid rgba(238, 218, 160, 0.22);
  border-radius: 4px;
  bottom: clamp(22px, 4vh, 42px);
  color: rgba(249, 242, 218, 0.82);
  display: flex;
  gap: 14px;
  left: 50%;
  opacity: 0;
  padding: 8px 12px;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.realm-controls-hint span {
  align-items: center;
  display: inline-flex;
  font-size: 0.78rem;
  gap: 6px;
  white-space: nowrap;
}

.realm-controls-hint kbd {
  background: rgba(255, 248, 223, 0.14);
  border: 1px solid rgba(255, 239, 190, 0.28);
  border-radius: 3px;
  color: #fff4cf;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  font-weight: 800;
  min-width: 26px;
  padding: 2px 6px;
  text-align: center;
}

.poem-realm.is-playing .realm-controls-hint {
  opacity: 1;
  transform: translateX(-50%);
}

.realm-entry {
  bottom: clamp(52px, 9vh, 94px);
  display: grid;
  gap: 8px;
  left: clamp(20px, 5vw, 72px);
  max-width: 480px;
  transition: opacity 240ms ease, transform 240ms ease;
}

.realm-entry strong {
  font-family: "Noto Serif SC", serif;
  font-size: 1.42rem;
  font-weight: 500;
  text-shadow: 0 2px 16px rgba(7, 20, 18, 0.82);
}

.realm-entry button {
  background: #b54539;
  border: 1px solid rgba(255, 234, 181, 0.62);
  border-radius: 4px;
  color: #fff5d7;
  font-weight: 900;
  margin-top: 8px;
  min-height: 46px;
  padding: 0 22px;
  width: fit-content;
}

.poem-realm.is-playing .realm-entry {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}

.realm-verse {
  background: rgba(19, 43, 38, 0.78);
  border-left: 3px solid #d6b864;
  bottom: clamp(48px, 8vh, 86px);
  left: 50%;
  max-width: min(620px, calc(100% - 40px));
  padding: 14px 18px;
  transform: translateX(-50%);
  width: max-content;
}

.realm-verse p {
  font-family: "Noto Serif SC", serif;
  font-size: 1.18rem;
  line-height: 1.65;
  margin: 0;
}

.realm-tools {
  align-items: center;
  bottom: clamp(24px, 4vh, 42px);
  display: flex;
  gap: 8px;
  right: clamp(20px, 5vw, 72px);
}

.realm-tools button,
.realm-tools a,
.reader-realm-link {
  align-items: center;
  backdrop-filter: blur(12px);
  background: rgba(20, 45, 39, 0.72);
  border: 1px solid rgba(238, 218, 160, 0.38);
  border-radius: 4px;
  color: #f4ead0;
  display: inline-flex;
  font-weight: 900;
  min-height: 38px;
  padding: 0 12px;
}

.realm-tools button {
  font-size: 1.25rem;
  justify-content: center;
  padding: 0;
  width: 38px;
}

.realm-crosshair {
  border: 1px solid rgba(247, 228, 171, 0.88);
  border-radius: 50%;
  height: 9px;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 180ms ease;
  width: 9px;
  z-index: 3;
}

.poem-realm.is-playing .realm-crosshair {
  opacity: 1;
}

.realm-touch {
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transition: opacity 180ms ease;
  z-index: 4;
}

.poem-realm.is-playing .realm-touch {
  opacity: 1;
}

.poem-realm:not(.is-playing) .realm-joystick,
.poem-realm:not(.is-playing) .realm-look-zone {
  pointer-events: none;
}

.realm-joystick {
  background: rgba(13, 36, 31, 0.26);
  border: 1px solid rgba(246, 229, 180, 0.36);
  border-radius: 50%;
  bottom: 32px;
  height: 108px;
  left: 22px;
  pointer-events: auto;
  position: absolute;
  touch-action: none;
  width: 108px;
}

.realm-joystick span {
  background: rgba(232, 206, 129, 0.72);
  border: 1px solid rgba(255, 246, 217, 0.72);
  border-radius: 50%;
  height: 42px;
  left: 32px;
  position: absolute;
  top: 32px;
  transform: translate(0, 0);
  width: 42px;
}

.realm-look-zone {
  bottom: 0;
  pointer-events: auto;
  position: absolute;
  right: 0;
  top: 0;
  touch-action: none;
  width: 54%;
}

.realm-fallback {
  color: #f4ead0;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
}

.cloud-realm {
  background:
    radial-gradient(circle at 54% 46%, rgba(246, 228, 164, 0.18), transparent 36%),
    linear-gradient(180deg, #9fbfbd 0%, #d8dac5 52%, #9ab6ad 100%);
}

.cloud-realm::after {
  background: rgba(255, 244, 206, 0.72);
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(255, 210, 122, 0.45);
  content: "";
  height: 5px;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 160ms ease;
  width: 5px;
  z-index: 3;
}

.cloud-realm.is-playing::after {
  opacity: 0.52;
}

.cloud-realm canvas {
  cursor: grab;
  filter: brightness(1.06) contrast(1.04) saturate(1.12);
}

.cloud-realm canvas:active {
  cursor: grabbing;
}

.cloud-realm-title,
.cloud-realm-panel,
.cloud-realm-entry,
.cloud-realm-keyhint,
.cloud-realm-tools {
  position: absolute;
  z-index: 3;
}

.cloud-realm-title {
  left: clamp(20px, 5vw, 72px);
  max-width: 210px;
  opacity: 0.52;
  top: clamp(86px, 11vh, 112px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.cloud-realm-title p,
.cloud-realm-panel span {
  color: #d9c17b;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.cloud-realm-title h2 {
  color: #fff8df;
  font-size: clamp(1.62rem, 3vw, 2.35rem);
  font-weight: 500;
  line-height: 1;
  margin-bottom: 8px;
  text-shadow: 0 3px 24px rgba(9, 25, 22, 0.58);
}

.cloud-realm-title span {
  color: rgba(249, 242, 218, 0.82);
  font-family: "Noto Serif SC", serif;
  font-size: 0.82rem;
  text-shadow: 0 2px 14px rgba(7, 20, 18, 0.52);
}

.cloud-realm-panel {
  backdrop-filter: blur(12px);
  background:
    linear-gradient(135deg, rgba(20, 44, 39, 0.56), rgba(58, 91, 76, 0.38)),
    radial-gradient(circle at 12% 18%, rgba(232, 206, 129, 0.18), transparent 38%);
  border: 1px solid rgba(238, 218, 160, 0.28);
  border-radius: 6px;
  bottom: clamp(30px, 7vh, 72px);
  box-shadow: 0 16px 48px rgba(8, 24, 21, 0.2);
  display: grid;
  gap: 4px;
  left: clamp(20px, 5vw, 72px);
  padding: 12px 14px;
}

.cloud-realm-panel strong {
  color: #fff3cf;
  font-family: "Noto Serif SC", serif;
  font-size: 1rem;
  font-weight: 700;
}

.cloud-realm-entry {
  bottom: clamp(124px, 18vh, 170px);
  left: clamp(20px, 5vw, 72px);
}

.cloud-realm-entry button,
.cloud-realm-tools button {
  backdrop-filter: blur(12px);
  background: rgba(20, 45, 39, 0.72);
  border: 1px solid rgba(238, 218, 160, 0.38);
  border-radius: 4px;
  color: #f4ead0;
  font-weight: 900;
  min-height: 40px;
}

.cloud-realm-entry button {
  background: #b54539;
  border-color: rgba(255, 234, 181, 0.62);
  color: #fff5d7;
  min-height: 46px;
  padding: 0 22px;
}

.cloud-realm.is-playing .cloud-realm-entry {
  display: none;
}

.cloud-realm.is-playing .cloud-realm-title {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-18px);
}

.cloud-realm-keyhint {
  align-items: center;
  background: rgba(16, 35, 31, 0.42);
  border: 1px solid rgba(238, 218, 160, 0.22);
  border-radius: 6px;
  bottom: clamp(24px, 4vh, 42px);
  color: rgba(255, 246, 218, 0.82);
  display: flex;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 800;
  gap: 10px;
  left: 50%;
  opacity: 0;
  padding: 9px 12px;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.cloud-realm-keyhint span:first-child {
  color: #ffe2a3;
}

.cloud-realm.is-playing .cloud-realm-keyhint {
  opacity: 1;
  transform: translate(-50%, 0);
}

.cloud-realm-tools {
  bottom: clamp(24px, 4vh, 42px);
  display: flex;
  gap: 8px;
  right: clamp(20px, 5vw, 72px);
}

.cloud-realm-tools button {
  font-family: "Noto Serif SC", serif;
  width: 42px;
}

.interaction-lab {
  background:
    radial-gradient(circle at 18% 22%, rgba(184, 65, 52, 0.13), transparent 28%),
    radial-gradient(circle at 78% 18%, rgba(181, 143, 71, 0.16), transparent 30%),
    linear-gradient(145deg, #182622 0%, #25332c 48%, #171f21 100%);
  color: #f7eed6;
  display: grid;
  gap: 28px;
  min-height: 100svh;
  padding: clamp(86px, 12vh, 132px) clamp(18px, 5vw, 72px) clamp(44px, 8vh, 82px);
  position: relative;
  overflow: hidden;
}

.interaction-lab::before {
  background-image:
    linear-gradient(rgba(245, 225, 166, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 225, 166, 0.04) 1px, transparent 1px);
  background-size: 42px 42px;
  content: "";
  inset: 0;
  mask-image: radial-gradient(circle at 50% 42%, #000, transparent 72%);
  pointer-events: none;
  position: absolute;
}

.lab-heading,
.lab-stage {
  position: relative;
  z-index: 1;
}

.lab-heading {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 760px);
}

.lab-heading h2 {
  color: #fff4d8;
  font-size: clamp(2.6rem, 6vw, 5.2rem);
  font-weight: 500;
  line-height: 1;
  margin: 4px 0 12px;
}

.lab-heading p:not(.eyebrow) {
  color: rgba(247, 238, 214, 0.75);
  font-family: "Noto Serif SC", serif;
  line-height: 1.8;
  margin: 0;
  max-width: 680px;
}

.lab-tabs {
  align-self: start;
  background: rgba(12, 24, 22, 0.44);
  border: 1px solid rgba(228, 203, 142, 0.22);
  border-radius: 999px;
  display: flex;
  gap: 5px;
  justify-self: start;
  padding: 5px;
}

.lab-tabs button {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: rgba(247, 238, 214, 0.72);
  font-weight: 900;
  min-height: 38px;
  padding: 0 16px;
}

.lab-tabs button.is-active {
  background: linear-gradient(135deg, #c7a256, #a84235);
  color: #fff8df;
}

.lab-stage {
  min-height: 560px;
}

.lab-panel {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  min-height: 560px;
}

.lab-panel[hidden] {
  display: none;
}

.lab-constellation,
.imagery-river,
.lens-text,
.lab-inspector,
.lens-card {
  border: 1px solid rgba(231, 207, 147, 0.2);
  box-shadow: 0 28px 80px rgba(3, 11, 10, 0.24);
}

.lab-constellation,
.imagery-river,
.lens-text {
  background:
    radial-gradient(circle at 50% 50%, rgba(238, 214, 151, 0.12), transparent 34%),
    linear-gradient(145deg, rgba(11, 24, 23, 0.72), rgba(36, 55, 47, 0.52));
  min-height: 560px;
  overflow: hidden;
  position: relative;
}

.lab-constellation {
  background:
    radial-gradient(circle at 50% 52%, rgba(248, 211, 123, 0.08), transparent 12%),
    linear-gradient(145deg, #050914 0%, #091522 48%, #13101e 100%);
}

.lab-constellation::before,
.lab-constellation::after {
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.lab-constellation::before {
  animation: lab-space-shimmer 9s ease-in-out infinite alternate;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 247, 190, 0.75) 0 1px, transparent 2px),
    radial-gradient(circle at 22% 76%, rgba(180, 220, 255, 0.7) 0 1px, transparent 2px),
    radial-gradient(circle at 34% 42%, rgba(255, 238, 180, 0.72) 0 1px, transparent 2px),
    radial-gradient(circle at 52% 14%, rgba(176, 228, 255, 0.65) 0 1px, transparent 2px),
    radial-gradient(circle at 63% 67%, rgba(255, 222, 170, 0.72) 0 1px, transparent 2px),
    radial-gradient(circle at 82% 30%, rgba(255, 246, 198, 0.78) 0 1px, transparent 2px),
    radial-gradient(circle at 88% 78%, rgba(180, 217, 255, 0.68) 0 1px, transparent 2px);
  opacity: 0.72;
  z-index: 1;
}

.lab-constellation::after {
  animation: lab-space-drift 18s linear infinite;
  background:
    linear-gradient(112deg, transparent 22%, rgba(136, 189, 216, 0.08) 36%, rgba(237, 202, 121, 0.12) 47%, rgba(160, 84, 111, 0.1) 58%, transparent 74%),
    radial-gradient(ellipse at 50% 50%, rgba(226, 193, 113, 0.13), transparent 48%);
  filter: blur(9px);
  opacity: 0.52;
  transform: rotate(-12deg) scale(1.16);
  z-index: 1;
}

.lab-cosmos-canvas {
  animation: lab-cosmos-drift 16s ease-in-out infinite alternate;
  height: 100%;
  inset: 0;
  opacity: 0.96;
  pointer-events: none;
  position: absolute;
  width: 100%;
  z-index: 0;
}

.lab-galaxy-band,
.lab-nebula-core,
.lab-starfield,
.lab-starfield span {
  pointer-events: none;
  position: absolute;
}

.lab-galaxy-band {
  animation: lab-galaxy-turn 42s linear infinite;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(255, 238, 180, 0.16), rgba(130, 190, 215, 0.06) 34%, transparent 68%),
    linear-gradient(90deg, transparent, rgba(255, 225, 150, 0.13), rgba(148, 205, 224, 0.1), transparent);
  filter: blur(4px);
  height: 52%;
  left: 2%;
  opacity: 0.58;
  top: 25%;
  transform: rotate(-14deg);
  width: 96%;
  z-index: 1;
}

.lab-nebula-core {
  animation: lab-nebula-pulse 5.5s ease-in-out infinite;
  background:
    radial-gradient(circle, rgba(255, 236, 170, 0.2), rgba(168, 91, 96, 0.09) 32%, rgba(61, 122, 152, 0.08) 56%, transparent 72%);
  border-radius: 50%;
  filter: blur(8px);
  height: 46%;
  left: 27%;
  top: 27%;
  width: 46%;
  z-index: 1;
}

.lab-starfield {
  inset: 0;
  z-index: 2;
}

.lab-starfield span {
  animation: lab-star-twinkle 2.8s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  background: #fff3bf;
  border-radius: 50%;
  box-shadow:
    0 0 8px rgba(255, 232, 157, 0.85),
    0 0 18px rgba(122, 191, 218, 0.28);
  height: 2px;
  left: var(--sx);
  opacity: var(--glow, 0.7);
  top: var(--sy);
  width: 2px;
}

.lab-star {
  --x: 50%;
  --y: 50%;
  --size: 40px;
  background:
    radial-gradient(circle at 32% 25%, rgba(255, 252, 224, 0.98), rgba(241, 209, 119, 0.9) 23%, rgba(158, 72, 78, 0.74) 58%, rgba(30, 50, 82, 0.56) 86%),
    radial-gradient(circle at 73% 80%, rgba(106, 190, 224, 0.42), transparent 45%);
  border: 1px solid rgba(255, 238, 180, 0.58);
  border-radius: 50%;
  box-shadow:
    0 0 calc(var(--size) * 0.85) rgba(235, 202, 112, 0.32),
    0 0 calc(var(--size) * 1.4) rgba(93, 157, 199, 0.14),
    inset -8px -10px 18px rgba(15, 20, 34, 0.38);
  color: #fff8df;
  cursor: pointer;
  display: grid;
  font-family: "Noto Serif SC", serif;
  font-size: 0.72rem;
  font-weight: 900;
  height: var(--size);
  left: var(--x);
  padding: 0;
  place-items: center;
  position: absolute;
  top: var(--y);
  transform: translate(-50%, -50%);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
  width: var(--size);
  z-index: 4;
}

.lab-star span {
  position: relative;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.38),
    0 0 10px rgba(255, 233, 164, 0.46);
  z-index: 1;
}

.lab-star::before {
  background:
    linear-gradient(145deg, rgba(255, 255, 240, 0.62), transparent 42%),
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.9) 0 5%, transparent 12%);
  border-radius: 50%;
  content: "";
  inset: 1px;
  opacity: 0.7;
  position: absolute;
}

.lab-star::after {
  animation: lab-star-aura 3.4s ease-in-out infinite;
  animation-delay: var(--phase, 0s);
  border: 1px solid rgba(255, 236, 164, 0.18);
  border-radius: 50%;
  content: "";
  inset: -9px;
  opacity: 0.58;
  position: absolute;
}

@media (prefers-reduced-motion: no-preference) {
  .lab-star {
    animation: lab-author-drift var(--drift, 4.6s) ease-in-out infinite;
    animation-delay: var(--phase, 0s);
  }
}

.lab-star:hover,
.lab-star.is-active {
  box-shadow:
    0 0 calc(var(--size) * 1.55) rgba(255, 218, 128, 0.62),
    0 0 calc(var(--size) * 2.1) rgba(126, 201, 226, 0.28),
    inset -8px -10px 18px rgba(15, 20, 34, 0.3);
  filter: saturate(1.16);
  transform: translate(-50%, -50%) scale(1.1);
  z-index: 5;
}

.lab-orbit-ring {
  animation: lab-orbit-breathe 8s ease-in-out infinite;
  border: 1px solid rgba(177, 222, 241, 0.14);
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(205, 178, 106, 0.06);
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) rotate(var(--tilt, 0deg));
  z-index: 3;
}

.lab-inspector,
.lens-card {
  align-self: stretch;
  background:
    linear-gradient(180deg, rgba(244, 232, 196, 0.94), rgba(221, 207, 169, 0.9)),
    radial-gradient(circle at 20% 10%, rgba(184, 65, 52, 0.12), transparent 42%);
  color: #2f2921;
  display: grid;
  gap: 12px;
  padding: 24px;
}

.lab-inspector > span,
.lens-card > span {
  color: #9b473f;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lab-inspector strong,
.lens-card strong {
  font-family: "Noto Serif SC", serif;
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 700;
  line-height: 1;
}

.lab-inspector p,
.lens-card p {
  color: rgba(47, 41, 33, 0.72);
  line-height: 1.72;
  margin: 0;
}

.lab-work-chip,
.imagery-chip {
  background: rgba(133, 53, 44, 0.08);
  border: 1px solid rgba(133, 53, 44, 0.18);
  color: #382f24;
  display: block;
  font-family: "Noto Serif SC", serif;
  font-weight: 900;
  margin-top: 8px;
  min-height: 40px;
  padding: 9px 12px;
  text-align: left;
  width: 100%;
}

.lab-work-card,
.lab-route-card,
.lab-selection-item {
  background:
    linear-gradient(135deg, rgba(255, 252, 237, 0.58), rgba(215, 194, 145, 0.16)),
    rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(114, 76, 46, 0.16);
  display: grid;
  gap: 10px;
}

.lab-work-card {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 10px;
  padding: 10px;
}

.lab-work-card.is-selected,
.lab-route-card.is-selected {
  border-color: rgba(154, 60, 49, 0.38);
  box-shadow: inset 4px 0 0 rgba(154, 60, 49, 0.48);
}

.lab-work-main,
.lab-route-main,
.lab-selection-item > button:first-child {
  background: transparent;
  border: 0;
  color: #32271d;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 0;
  text-align: left;
}

.lab-work-main strong,
.lab-route-main strong,
.lab-selection-item strong {
  font-family: "Noto Serif SC", serif;
  font-size: 1rem;
  line-height: 1.25;
}

.lab-work-main small,
.lab-route-main small,
.lab-selection-item small {
  color: rgba(54, 43, 31, 0.6);
  font-size: 0.74rem;
  font-weight: 800;
}

.lab-work-main span {
  color: rgba(54, 43, 31, 0.62);
  font-size: 0.78rem;
  line-height: 1.45;
}

.lab-work-add,
.lab-route-actions button,
.lab-anthology-head button,
.lens-related-list button {
  background: rgba(132, 54, 45, 0.1);
  border: 1px solid rgba(132, 54, 45, 0.2);
  color: #7d342d;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
  min-height: 34px;
  padding: 0 10px;
}

.lab-work-add[aria-pressed="true"] {
  background: rgba(132, 54, 45, 0.9);
  color: #fff8e5;
}

.lab-route {
  border-top: 1px solid rgba(105, 70, 43, 0.14);
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding-top: 14px;
}

.lab-route-head {
  display: grid;
  gap: 8px;
}

.lab-route-head span,
.lab-anthology-head span {
  color: #8b3f37;
  font-size: 0.76rem;
  font-weight: 900;
}

.lab-route-head i,
.lab-score-row i {
  background: rgba(83, 62, 39, 0.16);
  display: block;
  height: 7px;
  overflow: hidden;
  position: relative;
}

.lab-route-head i::after,
.lab-score-row i::after {
  background: linear-gradient(90deg, #a94337, #c59d4f);
  content: "";
  inset: 0 auto 0 0;
  position: absolute;
  width: var(--route-progress, var(--score, 0%));
}

.lab-route-list {
  display: grid;
  gap: 8px;
}

.lab-route-card {
  align-items: center;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  padding: 9px;
}

.lab-route-step {
  background: rgba(36, 51, 43, 0.88);
  border: 1px solid rgba(236, 207, 141, 0.42);
  border-radius: 50%;
  color: #fff1c5;
  cursor: pointer;
  font-weight: 900;
  height: 30px;
  padding: 0;
  width: 30px;
}

.lab-route-card.is-complete .lab-route-step {
  background: #a94337;
}

.lab-route-card.is-complete .lab-route-main strong {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.lab-route-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.imagery-pair {
  background: rgba(47, 68, 57, 0.08);
  border: 1px solid rgba(47, 68, 57, 0.14);
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.imagery-pair span {
  color: #8b3f37;
  font-size: 0.72rem;
  font-weight: 900;
}

.imagery-pair strong {
  color: #263a32;
  font-size: 1.35rem;
}

.lab-anthology {
  border-top: 1px solid rgba(105, 70, 43, 0.14);
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding-top: 14px;
}

.lab-anthology-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.lab-anthology-head button:disabled {
  cursor: default;
  opacity: 0.42;
}

.lab-selection-tray {
  display: grid;
  gap: 8px;
}

.lab-selection-item {
  align-items: center;
  grid-template-columns: minmax(0, 1fr) 30px;
  padding: 9px;
}

.lab-selection-item > button:last-child {
  background: rgba(51, 40, 29, 0.08);
  border: 1px solid rgba(51, 40, 29, 0.12);
  color: #7d342d;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 900;
  height: 30px;
  padding: 0;
  width: 30px;
}

.lab-empty,
.lab-judgement {
  color: rgba(54, 43, 31, 0.68);
  font-size: 0.86rem;
  line-height: 1.65;
  margin: 0;
}

.lab-score-panel {
  display: grid;
  gap: 9px;
}

.lab-score-row {
  display: grid;
  gap: 6px;
}

.lab-score-row span {
  color: rgba(54, 43, 31, 0.72);
  font-size: 0.78rem;
  font-weight: 900;
}

.lens-related-list {
  display: grid;
  gap: 8px;
}

.lens-related-list button {
  text-align: left;
}

.imagery-river {
  display: grid;
  place-items: center;
}

.imagery-node {
  --x: 50%;
  --y: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 251, 222, 0.98), rgba(135, 190, 174, 0.9) 36%, rgba(43, 105, 100, 0.6) 68%, rgba(18, 41, 39, 0.1));
  border: 1px solid rgba(213, 235, 213, 0.46);
  border-radius: 999px;
  box-shadow: 0 0 36px rgba(125, 207, 182, 0.22);
  color: #fffbe8;
  cursor: pointer;
  font-family: "Noto Serif SC", serif;
  font-size: 1.08rem;
  font-weight: 900;
  height: var(--size, 78px);
  left: var(--x);
  padding: 0;
  position: absolute;
  top: var(--y);
  transform: translate(-50%, -50%);
  width: var(--size, 78px);
}

.imagery-node.is-active,
.imagery-node:hover {
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 251, 222, 1), rgba(218, 168, 89, 0.95) 34%, rgba(159, 65, 54, 0.68) 72%, rgba(18, 41, 39, 0.1));
  box-shadow: 0 0 48px rgba(238, 192, 103, 0.4);
}

.imagery-link {
  background: linear-gradient(90deg, transparent, rgba(214, 231, 203, 0.42), transparent);
  height: 1px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform-origin: 0 0;
}

.lens-text {
  color: #f7eed6;
  display: grid;
  place-content: center;
  padding: clamp(26px, 6vw, 70px);
}

.lens-text p {
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.5rem, 3.6vw, 3rem);
  line-height: 2.05;
  margin: 0;
  max-width: 900px;
}

.lens-term {
  background: rgba(184, 65, 52, 0.22);
  border: 1px solid rgba(239, 207, 131, 0.38);
  color: #fff3c7;
  cursor: pointer;
  font: inherit;
  padding: 0 4px;
}

.lens-term.is-active,
.lens-term:hover {
  background: rgba(218, 164, 74, 0.42);
  box-shadow: 0 0 0 4px rgba(218, 164, 74, 0.1);
}

.lens-layers {
  display: grid;
  gap: 10px;
}

.lens-layer {
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(80, 62, 38, 0.14);
  display: grid;
  gap: 4px;
  padding: 12px;
}

.lens-layer span {
  color: #9b473f;
  font-size: 0.78rem;
  font-weight: 900;
}

.lens-layer p {
  color: #352b20;
}

@keyframes lab-space-shimmer {
  from {
    opacity: 0.48;
    transform: translate3d(0, 0, 0);
  }

  to {
    opacity: 0.82;
    transform: translate3d(1.2%, -0.8%, 0);
  }
}

@keyframes lab-cosmos-drift {
  from {
    filter: saturate(1) brightness(0.95);
    transform: scale(1.01) translate3d(-0.5%, 0.2%, 0);
  }

  to {
    filter: saturate(1.1) brightness(1.06);
    transform: scale(1.035) translate3d(0.6%, -0.3%, 0);
  }
}

@keyframes lab-space-drift {
  from {
    transform: rotate(-12deg) scale(1.16) translateX(-3%);
  }

  to {
    transform: rotate(-12deg) scale(1.16) translateX(3%);
  }
}

@keyframes lab-galaxy-turn {
  from {
    transform: rotate(-17deg) translateX(-1%);
  }

  to {
    transform: rotate(343deg) translateX(-1%);
  }
}

@keyframes lab-nebula-pulse {
  0%,
  100% {
    opacity: 0.42;
    transform: scale(0.96);
  }

  50% {
    opacity: 0.76;
    transform: scale(1.06);
  }
}

@keyframes lab-star-twinkle {
  0%,
  100% {
    opacity: 0.22;
    transform: scale(0.62);
  }

  45% {
    opacity: 1;
    transform: scale(1.45);
  }
}

@keyframes lab-author-drift {
  0%,
  100% {
    margin-left: 0;
    margin-top: 0;
  }

  50% {
    margin-left: 3px;
    margin-top: -5px;
  }
}

@keyframes lab-star-aura {
  0%,
  100% {
    opacity: 0.24;
    transform: scale(0.92);
  }

  50% {
    opacity: 0.72;
    transform: scale(1.08);
  }
}

@keyframes lab-orbit-breathe {
  0%,
  100% {
    opacity: 0.42;
  }

  50% {
    opacity: 0.88;
  }
}

@media (max-width: 980px) {
  .lab-heading {
    grid-template-columns: minmax(0, 1fr);
  }

  .lab-tabs {
    border-radius: 12px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-self: stretch;
    width: 100%;
  }

  .lab-tabs button {
    min-width: 0;
    padding: 0 8px;
  }

  .lab-panel {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
  }

  .lab-constellation,
  .imagery-river,
  .lens-text {
    min-height: 430px;
  }

  .lab-inspector,
  .lens-card {
    min-height: 0;
  }

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

@media (max-width: 620px) {
  .interaction-lab {
    padding-left: 20px;
    padding-right: 20px;
  }

  .lab-heading h2 {
    font-size: clamp(2.2rem, 11vw, 3.4rem);
  }

  .lab-heading p:not(.eyebrow) {
    font-size: 0.94rem;
  }

  .lab-tabs button {
    font-size: 0.82rem;
  }

  .lab-stage {
    min-height: auto;
  }

  .lab-constellation,
  .imagery-river,
  .lens-text {
    min-height: 320px;
  }

  .lab-orbit-ring:nth-of-type(1) {
    width: 36% !important;
    height: 36% !important;
  }

  .lab-orbit-ring:nth-of-type(2) {
    width: 52% !important;
    height: 52% !important;
  }

  .lab-orbit-ring:nth-of-type(3) {
    width: 68% !important;
    height: 68% !important;
  }

  .lab-orbit-ring:nth-of-type(4) {
    width: 84% !important;
    height: 84% !important;
  }

  .lab-star {
    font-size: 0.68rem;
  }

  .lab-inspector,
  .lens-card {
    padding: 18px;
  }

  .lab-inspector strong,
  .lens-card strong {
    font-size: 2rem;
  }

  .lens-text p {
    font-size: 1.45rem;
  }

  .lab-work-card,
  .lab-route-card,
  .lab-selection-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .lab-route-card {
    align-items: stretch;
  }

  .lab-route-step,
  .lab-selection-item > button:last-child {
    justify-self: start;
  }

  .lab-work-add,
  .lab-route-actions button {
    width: 100%;
  }
}

.volume-switcher {
  border-top: 1px solid var(--line);
  max-height: 122px;
  margin-top: 16px;
  overflow: auto;
  padding-top: 16px;
}

.result-count {
  color: var(--muted);
  font-weight: 800;
  margin: 0;
}

.volume-switcher button {
  background: rgba(255, 253, 241, 0.6);
  color: #475a52;
}

.volume-switcher button.is-active {
  background: #25594d;
  border-color: #25594d;
  color: #f1edda;
}

.library {
  background:
    radial-gradient(circle at 82% 12%, rgba(155, 47, 38, 0.075), transparent 22%),
    radial-gradient(circle at 12% 84%, rgba(47, 123, 103, 0.09), transparent 26%),
    linear-gradient(90deg, rgba(184, 58, 47, 0.045), transparent 30%),
    linear-gradient(180deg, rgba(255, 253, 242, 0.36), rgba(235, 224, 198, 0.18)),
    var(--paper);
  position: relative;
}

.library::before {
  border: 2px solid rgba(155, 47, 38, 0.24);
  bottom: clamp(22px, 4vw, 48px);
  content: "昭明\A文选";
  color: rgba(155, 47, 38, 0.34);
  display: grid;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.15rem, 2vw, 2rem);
  font-weight: 900;
  height: clamp(74px, 9vw, 118px);
  letter-spacing: 0;
  line-height: 1.08;
  place-items: center;
  pointer-events: none;
  position: absolute;
  right: clamp(26px, 5vw, 78px);
  transform: rotate(8deg);
  white-space: pre-line;
  width: clamp(74px, 9vw, 118px);
  z-index: 0;
}

.library::after {
  background: url("assets/plum-corner.svg") center / contain no-repeat;
  bottom: clamp(20px, 4vw, 54px);
  content: "";
  height: clamp(120px, 16vw, 220px);
  left: clamp(18px, 4vw, 72px);
  opacity: 0.13;
  pointer-events: none;
  position: absolute;
  transform: rotate(-5deg);
  width: clamp(150px, 20vw, 260px);
  z-index: 0;
}

.library > * {
  position: relative;
  z-index: 1;
}

.library-heading {
  display: grid;
  gap: 14px;
  grid-template-columns: 220px minmax(0, 1fr);
  margin-bottom: 28px;
}

.library-heading h2 {
  color: #2f271f;
  font-weight: 700;
  text-wrap: balance;
}

.library-heading p:last-child {
  color: #514538;
  font-size: 1.05rem;
  grid-column: 2;
  margin-bottom: 0;
  max-width: 760px;
}

.search-shell,
.article-detail,
.article-card {
  background:
    radial-gradient(circle at 92% 8%, rgba(155, 47, 38, 0.035), transparent 26%),
    linear-gradient(135deg, rgba(255, 253, 244, 0.95), rgba(247, 239, 218, 0.88));
  border: 1px solid var(--line);
  border-radius: 8px;
}

.search-shell {
  box-shadow: 0 18px 52px rgba(40, 26, 16, 0.1), inset 0 0 0 3px rgba(255, 252, 238, 0.36);
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 18px;
}

.search-shell label {
  color: var(--cinnabar);
  font-family: "Noto Serif SC", serif;
  font-size: 1.2rem;
  font-weight: 900;
}

.workbench-portal-section {
  background:
    radial-gradient(circle at 78% 14%, rgba(184, 58, 47, 0.11), transparent 24%),
    radial-gradient(circle at 18% 80%, rgba(47, 123, 103, 0.12), transparent 28%),
    repeating-linear-gradient(105deg, rgba(66, 47, 27, 0.026) 0 1px, transparent 1px 12px),
    linear-gradient(135deg, #eadbb4, #d4c696 48%, #efe3c0);
  display: grid;
  gap: clamp(22px, 4vw, 48px);
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  overflow: hidden;
  padding: clamp(72px, 9vw, 126px) clamp(18px, 4vw, 56px);
  position: relative;
}

.notebook-section {
  background:
    radial-gradient(circle at 82% 10%, rgba(47, 123, 103, 0.1), transparent 24%),
    radial-gradient(circle at 16% 80%, rgba(184, 58, 47, 0.1), transparent 28%),
    repeating-linear-gradient(0deg, rgba(96, 72, 42, 0.026) 0 1px, transparent 1px 12px),
    linear-gradient(135deg, #f4ead0, #ddd0a7 52%, #efe6c8);
  display: grid;
  gap: 22px;
  padding: clamp(72px, 9vw, 122px) clamp(18px, 4vw, 56px);
  position: relative;
}

.notebook-heading {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(260px, 0.58fr) minmax(0, 1fr);
  max-width: 1180px;
  width: 100%;
}

.notebook-heading h2 {
  color: #2d261d;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(2.7rem, 7vw, 6rem);
  font-weight: 500;
  line-height: 0.98;
  margin: 0;
}

.notebook-heading > p {
  align-self: end;
  color: #534638;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1rem, 1.45vw, 1.22rem);
  line-height: 1.86;
  margin: 0;
  max-width: 680px;
}

.notebook-tools,
.notebook-empty,
.notebook-card {
  background:
    radial-gradient(circle at 92% 10%, rgba(155, 47, 38, 0.035), transparent 25%),
    linear-gradient(135deg, rgba(255, 253, 244, 0.92), rgba(241, 230, 203, 0.86));
  border: 1px solid rgba(86, 72, 55, 0.16);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(56, 40, 22, 0.1), inset 0 0 0 3px rgba(255, 252, 238, 0.28);
}

.notebook-tools {
  display: grid;
  gap: 12px;
  max-width: 1180px;
  padding: 18px;
  width: 100%;
}

.notebook-tools label {
  color: #8f332a;
  font-family: "Noto Serif SC", serif;
  font-size: 1.12rem;
  font-weight: 900;
}

.notebook-search-row {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.notebook-search-row input,
.reader-journal textarea,
.reader-journal input {
  background: rgba(255, 253, 241, 0.72);
  border: 1px solid rgba(86, 72, 55, 0.18);
  border-radius: 6px;
  color: #30271c;
  font: inherit;
  outline: none;
}

.notebook-search-row input {
  min-height: 44px;
  padding: 0 13px;
}

.notebook-search-row button,
.notebook-filter-row button,
.reader-journal-actions button,
.reader-journal-status button,
.notebook-card-actions button,
.reader-entry-actions button {
  border: 1px solid rgba(86, 72, 55, 0.18);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 900;
}

.notebook-search-row button,
.reader-journal-actions button:first-child,
.reader-entry-actions button {
  background: linear-gradient(135deg, #96342b, #bd8740);
  color: #fff4d6;
  min-height: 44px;
  padding: 0 15px;
}

.notebook-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notebook-filter-row button,
.reader-journal-status button,
.notebook-card-actions button,
.reader-journal-actions button:last-child {
  background: rgba(255, 250, 232, 0.62);
  color: #4d4033;
  min-height: 34px;
  padding: 0 11px;
}

.notebook-filter-row button.is-active,
.reader-journal-status button.is-active {
  background: #252018;
  border-color: #252018;
  color: #fff2d6;
}

.notebook-tools output {
  color: #7c6b54;
  font-size: 0.84rem;
  font-weight: 900;
}

.notebook-list {
  display: grid;
  gap: 14px;
  max-width: 1180px;
  width: 100%;
}

.notebook-card,
.notebook-empty {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.notebook-card > span {
  color: #8f332a;
  font-size: 0.76rem;
  font-weight: 900;
}

.notebook-card > strong,
.notebook-empty strong {
  color: #2e261d;
  font-family: "Noto Serif SC", serif;
  font-size: 1.32rem;
}

.notebook-card-body {
  display: grid;
  gap: 8px;
}

.notebook-card-body p,
.notebook-empty p {
  color: #4d4033;
  font-size: 0.94rem;
  line-height: 1.72;
  margin: 0;
}

.notebook-card-body em {
  color: #8f332a;
  font-style: normal;
  font-weight: 900;
  margin-right: 0.7em;
}

.notebook-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.notebook-card-tags i {
  background: rgba(151, 106, 42, 0.11);
  border: 1px solid rgba(151, 106, 42, 0.16);
  color: #755221;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
  padding: 5px 8px;
}

.notebook-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.workbench-portal-section::before {
  border: 2px solid rgba(184, 58, 47, 0.16);
  color: rgba(184, 58, 47, 0.14);
  content: "昭明\A选文";
  font-family: "Noto Serif SC", serif;
  font-size: clamp(2.2rem, 6vw, 6rem);
  font-weight: 900;
  line-height: 1.08;
  padding: 18px 10px;
  pointer-events: none;
  position: absolute;
  right: clamp(22px, 6vw, 96px);
  top: clamp(28px, 5vw, 70px);
  transform: rotate(-9deg);
  white-space: pre-line;
  writing-mode: vertical-rl;
}

.workbench-portal-copy {
  align-self: center;
  max-width: 680px;
  position: relative;
  z-index: 1;
}

.workbench-portal-copy h2 {
  color: #2d261d;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(2.8rem, 7vw, 6.4rem);
  font-weight: 500;
  line-height: 0.98;
  margin: 8px 0 18px;
}

.workbench-portal-copy p:not(.eyebrow) {
  color: #4e4538;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
  line-height: 1.86;
  max-width: 620px;
}

.workbench-portal-stats,
.workbench-portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.workbench-portal-stats span {
  background: rgba(255, 250, 232, 0.46);
  border: 1px solid rgba(76, 56, 35, 0.14);
  color: #6a342c;
  font-weight: 900;
  padding: 9px 12px;
}

.workbench-portal-actions a {
  align-items: center;
  background: rgba(255, 250, 232, 0.62);
  border: 1px solid rgba(76, 56, 35, 0.18);
  color: #263a31;
  display: inline-flex;
  font-weight: 900;
  min-height: 48px;
  padding: 0 18px;
}

.workbench-portal-actions .workbench-primary-link {
  background: linear-gradient(135deg, #9b342b, #c79945);
  border-color: rgba(255, 238, 182, 0.28);
  color: #fff4d6;
}

.workbench-portal-preview {
  align-self: center;
  box-shadow: 0 28px 80px rgba(44, 30, 16, 0.22);
  color: #fff4d6;
  display: block;
  min-height: 420px;
  overflow: hidden;
  position: relative;
}

.workbench-portal-preview img {
  display: block;
  height: 100%;
  inset: 0;
  object-fit: cover;
  object-position: 58% 18%;
  position: absolute;
  width: 100%;
}

.workbench-portal-preview::after {
  background:
    linear-gradient(90deg, rgba(22, 19, 14, 0.78), rgba(22, 19, 14, 0.2) 56%, rgba(22, 19, 14, 0.54)),
    linear-gradient(180deg, transparent, rgba(22, 19, 14, 0.62));
  content: "";
  inset: 0;
  position: absolute;
}

.workbench-preview-overlay {
  bottom: 24px;
  display: grid;
  gap: 8px;
  left: 24px;
  position: absolute;
  right: 24px;
  z-index: 1;
}

.workbench-preview-overlay span,
.workbench-preview-overlay em {
  color: rgba(255, 244, 214, 0.72);
  font-style: normal;
  font-weight: 900;
}

.workbench-preview-overlay strong {
  font-family: "Noto Serif SC", serif;
  font-size: clamp(2.3rem, 5vw, 5.4rem);
  font-weight: 500;
  line-height: 1;
}

.search-row {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.search-row input {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 48px;
  padding: 0 14px;
  width: 100%;
}

.advanced-filters {
  border-bottom: 1px solid rgba(91, 72, 45, 0.14);
  border-top: 1px solid rgba(91, 72, 45, 0.14);
  display: grid;
  gap: 10px;
  padding: 13px 0;
}

.filter-line {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 54px minmax(0, 1fr);
}

.filter-line > span {
  color: #7f352b;
  font-family: "Noto Serif SC", serif;
  font-size: 0.88rem;
  font-weight: 900;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-options button {
  background: transparent;
  border: 1px solid rgba(67, 57, 43, 0.18);
  border-radius: 4px;
  color: #5b5143;
  font-size: 0.82rem;
  font-weight: 800;
  min-height: 32px;
  padding: 4px 11px;
}

.filter-options button:hover,
.filter-options button:focus-visible {
  border-color: #846f4c;
  color: #332b21;
  outline: none;
}

.filter-options [data-period-filter].is-active {
  background: #315f53;
  border-color: #315f53;
  color: #f8f0d8;
}

.filter-options [data-genre-filter].is-active {
  background: #91392f;
  border-color: #91392f;
  color: #fff0d5;
}

.filter-options [data-mood-filter].is-active {
  background: #8a6d2d;
  border-color: #8a6d2d;
  color: #fff3d1;
}

.literary-history-line {
  border-top: 1px dashed rgba(91, 72, 45, 0.16);
  padding-top: 10px;
}

.filter-options [data-movement-filter].is-active {
  background: #455d6a;
  border-color: #455d6a;
  color: #f8f0db;
}

.movement-options button {
  min-height: 34px;
}

.filter-summary {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.filter-summary output {
  color: #675b49;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  font-weight: 700;
}

.filter-summary button {
  background: transparent;
  border: 0;
  color: #8b382e;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 3px 0;
}

.search-row button,
.search-tags button {
  background: var(--ink);
  border: 0;
  border-radius: 8px;
  color: var(--paper-strong);
  font-weight: 900;
  padding: 0 16px;
}

.search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.search-tags button {
  background: #e7dcc7;
  color: #3a3026;
  min-height: 38px;
}

.library-layout {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
}

.article-list {
  display: grid;
  gap: 12px;
}

.article-card {
  color: var(--ink);
  display: grid;
  gap: 10px;
  padding: 18px;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.article-card:hover,
.article-card.is-selected {
  border-color: rgba(184, 58, 47, 0.5);
  box-shadow: 0 18px 42px rgba(40, 26, 16, 0.11), inset 4px 0 rgba(155, 47, 38, 0.18);
  transform: translateY(-2px);
}

.article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.article-actions a,
.article-actions button {
  align-items: center;
  background: var(--ink);
  border: 0;
  border-radius: 8px;
  color: var(--paper-strong);
  display: inline-flex;
  font-weight: 900;
  min-height: 38px;
  padding: 0 12px;
}

.article-actions a {
  background: var(--cinnabar);
}

.article-actions button.secondary-action,
.article-actions a.secondary-action {
  background: #e7dcc7;
  color: #3a3026;
}

.article-card strong,
.article-detail h3 {
  color: var(--cinnabar);
  font-family: "Noto Serif SC", serif;
  font-size: 1.36rem;
}

.article-card small,
.article-detail span {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
}

.article-card p,
.article-detail p,
.map-copy {
  color: #514538;
  margin-bottom: 0;
}

.article-plain-title {
  color: #8f3329;
  font-family: "Noto Serif SC", serif;
  font-size: 0.95rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1.35;
}

.article-genre-note {
  align-self: start;
  background: rgba(146, 104, 46, 0.1);
  border-left: 3px solid rgba(146, 104, 46, 0.48);
  color: #6e4e24;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.45;
  padding: 6px 9px;
}

.article-excerpt {
  background: rgba(197, 155, 63, 0.12);
  border-left: 3px solid var(--gold);
  color: #3d3023;
  font-family: "Noto Serif SC", serif;
  line-height: 1.8;
  margin: 0;
  padding: 10px 12px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article-meta em {
  background: rgba(47, 123, 103, 0.12);
  border-radius: 999px;
  color: #315f52;
  font-style: normal;
  font-weight: 800;
  padding: 4px 9px;
}

.article-meta em.literary-label {
  background: rgba(145, 57, 47, 0.1);
  border: 1px solid rgba(145, 57, 47, 0.24);
  border-radius: 3px;
  color: #87372e;
}

.article-coverage {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.article-coverage em {
  background: rgba(54, 91, 76, 0.1);
  border: 1px solid rgba(54, 91, 76, 0.2);
  border-radius: 4px;
  color: #315f52;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  padding: 4px 7px;
}

.article-coverage em.has-guide {
  background: rgba(184, 58, 47, 0.09);
  border-color: rgba(184, 58, 47, 0.25);
  color: #8f3028;
}

.article-coverage em.has-intro {
  background: rgba(139, 92, 35, 0.12);
  border-color: rgba(139, 92, 35, 0.28);
  color: #744c1f;
}

.article-coverage em.has-realm {
  background: rgba(39, 111, 104, 0.12);
  border-color: rgba(39, 111, 104, 0.34);
  color: #21655e;
}

.article-coverage em.has-notes {
  background: rgba(197, 155, 63, 0.15);
  border-color: rgba(144, 105, 29, 0.3);
  color: #72521b;
}

.article-coverage em.has-baihua {
  background: rgba(47, 123, 103, 0.12);
  border-color: rgba(47, 123, 103, 0.28);
  color: #275f50;
}

.article-coverage em.is-missing {
  background: rgba(105, 94, 80, 0.06);
  border-color: rgba(105, 94, 80, 0.17);
  color: #7b7063;
}

.article-detail {
  box-shadow: var(--shadow), inset 0 0 0 4px rgba(255, 252, 238, 0.3);
  display: grid;
  gap: 12px;
  padding: 22px;
  position: sticky;
  top: 86px;
}

.article-detail .article-excerpt {
  max-height: 260px;
  overflow: auto;
}

.generator {
  background: #161310;
  color: var(--paper-strong);
  display: grid;
  gap: 22px;
}

.prompt-panel {
  box-shadow: none;
  padding: 18px;
}

.prompt-head {
  color: var(--ink);
  font-weight: 900;
  margin-bottom: 12px;
}

textarea {
  background: var(--white);
  border: 1px solid rgba(45, 34, 22, 0.18);
  border-radius: 8px;
  color: var(--ink);
  min-height: 140px;
  padding: 16px;
  resize: vertical;
  width: 100%;
}

textarea:focus,
input:focus {
  border-color: var(--cyan);
  outline: 3px solid rgba(43, 156, 163, 0.18);
}

.chips {
  margin-top: 14px;
}

.chips button {
  background: #e8e0d0;
  color: #3a3026;
  padding: 10px 12px;
}

.output-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 0.8fr) minmax(320px, 1.25fr);
}

.result-card,
.code-card {
  box-shadow: none;
  color: var(--ink);
  padding: 22px;
}

.result-card ul {
  margin: 14px 0 0;
  padding-left: 20px;
}

.result-card li + li {
  margin-top: 10px;
}

.result-card p {
  margin: 14px 0 0;
}

.code-card {
  background: #1d1b17;
  color: #e6f2df;
  overflow: hidden;
  padding: 0;
}

.code-head {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 14px 16px;
}

.code-head button {
  background: var(--gold);
  border-radius: 8px;
  color: #161310;
  font-weight: 900;
  padding: 8px 12px;
}

pre {
  margin: 0;
  overflow-x: auto;
  padding: 18px;
}

code {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}

.map {
  align-items: start;
  background:
    radial-gradient(circle at 72% 18%, rgba(183, 213, 196, 0.24), transparent 28%),
    radial-gradient(circle at 18% 78%, rgba(205, 162, 126, 0.18), transparent 26%),
    linear-gradient(180deg, #f3efe2 0%, #e9ecdf 52%, #e0e7dd 100%);
  display: grid;
  gap: 32px 42px;
  grid-template-columns: minmax(260px, 0.42fr) minmax(560px, 1fr);
}

.map-heading {
  padding-top: 22px;
}

.map-heading h2 {
  font-size: 3.7rem;
  margin-bottom: 24px;
}

.map-copy {
  line-height: 1.9;
  max-width: 390px;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 28px;
}

.map-legend span {
  align-items: center;
  color: #5f554a;
  display: inline-flex;
  font-size: 0.84rem;
  font-weight: 800;
  gap: 7px;
}

.map-legend > strong {
  color: #71665a;
  flex-basis: 100%;
  font-size: 0.72rem;
  letter-spacing: 0;
}

.map-legend i {
  background: linear-gradient(135deg, #b16f1d, #ffdf63 62%, #fff2a8);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(208, 156, 45, 0.16), 0 0 14px rgba(255, 213, 90, 0.22);
  height: 10px;
  width: 10px;
}

.map-legend i[data-count-color="20"] { background: linear-gradient(135deg, #a84b39, #f18a62 62%, #ffc3a3); box-shadow: 0 0 0 3px rgba(198, 95, 66, 0.16), 0 0 14px rgba(241, 138, 98, 0.2); }
.map-legend i[data-count-color="12"] { background: linear-gradient(135deg, #237965, #75dfb0 62%, #d9ffdf); box-shadow: 0 0 0 3px rgba(62, 164, 123, 0.16), 0 0 14px rgba(117, 223, 176, 0.2); }
.map-legend i[data-count-color="7"] { background: linear-gradient(135deg, #317894, #8ed9ec 62%, #d8f6ff); box-shadow: 0 0 0 3px rgba(66, 143, 172, 0.16), 0 0 14px rgba(142, 217, 236, 0.2); }
.map-legend i[data-count-color="4"] { background: linear-gradient(135deg, #2a8d82, #91e3ce 62%, #d9fff0); box-shadow: 0 0 0 3px rgba(60, 164, 149, 0.16), 0 0 14px rgba(145, 227, 206, 0.2); }
.map-legend i[data-count-color="2"] { background: linear-gradient(135deg, #7550a7, #d1a9ff 62%, #f3ddff); box-shadow: 0 0 0 3px rgba(135, 91, 184, 0.16), 0 0 14px rgba(209, 169, 255, 0.18); }
.map-legend i[data-count-color="1"] { background: linear-gradient(135deg, #8c9188, #ffedc2 62%, #fff8dc); box-shadow: 0 0 0 3px rgba(160, 153, 126, 0.15), 0 0 14px rgba(255, 237, 194, 0.2); }

.map-semantic-legend {
  border-top: 1px solid rgba(70, 58, 43, 0.14);
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
}

.map-semantic-legend > div {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
}

.map-semantic-legend strong {
  color: #71665a;
  flex-basis: 100%;
  font-size: 0.72rem;
}

.map-semantic-legend span {
  align-items: center;
  color: #62584d;
  display: inline-flex;
  font-size: 0.74rem;
  font-weight: 700;
  gap: 6px;
}

.map-semantic-legend i {
  background: #e5c673;
  display: inline-block;
  height: 2px;
  width: 18px;
}

.map-semantic-legend i[data-era-color="han"] { background: #cf755d; }
.map-semantic-legend i[data-era-color="wei-jin"] { background: #65ae93; }
.map-semantic-legend i[data-era-color="southern"] { background: #6c9fc1; }
.map-semantic-legend i[data-relation-color="circle"] { background: linear-gradient(90deg, #e9c667 0 70%, transparent 70%); background-size: 7px 2px; }
.map-semantic-legend i[data-relation-color="tradition"] { background: linear-gradient(90deg, #d67360 0 48%, transparent 48%); background-size: 6px 2px; }
.map-semantic-legend i[data-relation-color="aesthetic"] { background: linear-gradient(90deg, #71b8a3 0 34%, transparent 34%); background-size: 5px 2px; }

.author-map-shell {
  aspect-ratio: auto;
  background:
    radial-gradient(circle at 10% 12%, rgba(255, 202, 96, 0.14), transparent 22%),
    radial-gradient(circle at 92% 13%, rgba(160, 225, 242, 0.12), transparent 21%),
    radial-gradient(circle at 88% 80%, rgba(214, 112, 88, 0.08), transparent 28%),
    linear-gradient(145deg, #17343a 0%, #18312d 46%, #0f242c 100%);
  border: 1px solid rgba(220, 186, 93, 0.34);
  border-radius: 8px;
  box-shadow:
    0 28px 76px rgba(20, 32, 34, 0.28),
    inset 0 0 92px rgba(255, 223, 126, 0.09),
    inset 0 -54px 126px rgba(3, 18, 24, 0.42);
  isolation: isolate;
  height: 540px;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.author-map-shell::after {
  background:
    linear-gradient(90deg, rgba(242, 226, 177, 0.08), transparent 18%, transparent 82%, rgba(242, 226, 177, 0.08)),
    linear-gradient(180deg, rgba(255, 248, 225, 0.08), transparent 22%, transparent 76%, rgba(5, 18, 22, 0.3));
  border: 1px solid rgba(226, 201, 132, 0.18);
  content: "";
  inset: 10px;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.author-map-shell::before {
  background:
    radial-gradient(circle at 5% 86%, rgba(255, 204, 92, 0.18), transparent 14%),
    radial-gradient(circle at 96% 86%, rgba(130, 235, 206, 0.13), transparent 15%),
    radial-gradient(circle at 4% 18%, rgba(219, 106, 86, 0.1), transparent 13%),
    linear-gradient(90deg, rgba(255, 224, 135, 0.07), transparent 16%, transparent 84%, rgba(150, 232, 212, 0.07));
  content: "";
  inset: 0;
  opacity: 0.9;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.author-map-shell canvas {
  cursor: grab;
  display: block;
  height: 100%;
  outline: none;
  touch-action: none;
  width: 100%;
}

.author-map-shell canvas:active {
  cursor: grabbing;
}

.map-fallback {
  align-items: center;
  color: var(--paper-strong);
  display: flex;
  font-weight: 900;
  inset: 0;
  justify-content: center;
  pointer-events: none;
  position: absolute;
  text-align: center;
}

.map-fallback[hidden],
.map-tooltip[hidden] {
  display: none;
}

.map-author-status,
.map-controls,
.map-hint,
.map-tooltip {
  position: absolute;
  z-index: 3;
}

.map-author-status {
  backdrop-filter: blur(12px);
  background: rgba(242, 237, 218, 0.82);
  border: 1px solid rgba(207, 184, 118, 0.38);
  border-left: 2px solid #925046;
  bottom: 14px;
  left: 14px;
  max-width: 190px;
  padding: 6px 8px;
}

.map-author-status span {
  display: none;
}

.map-author-status strong {
  color: #7b3c35;
  font-family: "Noto Serif SC", serif;
  font-size: 1rem;
}

.map-author-status p {
  color: #4f574d;
  font-size: 0.62rem;
  line-height: 1.35;
  margin: 2px 0 0;
}

.map-controls {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, 38px);
  right: 18px;
  top: 18px;
}

.map-controls button {
  align-items: center;
  backdrop-filter: blur(12px);
  background: rgba(238, 233, 210, 0.84);
  border: 1px solid rgba(218, 198, 139, 0.42);
  border-radius: 4px;
  color: #263b33;
  display: flex;
  font-size: 1.18rem;
  font-weight: 800;
  height: 38px;
  justify-content: center;
  padding: 0;
  width: 38px;
}

.map-hint {
  bottom: 24px;
  color: rgba(245, 238, 214, 0.78);
  font-size: 0.74rem;
  right: 22px;
}

.map-tooltip {
  backdrop-filter: blur(12px);
  background: rgba(250, 247, 234, 0.9);
  border: 1px solid rgba(151, 128, 78, 0.25);
  color: #2b302b;
  font-family: "Noto Serif SC", serif;
  font-size: 0.84rem;
  font-weight: 700;
  max-width: 190px;
  padding: 7px 9px;
  pointer-events: none;
  transform: translate(12px, 12px);
}

.map-click-burst {
  animation: map-click-burst 780ms ease-out forwards;
  border: 2px solid var(--burst-color, #ffe28a);
  border-radius: 50%;
  box-shadow:
    0 0 18px var(--burst-color, #ffe28a),
    0 0 34px rgba(255, 244, 205, 0.5),
    inset 0 0 18px var(--burst-color, #ffe28a);
  height: 18px;
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.4);
  width: 18px;
  z-index: 4;
}

.map-click-burst::before,
.map-click-burst::after {
  background: linear-gradient(90deg, transparent, var(--burst-color, #ffe28a), transparent);
  content: "";
  height: 2px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform-origin: 0 50%;
  width: 64px;
}

.map-click-burst::before {
  transform: rotate(23deg) translateX(-50%);
}

.map-click-burst::after {
  transform: rotate(-48deg) translateX(-50%);
}

@keyframes map-click-burst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  16% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(3.3); }
}

.author-directory {
  border-top: 1px solid var(--line);
  grid-column: 1 / -1;
  min-width: 0;
  padding-top: 24px;
}

.author-directory > header {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.author-directory > header span,
.author-directory > header > strong {
  color: var(--muted);
  font-size: 0.78rem;
}

.author-directory h3 {
  font-family: "Noto Serif SC", serif;
  font-size: 1.7rem;
  margin: 2px 0 0;
}

.genre-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-height: 300px;
  overflow: auto;
  padding: 0 8px 8px 0;
  scrollbar-color: rgba(91, 81, 59, 0.42) transparent;
  scrollbar-width: thin;
}

.genre-list button {
  background: rgba(255, 250, 240, 0.66);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  display: grid;
  gap: 3px;
  min-height: 94px;
  padding: 13px 14px;
  text-align: left;
}

.genre-list span {
  color: var(--cinnabar);
  font-family: "Noto Serif SC", serif;
  font-size: 1.35rem;
}

.genre-list small {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.genre-list button.is-highlighted {
  background: rgba(255, 248, 233, 0.96);
  border-color: rgba(184, 58, 47, 0.62);
  box-shadow: 0 10px 24px rgba(40, 26, 16, 0.1);
  transform: translateY(-2px);
}

.birthplace-map {
  background:
    radial-gradient(circle at 18% 24%, rgba(214, 170, 83, 0.22), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(73, 133, 124, 0.18), transparent 28%),
    linear-gradient(135deg, rgba(252, 232, 176, 0.82), rgba(196, 218, 177, 0.7) 48%, rgba(231, 205, 139, 0.78));
  border: 1px solid rgba(94, 80, 55, 0.12);
  grid-column: 1 / -1;
  margin-top: 6px;
  padding: clamp(18px, 3vw, 34px);
  perspective: 1200px;
}

.birthplace-map-heading {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.birthplace-map-heading h3 {
  font-size: clamp(2.1rem, 5vw, 4rem);
  margin: 0;
}

.birthplace-map-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.birthplace-density-toggle {
  background: rgba(255, 249, 226, 0.58);
  border: 1px solid rgba(92, 73, 44, 0.16);
  border-radius: 8px;
  display: inline-flex;
  gap: 3px;
  padding: 3px;
}

.birthplace-density-toggle button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #574836;
  font-weight: 900;
  min-height: 34px;
  padding: 0 12px;
}

.birthplace-density-toggle button.is-active {
  background: var(--ink);
  color: var(--paper-strong);
}

.birthplace-sound-toggle,
.birthplace-card button {
  background: var(--ink);
  border: 0;
  border-radius: 6px;
  color: var(--paper-strong);
  font-weight: 900;
  min-height: 40px;
  padding: 0 14px;
}

.birthplace-sound-toggle[aria-pressed="false"] {
  background: rgba(48, 42, 34, 0.28);
  color: #4f463a;
}

.birthplace-map-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
}

.birthplace-map-canvas {
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 233, 154, 0.28), transparent 26%),
    radial-gradient(circle at 25% 82%, rgba(201, 141, 65, 0.22), transparent 24%),
    radial-gradient(circle at 68% 22%, rgba(128, 169, 141, 0.28), transparent 28%),
    linear-gradient(90deg, rgba(93, 78, 48, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(93, 78, 48, 0.06) 1px, transparent 1px),
    linear-gradient(145deg, rgba(245, 217, 142, 0.62), rgba(187, 216, 172, 0.74) 42%, rgba(231, 190, 110, 0.52));
  background-size: auto, auto, 38px 38px, 38px 38px, auto;
  border: 1px solid rgba(89, 75, 50, 0.18);
  box-shadow:
    inset 0 0 0 6px rgba(255, 251, 232, 0.28),
    inset 0 -70px 120px rgba(125, 94, 50, 0.18),
    0 36px 66px rgba(39, 49, 37, 0.24);
  min-height: 640px;
  overflow: hidden;
  position: relative;
  transform: rotateX(13deg) rotateZ(-0.7deg);
  transform-origin: center top;
}

.birthplace-map-canvas::before,
.birthplace-map-canvas::after {
  content: "";
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.birthplace-map-canvas::before {
  background:
    radial-gradient(ellipse at 22% 66%, rgba(117, 104, 73, 0.28), transparent 20%),
    radial-gradient(ellipse at 40% 35%, rgba(92, 128, 96, 0.2), transparent 18%),
    radial-gradient(ellipse at 73% 53%, rgba(150, 116, 62, 0.16), transparent 20%);
  filter: blur(1px);
  inset: 0;
  opacity: 0.88;
}

.birthplace-map-canvas::after {
  background: linear-gradient(180deg, rgba(255, 244, 204, 0.2), transparent 34%, rgba(111, 70, 31, 0.2));
  inset: 0;
}

.birthplace-map-drawing {
  filter: drop-shadow(0 22px 18px rgba(87, 65, 32, 0.2));
  height: 92%;
  inset: 4% 3% 4%;
  opacity: 1;
  position: absolute;
  width: 94%;
  z-index: 2;
}

.birthplace-markers {
  inset: 4% 3% 4%;
  position: absolute;
  z-index: 4;
}

.map-depth-shape {
  fill: rgba(113, 87, 48, 0.34);
  pointer-events: none;
  stroke: rgba(89, 68, 39, 0.18);
  stroke-width: 1.5;
  transform: translateY(2.8px);
}

.land-shape {
  fill: url("#chinaLandGradient");
  pointer-events: none;
  stroke: rgba(58, 91, 62, 0.86);
  stroke-linejoin: round;
  stroke-width: 2.25;
}

.island-shape {
  fill: rgba(219, 185, 108, 0.82);
  stroke-width: 1.2;
}

.taiwan-shape,
.hainan-shape {
  stroke: rgba(78, 95, 63, 0.72);
}

.province-line {
  fill: none;
  opacity: 0.34;
  pointer-events: none;
  stroke: rgba(109, 122, 82, 0.8);
  stroke-dasharray: 2.6 2.2;
  stroke-linecap: round;
  stroke-width: 0.9;
}

.terrain {
  cursor: pointer;
  opacity: 0.38;
  transition: opacity 160ms ease, filter 160ms ease, transform 160ms ease;
}

.terrain-west {
  fill: rgba(128, 113, 78, 0.56);
}

.terrain-central {
  fill: rgba(99, 132, 86, 0.43);
}

.terrain-south {
  fill: rgba(79, 132, 111, 0.36);
}

.terrain:hover,
.terrain.is-feature-active {
  filter: saturate(1.35) brightness(1.08);
  opacity: 0.74;
  transform: translateY(-0.5px);
}

.river {
  cursor: pointer;
  fill: none;
  opacity: 0.86;
  stroke-linecap: round;
  stroke-width: 1.45;
  transition: opacity 160ms ease, stroke-width 160ms ease, filter 160ms ease;
}

.river-yellow {
  stroke: rgba(184, 139, 54, 0.56);
}

.river-yangzi {
  stroke: rgba(61, 131, 145, 0.58);
}

.river-wei {
  stroke: rgba(112, 159, 132, 0.56);
}

.river-huai {
  stroke: rgba(82, 139, 151, 0.5);
}

.river-xiang {
  stroke: rgba(49, 124, 128, 0.5);
}

.river:hover,
.river.is-feature-active {
  filter: drop-shadow(0 0 3px rgba(255, 244, 195, 0.72));
  opacity: 1;
  stroke-width: 2.25;
}

.mountain-line {
  cursor: pointer;
  fill: none;
  opacity: 0.74;
  stroke: rgba(103, 117, 79, 0.56);
  stroke-dasharray: 2 2;
  stroke-linecap: round;
  stroke-width: 1.2;
}

.mountain-line:hover,
.mountain-line.is-feature-active {
  opacity: 1;
  stroke-width: 1.85;
}

.mountain-line-west {
  stroke: rgba(118, 94, 65, 0.3);
}

.geo-label {
  color: rgba(68, 63, 50, 0.58);
  font-family: "Noto Serif SC", serif;
  font-size: 0.78rem;
  font-weight: 900;
  position: absolute;
  z-index: 4;
}

.geo-label-north { left: 46%; top: 25%; }
.geo-label-east { right: 12%; top: 38%; }
.geo-label-west { left: 24%; top: 57%; }
.geo-label-south { left: 49%; bottom: 15%; }

.birthplace-feature-tip {
  background: rgba(255, 248, 226, 0.8);
  border: 1px solid rgba(97, 79, 47, 0.14);
  bottom: 14px;
  color: rgba(62, 49, 35, 0.8);
  font-size: 0.78rem;
  font-weight: 800;
  left: 14px;
  line-height: 1.5;
  max-width: min(430px, calc(100% - 28px));
  padding: 8px 10px;
  position: absolute;
  z-index: 5;
}

.birthplace-marker {
  --marker-color: #a73d31;
  align-items: center;
  background: linear-gradient(180deg, rgba(255, 247, 220, 0.96), rgba(228, 194, 127, 0.9));
  border: 1px solid rgba(129, 50, 38, 0.46);
  border-radius: 8px;
  box-shadow: 0 13px 18px rgba(59, 40, 24, 0.18), 0 0 0 5px rgba(166, 58, 48, 0.08);
  color: #4a3328;
  display: inline-flex;
  font-family: "Noto Serif SC", serif;
  font-size: 0.74rem;
  font-weight: 900;
  justify-content: center;
  min-height: 62px;
  padding: 7px 3px;
  position: absolute;
  transform: translate(-50%, -50%) rotateX(-8deg);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
  white-space: nowrap;
  width: 28px;
  writing-mode: vertical-rl;
  z-index: 3;
}

.birthplace-map:not(.is-density-all) .birthplace-marker.is-secondary,
.birthplace-map:not(.is-density-all) .birthplace-marker.is-minor {
  background: rgba(103, 125, 90, 0.78);
  border-color: rgba(255, 246, 204, 0.5);
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(96, 122, 88, 0.08), 0 8px 14px rgba(45, 51, 35, 0.16);
  min-height: 13px;
  opacity: 0.62;
  padding: 0;
  width: 13px;
}

.birthplace-map:not(.is-density-all) .birthplace-marker.is-secondary span,
.birthplace-map:not(.is-density-all) .birthplace-marker.is-minor span {
  display: none;
}

.birthplace-map:not(.is-density-all) .birthplace-marker.is-secondary::after,
.birthplace-map:not(.is-density-all) .birthplace-marker.is-minor::after {
  display: none;
}

.birthplace-map:not(.is-density-all) .birthplace-marker.is-secondary:hover,
.birthplace-map:not(.is-density-all) .birthplace-marker.is-secondary:focus-visible,
.birthplace-map:not(.is-density-all) .birthplace-marker.is-secondary.is-active,
.birthplace-map:not(.is-density-all) .birthplace-marker.is-minor:hover,
.birthplace-map:not(.is-density-all) .birthplace-marker.is-minor:focus-visible,
.birthplace-map:not(.is-density-all) .birthplace-marker.is-minor.is-active {
  border-radius: 8px;
  min-height: 54px;
  opacity: 1;
  padding: 7px 3px;
  width: 26px;
}

.birthplace-map:not(.is-density-all) .birthplace-marker.is-secondary:hover span,
.birthplace-map:not(.is-density-all) .birthplace-marker.is-secondary:focus-visible span,
.birthplace-map:not(.is-density-all) .birthplace-marker.is-secondary.is-active span,
.birthplace-map:not(.is-density-all) .birthplace-marker.is-minor:hover span,
.birthplace-map:not(.is-density-all) .birthplace-marker.is-minor:focus-visible span,
.birthplace-map:not(.is-density-all) .birthplace-marker.is-minor.is-active span {
  display: inline;
}

.birthplace-marker span {
  pointer-events: none;
}

.birthplace-marker::before {
  background: var(--marker-color);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(166, 58, 48, 0.58);
  content: "";
  height: 8px;
  left: 50%;
  position: absolute;
  top: calc(100% + 3px);
  transform: translateX(-50%);
  width: 8px;
}

.birthplace-marker::after {
  background: linear-gradient(180deg, rgba(111, 65, 36, 0.38), transparent);
  content: "";
  height: 16px;
  left: 50%;
  position: absolute;
  top: 100%;
  transform: translateX(-50%);
  width: 1px;
}

.birthplace-marker.is-estimated {
  background: linear-gradient(180deg, rgba(255, 247, 220, 0.74), rgba(209, 192, 143, 0.62));
  border-color: rgba(99, 86, 60, 0.3);
  box-shadow: 0 8px 13px rgba(59, 40, 24, 0.1), 0 0 0 4px rgba(92, 115, 88, 0.06);
  color: rgba(54, 48, 38, 0.72);
}

.birthplace-marker.is-estimated::before {
  background: #6d8166;
  box-shadow: 0 0 8px rgba(95, 122, 89, 0.42);
}

.birthplace-marker.is-minor {
  font-size: 0.56rem;
  min-height: 42px;
  opacity: 0.72;
  padding-block: 5px;
  width: 21px;
}

.birthplace-marker.is-minor:hover,
.birthplace-marker.is-minor:focus-visible,
.birthplace-marker.is-minor.is-active {
  opacity: 1;
}

.birthplace-marker:hover,
.birthplace-marker:focus-visible,
.birthplace-marker.is-active {
  background: #9b352b;
  box-shadow: 0 11px 24px rgba(91, 42, 30, 0.24), 0 0 0 7px rgba(166, 58, 48, 0.15);
  color: #fff2d6;
  outline: none;
  transform: translate(-50%, -50%) rotateX(-8deg) translateY(-5px) scale(1.08);
  z-index: 6;
}

.birthplace-marker:hover::before,
.birthplace-marker:focus-visible::before,
.birthplace-marker.is-active::before {
  background: #f2d176;
}

.birthplace-card {
  align-self: stretch;
  background: rgba(249, 244, 226, 0.9);
  border: 1px solid rgba(92, 74, 46, 0.16);
  box-shadow: 0 20px 46px rgba(48, 42, 32, 0.12);
  display: grid;
  gap: 12px;
  padding: 20px;
}

.birthplace-card > span {
  color: var(--cinnabar);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.birthplace-card h4 {
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  margin: 0;
}

.birthplace-card p {
  line-height: 1.75;
  margin: 0;
}

.birthplace-card p:first-of-type {
  color: #463b2d;
  font-weight: 900;
}

.birthplace-card-meta {
  border-top: 1px solid rgba(86, 72, 55, 0.14);
  display: grid;
  gap: 6px;
  padding-top: 12px;
}

.birthplace-card-meta strong {
  color: #8f3329;
  font-size: 1.05rem;
}

.birthplace-card-meta em {
  color: #5f554a;
  font-style: normal;
  line-height: 1.6;
}

.feihua-game {
  --feihua-accent: #b7473c;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 236, 166, 0.32), transparent 28%),
    radial-gradient(circle at 86% 14%, rgba(105, 155, 146, 0.22), transparent 30%),
    linear-gradient(135deg, rgba(245, 229, 177, 0.92), rgba(198, 222, 190, 0.82) 52%, rgba(234, 207, 144, 0.88));
  border: 1px solid rgba(94, 80, 55, 0.12);
  grid-column: 1 / -1;
  margin-top: 6px;
  padding: clamp(18px, 3vw, 34px);
}

.feihua-heading {
  align-items: end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.feihua-heading h3 {
  font-size: clamp(2.2rem, 5vw, 4.1rem);
  margin: 0;
}

.feihua-scoreboard {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.feihua-scoreboard span {
  background: rgba(255, 249, 226, 0.72);
  border: 1px solid rgba(92, 73, 44, 0.13);
  color: #514536;
  font-size: 0.82rem;
  font-weight: 900;
  padding: 8px 10px;
}

.feihua-scoreboard strong {
  color: var(--feihua-accent);
  font-size: 1rem;
}

.feihua-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
}

.feihua-stage {
  background:
    radial-gradient(circle at 18% 26%, rgba(255, 248, 212, 0.5), transparent 24%),
    radial-gradient(circle at 72% 78%, rgba(93, 125, 88, 0.18), transparent 22%),
    linear-gradient(145deg, rgba(237, 225, 171, 0.72), rgba(181, 214, 190, 0.76));
  border: 1px solid rgba(88, 77, 52, 0.16);
  box-shadow:
    inset 0 0 0 6px rgba(255, 251, 232, 0.26),
    inset 0 -80px 130px rgba(111, 83, 45, 0.14),
    0 28px 54px rgba(39, 49, 37, 0.18);
  min-height: 560px;
  overflow: hidden;
  position: relative;
}

.feihua-stage::before {
  background:
    radial-gradient(circle, rgba(77, 119, 96, 0.18) 0 2px, transparent 3px),
    linear-gradient(90deg, rgba(88, 76, 46, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(88, 76, 46, 0.05) 1px, transparent 1px);
  background-size: 34px 34px, 46px 46px, 46px 46px;
  content: "";
  inset: 0;
  opacity: 0.72;
  pointer-events: none;
  position: absolute;
}

.feihua-stream {
  inset: 8% 5%;
  pointer-events: none;
  position: absolute;
}

.feihua-stream::before,
.feihua-stream::after {
  border: 34px solid rgba(60, 124, 127, 0.22);
  border-left-color: transparent;
  border-radius: 50%;
  border-right-color: transparent;
  content: "";
  height: 56%;
  left: 3%;
  position: absolute;
  top: 12%;
  transform: rotate(-8deg);
  width: 88%;
}

.feihua-stream::after {
  border-width: 18px;
  filter: blur(1px);
  opacity: 0.58;
  transform: rotate(-8deg) translateY(11px);
}

.feihua-stream span {
  background: linear-gradient(90deg, transparent, rgba(255, 250, 218, 0.58), transparent);
  height: 1px;
  left: 10%;
  position: absolute;
  top: calc(30% + var(--line-offset, 0px));
  transform: rotate(-9deg);
  width: 78%;
}

.feihua-stream span:nth-child(2) {
  --line-offset: 64px;
  opacity: 0.6;
}

.feihua-stream span:nth-child(3) {
  --line-offset: 128px;
  opacity: 0.42;
}

.feihua-cup {
  align-items: center;
  animation: feihua-cup-glow 5.5s ease-in-out infinite;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 252, 232, 0.98), rgba(239, 218, 158, 0.94) 48%, rgba(158, 82, 48, 0.82) 100%);
  border: 1px solid rgba(118, 67, 42, 0.34);
  border-radius: 999px 999px 44% 44%;
  box-shadow: 0 16px 25px rgba(64, 49, 28, 0.2), 0 0 0 8px rgba(255, 246, 204, 0.16);
  color: #3e2d21;
  display: grid;
  gap: 4px;
  height: 132px;
  justify-items: center;
  padding: 13px 10px 12px;
  position: absolute;
  text-align: center;
  transform: translate(-50%, -50%);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
  width: 150px;
  z-index: 3;
}

.feihua-cup::after {
  background: rgba(58, 118, 126, 0.22);
  border-radius: 50%;
  bottom: -14px;
  content: "";
  filter: blur(4px);
  height: 14px;
  left: 16%;
  position: absolute;
  right: 16%;
}

.feihua-cup-word {
  align-items: center;
  background: var(--feihua-accent);
  border-radius: 999px;
  color: #fff7dc;
  display: inline-flex;
  font-family: "Noto Serif SC", serif;
  font-size: 1rem;
  font-weight: 900;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.feihua-cup strong {
  display: -webkit-box;
  font-family: "Noto Serif SC", serif;
  font-size: 0.92rem;
  line-height: 1.38;
  max-width: 124px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.feihua-cup small {
  color: rgba(57, 45, 33, 0.7);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1.2;
}

.feihua-cup:hover,
.feihua-cup:focus-visible,
.feihua-cup.is-caught {
  background:
    radial-gradient(circle at 50% 18%, #fff8dc, #f1cf75 48%, var(--feihua-accent) 100%);
  box-shadow: 0 18px 30px rgba(89, 43, 32, 0.25), 0 0 0 10px rgba(255, 239, 176, 0.24);
  outline: none;
  transform: translate(-50%, -50%) translateY(-8px) scale(1.05);
  z-index: 5;
}

.feihua-ripple {
  background: rgba(255, 248, 226, 0.82);
  border: 1px solid rgba(97, 79, 47, 0.14);
  bottom: 16px;
  color: rgba(62, 49, 35, 0.82);
  font-size: 0.84rem;
  font-weight: 900;
  left: 16px;
  line-height: 1.5;
  max-width: min(520px, calc(100% - 32px));
  padding: 8px 10px;
  position: absolute;
  z-index: 4;
}

.feihua-panel {
  background: rgba(249, 244, 226, 0.94);
  border: 1px solid rgba(92, 74, 46, 0.16);
  box-shadow: 0 20px 46px rgba(48, 42, 32, 0.12);
  display: grid;
  gap: 14px;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  padding: 18px;
}

.feihua-keywords {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feihua-keywords button,
.feihua-actions button {
  background: rgba(43, 36, 28, 0.08);
  border: 1px solid rgba(84, 68, 45, 0.12);
  border-radius: 6px;
  color: #4b4032;
  font-family: "Noto Serif SC", serif;
  font-weight: 900;
  min-height: 40px;
}

.feihua-keywords button.is-active,
.feihua-actions button:first-child {
  background: var(--ink);
  color: var(--paper-strong);
}

.feihua-current {
  border-left: 4px solid var(--feihua-accent);
  padding-left: 14px;
}

.feihua-current span {
  color: var(--feihua-accent);
  font-size: 0.76rem;
  font-weight: 900;
}

.feihua-current blockquote {
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  font-weight: 900;
  line-height: 1.38;
  margin: 8px 0 10px;
}

.feihua-current p {
  color: #5e5348;
  line-height: 1.65;
  margin: 0;
}

.feihua-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.feihua-chain {
  counter-reset: feihua-chain;
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  max-height: 220px;
  overflow: auto;
  padding: 0;
}

.feihua-chain li {
  background: rgba(231, 222, 204, 0.5);
  color: #473b2e;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.55;
  padding: 8px 10px;
}

@keyframes feihua-cup-glow {
  0%,
  100% {
    filter: saturate(0.98) brightness(1);
  }

  50% {
    filter: saturate(1.12) brightness(1.04);
  }
}

.feihua-game {
  background:
    radial-gradient(circle at 16% 16%, rgba(255, 248, 214, 0.48), transparent 24%),
    radial-gradient(circle at 82% 12%, rgba(177, 215, 203, 0.34), transparent 26%),
    linear-gradient(135deg, #e7d69c 0%, #c4d7bc 46%, #d7b66d 100%);
  border: 0;
  margin-top: 0;
  overflow: hidden;
  padding: clamp(26px, 4.6vw, 64px) clamp(18px, 6vw, 80px);
  position: relative;
}

.feihua-game::before {
  background:
    linear-gradient(90deg, rgba(73, 57, 36, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(73, 57, 36, 0.06) 1px, transparent 1px);
  background-size: 54px 54px;
  content: "";
  inset: 0;
  opacity: 0.45;
  pointer-events: none;
  position: absolute;
}

.feihua-heading,
.feihua-layout {
  position: relative;
  z-index: 1;
}

.feihua-heading {
  align-items: end;
  margin-bottom: 24px;
}

.feihua-heading h3 {
  letter-spacing: 0;
  line-height: 0.98;
}

.feihua-scoreboard span {
  backdrop-filter: blur(12px);
  background: rgba(255, 250, 230, 0.74);
  box-shadow: 0 12px 30px rgba(74, 61, 38, 0.1);
}

.feihua-layout {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 370px);
}

.feihua-stage {
  background:
    radial-gradient(ellipse at 14% 82%, rgba(96, 111, 69, 0.18), transparent 24%),
    radial-gradient(ellipse at 84% 18%, rgba(244, 230, 176, 0.52), transparent 18%),
    linear-gradient(135deg, rgba(225, 218, 158, 0.78), rgba(177, 203, 166, 0.86));
  border: 1px solid rgba(74, 65, 43, 0.14);
  box-shadow:
    inset 0 0 0 8px rgba(255, 251, 232, 0.22),
    inset 0 -90px 150px rgba(86, 72, 42, 0.16),
    0 38px 70px rgba(47, 54, 38, 0.18);
  min-height: 640px;
}

.feihua-stage::before {
  background:
    linear-gradient(115deg, transparent 0 12%, rgba(255, 249, 218, 0.26) 12% 13%, transparent 13% 100%),
    radial-gradient(circle at 17% 20%, rgba(255, 250, 226, 0.42), transparent 12%),
    radial-gradient(circle at 86% 74%, rgba(77, 104, 83, 0.18), transparent 18%);
  background-size: auto;
  opacity: 0.9;
}

.feihua-bank {
  background:
    radial-gradient(circle at 16px 16px, rgba(99, 88, 63, 0.56) 0 11px, transparent 12px),
    radial-gradient(circle at 45px 30px, rgba(134, 118, 82, 0.48) 0 14px, transparent 15px);
  background-size: 68px 42px;
  filter: drop-shadow(0 8px 10px rgba(70, 61, 40, 0.18));
  opacity: 0.7;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.feihua-bank-left {
  border-radius: 48% 52% 42% 58%;
  height: 42%;
  left: 3%;
  top: 16%;
  transform: rotate(-17deg);
  width: 20%;
}

.feihua-bank-right {
  border-radius: 55% 45% 60% 40%;
  bottom: 14%;
  height: 38%;
  right: 4%;
  transform: rotate(-16deg);
  width: 22%;
}

.feihua-stream {
  inset: 8% 7%;
  z-index: 3;
}

.feihua-stream::before,
.feihua-stream::after {
  border: 42px solid rgba(57, 125, 134, 0.24);
  border-left-color: transparent;
  border-radius: 50%;
  border-right-color: transparent;
  height: 48%;
  left: 5%;
  top: 24%;
  transform: rotate(-18deg);
  width: 82%;
}

.feihua-stream::after {
  border-color: rgba(205, 238, 220, 0.45);
  border-left-color: transparent;
  border-right-color: transparent;
  border-width: 18px;
  filter: blur(0.5px);
  opacity: 0.9;
  transform: rotate(-18deg) translateY(2px);
}

.feihua-stream span {
  animation: stream-glimmer 4.8s ease-in-out infinite;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 229, 0.75), transparent);
  top: calc(44% + var(--line-offset, 0px));
  transform: rotate(-18deg);
}

.feihua-stream span:nth-child(2) {
  --line-offset: 46px;
}

.feihua-stream span:nth-child(3) {
  --line-offset: 92px;
}

.feihua-mist span {
  animation: feihua-mist 9s ease-in-out infinite;
  background: linear-gradient(90deg, transparent, rgba(255, 252, 232, 0.54), transparent);
  border-radius: 999px;
  height: 22px;
  left: 10%;
  pointer-events: none;
  position: absolute;
  top: 18%;
  width: 32%;
  z-index: 4;
}

.feihua-mist span:nth-child(2) {
  animation-delay: -3s;
  left: 44%;
  top: 70%;
  width: 38%;
}

.feihua-mist span:nth-child(3) {
  animation-delay: -6s;
  left: 26%;
  top: 48%;
  width: 28%;
}

.feihua-seat {
  align-items: center;
  color: rgba(56, 44, 32, 0.78);
  display: grid;
  gap: 5px;
  justify-items: center;
  position: absolute;
  z-index: 5;
}

.feihua-seat i {
  background:
    radial-gradient(circle at 50% 18%, #403027 0 8px, transparent 9px),
    linear-gradient(90deg, transparent 17px, #5c4230 17px 31px, transparent 31px),
    linear-gradient(180deg, transparent 22px, rgba(197, 154, 88, 0.88) 22px 50px, transparent 50px);
  border-radius: 999px 999px 12px 12px;
  display: block;
  height: 58px;
  width: 48px;
}

.feihua-seat b {
  background: rgba(255, 247, 218, 0.58);
  font-size: 0.78rem;
  padding: 4px 8px;
}

.seat-one { left: 15%; top: 22%; }
.seat-two { right: 21%; top: 24%; }
.seat-three { left: 19%; bottom: 17%; }
.seat-four { right: 14%; bottom: 22%; }

.feihua-dance {
  bottom: 14%;
  display: flex;
  gap: 28px;
  left: 48%;
  opacity: 0.58;
  pointer-events: none;
  position: absolute;
  transform: translateX(-50%);
  z-index: 4;
}

.feihua-dance span {
  animation: dancer-sway 5.5s ease-in-out infinite;
  background:
    radial-gradient(circle at 50% 7px, rgba(64, 42, 32, 0.78) 0 7px, transparent 8px),
    linear-gradient(135deg, transparent 0 16px, rgba(156, 71, 59, 0.56) 16px 38px, transparent 39px),
    linear-gradient(45deg, transparent 0 17px, rgba(234, 197, 126, 0.66) 17px 42px, transparent 43px);
  border-radius: 999px 999px 16px 16px;
  height: 92px;
  width: 58px;
}

.feihua-dance span:nth-child(2) {
  animation-delay: -2.3s;
  transform: scaleX(-1);
}

.feihua-cup {
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 252, 232, 0.98), rgba(235, 205, 129, 0.95) 45%, rgba(151, 77, 47, 0.88) 100%);
  border-color: rgba(113, 69, 43, 0.36);
  box-shadow: 0 16px 26px rgba(45, 63, 55, 0.22), 0 0 0 10px rgba(219, 237, 211, 0.18);
  height: 118px;
  width: 166px;
  z-index: 7;
}

.feihua-cup strong {
  font-size: 0.9rem;
  max-width: 138px;
}

.feihua-ripple {
  backdrop-filter: blur(12px);
  background: rgba(255, 250, 229, 0.74);
  bottom: 18px;
  left: 18px;
}

.feihua-panel {
  background:
    linear-gradient(180deg, rgba(255, 250, 232, 0.95), rgba(239, 230, 200, 0.9));
  border: 1px solid rgba(85, 68, 44, 0.14);
}

.feihua-current blockquote {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

@keyframes stream-glimmer {
  0%,
  100% {
    opacity: 0.28;
    translate: -8px 0;
  }

  50% {
    opacity: 0.86;
    translate: 14px 0;
  }
}

@keyframes feihua-mist {
  0%,
  100% {
    opacity: 0.18;
    translate: -12px 0;
  }

  50% {
    opacity: 0.74;
    translate: 18px -6px;
  }
}

@keyframes dancer-sway {
  0%,
  100% {
    rotate: -3deg;
    translate: 0 0;
  }

  50% {
    rotate: 4deg;
    translate: 0 -7px;
  }
}

@media (max-width: 640px) {
  .feihua-game {
    padding: 92px 16px 104px;
  }

  .feihua-layout {
    gap: 16px;
  }

  .feihua-stage {
    min-height: 520px;
  }

  .feihua-bank-left {
    height: 30%;
    left: -3%;
    top: 18%;
    width: 28%;
  }

  .feihua-bank-right {
    bottom: 12%;
    height: 30%;
    right: -4%;
    width: 28%;
  }

  .feihua-stream {
    inset: 8% 2%;
  }

  .feihua-stream::before,
  .feihua-stream::after {
    height: 46%;
    left: 2%;
    top: 25%;
    width: 90%;
  }

  .feihua-seat i {
    height: 45px;
    width: 38px;
  }

  .feihua-seat b {
    font-size: 0.66rem;
    padding: 3px 6px;
  }

  .seat-one { left: 7%; top: 17%; }
  .seat-two { right: 7%; top: 19%; }
  .seat-three { left: 8%; bottom: 18%; }
  .seat-four { right: 7%; bottom: 18%; }

  .feihua-dance {
    bottom: 8%;
    gap: 14px;
  }

  .feihua-dance span {
    height: 62px;
    width: 40px;
  }

  .feihua-cup {
    height: 108px;
    width: 128px;
  }

  .feihua-cup strong {
    font-size: 0.76rem;
    max-width: 104px;
  }

  .feihua-poem-column {
    max-height: 104px;
  }
}

@media (max-width: 640px) {
  .feihua-stage {
    aspect-ratio: 1086 / 1448;
    height: auto !important;
    min-height: 0 !important;
  }

  .feihua-scene-image {
    object-fit: cover;
  }
}

.feihua-game {
  --feihua-accent: #9d3b32;
  background:
    radial-gradient(circle at 12% 16%, rgba(237, 207, 157, 0.36), transparent 22%),
    radial-gradient(circle at 82% 12%, rgba(123, 142, 113, 0.2), transparent 26%),
    linear-gradient(135deg, #e8d9be 0%, #c9d2bd 48%, #d1b47a 100%);
  border: 0;
  margin: 0;
  overflow: hidden;
  padding: clamp(24px, 4vw, 54px) clamp(18px, 5vw, 72px);
}

.feihua-game::before {
  background:
    linear-gradient(90deg, rgba(67, 51, 32, 0.07) 1px, transparent 1px),
    linear-gradient(180deg, rgba(67, 51, 32, 0.05) 1px, transparent 1px);
  background-size: 54px 54px;
}

.feihua-layout {
  align-items: start;
  grid-template-columns: minmax(520px, 700px) minmax(310px, 380px);
  justify-content: center;
}

.feihua-stage {
  aspect-ratio: 1086 / 1448;
  background: #ddceb3;
  border: 1px solid rgba(63, 50, 34, 0.22);
  box-shadow: 0 34px 72px rgba(47, 38, 25, 0.26);
  height: auto;
  max-width: 700px;
  min-height: 0;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.feihua-stage::before {
  background: linear-gradient(180deg, rgba(255, 249, 224, 0.05), rgba(67, 48, 32, 0.14));
  z-index: 2;
}

.feihua-scene-image {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.feihua-scene-vignette {
  background:
    radial-gradient(circle at 50% 48%, transparent 48%, rgba(46, 33, 22, 0.12) 100%),
    linear-gradient(180deg, rgba(255, 250, 230, 0.08), rgba(51, 39, 28, 0.1));
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.feihua-ambient {
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  z-index: 3;
}

.water-sheen {
  animation: feihua-water-flow 7s linear infinite;
  background: linear-gradient(100deg, transparent, rgba(239, 255, 238, 0.62), transparent);
  border-radius: 999px;
  filter: blur(0.4px);
  height: 2.4%;
  left: 20%;
  mix-blend-mode: screen;
  opacity: 0.38;
  position: absolute;
  top: 46%;
  transform: rotate(-23deg);
  width: 46%;
}

.sheen-two {
  animation-delay: -2.6s;
  left: 28%;
  opacity: 0.28;
  top: 60%;
  transform: rotate(-18deg);
  width: 52%;
}

.sheen-three {
  animation-delay: -4.2s;
  left: 34%;
  opacity: 0.3;
  top: 74%;
  transform: rotate(-27deg);
  width: 42%;
}

.water-current {
  animation: feihua-current-drift 9s ease-in-out infinite;
  background:
    repeating-linear-gradient(110deg, transparent 0 15px, rgba(247, 255, 241, 0.3) 16px 18px, transparent 19px 34px),
    linear-gradient(90deg, transparent, rgba(124, 166, 151, 0.2), transparent);
  border-radius: 48% 52% 46% 54%;
  filter: blur(0.35px);
  height: 9%;
  left: 31%;
  mix-blend-mode: screen;
  opacity: 0.32;
  position: absolute;
  top: 40%;
  transform: rotate(-24deg);
  width: 27%;
}

.current-two {
  animation-delay: -3.2s;
  height: 10%;
  left: 38%;
  opacity: 0.26;
  top: 56%;
  transform: rotate(-16deg);
  width: 35%;
}

.current-three {
  animation-delay: -6.4s;
  height: 12%;
  left: 30%;
  opacity: 0.3;
  top: 72%;
  transform: rotate(-27deg);
  width: 34%;
}

.water-spark {
  animation: feihua-water-spark 5.8s ease-in-out infinite;
  background: radial-gradient(circle, rgba(255, 247, 201, 0.86), rgba(255, 247, 201, 0.16) 45%, transparent 70%);
  border-radius: 999px;
  height: 42px;
  left: 46%;
  mix-blend-mode: screen;
  opacity: 0;
  position: absolute;
  top: 49%;
  width: 42px;
}

.spark-two {
  animation-delay: -2.1s;
  left: 57%;
  top: 64%;
}

.spark-three {
  animation-delay: -4s;
  left: 39%;
  top: 78%;
}

.mountain-mist {
  animation: feihua-mist-drift 12s ease-in-out infinite;
  background: linear-gradient(90deg, transparent, rgba(255, 252, 236, 0.55), transparent);
  border-radius: 999px;
  filter: blur(6px);
  height: 5.5%;
  left: 28%;
  opacity: 0.44;
  position: absolute;
  top: 15%;
  width: 45%;
}

.mist-two {
  animation-delay: -6s;
  left: 36%;
  opacity: 0.32;
  top: 24%;
  width: 35%;
}

.mist-three {
  animation: feihua-mist-rise 15s ease-in-out infinite;
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 250, 231, 0.48), transparent 68%);
  filter: blur(10px);
  height: 12%;
  left: 18%;
  opacity: 0.28;
  top: 28%;
  width: 68%;
}

.bamboo-wind {
  animation: feihua-bamboo-sway 5.5s ease-in-out infinite;
  background:
    linear-gradient(70deg, transparent 0 44%, rgba(39, 67, 45, 0.3) 45% 50%, transparent 51% 100%),
    radial-gradient(ellipse at 50% 18%, rgba(56, 88, 54, 0.28), transparent 62%);
  bottom: 19%;
  height: 18%;
  opacity: 0.34;
  position: absolute;
  right: 1%;
  transform-origin: bottom right;
  width: 18%;
}

.bamboo-two {
  animation-delay: -2.7s;
  bottom: 48%;
  height: 15%;
  left: 0;
  right: auto;
  transform-origin: bottom left;
  width: 16%;
}

.bamboo-three {
  animation-duration: 6.8s;
  animation-delay: -1.4s;
  bottom: 3%;
  height: 20%;
  left: 2%;
  right: auto;
  transform-origin: bottom left;
  width: 18%;
}

.figure-motion {
  animation: feihua-figure-breathe 4.6s ease-in-out infinite;
  border: 1px solid rgba(255, 238, 181, 0.28);
  border-color: transparent rgba(255, 238, 181, 0.36) transparent transparent;
  border-radius: 52% 48% 58% 42%;
  filter: blur(0.2px);
  height: 8%;
  left: 23%;
  mix-blend-mode: screen;
  opacity: 0.34;
  position: absolute;
  top: 43%;
  transform: rotate(-19deg);
  width: 10%;
}

.figure-motion::after {
  animation: feihua-cup-glint 3.8s ease-in-out infinite;
  background: radial-gradient(circle, rgba(255, 248, 202, 0.84), transparent 62%);
  border-radius: 999px;
  content: "";
  height: 12px;
  position: absolute;
  right: 18%;
  top: 28%;
  width: 12px;
}

.figure-two {
  animation-delay: -1.2s;
  left: 62%;
  top: 42%;
  transform: rotate(21deg);
}

.figure-three {
  animation-delay: -2.4s;
  left: 35%;
  top: 67%;
  transform: rotate(-14deg);
}

.figure-four {
  animation-delay: -3.1s;
  left: 66%;
  top: 70%;
  transform: rotate(16deg);
}

.petal {
  animation: feihua-petal-fall 10s linear infinite;
  background: rgba(221, 143, 129, 0.72);
  border-radius: 78% 12% 78% 18%;
  box-shadow: 0 0 4px rgba(255, 239, 221, 0.5);
  height: 7px;
  left: var(--petal-left);
  opacity: 0;
  position: absolute;
  top: -4%;
  transform: rotate(var(--petal-rotate));
  width: 10px;
}

.petal-one { --petal-left: 14%; --petal-rotate: 22deg; animation-delay: -0.6s; }
.petal-two { --petal-left: 26%; --petal-rotate: -18deg; animation-delay: -2.1s; }
.petal-three { --petal-left: 42%; --petal-rotate: 31deg; animation-delay: -3.4s; }
.petal-four { --petal-left: 58%; --petal-rotate: -28deg; animation-delay: -5s; }
.petal-five { --petal-left: 72%; --petal-rotate: 14deg; animation-delay: -6.3s; }
.petal-six { --petal-left: 84%; --petal-rotate: -36deg; animation-delay: -7.8s; }
.petal-seven { --petal-left: 34%; --petal-rotate: 41deg; animation-delay: -8.8s; }
.petal-eight { --petal-left: 64%; --petal-rotate: -11deg; animation-delay: -9.5s; }

.feihua-cups {
  inset: 0;
  position: absolute;
  z-index: 5;
}

.feihua-cup {
  animation: feihua-scroll-breathe 4.8s ease-in-out infinite;
  background:
    linear-gradient(90deg, rgba(125, 91, 52, 0.34), transparent 8%, transparent 92%, rgba(125, 91, 52, 0.34)),
    linear-gradient(180deg, rgba(255, 251, 232, 0.96), rgba(230, 214, 178, 0.94));
  border: 1px solid rgba(77, 56, 33, 0.38);
  border-radius: 2px;
  box-shadow: 0 12px 24px rgba(46, 34, 23, 0.24), inset 0 0 0 4px rgba(255, 255, 242, 0.3);
  color: #241b14;
  display: grid;
  gap: 7px;
  height: 210px;
  justify-items: center;
  padding: 16px 11px 15px;
  position: absolute;
  text-align: center;
  transform: translate(-50%, -50%);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
  width: 94px;
  writing-mode: horizontal-tb;
}

.feihua-cup::before,
.feihua-cup::after {
  background:
    radial-gradient(circle at 10px 50%, #3f2d1e 0 3px, transparent 4px),
    linear-gradient(90deg, #4d3725, #8f7146, #4d3725);
  border-radius: 999px;
  content: "";
  height: 10px;
  left: -7px;
  position: absolute;
  right: -7px;
}

.feihua-cup::before {
  top: -6px;
}

.feihua-cup::after {
  bottom: -6px;
  filter: none;
}

.feihua-cup-word {
  background: transparent;
  border: 1px solid rgba(157, 59, 50, 0.18);
  border-radius: 0;
  color: var(--feihua-accent);
  display: inline-grid;
  font-size: 1.05rem;
  height: 28px;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  place-items: center;
  width: 28px;
  writing-mode: horizontal-tb;
}

.feihua-cup strong {
  align-items: start;
  display: inline-flex;
  flex-direction: row-reverse;
  font-size: 0.98rem;
  gap: 4px;
  margin-right: 17px;
  letter-spacing: 0;
  line-height: 1.32;
  max-height: none;
  max-width: none;
  overflow: hidden;
  writing-mode: horizontal-tb;
}

.feihua-poem-column {
  display: block;
  max-height: 142px;
  overflow: hidden;
  writing-mode: vertical-rl;
}

.feihua-cup small {
  color: rgba(45, 34, 23, 0.72);
  display: none;
  font-size: 0.62rem;
  line-height: 1.25;
}

.feihua-cup:hover,
.feihua-cup:focus-visible,
.feihua-cup.is-caught {
  background:
    linear-gradient(90deg, rgba(137, 73, 45, 0.34), transparent 8%, transparent 92%, rgba(137, 73, 45, 0.34)),
    linear-gradient(180deg, #fff8dc, #ead29b);
  box-shadow: 0 16px 34px rgba(95, 48, 31, 0.28), 0 0 0 8px rgba(255, 240, 184, 0.22);
  filter: saturate(1.06);
  transform: translate(-50%, -50%) translateY(-5px) scale(1.025);
}

.feihua-ripple {
  backdrop-filter: blur(14px);
  background: rgba(255, 249, 226, 0.84);
  bottom: 18px;
  box-shadow: 0 10px 24px rgba(47, 38, 25, 0.12);
  left: 18px;
  z-index: 6;
}

.feihua-panel {
  background:
    linear-gradient(180deg, rgba(255, 250, 232, 0.94), rgba(236, 225, 196, 0.92));
  border: 1px solid rgba(82, 65, 43, 0.15);
  box-shadow: 0 28px 58px rgba(57, 45, 31, 0.18);
  min-height: 0;
}

.feihua-current blockquote {
  font-size: clamp(1.5rem, 2.7vw, 2.35rem);
}

.feihua-keywords {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@keyframes feihua-scroll-breathe {
  0%,
  100% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(1.05);
  }
}

@keyframes feihua-water-flow {
  0% {
    opacity: 0;
    translate: -28px -6px;
  }

  22%,
  68% {
    opacity: 0.38;
  }

  100% {
    opacity: 0;
    translate: 38px 10px;
  }
}

@keyframes feihua-current-drift {
  0%,
  100% {
    opacity: 0.18;
    translate: -12px -5px;
  }

  45% {
    opacity: 0.43;
    translate: 18px 7px;
  }

  72% {
    opacity: 0.28;
    translate: 28px 13px;
  }
}

@keyframes feihua-water-spark {
  0%,
  100% {
    opacity: 0;
    scale: 0.68;
    translate: -8px -4px;
  }

  36% {
    opacity: 0.55;
    scale: 1;
  }

  70% {
    opacity: 0.12;
    scale: 1.25;
    translate: 18px 12px;
  }
}

@keyframes feihua-mist-drift {
  0%,
  100% {
    opacity: 0.24;
    translate: -18px 0;
  }

  50% {
    opacity: 0.58;
    translate: 24px -4px;
  }
}

@keyframes feihua-mist-rise {
  0%,
  100% {
    opacity: 0.18;
    translate: -12px 14px;
  }

  50% {
    opacity: 0.42;
    translate: 18px -12px;
  }
}

@keyframes feihua-bamboo-sway {
  0%,
  100% {
    rotate: -1deg;
    translate: 0 0;
  }

  50% {
    rotate: 4deg;
    translate: 3px -2px;
  }
}

@keyframes feihua-figure-breathe {
  0%,
  100% {
    opacity: 0.18;
    scale: 0.96;
    translate: 0 0;
  }

  50% {
    opacity: 0.38;
    scale: 1.04;
    translate: 3px -2px;
  }
}

@keyframes feihua-cup-glint {
  0%,
  100% {
    opacity: 0;
    scale: 0.7;
  }

  45% {
    opacity: 0.75;
    scale: 1.05;
  }
}

@keyframes feihua-petal-fall {
  0% {
    opacity: 0;
    translate: 0 0;
  }

  12% {
    opacity: 0.78;
  }

  70% {
    opacity: 0.62;
  }

  100% {
    opacity: 0;
    translate: 42px 760px;
  }
}

@media (max-width: 980px) {
  .feihua-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .feihua-stage {
    height: auto;
    max-height: none;
  }

  .feihua-panel {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .feihua-game {
    padding: 92px 16px 104px;
  }

  .feihua-stage {
    aspect-ratio: 1086 / 1448;
    min-height: 0;
  }

  .feihua-cup {
    height: 156px;
    padding: 12px 8px;
    width: 72px;
  }

  .feihua-cup-word {
    font-size: 0.62rem;
  }

  .feihua-cup strong {
    font-size: 0.78rem;
    max-height: 112px;
  }

  .feihua-cup small {
    font-size: 0.5rem;
  }

  .feihua-keywords {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .petal {
    height: 5px;
    width: 8px;
  }

  .water-spark {
    height: 28px;
    width: 28px;
  }

  .figure-motion {
    opacity: 0.24;
  }
}

.flow {
  background: #e7eadb;
}

.flow-steps {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 28px;
}

.flow-steps article {
  border-top: 4px solid var(--ink);
  padding-top: 18px;
}

.flow-steps span {
  color: var(--cinnabar);
  font-family: "JetBrains Mono", monospace;
  font-weight: 900;
}

.flow-steps p {
  color: #453b31;
  margin-bottom: 0;
}

.footer {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 28px clamp(18px, 6vw, 80px);
}

.footer span {
  color: var(--muted);
  font-weight: 800;
}

.focus-reader {
  --reader-seal-opacity: 0.095;
  background:
    radial-gradient(circle at 16% 10%, rgba(150, 46, 38, 0.045), transparent 24%),
    radial-gradient(circle at 86% 18%, rgba(185, 138, 56, 0.05), transparent 22%),
    linear-gradient(90deg, rgba(255, 252, 240, 0.34), transparent 18%, transparent 82%, rgba(227, 217, 191, 0.28)),
    var(--paper);
  border: 0;
  color: var(--ink);
  height: 100dvh;
  margin: 0;
  max-height: none;
  max-width: none;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
  position: relative;
  width: 100%;
  z-index: 80;
}

.focus-reader::backdrop {
  background: rgba(14, 12, 10, 0.72);
}

body.is-reader-open {
  overflow: hidden;
}

body.is-reader-open .mobile-jump-nav {
  display: none;
}

.focus-reader.is-fallback-open {
  display: block;
  height: 100dvh;
  inset: 0;
  max-height: 100dvh;
  max-width: 100vw;
  overflow-y: auto;
  position: fixed;
  width: 100vw;
  z-index: 100;
  -webkit-overflow-scrolling: touch;
}

.focus-reader::before {
  background: url("assets/zhaoming-seal.svg") center / contain no-repeat;
  content: "";
  filter: saturate(0.92) contrast(0.94);
  height: clamp(70px, 8vw, 112px);
  mix-blend-mode: multiply;
  opacity: var(--reader-seal-opacity);
  pointer-events: none;
  position: fixed;
  right: clamp(22px, 5vw, 70px);
  top: clamp(86px, 12vw, 142px);
  transform: rotate(8deg);
  width: clamp(70px, 8vw, 112px);
  z-index: 1;
}

.focus-reader[data-reader-view="study"]::before {
  background-image: url("assets/lishan-seal.svg");
  --reader-seal-opacity: 0.14;
}

.focus-reader[data-reader-view="plain"]::before {
  --reader-seal-opacity: 0.055;
}

.focus-reader::after {
  background: url("assets/plum-corner.svg") center / contain no-repeat;
  content: "";
  height: clamp(122px, 18vw, 220px);
  opacity: 0.13;
  pointer-events: none;
  position: fixed;
  right: clamp(16px, 4vw, 58px);
  top: clamp(78px, 10vw, 128px);
  transform: rotate(3deg);
  width: clamp(150px, 22vw, 260px);
  z-index: 1;
}

.focus-reader[data-reader-view="plain"]::after {
  opacity: 0.095;
}

.reader-progress {
  --reader-progress: 0;
  background: rgba(86, 72, 55, 0.12);
  height: 3px;
  position: sticky;
  top: 0;
  z-index: 4;
}

.reader-progress span {
  background: linear-gradient(90deg, #9b2f26, #d2a84d 62%, rgba(82, 94, 81, 0.86));
  box-shadow: 0 0 14px rgba(166, 58, 48, 0.22);
  display: block;
  height: 100%;
  transform: scaleX(var(--reader-progress));
  transform-origin: left center;
  transition: transform 120ms ease-out;
}

.focus-reader.is-opening .reader-toolbar,
.focus-reader.is-opening .reader-layout,
.focus-reader.is-opening .reader-navigation {
  animation: reader-open-wash 620ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.focus-reader.is-opening .reader-notes {
  animation-delay: 80ms;
}

.focus-reader.is-opening::before {
  animation: reader-seal-bloom 720ms ease both;
}

.reader-toolbar {
  align-items: center;
  background: rgba(245, 239, 226, 0.96);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 16px clamp(18px, 5vw, 70px);
  position: sticky;
  top: 0;
  z-index: 2;
}

.reader-breadcrumb {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.reader-toolbar-actions,
.reader-script-toggle {
  align-items: center;
  display: flex;
}

.reader-toolbar-actions {
  flex: none;
  gap: 8px;
}

.reader-script-toggle {
  background: #e7decc;
  border: 1px solid rgba(86, 72, 55, 0.18);
  border-radius: 6px;
  padding: 3px;
}

.reader-script-toggle button {
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: #716556;
  font-size: 0.84rem;
  font-weight: 900;
  height: 32px;
  padding: 0;
  width: 38px;
}

.reader-script-toggle button.is-active {
  background: var(--ink);
  color: var(--paper-strong);
}

.reader-view-toggle {
  background: #e7decc;
  border: 1px solid rgba(86, 72, 55, 0.18);
  border-radius: 6px;
  display: flex;
  padding: 3px;
}

.reader-view-toggle button {
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: #716556;
  font-weight: 900;
  height: 32px;
  padding: 0;
  white-space: nowrap;
  min-width: 48px;
  width: auto;
}

.reader-view-toggle button[data-reader-view="plain"] {
  padding-inline: 9px;
}

.reader-view-toggle button.is-active {
  background: var(--ink);
  color: var(--paper-strong);
}

.reader-close {
  align-items: center;
  background: var(--ink);
  border: 0;
  border-radius: 50%;
  color: var(--paper-strong);
  display: inline-flex;
  font-size: 1.4rem;
  height: 38px;
  justify-content: center;
  line-height: 1;
  width: 38px;
}

.reader-layout {
  align-items: start;
  display: grid;
  gap: clamp(32px, 7vw, 100px);
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  margin: 0 auto;
  max-width: 1180px;
  padding: clamp(54px, 8vw, 110px) clamp(20px, 5vw, 70px);
  position: relative;
  z-index: 2;
}

.reader-text {
  max-width: 760px;
  position: relative;
}

.reader-text::after {
  border-bottom: 1px solid rgba(132, 101, 57, 0.08);
  border-left: 1px solid rgba(132, 101, 57, 0.08);
  bottom: -12px;
  content: "";
  height: 54px;
  left: -12px;
  pointer-events: none;
  position: absolute;
  width: 54px;
}

.reader-meta,
.reader-author,
.reader-notes > span {
  color: var(--muted);
  font-weight: 800;
}

.reader-interaction-hint {
  align-items: center;
  background: rgba(255, 249, 232, 0.64);
  border: 1px solid rgba(166, 58, 48, 0.16);
  border-left: 3px solid rgba(166, 58, 48, 0.46);
  color: #7c352c;
  display: inline-flex;
  font-size: 0.86rem;
  font-weight: 900;
  gap: 8px;
  line-height: 1.4;
  margin: 12px 0 0;
  padding: 7px 11px;
}

.reader-interaction-hint[hidden] {
  display: none;
}

.reader-interaction-hint::before {
  background: #9b2f26;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(155, 47, 38, 0.08);
  content: "";
  flex: 0 0 auto;
  height: 6px;
  width: 6px;
}

.reader-entry-card {
  background:
    linear-gradient(135deg, rgba(255, 250, 232, 0.94), rgba(235, 224, 196, 0.86)),
    radial-gradient(circle at 10% 0%, rgba(211, 168, 77, 0.2), transparent 42%);
  border: 1px solid rgba(132, 101, 57, 0.18);
  border-left: 4px solid rgba(166, 58, 48, 0.72);
  box-shadow: 0 18px 40px rgba(65, 45, 26, 0.1), inset 0 0 0 1px rgba(255, 255, 245, 0.48);
  display: grid;
  gap: 14px;
  margin-top: 22px;
  padding: 18px 20px;
}

.reader-entry-card:empty {
  display: none;
}

.reader-entry-copy {
  display: grid;
  gap: 7px;
}

.reader-entry-copy span {
  color: #9b382d;
  font-size: 0.72rem;
  font-weight: 900;
}

.reader-entry-copy strong {
  color: #30261d;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.02rem, 1.35vw, 1.24rem);
  line-height: 1.35;
}

.reader-entry-copy p {
  color: #514335;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.72;
  margin: 0;
}

.reader-entry-stats {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.reader-entry-stats div {
  background: rgba(255, 253, 244, 0.62);
  border: 1px solid rgba(132, 101, 57, 0.13);
  min-width: 0;
  padding: 9px 9px 8px;
}

.reader-entry-stats strong,
.reader-entry-stats small {
  display: block;
}

.reader-entry-stats strong {
  color: #2f281f;
  font-size: 0.86rem;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.reader-entry-stats small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  margin-top: 4px;
}

.reader-entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.reader-entry-tags span {
  background: rgba(151, 106, 42, 0.11);
  border: 1px solid rgba(151, 106, 42, 0.16);
  color: #755221;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 5px 8px;
}

.reader-text h2 {
  font-size: clamp(2.8rem, 7vw, 5.6rem);
  margin: 10px 0 8px;
}

.reader-content {
  border-top: 1px solid var(--line);
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.12rem, 2vw, 1.35rem);
  line-height: 2.05;
  margin-top: 34px;
  padding-top: 30px;
}

.reader-content p {
  margin-bottom: 1.4em;
  position: relative;
  transition: background 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.reader-content.is-baihua {
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.04rem, 1.8vw, 1.22rem);
  line-height: 1.95;
}

.reader-parallel-block {
  background:
    linear-gradient(90deg, rgba(174, 56, 45, 0.11), transparent 22%),
    rgba(247, 242, 228, 0.54);
  border-bottom: 1px solid rgba(86, 72, 55, 0.14);
  border-left: 3px solid rgba(166, 58, 48, 0.32);
  margin-bottom: 1.5rem;
  padding: 1rem 0 1.1rem 1.1rem;
  position: relative;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.reader-content > p:hover,
.reader-content > p.reader-hover-focus {
  background: linear-gradient(90deg, rgba(166, 58, 48, 0.06), rgba(211, 168, 77, 0.035) 42%, transparent);
  box-shadow: inset 3px 0 rgba(166, 58, 48, 0.34);
}

.reader-parallel-block:hover,
.reader-parallel-block.reader-hover-focus {
  background:
    linear-gradient(90deg, rgba(174, 56, 45, 0.15), transparent 30%),
    rgba(249, 244, 230, 0.72);
  border-left-color: rgba(166, 58, 48, 0.62);
}

.reader-content > p.reader-read-focus,
.reader-parallel-block.reader-read-focus {
  animation: reader-cinnabar-note 920ms ease;
}

.reader-parallel-block::before {
  color: rgba(114, 98, 73, 0.52);
  content: attr(data-paragraph);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.64rem;
  font-weight: 900;
  left: -3rem;
  line-height: 1;
  position: absolute;
  text-align: right;
  top: 1.35rem;
  width: 2.5rem;
}

.reader-content .reader-original,
.reader-content .reader-translation {
  margin: 0;
}

.reader-content .reader-original {
  color: #2f281f;
  font-size: 1.02em;
  white-space: pre-line;
}

.reader-content .reader-original::before {
  color: #7d342b;
  content: "原文";
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0;
  margin-right: 0.72rem;
  transform: translateY(-0.08em);
}

.reader-content .reader-translation {
  background: rgba(235, 224, 197, 0.52);
  border-left: 2px solid rgba(196, 143, 54, 0.62);
  color: #5d5142;
  font-size: 0.9em;
  line-height: 1.82;
  margin-top: 0.75rem;
  padding: 0.72rem 0.92rem;
}

.reader-content .reader-translation::before {
  color: #9a3a2e;
  content: "白话";
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0;
  margin-right: 0.72rem;
  transform: translateY(-0.08em);
}

@keyframes reader-open-wash {
  from {
    filter: blur(4px);
    opacity: 0;
    transform: translateY(14px);
  }

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

@keyframes reader-seal-bloom {
  0% {
    opacity: 0;
    transform: rotate(4deg) scale(0.9);
  }

  54% {
    opacity: 0.18;
  }

  100% {
    opacity: var(--reader-seal-opacity);
    transform: rotate(8deg) scale(1);
  }
}

@keyframes reader-cinnabar-note {
  0% {
    box-shadow: inset 0 0 0 rgba(166, 58, 48, 0);
  }

  42% {
    box-shadow:
      inset 4px 0 rgba(166, 58, 48, 0.72),
      0 10px 30px rgba(119, 72, 41, 0.08);
  }

  100% {
    box-shadow: inset 3px 0 rgba(166, 58, 48, 0.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reader-progress span {
    transition: none;
  }

  .focus-reader.is-opening .reader-toolbar,
  .focus-reader.is-opening .reader-layout,
  .focus-reader.is-opening .reader-navigation,
  .focus-reader.is-opening::before,
  .reader-content > p.reader-read-focus,
  .reader-parallel-block.reader-read-focus,
  .reading-companion.is-thinking .companion-avatar,
  .reading-companion.is-awake .companion-avatar,
  .companion-fireflies i {
    animation: none;
  }
}

.reader-inline-notes {
  background: rgba(255, 252, 239, 0.72);
  border: 1px solid rgba(166, 58, 48, 0.18);
  margin-top: 0.85rem;
  padding: 0;
}

.reader-inline-notes summary {
  color: #7d342b;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.45;
  list-style-position: inside;
  padding: 0.62rem 0.8rem;
}

.reader-inline-notes > div {
  display: grid;
  gap: 8px;
  padding: 0 0.8rem 0.82rem;
}

.reader-inline-notes article {
  background: rgba(238, 229, 205, 0.62);
  border-left: 3px solid rgba(196, 143, 54, 0.72);
  padding: 9px 11px;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.reader-inline-notes article.is-focused,
.reader-baihua-notes article.is-focused {
  background: rgba(231, 211, 169, 0.82);
  border-left-color: var(--cinnabar);
  box-shadow: inset 0 0 0 1px rgba(184, 58, 47, 0.22);
}

.reader-inline-notes article div {
  align-items: baseline;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.reader-inline-notes article p {
  color: #4b4136;
  font-size: 0.83rem;
  line-height: 1.68;
  margin: 6px 0 0;
}

.reader-content p[data-paragraph]::before {
  color: #a99b87;
  content: attr(data-paragraph);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.64rem;
  left: -34px;
  line-height: 1;
  position: absolute;
  top: 0.9em;
}

.reader-term-mark {
  background: transparent;
  border: 0;
  border-bottom: 2px solid rgba(166, 58, 48, 0.66);
  color: inherit;
  cursor: pointer;
  font: inherit;
  line-height: inherit;
  padding: 0 1px 1px;
  position: relative;
  text-decoration: none;
  text-underline-offset: 0.2em;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.reader-term-mark:hover,
.reader-term-mark:focus-visible,
.reader-term-mark.is-popover-open {
  background: linear-gradient(180deg, transparent 54%, rgba(201, 157, 71, 0.24) 54%);
  border-bottom-color: var(--cinnabar);
  color: #7c2d26;
  outline: none;
}

.reader-gloss-popover {
  background:
    linear-gradient(180deg, rgba(255, 252, 239, 0.98), rgba(243, 235, 214, 0.98));
  border: 1px solid rgba(166, 58, 48, 0.22);
  box-shadow: 0 18px 42px rgba(56, 38, 22, 0.22);
  color: #3b3127;
  display: grid;
  gap: 7px;
  max-width: min(310px, calc(100vw - 28px));
  padding: 12px 13px 13px;
  position: absolute;
  z-index: 5;
}

.reader-gloss-popover[hidden] {
  display: none;
}

.reader-gloss-popover strong {
  color: #8c3229;
  font-size: 1rem;
}

.reader-gloss-popover > span {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.68rem;
  font-weight: 900;
}

.reader-gloss-popover p {
  color: #4b4136;
  font-size: 0.9rem;
  line-height: 1.72;
  margin: 0;
}

.reader-gloss-popover div {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 2px;
}

.reader-gloss-popover button {
  background: transparent;
  border: 1px solid rgba(86, 72, 55, 0.28);
  border-radius: 4px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  min-height: 30px;
  padding: 0 10px;
}

.reader-gloss-popover button:first-child {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper-strong);
}

.reader-note-mark {
  border-bottom-color: rgba(184, 58, 47, 0.82);
}

.reader-term-number {
  background: linear-gradient(135deg, #a83c30, #d3a84d);
  border: 1px solid rgba(255, 244, 207, 0.72);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(104, 39, 31, 0.2);
  color: #fff8e6;
  display: inline-grid;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.52em;
  font-weight: 900;
  height: 1.42em;
  line-height: 1;
  margin-left: 0.14em;
  min-width: 1.42em;
  padding: 0 0.26em;
  place-items: center;
  transform: translateY(-0.56em);
  vertical-align: baseline;
}

.reader-notes {
  border-top: 4px solid var(--cinnabar);
  max-height: calc(100dvh - 116px);
  overscroll-behavior: contain;
  overflow: auto;
  padding-top: 18px;
  position: sticky;
  scrollbar-color: rgba(142, 106, 54, 0.4) transparent;
  scrollbar-width: thin;
  top: 82px;
}

.reader-notes p {
  color: #4b4136;
  margin: 14px 0 20px;
}

.reader-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}

.reader-journal {
  background:
    linear-gradient(135deg, rgba(255, 252, 238, 0.86), rgba(236, 225, 199, 0.68));
  border: 1px solid rgba(86, 72, 55, 0.16);
  border-left: 3px solid rgba(166, 58, 48, 0.64);
  display: grid;
  gap: 11px;
  margin: 0 0 26px;
  padding: 14px;
}

.reader-journal-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reader-journal label {
  display: grid;
  gap: 5px;
}

.reader-journal label span {
  color: #7c6b54;
  font-size: 0.72rem;
  font-weight: 900;
}

.reader-journal textarea {
  line-height: 1.58;
  min-height: 58px;
  padding: 8px 10px;
  resize: vertical;
}

.reader-journal input {
  min-height: 38px;
  padding: 0 10px;
}

.reader-journal-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.reader-journal-feedback {
  color: #8f332a;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.55;
  margin: 0;
  min-height: 1.4em;
}

.reader-journal-recent {
  border-top: 1px solid rgba(86, 72, 55, 0.14);
  display: grid;
  gap: 7px;
  padding-top: 10px;
}

.reader-journal-recent:empty {
  display: none;
}

.reader-journal-recent > span {
  color: #7c6b54;
  font-size: 0.72rem;
  font-weight: 900;
}

.reader-journal-recent article {
  background: rgba(255, 250, 232, 0.48);
  border-left: 2px solid rgba(196, 143, 54, 0.6);
  padding: 7px 9px;
}

.reader-journal-recent small {
  color: #8f332a;
  font-size: 0.66rem;
  font-weight: 900;
}

.reader-journal-recent p {
  color: #4d4033;
  font-size: 0.78rem;
  line-height: 1.58;
  margin: 4px 0 0;
}

.reader-study {
  border-top: 1px solid var(--line);
  margin-top: 26px;
  padding-top: 22px;
}

.reader-baihua {
  border-top: 1px solid rgba(86, 72, 55, 0.18);
  margin-top: 24px;
  padding-top: 20px;
}

.reader-subworks {
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
  padding-bottom: 22px;
}

.reader-subworks > div:last-child {
  display: grid;
  gap: 6px;
  max-height: 238px;
  overflow: auto;
  padding-right: 4px;
}

.reader-subworks button {
  background: rgba(231, 222, 204, 0.58);
  border: 1px solid transparent;
  border-radius: 4px;
  color: #4b4136;
  font-family: "Noto Serif SC", serif;
  font-weight: 800;
  line-height: 1.45;
  min-height: 38px;
  padding: 7px 10px;
  text-align: left;
  width: 100%;
}

.reader-subworks button:hover,
.reader-subworks button.is-active {
  background: rgba(184, 58, 47, 0.1);
  border-color: rgba(184, 58, 47, 0.34);
  color: var(--cinnabar);
}

.reader-study > span,
.reader-citation > span {
  color: var(--muted);
  display: block;
  font-size: 0.82rem;
  font-weight: 900;
  margin-bottom: 12px;
}

.reader-pdf-note-section {
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
  padding-bottom: 24px;
}

.reader-baihua-source {
  background: rgba(231, 222, 204, 0.48);
  border-left: 3px solid rgba(196, 143, 54, 0.72);
  font-size: 0.82rem;
  line-height: 1.65;
  margin: 0 0 12px;
  padding: 9px 11px;
}

.reader-note-heading {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.reader-note-heading span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.reader-note-heading strong {
  color: var(--cinnabar);
  font-size: 0.78rem;
}

.reader-pdf-notes {
  display: grid;
  gap: 8px;
}

.reader-baihua-notes {
  display: grid;
  gap: 6px;
  max-height: none;
  overflow: visible;
  padding-right: 6px;
}

.reader-pdf-notes article,
.reader-baihua-notes article {
  background: rgba(223, 211, 186, 0.55);
  border-left: 3px solid rgba(166, 58, 48, 0.52);
  padding: 10px 12px;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.reader-baihua-notes article {
  background: rgba(246, 239, 220, 0.72);
  border-left-color: rgba(196, 143, 54, 0.66);
  padding: 8px 10px;
}

.reader-baihua-notes .reader-note-number {
  background: rgba(147, 55, 45, 0.12);
  color: #873329;
}

.reader-baihua-notes article p {
  font-size: 0.8rem;
  line-height: 1.58;
  margin-top: 4px;
}

.reader-pdf-notes article.is-focused {
  background: rgba(231, 211, 169, 0.82);
  border-left-color: var(--cinnabar);
  box-shadow: inset 0 0 0 1px rgba(184, 58, 47, 0.22);
}

.reader-pdf-notes article div,
.reader-baihua-notes article div {
  align-items: baseline;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.reader-note-title {
  align-items: baseline;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.reader-note-number {
  background: linear-gradient(135deg, #a83c30, #d8aa4d);
  border-radius: 999px;
  color: #fff7df;
  flex: 0 0 auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.66rem;
  line-height: 1;
  padding: 4px 7px;
}

.reader-pdf-notes article small {
  color: var(--muted);
  font-size: 0.68rem;
  flex: 0 0 auto;
}

.reader-pdf-notes article p,
.reader-baihua-notes article p {
  font-size: 0.83rem;
  line-height: 1.68;
  margin: 6px 0 0;
}

.reader-pdf-note-section > button,
.reader-baihua > button {
  background: transparent;
  border: 1px solid rgba(86, 72, 55, 0.28);
  border-radius: 4px;
  color: var(--ink);
  font-weight: 900;
  margin-top: 12px;
  min-height: 38px;
  padding: 0 14px;
  width: 100%;
}

.reader-facts {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 28px;
}

.reader-mobile-facts {
  display: none;
}

.reader-facts div {
  border-left: 2px solid var(--cinnabar);
  min-width: 0;
  padding-left: 8px;
}

.reader-facts strong,
.reader-facts small {
  display: block;
}

.reader-facts strong {
  font-size: 0.92rem;
}

.reader-facts small {
  color: var(--muted);
  font-size: 0.68rem;
  margin-top: 3px;
}

.reader-terms {
  display: grid;
  gap: 9px;
}

.reader-terms article {
  background: rgba(231, 222, 204, 0.58);
  border-left: 3px solid transparent;
  padding: 10px 12px;
  transition: border-color 160ms ease, background 160ms ease;
}

.reader-terms article.is-focused {
  background: rgba(231, 211, 169, 0.78);
  border-left-color: var(--cinnabar);
}

.reader-terms article div {
  align-items: baseline;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.reader-terms article small {
  color: var(--muted);
  font-size: 0.68rem;
}

.reader-terms article p,
.reader-terms-empty {
  font-size: 0.82rem;
  line-height: 1.65;
  margin: 5px 0 0;
}

.reader-citation {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 20px;
}

.reader-citation p {
  font-family: "Noto Serif SC", serif;
  font-size: 0.88rem;
  line-height: 1.7;
}

.reader-citation button {
  background: var(--ink);
  border: 0;
  border-radius: 4px;
  color: var(--paper-strong);
  font-weight: 900;
  min-height: 38px;
  padding: 0 14px;
}

.reader-keywords span {
  background: #e8e0d0;
  border-radius: 8px;
  color: #4b4136;
  font-size: 0.86rem;
  font-weight: 800;
  padding: 7px 10px;
}

.reader-source-note {
  display: block;
  color: var(--cinnabar);
  font-weight: 900;
  line-height: 1.6;
}

.reader-navigation {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 auto;
  max-width: 1180px;
  padding: 22px clamp(20px, 5vw, 70px) 34px;
}

.reader-navigation button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 900;
  min-height: 48px;
}

.reader-navigation button:disabled {
  cursor: default;
  opacity: 0.35;
}

.reader-floating-view-toggle {
  background: rgba(246, 240, 224, 0.9);
  border: 1px solid rgba(86, 72, 55, 0.16);
  box-shadow: 0 12px 30px rgba(56, 38, 22, 0.12);
  display: none;
  gap: 3px;
  padding: 4px;
  position: fixed;
  right: clamp(18px, 4vw, 58px);
  top: clamp(96px, 13vh, 138px);
  z-index: 6;
}

body.is-reader-open .reader-floating-view-toggle {
  display: flex;
}

.reader-floating-view-toggle button {
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: #716556;
  font-size: 0.78rem;
  font-weight: 900;
  min-height: 32px;
  padding: 0 10px;
}

.reader-floating-view-toggle button.is-active {
  background: var(--ink);
  color: var(--paper-strong);
}

.reading-companion {
  align-items: end;
  display: grid;
  gap: 2px;
  grid-template-columns: auto minmax(0, 210px);
  pointer-events: none;
  position: fixed;
  z-index: 18;
}

.reader-companion {
  bottom: clamp(72px, 7vw, 112px);
  left: clamp(8px, 2.6vw, 34px);
  z-index: 5;
}

.companion-toggle,
.companion-panel {
  pointer-events: auto;
}

.companion-toggle {
  background:
    radial-gradient(circle at 52% 48%, rgba(255, 250, 225, 0.9), rgba(178, 139, 221, 0.18) 38%, rgba(211, 168, 77, 0.16) 54%, transparent 74%);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  height: 136px;
  padding: 0;
  place-items: center;
  position: relative;
  width: 136px;
}

.companion-toggle::after {
  background:
    radial-gradient(circle, rgba(255, 246, 207, 0.72), transparent 62%);
  content: "";
  inset: 16px;
  opacity: 0.74;
  position: absolute;
  transform: scale(0.88);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: -1;
}

.companion-avatar {
  background: url("assets/nine-tail-fox-jade-purple-cutout.png") center / contain no-repeat;
  filter: drop-shadow(0 16px 20px rgba(60, 38, 22, 0.2));
  display: block;
  height: 132px;
  position: relative;
  transform-origin: 50% 82%;
  transition: filter 180ms ease, transform 180ms ease;
  width: 132px;
}

.companion-toggle:hover::after,
.companion-toggle:focus-visible::after,
.reading-companion.is-open .companion-toggle::after {
  opacity: 1;
  transform: scale(1);
}

.companion-toggle:hover .companion-avatar,
.companion-toggle:focus-visible .companion-avatar,
.reading-companion.is-open .companion-avatar {
  filter: drop-shadow(0 16px 22px rgba(110, 47, 38, 0.26));
  transform: translateY(-3px) scale(1.035);
}

.companion-fireflies {
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.companion-fireflies i {
  animation: firefly-glow 2.8s ease-in-out infinite;
  background: #f5d469;
  border-radius: 999px;
  box-shadow:
    0 0 8px rgba(245, 212, 105, 0.85),
    0 0 18px rgba(245, 212, 105, 0.38);
  height: 5px;
  opacity: 0.32;
  position: absolute;
  width: 5px;
}

.companion-fireflies i:nth-child(1) {
  left: 18px;
  top: 30px;
}

.companion-fireflies i:nth-child(2) {
  animation-delay: 0.7s;
  background: #b995ff;
  box-shadow:
    0 0 8px rgba(185, 149, 255, 0.82),
    0 0 18px rgba(185, 149, 255, 0.38);
  right: 20px;
  top: 46px;
}

.companion-fireflies i:nth-child(3) {
  animation-delay: 1.2s;
  background: #88e0c9;
  bottom: 30px;
  box-shadow:
    0 0 8px rgba(136, 224, 201, 0.82),
    0 0 18px rgba(136, 224, 201, 0.34);
  left: 30px;
}

.companion-fireflies i:nth-child(4) {
  animation-delay: 1.8s;
  bottom: 42px;
  right: 30px;
}

.companion-fireflies i:nth-child(5) {
  animation-delay: 2.25s;
  background: #d8b0ff;
  box-shadow:
    0 0 8px rgba(216, 176, 255, 0.82),
    0 0 18px rgba(216, 176, 255, 0.34);
  left: 58px;
  top: 10px;
}

.companion-panel {
  background:
    linear-gradient(90deg, rgba(166, 58, 48, 0.055), transparent 18%, transparent 82%, rgba(196, 143, 54, 0.055)),
    rgba(246, 240, 224, 0.76);
  border: 1px solid rgba(86, 72, 55, 0.14);
  box-shadow: 0 16px 34px rgba(56, 38, 22, 0.11);
  color: #3d3128;
  max-width: 210px;
  opacity: 0;
  padding: 12px 13px 13px;
  backdrop-filter: blur(5px);
  transform: translateX(6px) translateY(8px) scale(0.96);
  transform-origin: left bottom;
  transition: opacity 180ms ease, transform 180ms ease;
  visibility: hidden;
}

.reader-companion .companion-panel {
  transform: translateX(-6px) translateY(8px) scale(0.96);
  transform-origin: right bottom;
}

.reading-companion.is-open .companion-panel {
  opacity: 1;
  transform: translateX(0) translateY(0) scale(1);
  visibility: visible;
}

.companion-head {
  align-items: baseline;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.companion-head strong {
  color: #7d342b;
  font-family: "Noto Serif SC", serif;
  font-size: 0.96rem;
}

.companion-head span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  white-space: nowrap;
}

.companion-panel p {
  font-family: "Noto Serif SC", serif;
  font-size: 0.88rem;
  line-height: 1.68;
  margin: 8px 0 10px;
}

.companion-actions {
  display: flex;
  gap: 7px;
  justify-content: flex-end;
}

.companion-actions button {
  background: rgba(231, 222, 204, 0.76);
  border: 1px solid rgba(86, 72, 55, 0.18);
  border-radius: 999px;
  color: #513c2f;
  font-family: "Noto Serif SC", serif;
  font-size: 0.82rem;
  font-weight: 900;
  height: 30px;
  padding: 0;
  width: 30px;
}

.companion-actions button:hover,
.companion-actions button:focus-visible {
  background: rgba(166, 58, 48, 0.12);
  border-color: rgba(166, 58, 48, 0.42);
  color: var(--cinnabar);
  outline: none;
}

.reading-companion.is-thinking .companion-avatar,
.reading-companion.is-awake .companion-avatar {
  animation: companion-fox-step 720ms ease;
}

@keyframes companion-fox-step {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }

  35% {
    transform: translateY(-8px) rotate(-2deg) scale(1.035);
  }

  70% {
    transform: translateY(-2px) rotate(2deg) scale(1.01);
  }
}

@keyframes firefly-glow {
  0%,
  100% {
    opacity: 0.18;
    transform: translate3d(0, 0, 0) scale(0.72);
  }

  42% {
    opacity: 0.92;
    transform: translate3d(6px, -8px, 0) scale(1.12);
  }

  68% {
    opacity: 0.38;
    transform: translate3d(-3px, -12px, 0) scale(0.86);
  }
}

body.mode-poetry {
  --cinnabar: #9f4f39;
  --jade: #376f76;
  --gold: #b8a24a;
}

body.mode-memorial {
  --cinnabar: #8f2f28;
  --jade: #49634f;
  --gold: #ba8b37;
}

@media (max-width: 980px) {
  body {
    padding-bottom: 78px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .reader-toolbar {
    gap: 10px;
  }

  .reader-breadcrumb {
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav {
    display: none;
  }

  .mobile-jump-nav {
    align-items: center;
    backdrop-filter: blur(20px);
    background:
      linear-gradient(180deg, rgba(255, 252, 241, 0.94), rgba(235, 228, 207, 0.9));
    border: 1px solid rgba(90, 74, 48, 0.16);
    border-radius: 999px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 18px 50px rgba(35, 30, 22, 0.22);
    display: grid;
    gap: 2px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    left: 12px;
    padding: 5px;
    position: fixed;
    right: 12px;
    z-index: 28;
  }

  .mobile-jump-nav a {
    align-items: center;
    border-radius: 999px;
    color: #3e362c;
    display: grid;
    gap: 1px;
    justify-items: center;
    min-height: 48px;
    padding: 4px 0;
  }

  .mobile-jump-nav a:active,
  .mobile-jump-nav a:focus-visible {
    background: rgba(181, 58, 48, 0.12);
    color: #8f3029;
  }

  .mobile-jump-nav span {
    align-items: center;
    background: rgba(28, 24, 18, 0.08);
    border-radius: 999px;
    display: inline-flex;
    font-family: "Noto Serif SC", serif;
    font-size: 0.76rem;
    font-weight: 900;
    height: 24px;
    justify-content: center;
    width: 24px;
  }

  .mobile-jump-nav em {
    font-size: 0.66rem;
    font-style: normal;
    font-weight: 900;
    line-height: 1.1;
    white-space: nowrap;
  }

  .reader,
  .reader-layout,
  .output-grid,
  .library-heading,
  .library-layout,
  .map,
  .notebook-heading,
  .workbench-portal-section,
  .flow-steps {
    grid-template-columns: 1fr;
  }

  .notebook-heading > p {
    max-width: none;
  }

  .reader-notes {
    max-height: none;
    overflow: visible;
    position: static;
  }

  .reading-companion {
    display: none;
  }

  .library-heading p:last-child {
    grid-column: auto;
  }

  .workbench-portal-preview {
    min-height: 320px;
  }

  .article-detail {
    position: static;
  }

  .reader {
    gap: 18px;
    min-height: auto;
  }

  .focus-reader::before {
    opacity: 0.06;
    right: 18px;
    top: 84px;
  }

  .focus-reader[data-reader-view="study"]::before {
    opacity: 0.11;
  }

  .focus-reader::after {
    height: 150px;
    opacity: 0.08;
    right: 18px;
    top: 88px;
    width: 178px;
  }

  .hero-verse {
    margin-left: 0;
    white-space: normal;
  }

  .control-panel {
    align-self: stretch;
  }

  .volume-atlas {
    min-height: 0;
  }

  .archive-scene {
    left: auto;
    min-width: 0;
    transform: none;
    width: 100%;
  }

  .author-map-shell {
    height: 440px;
    min-height: 0;
    width: 100%;
  }

  .genre-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .realm-title h2 {
    font-size: 3.6rem;
  }
}

@media (max-width: 640px) {
  body {
    padding-bottom: 82px;
  }

  body.is-reader-open {
    padding-bottom: 0;
  }

  .topbar {
    padding: 12px 16px;
  }

  .brand span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ghost-button {
    font-size: 0.84rem;
  }

  .reader {
    padding-top: 92px;
  }

  .reader-breadcrumb {
    display: none;
  }

  .reader-toolbar {
    background: transparent;
    border-bottom: 0;
    left: 0;
    padding: 10px 14px;
    pointer-events: none;
    position: fixed;
    right: 0;
    top: 0;
    justify-content: flex-end;
    z-index: 12;
  }

  .focus-reader {
    border-radius: 0;
    height: 100dvh;
    inset: 0;
    max-height: 100dvh;
    max-width: 100vw;
    width: 100vw;
  }

  .reader-layout {
    gap: 22px;
    padding: 86px 18px calc(38px + env(safe-area-inset-bottom));
  }

  .reader-text {
    max-width: none;
    width: 100%;
  }

  .reader-text h2 {
    font-size: clamp(2.2rem, 13vw, 3.4rem);
    line-height: 1.05;
  }

  .reader-toolbar-actions {
    gap: 6px;
    pointer-events: none;
  }

  .reader-toolbar .reader-view-toggle,
  .reader-toolbar .reader-script-toggle {
    display: none;
  }

  .reader-close {
    box-shadow: 0 10px 24px rgba(45, 32, 22, 0.2);
    pointer-events: auto;
  }

  .reader-entry-card {
    gap: 12px;
    margin-top: 18px;
    padding: 14px;
  }

  .reader-entry-copy strong {
    font-size: 0.98rem;
  }

  .reader-entry-copy p {
    font-size: 0.84rem;
    line-height: 1.64;
  }

  .reader-entry-stats {
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reader-entry-stats div {
    padding: 8px 9px;
  }

  .reader-entry-tags span {
    font-size: 0.62rem;
    padding: 4px 7px;
  }

  .reader-entry-actions button {
    width: 100%;
  }

  .reader-journal {
    margin-bottom: 22px;
    padding: 13px;
  }

  .reader-journal-actions {
    grid-template-columns: 1fr;
  }

  .reader-journal-actions button {
    min-height: 42px;
  }

  .notebook-section {
    gap: 16px;
    padding: 82px 16px calc(104px + env(safe-area-inset-bottom));
  }

  .notebook-heading {
    gap: 10px;
  }

  .notebook-heading h2 {
    font-size: clamp(2.35rem, 14vw, 3.6rem);
  }

  .notebook-heading > p {
    font-size: 0.92rem;
    line-height: 1.72;
  }

  .notebook-tools,
  .notebook-card,
  .notebook-empty {
    padding: 14px;
  }

  .notebook-search-row {
    grid-template-columns: 1fr;
  }

  .notebook-filter-row {
    gap: 6px;
  }

  .notebook-filter-row button {
    flex: 1 1 calc(33.333% - 6px);
    min-width: 74px;
  }

  .notebook-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .notebook-card-actions button {
    min-height: 40px;
  }

  .reader-mobile-facts {
    display: none;
  }

  .reader-notes .reader-facts {
    display: none;
  }

  .focus-reader::before,
  .focus-reader::after,
  .reader-text::after {
    display: none;
  }

  .reader-floating-view-toggle {
    left: 14px;
    right: auto;
    top: 12px;
    z-index: 13;
  }

  .reader-floating-view-toggle button {
    font-size: 0.72rem;
    min-height: 30px;
    padding: 0 8px;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .search-row button {
    min-height: 44px;
  }

  .filter-line {
    align-items: start;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  h1 {
    font-size: clamp(2.35rem, 12vw, 3.15rem);
    line-height: 1;
    padding-inline: 2px;
  }

  .reader-shade {
    background: linear-gradient(180deg, rgba(249, 247, 239, 0.78) 0%, rgba(249, 247, 239, 0.68) 62%, rgba(249, 247, 239, 0.18) 100%);
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .volume-atlas {
    background:
      linear-gradient(180deg, rgba(17, 24, 22, 0.92), rgba(28, 33, 26, 0.96)),
      #111816;
    min-height: 0;
    overflow: visible;
    padding: 86px 14px 104px;
  }

  .archive-scene {
    aspect-ratio: auto;
    display: grid;
    gap: 14px;
    margin: 0;
    overflow: visible;
    width: 100%;
  }

  .archive-scene-image {
    height: 100%;
    object-fit: cover;
    opacity: 0.18;
  }

  .archive-vignette {
    background:
      linear-gradient(180deg, rgba(8, 15, 14, 0.18), rgba(8, 15, 14, 0.58));
  }

  .incense-smoke,
  .incense-wisps,
  .archive-shelf,
  .archive-volume-hint {
    display: none;
  }

  .archive-title,
  .archive-index,
  .archive-preface,
  .scroll-paper {
    left: auto;
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    width: 100%;
  }

  .archive-title {
    padding: 0 4px 2px;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
    z-index: 3;
  }

  .archive-title p {
    font-size: 0.68rem;
    margin-bottom: 8px;
  }

  .archive-title h2 {
    font-size: clamp(2.35rem, 11vw, 3.2rem);
    line-height: 1.02;
  }

  .zhaoming-seal {
    height: 48px;
    margin-top: 10px;
    width: 48px;
  }

  .archive-index {
    backdrop-filter: blur(14px);
    gap: 9px;
    grid-template-rows: auto auto auto;
    height: auto;
    max-height: none;
    overflow: visible;
    overscroll-behavior: contain;
    padding: 12px;
    position: sticky;
    top: 68px;
    transition: padding 260ms ease, box-shadow 260ms ease, border-color 260ms ease;
    -webkit-overflow-scrolling: touch;
    z-index: 18;
  }

  .archive-index-heading {
    gap: 10px;
  }

  .archive-index-heading strong {
    flex: 0 0 auto;
  }

  .archive-index-heading output {
    font-size: 0.68rem;
    flex: 1 1 auto;
    max-width: none;
    min-width: 0;
  }

  .archive-index-toggle {
    display: none;
  }

  .archive-index-search {
    font-size: 0.92rem;
    height: 38px;
  }

  .archive-index-grid {
    gap: 5px;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    grid-template-rows: repeat(6, 32px);
  }

  .archive-index-button {
    border-radius: 4px;
    font-size: 0.72rem;
    min-height: 32px;
  }

  .archive-preface {
    align-items: center;
    display: inline-flex;
    font-size: 0.92rem;
    height: 40px;
    justify-content: center;
    justify-self: start;
    width: 72px;
    z-index: 4;
  }

  .scroll-paper {
    background:
      linear-gradient(90deg, rgba(255, 250, 231, 0.86), rgba(239, 229, 199, 0.78)),
      rgba(246, 239, 218, 0.94);
    border: 1px solid rgba(188, 162, 105, 0.55);
    box-shadow: 0 18px 42px rgba(4, 9, 8, 0.25);
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
    height: auto;
    padding: 16px;
    transition: transform 320ms cubic-bezier(0.22, 0.84, 0.24, 1), box-shadow 260ms ease;
    z-index: 4;
  }

  .scroll-paper-heading::before,
  .scroll-paper-rule,
  .scroll-paper-meta,
  .scroll-paper-aura {
    display: none;
  }

  .scroll-paper-heading > span {
    font-size: 0.72rem;
  }

  .scroll-paper-heading > strong {
    font-size: clamp(1.9rem, 9vw, 2.7rem);
    margin-bottom: 8px;
  }

  .scroll-paper-heading > p {
    font-size: 0.9rem;
    -webkit-line-clamp: 3;
  }

  .volume-work-list {
    gap: 2px;
    grid-template-columns: 1fr;
    max-height: min(48vh, 390px);
    overflow: auto;
    padding: 0 4px 6px 0;
  }

  .volume-work-list button {
    gap: 9px;
    min-height: 44px;
    padding: 8px 4px;
  }

  .volume-work-title {
    font-size: 1.08rem;
    line-height: 1.32;
  }

  .author-map-shell {
    height: 320px;
    min-height: 0;
  }

  .anthology-orbit {
    height: max(820px, 100svh);
    min-height: 820px;
  }

  .orbit-heading {
    left: 24px;
    max-width: calc(100% - 48px);
    top: 96px;
  }

  .orbit-heading h2 {
    font-size: clamp(3rem, 14vw, 3.8rem);
    margin-bottom: 12px;
  }

  .orbit-heading p:last-child {
    font-size: 0.96rem;
    line-height: 1.62;
  }

  .orbit-filters {
    left: 24px;
    top: 260px;
    transform: none;
  }

  .orbit-panel {
    bottom: 58px;
    left: 24px;
    padding: 17px 18px 18px;
    right: 24px;
    width: auto;
  }

  .orbit-panel strong {
    font-size: 1.85rem;
  }

  .orbit-panel blockquote {
    font-size: 0.98rem;
  }

  .orbit-count {
    bottom: 22px;
    left: 24px;
  }

  .map-heading h2 {
    font-size: 2.8rem;
  }

  .birthplace-map {
    padding: 16px;
  }

  .birthplace-map-heading {
    align-items: start;
    display: grid;
  }

  .birthplace-map-heading h3 {
    font-size: 2.35rem;
  }

  .birthplace-map-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .birthplace-density-toggle {
    flex: 1 1 auto;
  }

  .birthplace-density-toggle button {
    flex: 1;
  }

  .birthplace-map-layout {
    grid-template-columns: 1fr;
  }

  .birthplace-map-canvas {
    min-height: 580px;
    transform: none;
  }

  .birthplace-feature-tip {
    bottom: 10px;
    font-size: 0.7rem;
    left: 10px;
    max-width: calc(100% - 20px);
  }

  .birthplace-marker {
    font-size: 0.64rem;
    min-height: 50px;
    transform: translate(-50%, -50%);
    width: 25px;
  }

  .birthplace-marker.is-minor {
    font-size: 0.5rem;
    min-height: 36px;
    width: 18px;
  }

  .birthplace-marker:hover,
  .birthplace-marker:focus-visible,
  .birthplace-marker.is-active {
    transform: translate(-50%, -50%) translateY(-4px) scale(1.06);
  }

  .geo-label {
    font-size: 0.66rem;
  }

  .birthplace-card {
    padding: 16px;
  }

  .feihua-game {
    padding: 16px;
  }

  .feihua-heading {
    align-items: start;
    display: grid;
  }

  .feihua-heading h3 {
    font-size: 2.35rem;
  }

  .feihua-scoreboard {
    justify-content: flex-start;
  }

  .feihua-layout {
    grid-template-columns: 1fr;
  }

  .feihua-stage {
    min-height: 560px;
  }

  .feihua-stream {
    inset: 8% 0;
  }

  .feihua-cup {
    height: 98px;
    padding: 9px 7px;
    width: 104px;
  }

  .feihua-cup strong {
    font-size: 0.7rem;
    max-width: 86px;
  }

  .feihua-cup small {
    font-size: 0.54rem;
  }

  .feihua-cup-word {
    font-size: 0.88rem;
    height: 26px;
    width: 26px;
  }

  .feihua-ripple {
    bottom: 10px;
    font-size: 0.72rem;
    left: 10px;
    max-width: calc(100% - 20px);
  }

  .feihua-panel {
    padding: 16px;
  }

  .map-author-status {
    max-width: 170px;
    padding: 6px 8px;
  }

  .map-hint {
    display: none;
  }

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

  .volume-atlas-copy h2 {
    font-size: clamp(2.25rem, 11vw, 3rem);
    line-height: 1.04;
    margin-bottom: 20px;
  }

  .volume-atlas-copy p:last-child {
    line-height: 1.75;
  }

  .poem-realm {
    height: max(760px, 100svh);
    min-height: 760px;
  }

  .realm-title {
    left: 20px;
    top: 92px;
  }

  .realm-title p {
    max-width: 210px;
  }

  .realm-title h2 {
    font-size: 2.7rem;
  }

  .realm-progress {
    right: 20px;
    top: 98px;
  }

  .realm-hud {
    gap: 10px;
    left: 20px;
    max-width: none;
    padding: 12px;
    right: 20px;
    top: 206px;
  }

  .realm-minimap {
    height: 68px;
  }

  .realm-compass {
    max-width: calc(100% - 32px);
    top: 70px;
  }

  .realm-action-tip {
    font-size: 0.8rem;
    top: calc(50% + 24px);
  }

  .realm-entry {
    bottom: 54px;
    left: 20px;
    max-width: calc(100% - 40px);
  }

  .poem-realm.has-touch .realm-entry,
  .poem-realm.has-touch .realm-verse {
    bottom: 166px;
  }

  .realm-entry strong {
    font-size: 1.2rem;
  }

  .realm-verse {
    max-width: calc(100% - 40px);
    padding: 11px 14px;
    width: calc(100% - 40px);
  }

  .realm-verse p {
    font-size: 1rem;
  }

  .realm-tools {
    bottom: 20px;
    right: 18px;
  }

  .poem-realm.has-touch .realm-tools {
    bottom: 132px;
  }

  .cloud-realm-title {
    left: 20px;
    max-width: calc(100% - 40px);
    top: 92px;
  }

  .cloud-realm-title h2 {
    font-size: 2.55rem;
  }

  .cloud-realm-panel {
    bottom: 78px;
    left: 20px;
    max-width: calc(100% - 40px);
    padding: 10px 12px;
  }

  .cloud-realm-entry {
    bottom: 142px;
    left: 20px;
  }

  .cloud-realm-tools {
    bottom: 22px;
    right: 18px;
  }

  .realm-joystick {
    bottom: 24px;
    left: 18px;
  }

  .volume-dock {
    bottom: 26px;
  }

  .reader-navigation {
    grid-template-columns: 1fr;
  }

  .reader-parallel-block {
    padding: 1.45rem 0.85rem 1rem;
  }

  .reader-parallel-block::before {
    left: 0.85rem;
    top: 0.65rem;
  }

  .reader-content .reader-translation {
    padding: 0.68rem 0.76rem;
  }

  .reader-gloss-popover {
    bottom: 14px;
    left: 14px !important;
    max-height: 42vh;
    overflow: auto;
    position: fixed;
    right: 14px;
    top: auto !important;
    width: auto;
  }

  .reader-subworks > div:last-child {
    max-height: 190px;
  }
}

@media (max-width: 640px) {
  .feihua-game {
    padding: 92px 16px 104px;
  }

  .feihua-stage {
    min-height: 520px;
  }

  .feihua-bank-left {
    height: 30%;
    left: -3%;
    top: 18%;
    width: 28%;
  }

  .feihua-bank-right {
    bottom: 12%;
    height: 30%;
    right: -4%;
    width: 28%;
  }

  .seat-one { left: 7%; top: 17%; }
  .seat-two { right: 7%; top: 19%; }
  .seat-three { left: 8%; bottom: 18%; }
  .seat-four { right: 7%; bottom: 18%; }

  .feihua-dance {
    bottom: 8%;
    gap: 14px;
  }

  .feihua-dance span {
    height: 62px;
    width: 40px;
  }

  .feihua-cup {
    height: 108px;
    width: 128px;
  }

  .feihua-cup strong {
    font-size: 0.76rem;
    max-width: 104px;
  }
}

.feihua-cup {
  background:
    linear-gradient(90deg, rgba(119, 83, 48, 0.24), transparent 7%, transparent 93%, rgba(119, 83, 48, 0.24)),
    linear-gradient(180deg, rgba(255, 252, 236, 0.97), rgba(235, 222, 188, 0.96));
  border-color: rgba(88, 63, 38, 0.28);
  box-shadow: 0 12px 26px rgba(46, 34, 23, 0.2), inset 0 0 0 5px rgba(255, 255, 242, 0.34);
  height: 226px;
  padding: 18px 34px 22px 24px;
  width: 132px;
}

.feihua-cup::before,
.feihua-cup::after {
  background:
    radial-gradient(circle at 10px 50%, #46311f 0 3px, transparent 4px),
    linear-gradient(90deg, #5a3e28, #a38051, #5a3e28);
  height: 9px;
}

.feihua-cup-word {
  background: rgba(255, 248, 223, 0.72);
  border-color: rgba(157, 59, 50, 0.22);
  font-size: 1rem;
  height: 30px;
  right: 10px;
  width: 30px;
}

.feihua-cup strong {
  font-size: 0.94rem;
  gap: 6px;
  line-height: 1.28;
  margin-left: 18px;
  margin-right: 22px;
}

.feihua-poem-column {
  max-height: 160px;
}

.feihua-cup small {
  border-right: 1px solid rgba(90, 63, 38, 0.16);
  bottom: 17px;
  color: rgba(65, 48, 32, 0.62);
  display: block;
  font-size: 0.56rem;
  font-weight: 900;
  left: 10px;
  line-height: 1.18;
  max-height: 168px;
  overflow: hidden;
  padding-right: 5px;
  position: absolute;
  top: 17px;
  writing-mode: vertical-rl;
}

@media (max-width: 640px) {
  .feihua-cup {
    height: 178px;
    padding: 14px 27px 18px 19px;
    width: 104px;
  }

  .feihua-cup-word {
    font-size: 0.86rem;
    height: 25px;
    right: 8px;
    width: 25px;
  }

  .feihua-cup strong {
    font-size: 0.76rem;
    gap: 4px;
    margin-left: 14px;
    margin-right: 18px;
  }

  .feihua-poem-column {
    max-height: 126px;
  }

  .feihua-cup small {
    bottom: 13px;
    font-size: 0.46rem;
    left: 7px;
    max-height: 128px;
    top: 13px;
  }
}

.feihua-scoreboard {
  align-items: stretch;
}

.feihua-keywords {
  max-height: 236px;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-color: rgba(112, 91, 56, 0.34) transparent;
  scrollbar-width: thin;
}

.feihua-keywords::-webkit-scrollbar {
  width: 7px;
}

.feihua-keywords::-webkit-scrollbar-thumb {
  background: rgba(112, 91, 56, 0.32);
  border-radius: 999px;
}

.feihua-keywords button {
  min-height: 36px;
}

.feihua-keywords .feihua-random-word {
  background: linear-gradient(180deg, rgba(255, 249, 226, 0.92), rgba(224, 199, 139, 0.82));
  border-color: rgba(146, 104, 46, 0.32);
  color: #7a4a21;
  grid-column: span 2;
  position: relative;
}

.feihua-keywords .feihua-random-word::after {
  content: "✦";
  font-size: 0.7rem;
  margin-left: 6px;
}

.feihua-keywords .feihua-random-word.is-spinning {
  animation: feihua-random-glow 520ms ease both;
}

.feihua-scoreboard span {
  display: inline-grid;
  gap: 2px;
  min-width: 54px;
  place-items: center;
}

.feihua-scoreboard .feihua-timer-pill {
  display: none;
}

.feihua-game.is-challenge-mode .feihua-scoreboard .feihua-timer-pill {
  display: inline-grid;
}

.feihua-game.is-challenge-mode .feihua-stage {
  box-shadow:
    inset 0 0 0 6px rgba(255, 251, 232, 0.26),
    inset 0 -80px 130px rgba(111, 83, 45, 0.14),
    0 34px 70px rgba(93, 47, 32, 0.22);
}

.feihua-mode-switch {
  background: rgba(93, 75, 48, 0.08);
  border: 1px solid rgba(90, 69, 43, 0.15);
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 6px;
}

.feihua-mode-switch button {
  background: rgba(255, 251, 235, 0.72);
  border: 1px solid rgba(78, 61, 39, 0.12);
  color: #423629;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 900;
  min-height: 42px;
}

.feihua-mode-switch button.is-active {
  background: #111;
  border-color: #111;
  color: #fff7df;
  box-shadow: 0 10px 22px rgba(36, 24, 15, 0.16);
}

.feihua-mode-note {
  color: rgba(65, 52, 36, 0.72);
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.45;
  margin: -5px 0 0;
}

.feihua-current {
  position: relative;
}

.feihua-current::after {
  background: linear-gradient(180deg, transparent, rgba(184, 68, 54, 0.42), transparent);
  content: "";
  inset: 10px auto 10px -1px;
  opacity: 0;
  position: absolute;
  transition: opacity 220ms ease;
  width: 3px;
}

.feihua-current.is-revealed {
  animation: feihua-current-reveal 1200ms ease both;
}

.feihua-current.is-revealed::after {
  opacity: 1;
}

.feihua-current.is-missed {
  background: linear-gradient(180deg, rgba(242, 231, 205, 0.82), rgba(226, 210, 177, 0.76));
  filter: saturate(0.82);
}

.feihua-hit-ripple {
  animation: feihua-hit-ripple 1400ms ease-out forwards;
  border: 2px solid rgba(255, 232, 150, 0.88);
  border-radius: 999px;
  box-shadow: 0 0 24px rgba(255, 228, 128, 0.7);
  height: 82px;
  pointer-events: none;
  position: absolute;
  transform: translate(-50%, -50%) scale(0.18);
  width: 82px;
  z-index: 7;
}

.feihua-hit-ripple::after {
  background: radial-gradient(circle, rgba(255, 246, 196, 0.9), transparent 62%);
  border-radius: inherit;
  content: "";
  inset: 18px;
  position: absolute;
}

.feihua-stage.has-missed-cup::after {
  animation: feihua-miss-wash 760ms ease both;
  background: linear-gradient(115deg, transparent, rgba(106, 128, 126, 0.2), transparent);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 6;
}

.feihua-game.is-challenge-mode .feihua-cup {
  animation:
    feihua-scroll-breathe 4.8s ease-in-out infinite,
    feihua-challenge-pulse 1.4s ease-in-out infinite;
}

@keyframes feihua-current-reveal {
  0% {
    opacity: 0.72;
    transform: translateY(8px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes feihua-hit-ripple {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.18);
  }

  35% {
    opacity: 0.86;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.3);
  }
}

@keyframes feihua-miss-wash {
  0% {
    opacity: 0;
    translate: -32px 0;
  }

  45% {
    opacity: 0.78;
  }

  100% {
    opacity: 0;
    translate: 48px 0;
  }
}

@keyframes feihua-challenge-pulse {
  0%,
  100% {
    box-shadow: 0 12px 26px rgba(46, 34, 23, 0.2), inset 0 0 0 5px rgba(255, 255, 242, 0.34);
  }

  50% {
    box-shadow: 0 16px 32px rgba(103, 48, 36, 0.24), 0 0 0 8px rgba(255, 227, 143, 0.18), inset 0 0 0 5px rgba(255, 255, 242, 0.36);
  }
}

@keyframes feihua-random-glow {
  0%,
  100% {
    filter: brightness(1);
    transform: translateY(0);
  }

  45% {
    filter: brightness(1.12) saturate(1.08);
    transform: translateY(-2px);
  }
}

@media (max-width: 640px) {
  .feihua-keywords {
    max-height: 182px;
  }

  .feihua-keywords button {
    min-height: 38px;
  }

  .feihua-scoreboard {
    justify-content: flex-start;
  }

  .feihua-scoreboard span {
    font-size: 0.72rem;
    min-width: 48px;
    padding: 7px 8px;
  }

  .feihua-mode-switch button {
    min-height: 40px;
  }

  .feihua-mode-note {
    font-size: 0.76rem;
  }

  .feihua-hit-ripple {
    height: 54px;
    width: 54px;
  }

  .volume-work-list button.has-guide {
    min-height: 90px;
  }

  .volume-work-guide {
    font-size: 0.7rem;
  }

  .volume-work-badges em {
    font-size: 0.55rem;
  }

  .article-plain-title {
    font-size: 0.88rem;
  }

  .article-genre-note {
    font-size: 0.74rem;
  }
}

@media (max-width: 640px) {
  .topbar {
    background: linear-gradient(180deg, rgba(8, 18, 28, 0.72), rgba(8, 18, 28, 0.18));
    border-bottom-color: rgba(255, 215, 133, 0.16);
    color: #fff3d6;
  }

  .brand {
    color: #fff5d8;
    text-shadow: 0 0 18px rgba(235, 176, 83, 0.28);
  }

  .brand-mark {
    background: linear-gradient(180deg, #fff0b8, #b84d32);
    color: #190d0a;
    box-shadow: 0 0 22px rgba(235, 176, 83, 0.42);
  }

  .ghost-button {
    color: #ffe8af;
    text-shadow: 0 0 14px rgba(235, 176, 83, 0.28);
  }

  .reader {
    background: #071724;
    isolation: isolate;
    min-height: 100svh;
    padding: 98px 18px calc(128px + env(safe-area-inset-bottom));
  }

  .reader::before,
  .reader::after {
    content: "";
    inset: 0;
    pointer-events: none;
    position: absolute;
  }

  .reader::before {
    background-image: url("assets/wenxuan-mobile-guoman-hero.webp");
    background-position: 52% 50%;
    background-size: cover;
    filter: saturate(1.08) contrast(1.04);
    transform: scale(1.01);
    z-index: 0;
  }

  .reader::after {
    background:
      radial-gradient(circle at 26% 18%, rgba(255, 230, 155, 0.34), transparent 20%),
      radial-gradient(circle at 80% 58%, rgba(180, 57, 44, 0.22), transparent 25%),
      linear-gradient(180deg, rgba(5, 12, 22, 0.26) 0%, rgba(5, 12, 22, 0.08) 34%, rgba(5, 12, 22, 0.42) 68%, rgba(5, 12, 22, 0.78) 100%),
      linear-gradient(90deg, rgba(3, 9, 16, 0.78) 0%, rgba(3, 9, 16, 0.3) 52%, rgba(3, 9, 16, 0.08) 100%);
    mix-blend-mode: normal;
    z-index: 1;
  }

  .reader-bg {
    display: none;
  }

  .reader-shade {
    background:
      linear-gradient(180deg, rgba(255, 238, 184, 0.08), rgba(10, 19, 30, 0.56)),
      radial-gradient(circle at 14% 26%, rgba(255, 212, 121, 0.24), transparent 23%);
    z-index: 1;
  }

  .hero-smoke {
    bottom: 19%;
    height: 48%;
    left: 5%;
    opacity: 0.92;
    width: 42%;
    z-index: 2;
  }

  .hero-smoke span {
    border-left-color: rgba(255, 219, 143, 0.26);
    filter: blur(5px);
  }

  .bamboo-drift {
    height: 54%;
    opacity: 0.8;
    right: -12%;
    top: 10%;
    width: 72%;
    z-index: 2;
  }

  .bamboo-drift span {
    background: rgba(255, 211, 118, 0.58);
    box-shadow: 0 0 12px rgba(255, 199, 98, 0.34);
  }

  .hero-copy {
    align-content: start;
    gap: 13px;
    max-width: 86%;
    padding-top: clamp(18px, 5svh, 56px);
    z-index: 3;
  }

  .hero-copy::before {
    background: linear-gradient(90deg, #f4d078 0 48px, #b74333 48px 86px, transparent 86px);
    box-shadow: 0 0 18px rgba(244, 208, 120, 0.54);
    height: 3px;
    width: 118px;
  }

  .reader .eyebrow {
    color: #f4d58f;
    font-size: 0.72rem;
    letter-spacing: 0;
    margin-bottom: 2px;
    text-shadow: 0 0 16px rgba(244, 198, 99, 0.46);
  }

  .reader h1 {
    color: #fff4cf;
    font-size: clamp(4.7rem, 22vw, 6.8rem);
    line-height: 0.88;
    max-width: 4.2em;
    text-shadow:
      0 2px 0 rgba(77, 29, 18, 0.88),
      0 0 22px rgba(255, 207, 101, 0.54),
      0 18px 38px rgba(0, 0, 0, 0.58);
  }

  .lede {
    color: rgba(255, 245, 219, 0.92);
    font-size: 0.98rem;
    line-height: 1.72;
    max-width: 19.5em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.78);
  }

  .hero-verse {
    color: #ffd77d;
    font-size: 1rem;
    line-height: 1.55;
    max-width: 16em;
    text-shadow: 0 0 16px rgba(255, 203, 99, 0.46), 0 2px 12px rgba(0, 0, 0, 0.72);
  }

  .rhyme-portal {
    align-self: end;
    backdrop-filter: blur(18px);
    background:
      linear-gradient(180deg, rgba(18, 30, 43, 0.72), rgba(18, 18, 23, 0.62)),
      radial-gradient(circle at 15% 0%, rgba(255, 209, 103, 0.22), transparent 34%);
    border-color: rgba(255, 213, 128, 0.24);
    box-shadow: 0 22px 58px rgba(0, 0, 0, 0.38), inset 0 0 0 1px rgba(255, 238, 190, 0.08);
    color: #fff1d0;
    gap: 12px;
    margin-top: clamp(84px, 18svh, 180px);
    padding: 15px;
    z-index: 3;
  }

  .rhyme-portal .panel-head span,
  .portal-label {
    color: rgba(255, 230, 176, 0.72);
  }

  .rhyme-portal .panel-head strong,
  .classic-head strong {
    color: #ffd06f;
    text-shadow: 0 0 12px rgba(255, 196, 89, 0.38);
  }

  .portal-rhyme,
  .portal-selection p {
    color: rgba(255, 243, 216, 0.86);
  }

  .portal-selection {
    border-color: rgba(255, 217, 139, 0.2);
    min-height: 96px;
    padding: 11px 0;
  }

  .classic-head span {
    color: rgba(255, 214, 138, 0.76);
  }

  .mode-options {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .mode-options button {
    background: rgba(255, 237, 194, 0.12);
    border-color: rgba(255, 220, 144, 0.2);
    color: #ffe6aa;
    min-height: 38px;
  }

  .mode-options button.is-active {
    background: linear-gradient(180deg, #f6d37c, #a9362a);
    color: #170d09;
    box-shadow: 0 0 20px rgba(238, 187, 91, 0.34);
  }

  .portal-actions {
    grid-template-columns: 0.86fr 1.14fr;
  }

  .portal-actions button,
  .portal-actions .primary-button {
    border-radius: 6px;
    min-height: 44px;
  }

  .portal-actions .primary-button {
    background: linear-gradient(180deg, #ffe19a, #b83c2f);
    color: #180c08;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28), 0 0 20px rgba(255, 202, 105, 0.26);
  }

  .mobile-jump-nav {
    background:
      linear-gradient(180deg, rgba(19, 29, 42, 0.86), rgba(10, 15, 24, 0.82)),
      radial-gradient(circle at 50% 0%, rgba(255, 213, 128, 0.22), transparent 62%);
    border-color: rgba(255, 218, 150, 0.2);
  }

  .mobile-jump-nav a {
    color: rgba(255, 241, 210, 0.78);
  }

  .mobile-jump-nav span {
    background: rgba(255, 220, 142, 0.16);
    color: #ffdfa0;
  }

  .mobile-jump-nav a:active,
  .mobile-jump-nav a:focus-visible {
    background: rgba(255, 214, 123, 0.16);
    color: #ffe6aa;
  }
}
