:root {
  --ink: #183043;
  --ink-soft: #62717c;
  --paper: #f5f0e7;
  --paper-deep: #ebe3d6;
  --white: #fffdf9;
  --night: #0b1926;
  --night-2: #10283a;
  --amber: #e2a85f;
  --vermillion: #b8553f;
  --line: rgba(37, 57, 70, 0.13);
  --shadow: 0 24px 70px rgba(19, 34, 45, 0.13);
  --radius: 24px;
  --ease-enter: cubic-bezier(.22, 1, .36, 1);
  --ease-exit: cubic-bezier(.4, 0, 1, 1);
  --motion-fast: 120ms;
  --motion-hover: 180ms;
  --motion-enter: 340ms;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 7% 0%, rgba(226, 168, 95, 0.13), transparent 30rem),
    linear-gradient(180deg, #f8f4ec, #f0e8dd);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  color: var(--ink-soft);
}

.boot-moon {
  font-size: 3rem;
  color: var(--amber);
  animation: float 2.2s ease-in-out infinite;
}

@keyframes float {
  50% { transform: translateY(-8px) rotate(-4deg); }
}

.site-shell {
  min-height: 100vh;
}

.topbar {
  width: min(1180px, calc(100% - 40px));
  height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.brand-button {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50% 50% 50% 12px;
  color: #fff7e9;
  background: linear-gradient(145deg, #18384d, #0a1825);
  box-shadow: 0 8px 24px rgba(13, 34, 49, 0.23);
  font-size: 1.25rem;
}

.nav-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.global-search {
  width: min(420px, 42vw);
  height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 14px;
  border: 1px solid rgba(37, 57, 70, 0.12);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.72);
  box-shadow: 0 7px 24px rgba(24, 48, 67, 0.035);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.global-search:focus-within {
  border-color: rgba(184, 85, 63, 0.4);
  background: rgba(255, 253, 249, 0.96);
  box-shadow: 0 9px 28px rgba(24, 48, 67, 0.08);
}

.global-search > span {
  color: var(--ink-soft);
  font-size: 1.1rem;
}

.global-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
}

.global-search button {
  min-width: 54px;
  align-self: stretch;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
}

.global-search button:hover {
  background: rgba(24, 48, 67, 0.07);
}

.storage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #55966d;
  box-shadow: 0 0 0 5px rgba(85, 150, 109, 0.12);
}

.hero {
  --hero-x: 0px;
  --hero-y: 0px;
  width: min(1180px, calc(100% - 40px));
  min-height: clamp(510px, 62vh, 590px);
  margin: 8px auto 0;
  position: relative;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  isolation: isolate;
  color: #f8f4ec;
  border-radius: 34px 34px 0 0;
  background: #071620;
  box-shadow: 0 34px 90px rgba(10, 27, 40, 0.27);
}

.hero-media {
  position: absolute;
  z-index: 0;
  inset: -2%;
  overflow: hidden;
  transform: translate3d(var(--hero-x), var(--hero-y), 0);
  transition: transform 420ms var(--ease-enter);
  pointer-events: none;
}

.hero-media::before,
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
}

.hero-media::before {
  inset: -2%;
  background: url("/assets/hero.png") 58% center / cover;
  transform: scale(1.035);
  animation: hero-breathe 15s ease-in-out infinite alternate;
}

.hero-media::after {
  background:
    linear-gradient(90deg, rgba(6, 17, 27, 0.97) 0%, rgba(7, 20, 31, 0.82) 47%, rgba(8, 22, 33, 0.12) 77%),
    linear-gradient(0deg, rgba(5, 15, 23, 0.84), transparent 58%);
}

.hero::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: radial-gradient(circle at 73% 60%, rgba(229, 169, 91, 0.22), transparent 26%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(930px, 80%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 62px 58px 160px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  color: #e7bb7e;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 760;
  letter-spacing: 0.18em;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

.hero h1 {
  max-width: none;
  margin: 0;
  font-family: "STSong", "Songti SC", "Noto Serif SC", serif;
  font-size: clamp(3.15rem, 4.65vw, 4.15rem);
  font-weight: 610;
  line-height: 1.08;
  letter-spacing: -0.06em;
  white-space: nowrap;
}

.hero-title-mobile-break {
  display: none;
}

.hero-subtitle {
  max-width: 500px;
  margin: 28px 0 30px;
  color: rgba(247, 243, 235, 0.76);
  font-size: 1rem;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.continue-card {
  min-width: min(320px, 100%);
  min-height: 66px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  gap: 2px 10px;
  padding: 10px 42px 10px 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 17px;
  color: #fff;
  text-align: left;
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(14px);
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.continue-card:hover {
  transform: translateY(-2px);
  border-color: rgba(240, 193, 127, 0.52);
  background: rgba(255, 255, 255, 0.14);
}

.continue-card-kicker,
.continue-card-meta {
  grid-column: 1;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.67rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.continue-card strong {
  grid-column: 1;
  overflow: hidden;
  font-family: "STSong", "Songti SC", serif;
  font-size: 0.94rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.continue-card i {
  position: absolute;
  right: 16px;
  top: 50%;
  color: #f0c17f;
  font-style: normal;
  transform: translateY(-50%);
}

.primary-btn,
.secondary-btn,
.small-btn {
  border: 0;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-btn {
  min-height: 48px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  color: #102130;
  background: #f0c17f;
  box-shadow: 0 10px 30px rgba(230, 169, 86, 0.2);
  font-weight: 720;
}

.primary-btn:hover,
.secondary-btn:hover,
.small-btn:hover {
  transform: translateY(-2px);
}

.secondary-btn {
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.hero-progress {
  min-width: 130px;
  padding: 4px 0 4px 22px;
  position: absolute;
  z-index: 2;
  top: 62px;
  right: 42px;
  border-left: 1px solid rgba(240, 193, 127, 0.42);
}

.hero-progress .hero-progress-kicker {
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.06em;
}

.hero-progress strong {
  display: block;
  font-family: "STSong", "Songti SC", serif;
  color: #f6c784;
  font-size: 2.65rem;
  line-height: 1;
}

.hero-progress span {
  display: block;
  margin-top: 9px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.78rem;
}

.category-section,
.library {
  width: min(1180px, calc(100% - 40px));
  margin: 68px auto 0;
}

.category-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-kicker {
  margin: 0 0 9px !important;
  color: #a46e39 !important;
  font-size: 0.7rem !important;
  font-weight: 780;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.category-heading h2 {
  max-width: 720px;
  margin: 0;
  font-family: "STSong", "Songti SC", "Noto Serif SC", serif;
  font-size: clamp(1.8rem, 3.2vw, 2.65rem);
  font-weight: 650;
  letter-spacing: -0.035em;
}

.category-heading > span,
.library-count {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.category-tile {
  min-height: 112px;
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  text-align: left;
  background: rgba(255, 253, 249, 0.65);
  cursor: pointer;
  transition: transform 180ms ease, color 180ms ease, background 180ms ease, border-color 180ms ease;
}

.category-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(184, 85, 63, 0.34);
}

.category-tile.active {
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
  box-shadow: 0 16px 36px rgba(24, 48, 67, 0.17);
}

.category-glyph {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(184, 85, 63, 0.2);
  border-radius: 50%;
  color: var(--vermillion);
  background: rgba(184, 85, 63, 0.07);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 1.3rem;
}

.category-tile.active .category-glyph {
  color: #ffddb0;
  border-color: rgba(255, 221, 176, 0.28);
  background: rgba(255, 255, 255, 0.06);
}

.category-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-top: 2px;
}

.category-copy strong {
  font-family: "STSong", "Songti SC", serif;
  font-size: 1rem;
}

.category-copy small {
  margin-top: 6px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-tile.active .category-copy small {
  color: rgba(255, 255, 255, 0.58);
}

.category-count {
  position: absolute;
  right: 15px;
  bottom: 12px;
  color: #8a969d;
  font-size: 0.66rem;
}

.category-tile.active .category-count {
  color: rgba(255, 255, 255, 0.46);
}

.library {
  margin-top: 84px;
  margin-bottom: 90px;
}

.library-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.library-heading h2 {
  margin: 0;
  font-family: "STSong", "Songti SC", "Noto Serif SC", serif;
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 650;
  letter-spacing: -0.04em;
}

.library-heading p {
  margin: 10px 0 0;
  color: var(--ink-soft);
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.story-card {
  min-height: 320px;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(33, 51, 61, 0.11);
  border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.84);
  box-shadow: 0 14px 40px rgba(27, 41, 50, 0.065);
  cursor: pointer;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.story-card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--accent), transparent 55%);
  box-shadow: 0 24px 54px rgba(25, 39, 48, 0.13);
}

.card-cover {
  height: 132px;
  position: relative;
  display: flex;
  align-items: center;
  padding: 26px;
  color: white;
  background:
    radial-gradient(circle at 82% 20%, color-mix(in srgb, var(--accent), white 32%), transparent 32%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent), #102334 44%), color-mix(in srgb, var(--accent), #07121c 68%));
}

.card-cover::after {
  content: "";
  width: 140px;
  height: 140px;
  position: absolute;
  right: -42px;
  bottom: -76px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(255, 255, 255, 0.035), 0 0 0 42px rgba(255, 255, 255, 0.025);
}

.card-glyph {
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 3.7rem;
  line-height: 1;
  opacity: 0.93;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}

.card-number {
  position: absolute;
  top: 22px;
  right: 24px;
  color: rgba(255, 255, 255, 0.52);
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
}

.card-body {
  flex: 1;
  padding: 24px 24px 21px;
  display: flex;
  flex-direction: column;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 720;
  letter-spacing: 0.08em;
}

.card-meta span + span::before {
  content: "·";
  margin-right: 9px;
  opacity: 0.5;
}

.story-card h3 {
  margin: 13px 0 9px;
  font-family: "STSong", "Songti SC", "Noto Serif SC", serif;
  font-size: 1.45rem;
  font-weight: 670;
  line-height: 1.35;
  letter-spacing: -0.025em;
}

.card-synopsis {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.89rem;
  line-height: 1.65;
}

.card-footer {
  margin-top: auto;
  padding-top: 19px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mini-track {
  height: 4px;
  flex: 1;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper-deep);
}

.mini-track > span {
  display: block;
  height: 100%;
  width: var(--progress);
  border-radius: inherit;
  background: var(--accent);
}

.card-progress-text {
  color: var(--ink-soft);
  font-size: 0.73rem;
  font-variant-numeric: tabular-nums;
}

.card-complete {
  position: absolute;
  top: 113px;
  right: 20px;
  z-index: 2;
  padding: 7px 11px;
  border: 4px solid var(--white);
  border-radius: 999px;
  color: #fff;
  background: #4e8b69;
  font-size: 0.72rem;
  font-weight: 720;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 310px;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 60px;
  border: 1px dashed rgba(37, 57, 70, 0.2);
  border-radius: var(--radius);
  text-align: center;
  color: var(--ink-soft);
  background: rgba(255, 253, 249, 0.42);
}

.empty-state > span {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid rgba(184, 85, 63, 0.2);
  border-radius: 50%;
  color: var(--vermillion);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 1.8rem;
}

.empty-state strong {
  color: var(--ink);
  font-family: "STSong", "Songti SC", serif;
  font-size: 1.35rem;
}

.empty-state p {
  margin: 9px 0 20px;
}

.empty-reset {
  min-width: 150px;
  border-color: var(--line);
  color: var(--ink);
}

.site-footer {
  padding: 30px 20px 46px;
  color: #7b858b;
  text-align: center;
  font-size: 0.78rem;
}

.home-shell .site-footer {
  padding-top: 42px;
}

/* Catalogue and directory */
.subpage-shell {
  background:
    radial-gradient(circle at 86% 8%, rgba(81, 126, 143, 0.09), transparent 28rem),
    radial-gradient(circle at 8% 20%, rgba(226, 168, 95, 0.12), transparent 24rem);
}

.subpage-content {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.breadcrumbs {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #879197;
  font-size: 0.75rem;
}

.breadcrumbs button {
  padding: 3px 0;
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
}

.breadcrumbs button:hover {
  color: var(--vermillion);
}

.breadcrumbs strong {
  overflow: hidden;
  color: var(--ink);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-hero {
  min-height: 300px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  align-items: end;
  gap: 60px;
  padding: 52px 58px;
  overflow: hidden;
  position: relative;
  border-radius: 30px;
  color: #f8f4ec;
  background:
    radial-gradient(circle at 76% 32%, rgba(228, 173, 99, 0.2), transparent 22rem),
    linear-gradient(125deg, #10293a, #071620 78%);
  box-shadow: 0 26px 70px rgba(17, 39, 53, 0.16);
}

.catalog-hero::after {
  content: "目";
  position: absolute;
  right: 3%;
  bottom: -45%;
  color: rgba(255, 255, 255, 0.025);
  font-family: "STSong", "Songti SC", serif;
  font-size: 25rem;
  line-height: 1;
  pointer-events: none;
}

.catalog-hero h1 {
  margin: 0;
  font-family: "STSong", "Songti SC", "Noto Serif SC", serif;
  font-size: clamp(2.9rem, 5vw, 4.8rem);
  font-weight: 620;
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.catalog-intro {
  position: relative;
  z-index: 1;
}

.catalog-intro > p {
  max-width: 490px;
  margin: 0 0 28px;
  color: rgba(248, 244, 236, 0.68);
  line-height: 1.8;
}

.catalog-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.catalog-stats span {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.74rem;
}

.catalog-stats strong {
  color: #f2c382;
  font-family: "STSong", "Songti SC", serif;
  font-size: 1.55rem;
  font-weight: 520;
}

.catalog-section {
  margin: 74px 0 42px;
}

.catalog-grid .category-tile {
  min-height: 142px;
}

.catalog-grid .category-copy small {
  max-width: 150px;
  white-space: normal;
}

.category-arrow {
  position: absolute;
  right: 16px;
  top: 18px;
  color: #b5babe;
  font-size: 1rem;
  transition: transform 180ms ease, color 180ms ease;
}

.category-tile:hover .category-arrow {
  color: var(--vermillion);
  transform: translateX(3px);
}

.directory-hero {
  min-height: 282px;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  align-items: center;
  gap: 34px;
  padding: 46px 54px;
  overflow: hidden;
  position: relative;
  border-radius: 30px;
  color: #f8f4ec;
  background:
    radial-gradient(circle at 84% 30%, rgba(226, 168, 95, 0.18), transparent 22rem),
    linear-gradient(132deg, #17384b, #091b28 72%);
  box-shadow: 0 25px 65px rgba(16, 37, 51, 0.16);
}

.directory-hero-glyph {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(243, 195, 130, 0.32);
  border-radius: 50%;
  color: #f4c781;
  background: rgba(255, 255, 255, 0.035);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 3.4rem;
  box-shadow: inset 0 0 0 12px rgba(255, 255, 255, 0.018);
}

.directory-hero-copy {
  position: relative;
  z-index: 1;
}

.directory-hero-copy .eyebrow {
  margin-bottom: 12px;
}

.directory-hero-copy h1 {
  margin: 0;
  font-family: "STSong", "Songti SC", serif;
  font-size: clamp(2.7rem, 5vw, 4.8rem);
  font-weight: 610;
  letter-spacing: -0.05em;
}

.directory-hero-copy > p:last-child {
  max-width: 620px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.7;
}

.directory-hero-stats {
  min-width: 132px;
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 19px;
  background: rgba(4, 16, 25, 0.3);
}

.directory-hero-stats span {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: rgba(255, 255, 255, 0.54);
  font-size: 0.72rem;
}

.directory-hero-stats strong {
  min-width: 20px;
  color: #f1c17d;
  font-family: "STSong", "Songti SC", serif;
  font-size: 1.35rem;
  font-weight: 520;
}

.directory-section {
  margin: 70px 0 42px;
}

.directory-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.directory-heading h2 {
  margin: 0;
  font-family: "STSong", "Songti SC", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 640;
  letter-spacing: -0.04em;
}

.hero-progress strong span {
  display: inline;
  margin: 0;
  color: inherit;
  font: inherit;
}

.hero-progress strong small {
  color: rgba(246, 199, 132, 0.72);
  font-size: 1.3rem;
  font-weight: 480;
}

.hero-continue {
  min-height: 86px;
  position: absolute;
  z-index: 3;
  right: 58px;
  bottom: 20px;
  left: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 330px) 30px;
  align-items: center;
  gap: 28px;
  padding: 14px 20px 14px 24px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 18px;
  color: #fff;
  text-align: left;
  background: rgba(7, 21, 31, 0.72);
  backdrop-filter: blur(18px);
  cursor: pointer;
  transition: transform 180ms var(--ease-enter), border-color 180ms ease, background 180ms ease;
}

.hero-continue:hover {
  transform: translateY(-2px);
  border-color: rgba(240, 193, 127, 0.48);
  background: rgba(12, 30, 42, 0.84);
}

.hero-continue-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.hero-continue-copy small,
.hero-continue-copy > span,
.hero-continue-meter > small {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.68rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-continue-copy strong {
  overflow: hidden;
  font-family: "STSong", "Songti SC", serif;
  font-size: 1.02rem;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-continue-meter {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.hero-continue-meter > span {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.hero-continue-meter b {
  color: #f0c17f;
  font-size: 0.73rem;
  font-variant-numeric: tabular-nums;
}

.hero-continue-meter i {
  height: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
}

.hero-continue-meter em {
  display: block;
  height: 100%;
  background: #f0c17f;
}

.hero-continue-arrow {
  color: #f0c17f;
  font-size: 1.1rem;
  text-align: center;
}

.home-editorial {
  width: min(1180px, calc(100% - 40px));
  min-height: 220px;
  display: grid;
  grid-template-columns: 1fr 1.18fr;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(37, 57, 70, 0.1);
  border-top: 0;
  border-radius: 0 0 28px 28px;
  background: rgba(255, 253, 249, 0.72);
  box-shadow: 0 24px 60px rgba(24, 48, 67, 0.07);
}

.home-recent,
.home-categories {
  padding: 27px 34px 30px;
}

.home-categories {
  border-left: 1px solid rgba(37, 57, 70, 0.1);
}

.home-editorial-heading {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.home-editorial-heading h2 {
  margin: 0;
  font-family: "STSong", "Songti SC", serif;
  font-size: 1.1rem;
  font-weight: 650;
}

.home-editorial-heading button {
  min-height: 36px;
  padding: 0;
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  font-size: 0.7rem;
}

.home-recent-list,
.home-category-list {
  display: grid;
}

.home-recent-list button {
  min-height: 42px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) 82px 88px;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  border-top: 1px solid rgba(37, 57, 70, 0.08);
  color: var(--ink);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.home-recent-list button:hover strong,
.home-category-list button:hover strong,
.home-editorial-heading button:hover {
  color: var(--vermillion);
}

.home-recent-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
}

.home-recent-list strong {
  overflow: hidden;
  font-family: "STSong", "Songti SC", serif;
  font-size: 0.82rem;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-recent-list span:not(.home-recent-dot),
.home-recent-list small {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-category-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 28px;
}

.home-category-list button {
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  border-top: 1px solid rgba(37, 57, 70, 0.08);
  color: var(--ink);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.home-category-list strong {
  font-family: "STSong", "Songti SC", serif;
  font-size: 0.82rem;
  font-weight: 570;
}

.home-category-list span,
.home-category-list i {
  color: var(--ink-soft);
  font-size: 0.66rem;
  font-style: normal;
}

.directory-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(116px, 1fr)) auto;
  align-items: end;
  gap: 10px;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 249, 0.68);
}

.directory-filters label {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.directory-filters label > span {
  padding-left: 4px;
  color: var(--ink-soft);
  font-size: 0.66rem;
  font-weight: 700;
}

.directory-filters select {
  width: 100%;
  height: 40px;
  padding: 0 31px 0 12px;
  border: 1px solid rgba(37, 57, 70, 0.12);
  border-radius: 12px;
  outline: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
}

.directory-filters select:focus-visible {
  border-color: rgba(184, 85, 63, 0.48);
  box-shadow: 0 0 0 3px rgba(184, 85, 63, 0.1);
}

.directory-result-count {
  align-self: center;
  min-width: 96px;
  color: var(--ink-soft);
  text-align: right;
  font-size: 0.71rem;
  font-variant-numeric: tabular-nums;
}

.filter-empty {
  min-height: 210px;
  display: grid;
  place-content: center;
  gap: 8px;
  border: 1px dashed rgba(37, 57, 70, 0.18);
  border-radius: 21px;
  color: var(--ink-soft);
  text-align: center;
  background: rgba(255, 253, 249, 0.48);
}

.filter-empty strong {
  color: var(--ink);
  font-family: "STSong", "Songti SC", serif;
  font-size: 1.2rem;
}

.search-hero {
  padding: 54px 4px 18px;
}

.search-hero h1 {
  max-width: 860px;
  margin: 0;
  overflow-wrap: anywhere;
  font-family: "STSong", "Songti SC", serif;
  font-size: clamp(2.3rem, 5vw, 4.5rem);
  font-weight: 610;
  letter-spacing: -0.045em;
}

.search-hero > p:last-child {
  margin: 16px 0 0;
  color: var(--ink-soft);
}

.search-results {
  margin-top: 28px;
}

.search-empty {
  min-height: 330px;
}

.quiet-link {
  padding: 8px 0;
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
}

.quiet-link:hover {
  color: var(--vermillion);
}

.directory-list {
  display: grid;
  gap: 12px;
}

.directory-item {
  min-height: 150px;
  position: relative;
  display: grid;
  grid-template-columns: 42px 68px minmax(0, 1fr) 138px;
  align-items: center;
  gap: 20px;
  padding: 22px 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: rgba(255, 253, 249, 0.78);
  box-shadow: 0 10px 35px rgba(24, 48, 67, 0.045);
  cursor: pointer;
  content-visibility: auto;
  contain-intrinsic-size: auto 150px;
  transition: transform 190ms var(--ease-enter), border-color 190ms ease, box-shadow 190ms ease;
}

.directory-item::before {
  content: "";
  position: absolute;
  inset: 18px auto 18px 0;
  width: 3px;
  border-radius: 0 99px 99px 0;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform var(--motion-hover) var(--ease-enter);
}

.directory-item:hover,
.directory-item:focus-visible {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent), transparent 58%);
  box-shadow: 0 18px 42px rgba(24, 48, 67, 0.09);
}

.directory-item:hover::before,
.directory-item:focus-visible::before {
  transform: scaleY(1);
}

.directory-number {
  align-self: start;
  padding-top: 5px;
  color: #a3abad;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
}

.directory-glyph {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent), #244052 35%), color-mix(in srgb, var(--accent), #071722 62%));
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 2rem;
  transition: transform var(--motion-hover) var(--ease-enter);
}

.directory-item:hover .directory-glyph,
.directory-item:focus-visible .directory-glyph {
  transform: rotate(-3deg) scale(1.045);
}

.directory-copy {
  min-width: 0;
}

.directory-meta {
  color: var(--accent);
  font-size: 0.69rem;
  font-weight: 720;
  letter-spacing: 0.08em;
}

.directory-copy h2 {
  margin: 0;
  font-family: "STSong", "Songti SC", serif;
  font-size: 1.35rem;
  line-height: 1.35;
}

.directory-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 7px 0 6px;
}

.directory-title-row h2 {
  min-width: 0;
}

.directory-audio-mark {
  display: inline-grid;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.directory-video-mark {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 22px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  color: var(--accent);
  font-size: 0.58rem;
  font-weight: 760;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
}

.directory-audio-duration {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.directory-copy p {
  margin: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-progress {
  width: min(240px, 60%);
  height: 3px;
  margin-top: 13px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--paper-deep);
}

.directory-progress span {
  display: block;
  width: var(--progress);
  height: 100%;
  background: var(--accent);
  transition: width 480ms var(--ease-enter);
}

.directory-status {
  display: grid;
  justify-items: end;
  gap: 13px;
}

.directory-status span {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.directory-status.complete span {
  color: #4e8b69;
}

.directory-status strong {
  color: var(--ink);
  font-size: 0.78rem;
}

.directory-empty {
  min-height: 330px;
}

/* Reader */
.reader-shell {
  --reader-bg: #f4eee4;
  --reader-paper: #fffdf8;
  --reader-ink: #263946;
  --reader-soft: #778087;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0%, rgba(224, 166, 87, 0.09), transparent 34rem),
    var(--reader-bg);
  color: var(--reader-ink);
  transition: background 220ms ease, color 220ms ease;
}

.reader-shell.night {
  --reader-bg: #0c1923;
  --reader-paper: #122431;
  --reader-ink: #d9dfdc;
  --reader-soft: #8ea0a6;
  background:
    radial-gradient(circle at 50% 0%, rgba(75, 116, 128, 0.11), transparent 36rem),
    var(--reader-bg);
}

.reader-topbar {
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(0, 280px) minmax(150px, 1fr);
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  border-bottom: 1px solid color-mix(in srgb, var(--reader-ink), transparent 88%);
  border-radius: 27px 27px 0 0;
  background: color-mix(in srgb, var(--reader-paper), transparent 2%);
  backdrop-filter: blur(14px);
  transition: box-shadow var(--motion-hover) ease, background var(--motion-hover) ease;
}

.reader-topbar.is-scrolled {
  background: color-mix(in srgb, var(--reader-paper), transparent 1%);
  box-shadow: 0 10px 24px color-mix(in srgb, #07131c, transparent 93%);
}

.back-btn,
.tool-btn {
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}

.back-btn {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--reader-soft);
  font-size: 0.82rem;
}

.reader-title-mini {
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "STSong", "Songti SC", serif;
  font-size: 0.94rem;
  font-weight: 560;
}

.reader-settings {
  position: relative;
  justify-self: end;
}

.reader-settings > summary {
  min-width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  color: var(--reader-soft);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  list-style: none;
}

.reader-settings > summary::-webkit-details-marker {
  display: none;
}

.reader-settings > summary:hover,
.reader-settings[open] > summary {
  color: var(--reader-ink);
  background: color-mix(in srgb, var(--reader-ink), transparent 92%);
}

.reader-settings-panel {
  width: 190px;
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--reader-ink), transparent 86%);
  border-radius: 16px;
  color: var(--reader-ink);
  background: var(--reader-paper);
  box-shadow: 0 18px 44px color-mix(in srgb, #07131c, transparent 82%);
}

.reader-settings-panel > span {
  color: var(--reader-soft);
  font-size: 0.7rem;
  font-weight: 700;
}

.reader-settings-panel > div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.tool-btn {
  min-width: 44px;
  height: 44px;
  padding: 0 8px;
  color: var(--reader-soft);
  font-size: 0.82rem;
}

.tool-btn:hover {
  color: var(--reader-ink);
  background: color-mix(in srgb, var(--reader-ink), transparent 92%);
}

.story-audio {
  min-height: 58px;
  display: grid;
  grid-template-columns: 38px 108px minmax(120px, 1fr) 88px 68px auto 32px;
  align-items: center;
  gap: 12px;
  padding: 9px 24px;
  border-bottom: 1px solid color-mix(in srgb, var(--reader-ink), transparent 90%);
  color: var(--reader-ink);
  background: color-mix(in srgb, var(--accent), var(--reader-paper) 94%);
}

.audio-play,
.audio-download {
  border: 0;
  color: white;
  background: var(--accent);
  cursor: pointer;
}

.audio-play {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent), transparent 72%);
  font-size: 0.72rem;
  transition: transform 160ms var(--ease-enter), box-shadow 160ms ease;
}

.audio-play:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent), transparent 62%);
}

.audio-play.is-playing span {
  letter-spacing: -0.15em;
  transform: translateX(-0.06em);
}

.audio-play:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.audio-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.audio-copy strong {
  overflow: hidden;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-copy span {
  color: var(--reader-soft);
  font-size: 0.65rem;
}

.audio-seek {
  width: 100%;
  height: 4px;
  margin: 0;
  border-radius: 999px;
  accent-color: var(--accent);
  cursor: pointer;
}

.audio-time {
  display: flex;
  justify-content: center;
  gap: 5px;
  color: var(--reader-soft);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.audio-time i {
  opacity: 0.55;
  font-style: normal;
}

.audio-speed,
.audio-timer-wrap {
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  border: 1px solid color-mix(in srgb, var(--reader-ink), transparent 86%);
  border-radius: 10px;
  color: var(--reader-soft);
  background: color-mix(in srgb, var(--reader-paper), transparent 8%);
  font-size: 0.65rem;
  white-space: nowrap;
}

.audio-speed select,
.audio-timer-wrap select {
  max-width: 74px;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--reader-ink);
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.audio-plan {
  position: relative;
  z-index: 8;
  color: var(--reader-soft);
  font-size: 0.66rem;
}

.audio-plan > summary {
  min-width: 92px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--reader-ink), transparent 86%);
  border-radius: 10px;
  color: var(--reader-ink);
  background: color-mix(in srgb, var(--reader-paper), transparent 8%);
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}

.audio-plan > summary::-webkit-details-marker {
  display: none;
}

.audio-plan[open] > summary {
  border-color: color-mix(in srgb, var(--accent), transparent 52%);
  background: color-mix(in srgb, var(--accent), var(--reader-paper) 91%);
}

.audio-plan-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 292px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--reader-ink), transparent 86%);
  border-radius: 16px;
  background: var(--reader-paper);
  box-shadow: 0 18px 46px color-mix(in srgb, var(--reader-ink), transparent 82%);
}

.audio-plan-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 3px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--reader-ink), transparent 94%);
}

.audio-plan-modes button,
.audio-plan-actions button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}

.audio-plan-modes button {
  height: 28px;
  color: var(--reader-soft);
  background: transparent;
}

.audio-plan-modes button.is-active {
  color: var(--reader-ink);
  background: var(--reader-paper);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--reader-ink), transparent 90%);
}

.audio-plan-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  color: var(--reader-soft);
}

.audio-plan-field[hidden] {
  display: none;
}

.audio-plan-field select {
  min-width: 104px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--reader-ink), transparent 86%);
  border-radius: 8px;
  outline: 0;
  color: var(--reader-ink);
  background: var(--reader-paper);
  font: inherit;
}

.audio-plan-estimate {
  min-height: 36px;
  margin: 12px 0;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--reader-ink);
  background: color-mix(in srgb, var(--accent), var(--reader-paper) 94%);
  line-height: 1.5;
}

.audio-plan-actions {
  display: flex;
  gap: 7px;
}

.audio-plan-actions button {
  min-height: 31px;
  padding: 0 11px;
}

.audio-plan-start {
  flex: 1;
  color: white;
  background: var(--accent);
}

.audio-plan-cancel {
  color: var(--reader-soft);
  background: color-mix(in srgb, var(--reader-ink), transparent 93%);
}

.audio-download {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  text-decoration: none;
  font-size: 1rem;
  line-height: 1;
}

.voice-samples {
  padding: 16px 24px 18px;
  border-bottom: 1px solid color-mix(in srgb, var(--reader-ink), transparent 90%);
  color: var(--reader-ink);
  background: color-mix(in srgb, var(--accent), var(--reader-paper) 97%);
}

.voice-samples[hidden] {
  display: none;
}

.voice-samples-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.voice-samples-head > div {
  display: grid;
  gap: 2px;
}

.voice-samples-head span,
.voice-samples-head p {
  margin: 0;
  color: var(--reader-soft);
  font-size: 0.66rem;
}

.voice-samples-head strong {
  font-size: 0.86rem;
}

.voice-sample-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.voice-sample-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--reader-ink), transparent 88%);
  border-radius: 12px;
  background: color-mix(in srgb, var(--reader-paper), transparent 4%);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms var(--ease-enter);
}

.voice-sample-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent), transparent 58%);
}

.voice-sample-card.is-playing {
  border-color: color-mix(in srgb, var(--accent), transparent 28%);
  background: color-mix(in srgb, var(--accent), var(--reader-paper) 91%);
}

.voice-sample-card button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: white;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent), transparent 76%);
}

.voice-sample-card button i {
  font-size: 0.62rem;
  font-style: normal;
}

.voice-sample-card > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.voice-sample-card strong,
.voice-sample-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-sample-card strong {
  font-size: 0.76rem;
}

.voice-sample-card span {
  color: var(--reader-soft);
  font-size: 0.61rem;
}

.voice-sample-card small {
  padding: 3px 6px;
  border-radius: 999px;
  color: var(--reader-soft);
  background: color-mix(in srgb, var(--reader-ink), transparent 94%);
  font-size: 0.58rem;
  white-space: nowrap;
}

.voice-sample-card.is-recommended small {
  color: white;
  background: var(--accent);
}

.story-media {
  padding: 18px 24px 22px;
  border-bottom: 1px solid color-mix(in srgb, var(--reader-ink), transparent 90%);
  color: var(--reader-ink);
  background: color-mix(in srgb, var(--reader-paper), var(--reader-bg) 24%);
}

.story-media[hidden],
.story-media [hidden] {
  display: none;
}

.story-media-head {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.story-media-tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--reader-ink), transparent 94%);
}

.story-media-tabs button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  color: var(--reader-soft);
  background: transparent;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.story-media-tabs button span {
  margin-left: 5px;
  color: color-mix(in srgb, var(--reader-soft), transparent 22%);
  font-size: 0.62rem;
  font-weight: 560;
}

.story-media-tabs button.is-active {
  color: var(--reader-ink);
  background: var(--reader-paper);
  box-shadow: 0 3px 12px color-mix(in srgb, var(--reader-ink), transparent 90%);
}

.story-media-tabs button:focus-visible,
.story-media-thumbs button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent), white 20%);
  outline-offset: 2px;
}

.story-media-count {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: var(--reader-soft);
  font-size: 0.67rem;
  font-variant-numeric: tabular-nums;
}

.story-media-count strong {
  color: var(--accent);
  font-family: "STSong", "Songti SC", serif;
  font-size: 1.08rem;
  font-weight: 700;
}

.story-media-count i {
  opacity: 0.55;
  font-style: normal;
}

.story-video-publish {
  margin: 0 0 14px;
  padding: 17px 18px 16px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 72%);
  border-radius: 15px;
  background: color-mix(in srgb, var(--reader-paper), var(--accent) 5%);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--reader-ink), transparent 94%);
}

.story-video-publish-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.story-video-publish-head > span {
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.story-video-publish-head button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 58%);
  border-radius: 9px;
  color: var(--accent);
  background: var(--reader-paper);
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 760;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.story-video-publish-head button:hover {
  color: var(--reader-paper);
  background: var(--accent);
  transform: translateY(-1px);
}

.story-video-publish-head button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent), white 18%);
  outline-offset: 2px;
}

.story-video-publish h3 {
  margin: 7px 0 0;
  color: var(--reader-ink);
  font-family: "STSong", "Songti SC", "Noto Serif SC", serif;
  font-size: 1.08rem;
  line-height: 1.45;
}

.story-video-publish p {
  max-width: 920px;
  margin: 7px 0 0;
  color: var(--reader-soft);
  font-size: 0.73rem;
  line-height: 1.72;
}

.story-video-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

.story-video-topics span {
  padding: 5px 9px;
  border-radius: 999px;
  color: color-mix(in srgb, var(--accent), var(--reader-ink) 24%);
  background: color-mix(in srgb, var(--accent), transparent 90%);
  font-size: 0.65rem;
  font-weight: 700;
}

.story-media-stage {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--reader-ink), transparent 82%);
  border-radius: 18px;
  background: #15242d;
  box-shadow: 0 18px 42px color-mix(in srgb, #07131c, transparent 80%);
}

.story-gallery-panel,
.story-video-panel {
  aspect-ratio: 16 / 9;
  position: relative;
  margin: 0;
  overflow: hidden;
  background: #15242d;
}

.story-gallery-panel > img,
.story-video-panel video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.story-gallery-panel > img.is-entering {
  animation: story-media-enter 520ms var(--ease-enter) both;
}

@keyframes story-media-enter {
  from {
    opacity: 0.35;
    transform: scale(1.012);
  }
}

.story-gallery-panel figcaption {
  max-width: min(620px, calc(100% - 36px));
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  padding: 12px 15px 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 13px;
  color: #fffaf0;
  background: rgba(17, 29, 36, 0.82);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(3, 10, 14, 0.28);
}

.story-gallery-panel figcaption span {
  display: block;
  color: #f0c98e;
  font-size: 0.68rem;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.story-gallery-panel figcaption p {
  margin: 5px 0 0;
  color: rgba(255, 250, 240, 0.84);
  font-family: "STSong", "Songti SC", "Noto Serif SC", serif;
  font-size: 0.88rem;
  line-height: 1.55;
}

.story-video-panel video {
  background: #0c171e;
  object-fit: contain;
}

.story-video-toggle {
  min-width: 92px;
  min-height: 38px;
  position: absolute;
  z-index: 2;
  top: 16px;
  left: 16px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: #fffaf0;
  background: rgba(13, 24, 31, 0.86);
  box-shadow: 0 9px 24px rgba(3, 10, 14, 0.24);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 720;
  backdrop-filter: blur(8px);
}

.story-video-toggle:hover,
.story-video-toggle[aria-pressed="true"] {
  border-color: rgba(240, 201, 142, 0.56);
  color: #f0c98e;
}

.story-video-toggle:focus-visible {
  outline: 2px solid #f0c98e;
  outline-offset: 2px;
}

.story-media-thumbs {
  display: flex;
  gap: 9px;
  margin-top: 12px;
  overflow-x: auto;
  padding: 2px 2px 7px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent), transparent 42%) transparent;
  scroll-snap-type: x proximity;
}

.story-media-thumbs button {
  flex: 0 0 104px;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #15242d;
  cursor: pointer;
  opacity: 0.62;
  scroll-snap-align: center;
  transition: opacity 160ms ease, border-color 160ms ease, transform 160ms var(--ease-enter);
}

.story-media-thumbs button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.story-media-thumbs button.is-active {
  border-color: var(--accent);
  opacity: 1;
}

.story-media-thumbs img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.story-media-thumbs span {
  position: absolute;
  right: 5px;
  bottom: 4px;
  min-width: 22px;
  padding: 2px 5px;
  border-radius: 6px;
  color: #fffaf0;
  background: rgba(13, 24, 31, 0.76);
  font-size: 0.58rem;
  font-variant-numeric: tabular-nums;
}

.reader-layout {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 180px minmax(0, 920px);
  gap: 48px;
  justify-content: center;
}

.reader-aside {
  padding-top: 118px;
}

.aside-sticky {
  position: sticky;
  top: 105px;
}

.aside-label {
  margin-bottom: 14px;
  color: var(--reader-soft);
  font-size: 0.7rem;
  font-weight: 760;
  letter-spacing: 0.14em;
}

@property --p {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 0%;
}

.reader-progress-ring {
  --p: 0%;
  width: 92px;
  height: 92px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--p), color-mix(in srgb, var(--reader-ink), transparent 90%) 0);
  transition: --p 120ms linear, transform 220ms var(--ease-enter);
}

.reader-progress-ring::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--reader-bg);
}

.reader-progress-ring strong {
  position: relative;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.aside-detail {
  margin-top: 16px;
  color: var(--reader-soft);
  font-size: 0.76rem;
  line-height: 1.65;
}

.chapter-nav {
  margin-top: 30px;
  display: grid;
  gap: 6px;
}

.chapter-link {
  padding: 6px 0;
  border: 0;
  color: var(--reader-soft);
  text-align: left;
  background: transparent;
  cursor: pointer;
  font-size: 0.76rem;
  line-height: 1.45;
}

.chapter-link:hover {
  color: var(--reader-ink);
}

.reader-main {
  min-width: 0;
  padding: 28px 0 110px;
}

.reader-paper {
  border: 1px solid color-mix(in srgb, var(--reader-ink), transparent 90%);
  border-radius: 28px;
  background: var(--reader-paper);
  box-shadow: 0 28px 80px color-mix(in srgb, #07131c, transparent 89%);
  transition: background 220ms ease;
}

.reader-heading {
  margin: 0;
  padding: 50px clamp(30px, 7vw, 72px) 38px;
  text-align: center;
}

.reader-kicker {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.14em;
}

.reader-heading h1 {
  max-width: 100%;
  margin: 12px auto 10px;
  overflow: hidden;
  font-family: "STSong", "Songti SC", "Noto Serif SC", serif;
  font-size: clamp(2rem, 3.4vw, 2.9rem);
  font-weight: 680;
  line-height: 1.12;
  letter-spacing: -0.045em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-heading h1.reader-title-long {
  font-size: clamp(1.8rem, 2.8vw, 2.4rem);
}

.reader-heading h1.reader-title-extra-long {
  font-size: clamp(1.55rem, 2.35vw, 2rem);
}

.reader-deck {
  max-width: 100%;
  overflow: hidden;
  color: var(--reader-soft);
  font-size: 0.8rem;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-article {
  padding: 34px clamp(82px, 8.5vw, 142px) 58px;
}

.story-block {
  position: relative;
}

.story-block.heading {
  margin: 72px 0 28px;
  padding-top: 28px;
  border-top: 1px solid color-mix(in srgb, var(--reader-ink), transparent 87%);
}

.story-block.heading h2 {
  margin: 0;
  font-family: "STSong", "Songti SC", serif;
  font-size: calc(1.4rem * var(--font-scale, 1));
}

.story-block.subheading h3 {
  margin: 42px 0 16px;
  font-size: calc(1.08rem * var(--font-scale, 1));
}

.story-block.paragraph,
.story-block.quote {
  margin: 0 -20px;
  padding: 6px 20px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms var(--ease-enter);
}

.story-block.paragraph p,
.story-block.quote p {
  margin: 0;
  font-family: "STSong", "Songti SC", "Noto Serif SC", serif;
  font-size: calc(1.18rem * var(--font-scale, 1));
  line-height: 2.05;
  letter-spacing: 0.025em;
  text-align: justify;
}

.story-block.quote p {
  padding-left: 20px;
  border-left: 3px solid var(--accent);
  color: var(--reader-soft);
}

.story-block.paragraph:hover,
.story-block.quote:hover,
.story-block.selected {
  background: color-mix(in srgb, var(--accent), transparent 92%);
}

.story-block.paragraph.audio-active,
.story-block.quote.audio-active {
  color: var(--reader-ink);
  background: color-mix(in srgb, var(--accent), transparent 86%);
  box-shadow: inset 3px 0 0 var(--accent);
}

.story-block.paragraph.audio-active .block-dot,
.story-block.quote.audio-active .block-dot {
  opacity: 1;
  background: var(--accent);
  transform: scale(1.45);
}

.story-block.selected {
  transform: translateX(2px);
}

.story-block.spoken {
  color: color-mix(in srgb, var(--reader-ink), transparent 23%);
}

.story-block.saved {
  background: color-mix(in srgb, var(--accent), transparent 88%);
}

.story-block.saved::before {
  content: "讲到这里";
  position: absolute;
  right: calc(100% + 11px);
  top: 13px;
  width: max-content;
  padding: 5px 8px;
  border-radius: 7px;
  color: #fff;
  background: var(--accent);
  font-family: Inter, "PingFang SC", sans-serif;
  font-size: 0.63rem;
  letter-spacing: 0.06em;
}

.block-dot {
  width: 8px;
  height: 8px;
  position: absolute;
  top: 22px;
  left: -5px;
  border: 2px solid var(--reader-paper);
  border-radius: 50%;
  background: color-mix(in srgb, var(--reader-ink), transparent 82%);
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
}

.story-block:hover .block-dot,
.story-block.selected .block-dot,
.story-block.saved .block-dot {
  opacity: 1;
}

.story-block.saved .block-dot {
  background: var(--accent);
  transform: scale(1.35);
}

.story-list {
  margin: 10px 0 30px;
  padding-left: 1.25em;
  color: var(--reader-soft);
  font-family: "STSong", "Songti SC", serif;
  font-size: calc(1rem * var(--font-scale, 1));
  line-height: 1.9;
}

.appendix-start {
  margin-top: 80px;
}

.reader-article a {
  color: var(--accent);
  text-underline-offset: 4px;
}

.reader-dock {
  width: 100%;
  margin-top: 36px;
  padding: 24px 0 0;
  display: block;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--reader-ink), transparent 87%);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.dock-toggle {
  display: none;
}

.dock-toggle::-webkit-details-marker {
  display: none;
}

.dock-actions {
  display: grid;
  gap: 9px;
}

.reader-dock:not([open]) > .dock-copy,
.reader-dock:not([open]) > .dock-actions {
  display: none;
}

.dock-copy {
  min-width: 0;
  margin-bottom: 18px;
}

.dock-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
  line-height: 1.45;
}

.dock-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--reader-soft);
  font-size: 0.62rem;
  font-weight: 760;
  letter-spacing: 0.14em;
}

.small-btn {
  width: 100%;
  min-width: 0;
  min-height: 43px;
  padding: 0 10px;
  border-radius: 12px;
  color: var(--reader-ink);
  background: color-mix(in srgb, var(--reader-ink), transparent 92%);
  font-size: 0.76rem;
  font-weight: 680;
}

.save-btn {
  color: white;
  background: var(--accent);
}

.complete-btn {
  min-height: 34px;
  padding: 0 4px;
  border: 0;
  color: var(--reader-soft);
  text-align: left;
  background: transparent;
}

.complete-btn.is-complete {
  color: #5f876b;
  background: transparent;
}

.toast {
  position: fixed;
  z-index: 100;
  top: 22px;
  left: 50%;
  transform: translate(-50%, -16px);
  padding: 12px 18px;
  border-radius: 999px;
  color: white;
  background: rgba(11, 27, 39, 0.92);
  box-shadow: 0 10px 40px rgba(5, 16, 25, 0.24);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  font-size: 0.82rem;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.error-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 24px;
  text-align: center;
}

.error-screen h1 {
  font-family: "STSong", "Songti SC", serif;
}

/* Motion system */
#app {
  view-transition-name: app-shell;
}

.topbar,
.reader-topbar {
  view-transition-name: site-topbar;
}

.hero,
.catalog-hero,
.directory-hero {
  view-transition-name: page-hero;
}

.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  border-radius: 0 0 18px 18px;
  background: rgba(248, 244, 236, 0);
  transition:
    background var(--motion-hover) ease,
    box-shadow var(--motion-hover) ease,
    backdrop-filter var(--motion-hover) ease;
}

.topbar.is-scrolled {
  background: rgba(248, 244, 236, 0.86);
  box-shadow: 0 12px 32px rgba(23, 42, 55, 0.09);
  backdrop-filter: blur(18px);
}

[data-page]:focus {
  outline: none;
}

button:focus-visible,
.directory-item:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--amber), transparent 40%);
  outline-offset: 3px;
}

button:active,
.directory-item:active {
  transform: translateY(0) scale(0.985);
  transition-duration: 80ms;
}

.brand-mark,
.category-glyph,
.category-arrow {
  transition:
    transform var(--motion-hover) var(--ease-enter),
    color var(--motion-hover) ease,
    background var(--motion-hover) ease;
}

.brand-button:hover .brand-mark,
.brand-button:focus-visible .brand-mark {
  transform: rotate(-7deg) scale(1.05);
}

.storage-dot {
  animation: storage-pulse 2.8s ease-out infinite;
}

.primary-btn {
  position: relative;
  overflow: hidden;
}

.primary-btn::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% -45%;
  width: 32%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-18deg);
  transition: left 520ms var(--ease-enter);
  pointer-events: none;
}

.primary-btn:hover::after,
.primary-btn:focus-visible::after {
  left: 118%;
}

.primary-btn span,
.directory-status strong {
  display: inline-block;
  transition: transform var(--motion-hover) var(--ease-enter);
}

.primary-btn:hover span,
.primary-btn:focus-visible span,
.directory-item:hover .directory-status strong,
.directory-item:focus-visible .directory-status strong {
  transform: translateX(3px);
}

.category-tile:hover .category-glyph,
.category-tile:focus-visible .category-glyph {
  transform: rotate(-6deg) scale(1.07);
}

.catalog-hero::after {
  transform-origin: 70% 70%;
}

.motion-enabled .catalog-hero > *,
.motion-enabled .directory-hero > * {
  animation: hero-detail-enter 520ms var(--ease-enter) both;
}

.motion-enabled .catalog-hero > :nth-child(2),
.motion-enabled .directory-hero > :nth-child(2) {
  animation-delay: 70ms;
}

.motion-enabled .directory-hero > :nth-child(3) {
  animation-delay: 120ms;
}

.motion-enabled .catalog-hero::after {
  animation: catalog-mark-enter 760ms var(--ease-enter) both;
}

.motion-enabled [data-reveal] {
  opacity: 0;
  translate: 0 11px;
}

.motion-enabled [data-reveal].is-revealed {
  opacity: 1;
  translate: 0 0;
  animation: reveal-enter var(--motion-enter) var(--ease-enter) both;
  animation-delay: calc(var(--enter-index, 0) * 36ms);
}

.motion-enabled .reader-dock.is-entering {
  animation: dock-enter 380ms var(--ease-enter) 120ms both;
}

.motion-enabled .reader-dock.is-confirmed .save-btn {
  animation: save-confirm 620ms var(--ease-enter);
}

.route-progress {
  height: 3px;
  position: fixed;
  z-index: 200;
  inset: 0 0 auto;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-fast) ease;
}

.route-progress span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 0 99px 99px 0;
  background: linear-gradient(90deg, #c97e4c, #f1c37e 72%, #fff1d4);
  box-shadow: 0 0 14px rgba(226, 168, 95, 0.45);
  transform: scaleX(0);
  transform-origin: left;
}

.route-progress.is-active {
  opacity: 1;
}

.route-progress.is-active span {
  animation: route-loading 1.1s var(--ease-enter) forwards;
}

.route-progress.is-done span {
  animation: none;
  transform: scaleX(1);
  transition: transform 160ms var(--ease-enter);
}

::view-transition-group(app-shell),
::view-transition-group(site-topbar),
::view-transition-group(page-hero) {
  animation-duration: var(--motion-enter);
  animation-timing-function: var(--ease-enter);
}

::view-transition-old(app-shell) {
  animation: route-old-forward 135ms var(--ease-exit) both;
}

::view-transition-new(app-shell) {
  animation: route-new-forward var(--motion-enter) var(--ease-enter) both;
}

html[data-route-direction="back"]::view-transition-old(app-shell) {
  animation-name: route-old-back;
}

html[data-route-direction="back"]::view-transition-new(app-shell) {
  animation-name: route-new-back;
}

html[data-route-direction="cross"]::view-transition-old(app-shell) {
  animation-name: route-old-cross;
}

html[data-route-direction="cross"]::view-transition-new(app-shell) {
  animation-name: route-new-cross;
}

::view-transition-old(site-topbar),
::view-transition-new(site-topbar) {
  animation-duration: 260ms;
  animation-timing-function: ease;
}

::view-transition-old(page-hero) {
  animation: hero-old 150ms var(--ease-exit) both;
}

::view-transition-new(page-hero) {
  animation: hero-new 420ms var(--ease-enter) both;
}

@keyframes hero-breathe {
  from { transform: scale(1.035); }
  to { transform: scale(1.065); }
}

@keyframes storage-pulse {
  0%, 65%, 100% { box-shadow: 0 0 0 5px rgba(85, 150, 109, 0.12); }
  78% { box-shadow: 0 0 0 9px rgba(85, 150, 109, 0); }
}

@keyframes hero-detail-enter {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes reveal-enter {
  from { opacity: 0; translate: 0 11px; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes catalog-mark-enter {
  from { opacity: 0; transform: rotate(-5deg) scale(0.9); }
  to { opacity: 1; transform: rotate(0) scale(1); }
}

@keyframes dock-enter {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes save-confirm {
  0%, 100% { transform: scale(1); }
  45% {
    transform: translateY(-3px) scale(1.012);
    box-shadow: 0 12px 30px color-mix(in srgb, var(--accent), transparent 72%), 0 0 0 4px color-mix(in srgb, var(--accent), transparent 82%);
  }
}

@keyframes route-loading {
  0% { transform: scaleX(0); }
  38% { transform: scaleX(0.56); }
  72% { transform: scaleX(0.78); }
  100% { transform: scaleX(0.9); }
}

@keyframes route-old-forward {
  to { opacity: 0; transform: translate3d(-7px, 0, 0) scale(0.997); }
}

@keyframes route-new-forward {
  from { opacity: 0; transform: translate3d(9px, 6px, 0) scale(0.997); }
}

@keyframes route-old-back {
  to { opacity: 0; transform: translate3d(7px, 0, 0) scale(0.997); }
}

@keyframes route-new-back {
  from { opacity: 0; transform: translate3d(-9px, 6px, 0) scale(0.997); }
}

@keyframes route-old-cross {
  to { opacity: 0; }
}

@keyframes route-new-cross {
  from { opacity: 0; }
}

@keyframes hero-old {
  to { opacity: 0; transform: scale(0.995); }
}

@keyframes hero-new {
  from { opacity: 0; transform: translateY(8px) scale(0.995); }
}

@media (max-width: 1000px) {
  .reader-layout {
    display: block;
    width: min(760px, calc(100% - 32px));
  }

  .reader-aside {
    display: block;
    padding: 0;
  }

  .reader-aside .aside-sticky {
    position: static;
    opacity: 1 !important;
    translate: none !important;
    animation: none !important;
  }

  .reader-aside .aside-label,
  .reader-aside .reader-progress-ring,
  .reader-aside .aside-detail,
  .reader-aside .chapter-nav {
    display: none;
  }

  .reader-dock {
    width: auto;
    position: fixed;
    z-index: 30;
    left: max(0px, env(safe-area-inset-left));
    bottom: max(16px, env(safe-area-inset-bottom));
    margin: 0;
    padding: 0;
    display: block;
    border: 0;
    border-radius: 0 14px 14px 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .reader-dock .dock-toggle {
    width: 116px;
    min-height: 44px;
    padding: 0 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid color-mix(in srgb, var(--reader-ink), transparent 82%);
    border-left: 0;
    border-radius: 0 14px 14px 0;
    color: var(--reader-ink);
    background: color-mix(in srgb, var(--reader-paper), transparent 3%);
    box-shadow: 0 12px 34px rgba(7, 17, 24, 0.16);
    backdrop-filter: blur(16px);
    cursor: pointer;
    list-style: none;
    font-size: 0.7rem;
    font-weight: 720;
  }

  .dock-toggle [data-viewport-progress] {
    color: var(--accent);
    font-variant-numeric: tabular-nums;
  }

  .reader-dock[open] {
    width: 156px;
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--reader-ink), transparent 84%);
    border-left: 0;
    background: color-mix(in srgb, var(--reader-paper), transparent 3%);
    box-shadow: 0 16px 44px rgba(7, 17, 24, 0.18);
    backdrop-filter: blur(18px);
  }

  .reader-dock[open] .dock-toggle {
    width: 100%;
    min-height: 34px;
    margin-bottom: 8px;
    padding: 0 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .reader-dock[open] .dock-copy {
    display: block;
    margin-bottom: 8px;
  }

  .reader-dock[open] .dock-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .reader-dock .dock-copy {
    grid-column: auto;
  }

  .reader-dock .dock-copy span {
    display: none;
  }
}

@media (max-width: 940px) {
  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .catalog-hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .catalog-intro > p {
    margin-bottom: 20px;
  }

  .directory-hero {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .directory-hero-glyph {
    width: 92px;
    height: 92px;
  }

  .directory-hero-stats {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, 1fr);
  }

  .story-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    min-height: 560px;
  }

  .hero-copy {
    width: 86%;
    padding: 48px 44px 158px;
  }

  .hero-progress {
    top: 44px;
    right: 28px;
  }

  .hero-continue {
    right: 44px;
    left: 44px;
  }

}

@media (max-width: 680px) {
  .topbar,
  .hero,
  .home-editorial,
  .library,
  .subpage-content {
    width: min(100% - 24px, 1180px);
  }

  .topbar {
    height: 64px;
    gap: 8px;
  }

  .nav-note span:last-child {
    display: none;
  }

  .nav-note {
    flex: 0 0 8px;
  }

  .global-search {
    width: auto;
    min-width: 0;
    flex: 1;
    height: 44px;
    padding-left: 11px;
  }

  .global-search input {
    font-size: 0.78rem;
  }

  .global-search button {
    min-width: 48px;
  }

  .hero {
    min-height: 610px;
    align-items: stretch;
    background: #071620;
    border-radius: 26px 26px 0 0;
  }

  .hero-media {
    inset: 0;
    transform: none !important;
  }

  .hero-media::before {
    inset: -1%;
    background-position: 67% center;
    animation: none;
    transform: scale(1.025);
  }

  .hero-media::after {
    background: linear-gradient(
      0deg,
      rgba(6, 17, 27, 0.97) 0%,
      rgba(7, 18, 29, 0.67) 62%,
      rgba(7, 18, 29, 0.12) 100%
    );
  }

  .hero-copy {
    width: 100%;
    justify-content: center;
    padding: 38px 24px 180px;
  }

  .hero h1 {
    font-size: clamp(1.45rem, 7.45vw, 1.95rem);
    line-height: 1.12;
    letter-spacing: -0.065em;
    white-space: nowrap;
  }

  .hero-title-mobile-break {
    display: none;
  }

  .hero-subtitle {
    margin: 18px 0 24px;
    font-size: 0.91rem;
  }

  .hero-progress {
    display: none;
  }

  .hero-continue {
    min-height: 126px;
    right: 22px;
    bottom: 20px;
    left: 22px;
    grid-template-columns: minmax(0, 1fr) 22px;
    gap: 10px 12px;
    padding: 14px 15px;
    border-radius: 16px;
  }

  .hero-continue-meter {
    grid-column: 1;
  }

  .hero-continue-arrow {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
  }

  .home-editorial {
    min-height: 0;
    grid-template-columns: 1fr;
    border-radius: 0 0 24px 24px;
  }

  .home-recent,
  .home-categories {
    padding: 24px 20px 26px;
  }

  .home-categories {
    border-top: 1px solid rgba(37, 57, 70, 0.1);
    border-left: 0;
  }

  .home-recent-list button {
    grid-template-columns: 8px minmax(0, 1fr) 72px;
  }

  .home-recent-list small {
    display: none;
  }

  .primary-btn,
  .secondary-btn {
    flex: 1;
    padding: 0 14px;
  }

  .continue-card {
    width: 100%;
    min-width: 0;
  }

  .category-section,
  .library {
    margin-top: 48px;
  }

  .category-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .category-grid {
    width: calc(100vw - 20px);
    grid-template-columns: repeat(11, minmax(210px, 1fr));
    gap: 10px;
    margin-left: -10px;
    padding: 0 10px 14px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .category-tile {
    scroll-snap-align: start;
  }

  .catalog-hero {
    min-height: 380px;
    gap: 34px;
    padding: 36px 25px;
    border-radius: 24px;
  }

  .catalog-hero h1 {
    font-size: 3rem;
  }

  .catalog-stats {
    gap: 12px 18px;
  }

  .catalog-section {
    margin-top: 52px;
  }

  .catalog-grid {
    width: 100%;
    grid-template-columns: 1fr;
    margin-left: 0;
    padding: 0;
    overflow: visible;
  }

  .catalog-grid .category-tile {
    min-height: 112px;
  }

  .directory-hero {
    min-height: 0;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 18px;
    padding: 30px 24px;
    border-radius: 24px;
  }

  .directory-hero-glyph {
    width: 62px;
    height: 62px;
    font-size: 2rem;
    box-shadow: none;
  }

  .directory-hero-copy .eyebrow {
    display: none;
  }

  .directory-hero-copy h1 {
    font-size: 2.45rem;
  }

  .directory-hero-copy > p:last-child {
    grid-column: 1 / -1;
    font-size: 0.82rem;
  }

  .directory-hero-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 16px;
  }

  .directory-hero-stats span {
    display: grid;
    justify-items: center;
    gap: 2px;
    text-align: center;
  }

  .directory-section {
    margin-top: 50px;
  }

  .directory-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
  }

  .directory-filters select {
    height: 44px;
  }

  .directory-result-count {
    grid-column: 1 / -1;
    min-width: 0;
    text-align: left;
  }

  .search-hero {
    padding-top: 34px;
  }

  .search-hero h1 {
    font-size: 2.3rem;
  }

  .directory-item {
    min-height: 0;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 15px;
    padding: 18px;
  }

  .directory-number {
    display: none;
  }

  .directory-glyph {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    font-size: 1.6rem;
  }

  .directory-copy h2 {
    font-size: 1.15rem;
  }

  .directory-title-row {
    margin-top: 5px;
  }

  .directory-copy p {
    white-space: normal;
  }

  .directory-progress {
    width: 100%;
  }

  .directory-status {
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .library-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .library-count {
    margin-top: -8px;
  }

  .story-grid {
    grid-template-columns: 1fr;
  }

  .story-card {
    min-height: 300px;
  }

  .reader-topbar {
    height: 62px;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 8px;
    padding: 0 10px;
  }

  .back-btn span {
    display: none;
  }

  .back-btn {
    width: 44px;
    height: 44px;
    justify-content: center;
    font-size: 1rem;
  }

  .tool-btn {
    min-width: 44px;
    padding: 0 7px;
  }

  .story-audio {
    grid-template-columns: 44px minmax(70px, 1fr) auto auto 44px;
    gap: 9px;
    padding: 9px 12px 11px;
  }

  .audio-seek {
    grid-column: 1 / 4;
    grid-row: 2;
  }

  .audio-time {
    grid-column: 4 / 6;
    grid-row: 2;
    justify-content: end;
  }

  .audio-speed {
    grid-column: 3;
    grid-row: 1;
    min-height: 44px;
  }

  .audio-speed span {
    display: none;
  }

  .audio-plan > summary {
    min-width: 76px;
    min-height: 44px;
    padding-inline: 7px;
  }

  .audio-plan {
    grid-column: 4;
    grid-row: 1;
  }

  .audio-download {
    grid-column: 5;
    grid-row: 1;
  }

  .audio-plan-panel {
    width: min(292px, calc(100vw - 24px));
  }

  .audio-play,
  .audio-download {
    width: 44px;
    height: 44px;
  }

  .voice-samples {
    padding: 14px 12px 16px;
  }

  .voice-samples-head {
    align-items: flex-start;
  }

  .voice-sample-grid {
    grid-template-columns: 1fr 1fr;
  }

  .voice-sample-card {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .voice-sample-card button {
    width: 36px;
    height: 36px;
  }

  .voice-sample-card small {
    display: none;
  }

  .story-media {
    padding: 14px 12px 17px;
  }

  .story-media-head {
    margin-bottom: 10px;
  }

  .story-video-publish {
    margin-bottom: 10px;
    padding: 14px 13px 13px;
    border-radius: 12px;
  }

  .story-video-publish h3 {
    font-size: 0.96rem;
  }

  .story-video-publish p {
    font-size: 0.69rem;
    line-height: 1.62;
  }

  .story-media-tabs button {
    min-height: 38px;
    padding-inline: 10px;
  }

  .story-media-stage {
    border-radius: 13px;
  }

  .story-gallery-panel figcaption {
    max-width: none;
    right: 10px;
    bottom: 10px;
    left: 10px;
    padding: 9px 11px 10px;
    border-radius: 10px;
  }

  .story-gallery-panel figcaption span {
    font-size: 0.61rem;
  }

  .story-gallery-panel figcaption p {
    margin-top: 3px;
    overflow: hidden;
    font-size: 0.75rem;
    line-height: 1.42;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .story-media-thumbs {
    gap: 7px;
    margin-top: 9px;
  }

  .story-media-thumbs button {
    flex-basis: 86px;
    border-radius: 8px;
  }

  .reader-layout {
    width: 100%;
  }

  .reader-main {
    padding: 12px 12px 140px;
  }

  .reader-paper {
    border-radius: 21px;
  }

  .reader-heading {
    padding: 38px 25px 30px;
    margin: 0;
  }

  .reader-heading h1 {
    margin: 10px auto 8px;
    font-size: clamp(1.55rem, 7vw, 2.05rem);
  }

  .reader-heading h1.reader-title-long {
    font-size: clamp(1.4rem, 6.2vw, 1.82rem);
  }

  .reader-heading h1.reader-title-extra-long {
    font-size: clamp(1.22rem, 5.4vw, 1.58rem);
  }

  .reader-kicker {
    font-size: 0.66rem;
  }

  .reader-deck {
    font-size: 0.74rem;
  }

  .reader-article {
    padding: 30px 25px 54px;
  }

  .story-block.paragraph,
  .story-block.quote {
    margin: 0 -11px;
    padding: 5px 11px 13px;
  }

  .story-block.paragraph p,
  .story-block.quote p {
    font-size: calc(1.1rem * var(--font-scale, 1));
    line-height: 1.95;
  }

  .story-block.saved::before {
    top: -16px;
    right: 8px;
  }

  .block-dot {
    left: -4px;
  }

  .reader-dock {
    width: auto;
    min-height: 0;
    padding: 0;
  }

  .reader-dock .dock-toggle {
    width: 106px;
    min-height: 42px;
    padding: 0 11px;
  }

  .reader-dock[open] {
    width: 136px;
    padding: 8px;
  }

  .reader-dock[open] .dock-toggle {
    width: 100%;
    padding: 0 2px;
  }

  .small-btn {
    min-height: 38px;
    padding: 0 4px;
    font-size: 0.68rem;
  }
}

@media (max-width: 420px) {
  .brand > span:last-child {
    display: none;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .global-search > span {
    display: none;
  }

  .global-search {
    padding-left: 12px;
  }

  .hero-copy {
    padding: 34px 22px 180px;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-btn,
  .secondary-btn {
    flex: none;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    translate: none !important;
  }

  .hero-media {
    transform: none !important;
  }

  .hero-media::before {
    transform: scale(1.025);
  }

  .storage-dot {
    box-shadow: 0 0 0 5px rgba(85, 150, 109, 0.12);
  }

  .route-progress span {
    animation: none !important;
  }
}
