/* ============================================================
   BUBBLE VANGUARD · 小说阅览室
   ============================================================ */

body.novel-open {
  overflow: hidden;
}

.novel-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px 0 13px;
  border: 1px solid rgba(236, 194, 120, .42);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(240, 204, 140, .12), rgba(240, 204, 140, .04));
  color: #f2d59b;
  font-family: var(--font-ui, "Microsoft YaHei", "PingFang SC", sans-serif);
  font-size: 12px;
  letter-spacing: .14em;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.novel-btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  opacity: .9;
}

.novel-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(245, 207, 141, .8);
  background: linear-gradient(180deg, rgba(240, 204, 140, .22), rgba(240, 204, 140, .08));
}

.novel-btn:active {
  transform: translateY(0);
}

/* ---------------- full screen ---------------- */

.novel-screen {
  --n-ink: #06151b;
  --n-deep: #0a2229;
  --n-panel: rgba(12, 35, 41, .82);
  --n-gold: #e8b76d;
  --n-gold-soft: #f3d9a3;
  --n-teal: #7fc9c1;
  --n-text: #d9e5df;
  --n-muted: #8eaaa5;
  --n-paper: #f7eedc;
  --n-paper-ink: #2d2a23;
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  overflow: hidden;
  color: var(--n-text);
  background:
    radial-gradient(1000px 620px at 72% -12%, rgba(229, 178, 102, .18), transparent 63%),
    radial-gradient(820px 600px at -8% 104%, rgba(73, 151, 145, .17), transparent 65%),
    linear-gradient(142deg, #041218 0%, #0a2027 48%, #06151b 100%);
  font-family: var(--font-ui, "Microsoft YaHei", "PingFang SC", sans-serif);
  animation: novelScreenIn .45s cubic-bezier(.2, .7, .2, 1) both;
}

.novel-screen[hidden] {
  display: none !important;
}

.novel-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 4px),
    radial-gradient(rgba(255, 255, 255, .15) .6px, transparent .7px);
  background-size: auto, 5px 5px;
  mix-blend-mode: soft-light;
}

.novel-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 180px 30px rgba(0, 0, 0, .55);
}

.novel-atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.n-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
}

.n-glow-a {
  width: min(52vw, 720px);
  height: min(52vw, 720px);
  right: -8%;
  top: -20%;
  background: radial-gradient(circle, rgba(232, 183, 109, .14), transparent 68%);
}

.n-glow-b {
  width: min(42vw, 560px);
  height: min(42vw, 560px);
  left: -12%;
  bottom: -22%;
  background: radial-gradient(circle, rgba(78, 173, 165, .14), transparent 68%);
}

.n-mote {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--n-gold-soft);
  box-shadow: 0 0 13px 3px rgba(240, 201, 136, .38);
  opacity: .5;
  animation: nFloat 9s ease-in-out infinite;
}

.nm1 { left: 13%; top: 22%; animation-delay: -1s; }
.nm2 { left: 39%; top: 12%; width: 2px; height: 2px; opacity: .3; animation-delay: -4s; }
.nm3 { right: 18%; top: 31%; width: 3px; height: 3px; animation-delay: -6s; }
.nm4 { right: 7%; bottom: 30%; opacity: .25; animation-delay: -3s; }
.nm5 { left: 28%; bottom: 15%; width: 2px; height: 2px; opacity: .35; animation-delay: -7s; }

.n-fog {
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: -26%;
  height: 56%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 35% 50%, rgba(126, 195, 188, .11), transparent 62%),
    radial-gradient(ellipse at 68% 43%, rgba(194, 207, 195, .07), transparent 60%);
  filter: blur(26px);
}

.novel-shell {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: min(1480px, 100%);
  height: 100dvh;
  margin: 0 auto;
  padding: 24px clamp(16px, 3.1vw, 46px) 0;
}

/* ---------------- header ---------------- */

.novel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex: 0 0 auto;
}

.novel-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: #f4e8cd;
  font-family: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  font-size: 21px;
  letter-spacing: .16em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, .32);
}

.novel-brand small {
  display: block;
  margin-top: 4px;
  color: #76938e;
  font-family: var(--font-ui, "Microsoft YaHei", sans-serif);
  font-size: 8px;
  letter-spacing: .27em;
  white-space: nowrap;
}

.novel-mark {
  position: relative;
  display: block;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(238, 197, 123, .55);
  border-radius: 50%;
  background: radial-gradient(circle at 39% 33%, #fff3c9 0 5%, #e9bd74 13%, #916333 40%, #16272a 75%);
  box-shadow: 0 0 24px rgba(232, 183, 109, .22), inset 0 0 12px rgba(255, 242, 201, .3);
}

.novel-mark::before,
.novel-mark::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 228, 169, .38);
}

.novel-mark::before {
  inset: -5px;
  border-top-color: transparent;
  border-left-color: transparent;
  transform: rotate(-24deg);
}

.novel-mark::after {
  inset: 7px;
  border-color: rgba(255, 248, 220, .5);
}

.novel-mark i {
  position: absolute;
  inset: 0;
  display: block;
}

.novel-mark i::before,
.novel-mark i::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff6d3;
  box-shadow: 0 0 9px 2px rgba(255, 225, 159, .8);
  transform: translate(-50%, -50%);
}

.novel-mark i::after {
  width: 1px;
  height: 1px;
  box-shadow: 13px -9px 0 0 #f9ddb0, -12px 8px 0 0 #e1af6c, 8px 14px 0 0 rgba(244, 219, 166, .5);
}

.novel-close {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border: 1px solid rgba(184, 208, 201, .2);
  border-radius: 999px;
  background: rgba(8, 24, 29, .35);
  color: #b9ccc5;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: .08em;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.novel-close svg {
  width: 14px;
  height: 14px;
}

.novel-close:hover {
  color: #f2d59b;
  border-color: rgba(232, 183, 109, .45);
  background: rgba(232, 183, 109, .06);
}

/* ---------------- layout and vertical rail ---------------- */

.novel-layout {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  gap: 26px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 25px 0 28px;
}

.novel-rail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 22px 13px 16px;
  border: 1px solid rgba(194, 218, 209, .13);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(15, 45, 51, .84), rgba(6, 22, 28, .9));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .23), inset 0 1px rgba(255, 255, 255, .035);
  backdrop-filter: blur(18px);
}

.rail-caption {
  display: block;
  padding: 0 10px 20px;
  color: #8ea8a2;
  font-family: "Songti SC", "STSong", serif;
  font-size: 12px;
  letter-spacing: .25em;
}

.rail-caption small {
  display: block;
  margin-top: 6px;
  color: #587873;
  font-family: var(--font-ui, "Microsoft YaHei", sans-serif);
  font-size: 7px;
  letter-spacing: .22em;
}

.rail-btn {
  position: relative;
  display: block;
  width: 100%;
  min-height: 92px;
  padding: 14px 14px 13px;
  border: 1px solid transparent;
  border-radius: 17px;
  background: transparent;
  color: #a8c2bc;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: background .25s ease, border-color .25s ease, color .25s ease, transform .25s ease;
}

.rail-btn + .rail-btn {
  margin-top: 5px;
}

.rail-btn:hover {
  border-color: rgba(232, 183, 109, .18);
  background: rgba(255, 255, 255, .035);
  color: #f2e1c3;
  transform: translateX(2px);
}

.rail-btn.is-active {
  border-color: rgba(255, 229, 177, .65);
  background:
    radial-gradient(90% 130% at 10% 0%, #f7dfad, #e6b873 48%, #c79858 100%);
  color: #1e2926;
  box-shadow: 0 10px 30px rgba(210, 162, 87, .18), inset 0 1px rgba(255, 255, 255, .55);
}

.rail-no {
  display: block;
  color: #7f9e96;
  font-family: "Times New Roman", serif;
  font-size: 10px;
  letter-spacing: .18em;
}

.rail-btn.is-active .rail-no {
  color: rgba(31, 43, 38, .55);
}

.rail-btn b {
  display: block;
  margin: 9px 0 5px;
  font-family: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .13em;
}

.rail-btn small {
  display: block;
  color: #5e7d76;
  font-size: 7px;
  letter-spacing: .18em;
}

.rail-btn.is-active small {
  color: rgba(34, 48, 42, .52);
}

.rail-game {
  margin-top: 14px;
  border-top: 1px solid rgba(194, 218, 209, .1);
  border-radius: 0 0 17px 17px;
  padding-top: 18px;
}

.rail-game b {
  color: #e2c18d;
}

.rail-game:hover b {
  color: #f5dda9;
}

.rail-btn.is-active.rail-game b {
  color: #1e2926;
}

.rail-foot {
  margin-top: auto;
  padding: 22px 10px 3px;
  color: #58746e;
}

.rail-foot span {
  display: block;
  width: 22px;
  height: 1px;
  margin-bottom: 11px;
  background: #8b6539;
}

.rail-foot p {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: .08em;
}

/* ---------------- shared views ---------------- */

.novel-content {
  position: relative;
  min-width: 0;
  min-height: 0;
}

.novel-view {
  height: 100%;
  min-height: 0;
}

.novel-select {
  position: relative;
  overflow-y: auto;
  padding: 2px 8px 46px 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 183, 109, .32) transparent;
}

.novel-select::after {
  content: "灯";
  position: fixed;
  right: 2vw;
  bottom: -9vh;
  z-index: 0;
  color: rgba(230, 187, 116, .035);
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(260px, 30vw, 460px);
  line-height: 1;
  pointer-events: none;
}

.novel-title-row,
.novel-cards,
.reading-path,
.novel-note {
  position: relative;
  z-index: 1;
}

.novel-select::-webkit-scrollbar,
.reader-scroll::-webkit-scrollbar {
  width: 7px;
}

.novel-select::-webkit-scrollbar-thumb,
.reader-scroll::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(232, 183, 109, .28);
}

.novel-select::-webkit-scrollbar-track,
.reader-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.novel-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 4px 25px;
}

.novel-kicker {
  color: var(--n-gold);
  font-family: "Times New Roman", serif;
  font-size: 10px;
  letter-spacing: .24em;
}

.novel-title-row h1 {
  margin: 11px 0 9px;
  color: #f6ead1;
  font-family: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  font-size: clamp(36px, 4.1vw, 58px);
  font-weight: 500;
  letter-spacing: .16em;
  line-height: 1.12;
  text-shadow: 0 4px 30px rgba(0, 0, 0, .35);
}

.novel-title-row p {
  margin: 0;
  color: #8fa9a3;
  font-family: "Songti SC", "STSong", serif;
  font-size: 13px;
  letter-spacing: .08em;
}

.novel-stamp {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 77px;
  height: 77px;
  margin-right: 9px;
  border: 1px solid rgba(220, 174, 103, .4);
  border-radius: 50%;
  color: rgba(230, 190, 124, .7);
  font-family: "Songti SC", "STSong", serif;
  font-size: 12px;
  letter-spacing: .2em;
  line-height: 1.55;
  text-align: center;
  transform: rotate(8deg);
  box-shadow: inset 0 0 0 4px rgba(230, 190, 124, .035);
}

.novel-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.chapter-card {
  position: relative;
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  min-height: 354px;
  overflow: hidden;
  border: 1px solid rgba(213, 191, 154, .16);
  border-radius: 6px 24px 7px 24px;
  background: linear-gradient(150deg, rgba(17, 45, 49, .9), rgba(7, 24, 30, .92));
  cursor: pointer;
  outline: none;
  transition: transform .3s cubic-bezier(.2, .7, .2, 1), border-color .3s ease, box-shadow .3s ease;
}

.chapter-card::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(235, 207, 155, .06);
  border-radius: 3px 18px 4px 18px;
  pointer-events: none;
}

.chapter-card:hover,
.chapter-card:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(232, 183, 109, .48);
  box-shadow: 0 22px 56px rgba(0, 0, 0, .34), 0 0 0 1px rgba(232, 183, 109, .06);
}

.chapter-card:focus-visible {
  box-shadow: 0 0 0 2px rgba(240, 202, 132, .7);
}

.chapter-cover {
  position: relative;
  overflow: hidden;
  min-height: 100%;
  border-right: 1px solid rgba(231, 201, 153, .14);
  background: #102d31;
}

.cover-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.cover-art::before {
  content: "";
  position: absolute;
  inset: 15px;
  border: 1px solid rgba(249, 226, 181, .18);
  border-radius: 50% 50% 8px 8px;
  opacity: .8;
}

.cover-art::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(249, 225, 177, .35), transparent);
  box-shadow: 0 0 18px rgba(240, 198, 124, .32);
}

.cover-lamp {
  background:
    radial-gradient(circle at 52% 38%, rgba(255, 238, 184, .72) 0 2.5%, rgba(239, 196, 121, .24) 3% 15%, transparent 16%),
    radial-gradient(circle at 50% 40%, rgba(225, 173, 94, .27), transparent 46%),
    linear-gradient(165deg, #294d4a 0%, #132f31 52%, #081b20 100%);
}

.cover-fog {
  background:
    radial-gradient(circle at 54% 34%, rgba(180, 235, 221, .3) 0 2%, transparent 3%),
    radial-gradient(ellipse at 35% 38%, rgba(127, 201, 193, .2), transparent 34%),
    linear-gradient(160deg, #244b51 0%, #112e37 55%, #071920 100%);
}

.cover-lamp .cover-halo {
  position: absolute;
  left: 50%;
  top: 36%;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 226, 154, .4), rgba(232, 183, 109, .14) 38%, transparent 68%);
  box-shadow: 0 0 50px 10px rgba(232, 183, 109, .16);
}

.cover-fog .cover-halo {
  position: absolute;
  left: 50%;
  top: 37%;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(190, 240, 223, .24), rgba(127, 201, 193, .08) 42%, transparent 68%);
  filter: blur(4px);
}

.cover-glyph {
  position: absolute;
  right: -1px;
  bottom: -17px;
  color: rgba(248, 229, 194, .11);
  font-family: "Songti SC", "STSong", serif;
  font-size: 136px;
  line-height: 1;
  pointer-events: none;
}

.cover-no {
  position: absolute;
  left: 19px;
  top: 17px;
  z-index: 2;
  color: rgba(250, 231, 196, .66);
  font-family: "Times New Roman", serif;
  font-size: 11px;
  letter-spacing: .2em;
}

.cover-caption {
  position: absolute;
  left: 19px;
  bottom: 17px;
  z-index: 2;
  color: rgba(248, 229, 194, .56);
  font-family: "Songti SC", "STSong", serif;
  font-size: 10px;
  letter-spacing: .22em;
  writing-mode: vertical-rl;
}

.cover-line {
  position: absolute;
  left: 50%;
  top: 54%;
  width: 1px;
  height: 31%;
  background: linear-gradient(180deg, rgba(249, 225, 177, .42), transparent);
  transform: translateX(-50%);
}

.cover-lamp .cover-line {
  box-shadow: 0 0 12px rgba(240, 195, 120, .35);
}

.card-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 21px 20px 18px;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-ordinal {
  color: var(--n-gold);
  font-family: "Songti SC", "STSong", serif;
  font-size: 11px;
  letter-spacing: .2em;
}

.card-read {
  color: #76948d;
  font-size: 9px;
  letter-spacing: .08em;
  white-space: nowrap;
}

.card-read.is-new {
  color: #d5b477;
}

.card-body h2 {
  margin: 15px 0 7px;
  color: #f0e3c8;
  font-family: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  font-size: clamp(22px, 2.1vw, 30px);
  font-weight: 500;
  letter-spacing: .06em;
  line-height: 1.3;
}

.card-sub {
  margin: 0 0 13px;
  color: #b5a98f;
  font-family: "Songti SC", "STSong", serif;
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: .03em;
}

.card-synopsis {
  margin: 0 0 14px;
  color: #8fa7a1;
  font-size: 11.5px;
  line-height: 1.85;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
}

.card-tags span {
  padding: 3px 7px;
  border: 1px solid rgba(224, 191, 137, .15);
  border-radius: 99px;
  color: #9b8a6d;
  font-size: 9px;
  letter-spacing: .06em;
}

.card-bottom {
  margin-top: 15px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #6f8b84;
  font-size: 9px;
  letter-spacing: .05em;
}

.card-meta i {
  display: block;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #a17845;
}

.card-progress {
  height: 2px;
  margin: 10px 0 12px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(218, 190, 145, .13);
}

.card-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b18145, #efd095);
  box-shadow: 0 0 9px rgba(235, 192, 117, .35);
}

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #e4bd80;
  font-family: "Songti SC", "STSong", serif;
  font-size: 12px;
  letter-spacing: .12em;
}

.card-cta em {
  font-style: normal;
  transition: transform .2s ease;
}

.chapter-card:hover .card-cta em {
  transform: translateX(4px);
}

.reading-path {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 820px;
  margin: 24px 4px 0;
  padding: 12px 14px;
  border: 1px solid rgba(198, 218, 207, .1);
  border-radius: 3px 12px 3px 12px;
  background: rgba(9, 29, 34, .35);
}

.path-label {
  margin-right: 5px;
  color: #6f8c84;
  font-size: 9px;
  letter-spacing: .14em;
}

.reading-path b {
  color: #b8a482;
  font-family: "Songti SC", "STSong", serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .06em;
}

.reading-path i {
  color: #9c713a;
  font-family: "Times New Roman", serif;
  font-size: 11px;
  font-style: normal;
}

.reading-path b.is-soon {
  color: #647f78;
}

.novel-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 820px;
  margin: 16px 4px 0;
  padding-top: 16px;
  border-top: 1px solid rgba(202, 218, 207, .09);
  color: #69847d;
}

.note-mark {
  color: #b98b50;
  font-size: 11px;
  line-height: 1.8;
}

.novel-note p {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: .03em;
}

/* ---------------- reader ---------------- */

.novel-reader {
  display: flex;
  flex-direction: column;
  min-height: 0;
  --reader-size: 17px;
}

.novel-reader[hidden] {
  display: none !important;
}

.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 4px 10px;
}

.reader-back,
.font-btn {
  border: 0;
  background: transparent;
  color: #9bb3ac;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: .08em;
  cursor: pointer;
}

.reader-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
}

.reader-back span {
  color: var(--n-gold);
  font-size: 15px;
  transition: transform .2s ease;
}

.reader-back:hover {
  color: #eed8b4;
}

.reader-back:hover span {
  transform: translateX(-3px);
}

.reader-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reader-restart {
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: #718e86;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: .06em;
  cursor: pointer;
}

.reader-restart:hover {
  color: #e2c18d;
}

.reader-percent {
  min-width: 32px;
  color: #7f9b93;
  font-family: "Times New Roman", serif;
  font-size: 10px;
  text-align: right;
}

.font-btn {
  width: 29px;
  height: 29px;
  padding: 0;
  border: 1px solid rgba(189, 210, 201, .16);
  border-radius: 50%;
  color: #a5bab4;
  font-family: "Times New Roman", "Songti SC", serif;
  font-size: 11px;
  line-height: 1;
}

.font-btn:hover {
  border-color: rgba(232, 183, 109, .42);
  color: #ecd49e;
}

.reader-progress {
  flex: 0 0 auto;
  height: 1px;
  margin: 0 4px 0;
  overflow: hidden;
  background: rgba(218, 190, 145, .1);
}

.reader-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #b4834a, #f0d29a);
  box-shadow: 0 0 10px rgba(240, 206, 146, .42);
  transition: width .15s linear;
}

.reader-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 15px 6px 50px;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 183, 109, .3) transparent;
}

.reader-scroll:focus {
  outline: none;
}

.novel-article {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(34px, 5vw, 66px) clamp(24px, 5vw, 68px) 54px;
  overflow: hidden;
  border-radius: 4px 22px 6px 22px;
  background:
    radial-gradient(ellipse at 12% -4%, rgba(255, 255, 255, .85), transparent 44%),
    radial-gradient(ellipse at 94% 104%, rgba(191, 161, 106, .11), transparent 42%),
    linear-gradient(142deg, #fbf4e6 0%, #f8efdc 54%, #f1e4ca 100%);
  color: var(--n-paper-ink);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, .38),
    0 2px 0 rgba(255, 249, 231, .4) inset,
    0 0 0 1px rgba(118, 83, 37, .11);
}

.novel-article::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .45;
  background:
    repeating-linear-gradient(0deg, rgba(121, 91, 48, .025) 0 1px, transparent 1px 5px),
    radial-gradient(rgba(100, 74, 37, .11) .5px, transparent .6px);
  background-size: auto, 4px 4px;
  mix-blend-mode: multiply;
}

.novel-article::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 27px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(172, 121, 61, .17) 9%, rgba(172, 121, 61, .17) 91%, transparent);
}

.chapter-head {
  position: relative;
  z-index: 1;
  padding-bottom: 27px;
  border-bottom: 1px solid rgba(145, 105, 52, .18);
  text-align: center;
}

.chapter-head .chapter-kicker {
  color: #a17941;
  font-family: "Times New Roman", serif;
  font-size: 9px;
  letter-spacing: .24em;
}

.chapter-roman {
  margin-top: 12px;
  color: #a47a43;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 12px;
  letter-spacing: .3em;
}

.chapter-roman span {
  margin-left: 11px;
  color: #b09b7a;
  font-size: 10px;
  letter-spacing: .16em;
}

.chapter-head h1 {
  margin: 19px 0 11px;
  color: #29261f;
  font-family: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 500;
  letter-spacing: .08em;
  line-height: 1.28;
}

.chapter-sub {
  margin: 0;
  color: #8d7c61;
  font-family: "Songti SC", "STSong", serif;
  font-size: 12px;
  letter-spacing: .06em;
}

.chapter-quote {
  position: relative;
  max-width: 360px;
  margin: 24px auto 0;
  color: #7b6b53;
  font-family: "Songti SC", "STSong", serif;
  font-size: 12px;
  line-height: 1.9;
  letter-spacing: .03em;
}

.chapter-quote::before,
.chapter-quote::after {
  content: "·";
  margin: 0 8px;
  color: #b78b51;
}

.chapter-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 23px;
  color: #a08e72;
  font-size: 9px;
  letter-spacing: .06em;
}

.chapter-meta i {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #b78b51;
}

.chapter-toc {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin: 23px 0 0;
}

.toc-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid rgba(146, 107, 55, .16);
  border-radius: 99px;
  background: rgba(255, 252, 242, .35);
  color: #8d7b5f;
  font-family: inherit;
  font-size: 9px;
  letter-spacing: .03em;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}

.toc-chip b {
  color: #b58a50;
  font-family: "Times New Roman", serif;
  font-size: 8px;
  font-weight: normal;
}

.toc-chip:hover {
  border-color: rgba(154, 111, 52, .38);
  background: rgba(255, 251, 238, .75);
  color: #5e4d35;
}

.chapter-body {
  position: relative;
  z-index: 1;
  padding-top: 17px;
}

.novel-section {
  padding-top: 34px;
}

.novel-section h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 17px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 106, 53, .13);
  color: #4b4030;
  font-family: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .07em;
  line-height: 1.5;
}

.novel-section h2 .section-no {
  color: #b08a55;
  font-family: "Times New Roman", serif;
  font-size: 10px;
  font-weight: normal;
  letter-spacing: .12em;
}

.novel-section p {
  margin: 0 0 .9em;
  color: #373229;
  font-family: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  font-size: var(--reader-size);
  line-height: 2.04;
  letter-spacing: .015em;
  text-align: justify;
  text-indent: 2em;
  text-size-adjust: 100%;
}

.novel-section p.dialogue {
  color: #3f382d;
}

.novel-section p.special {
  color: #6f5d43;
  font-style: italic;
  text-align: center;
  text-indent: 0;
  letter-spacing: .1em;
}

.chapter-end {
  position: relative;
  z-index: 1;
  margin-top: 37px;
  padding-top: 27px;
  border-top: 1px solid rgba(148, 106, 53, .17);
  text-align: center;
}

.end-ornament {
  color: #b2884e;
  font-size: 11px;
  letter-spacing: .4em;
}

.end-note {
  margin: 12px 0 0;
  color: #a18d6f;
  font-family: "Songti SC", "STSong", serif;
  font-size: 10px;
  letter-spacing: .08em;
}

.chapter-next {
  margin-top: 27px;
  padding: 18px 19px;
  border: 1px solid rgba(148, 106, 53, .18);
  border-radius: 3px 12px 3px 12px;
  background: rgba(255, 251, 239, .38);
  text-align: left;
}

.chapter-next span {
  color: #a0845d;
  font-size: 9px;
  letter-spacing: .16em;
}

.chapter-next b {
  display: block;
  margin: 8px 0 12px;
  color: #4a3f2e;
  font-family: "Songti SC", "STSong", serif;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: .06em;
}

.chapter-next button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #9d713a;
  font-family: "Songti SC", "STSong", serif;
  font-size: 11px;
  letter-spacing: .1em;
  cursor: pointer;
}

.chapter-next button:hover {
  color: #6f4b21;
}

.chapter-next.is-end {
  border-color: rgba(148, 106, 53, .12);
  background: rgba(255, 251, 239, .22);
}

.chapter-next.is-end p {
  margin: 0 0 12px;
  color: #88765b;
  font-family: "Songti SC", "STSong", serif;
  font-size: 11px;
  line-height: 1.8;
}

/* ---------------- animations ---------------- */

@keyframes novelScreenIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes nFloat {
  0%, 100% { transform: translate3d(0, 0, 0); opacity: .28; }
  45% { transform: translate3d(6px, -17px, 0); opacity: .62; }
  72% { transform: translate3d(-4px, -27px, 0); opacity: .4; }
}

@keyframes novelRise {
  from { opacity: 0; transform: translateY(11px); }
  to { opacity: 1; transform: translateY(0); }
}

.novel-view:not([hidden]) .novel-title-row,
.novel-view:not([hidden]) .chapter-card,
.novel-view:not([hidden]) .novel-article {
  animation: novelRise .55s cubic-bezier(.2, .7, .2, 1) both;
}

.novel-view:not([hidden]) .chapter-card:nth-child(2) {
  animation-delay: .07s;
}

/* ---------------- responsive ---------------- */

@media (max-width: 1180px) {
  .novel-cards {
    grid-template-columns: 1fr;
    max-width: 760px;
  }

  .chapter-card {
    grid-template-columns: 170px minmax(0, 1fr);
    min-height: 250px;
  }

  .card-synopsis {
    max-width: 560px;
  }
}

@media (max-width: 900px) {
  .novel-shell {
    padding-left: 18px;
    padding-right: 18px;
  }

  .novel-layout {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 15px;
    padding-top: 18px;
  }

  .novel-rail {
    padding: 16px 8px 13px;
    border-radius: 20px;
  }

  .rail-caption {
    padding: 0 5px 14px;
    font-size: 10px;
  }

  .rail-caption small,
  .rail-btn small,
  .rail-foot {
    display: none;
  }

  .rail-btn {
    min-height: 76px;
    padding: 10px 9px;
    border-radius: 14px;
    text-align: left;
  }

  .rail-btn b {
    margin: 8px 0 0;
    font-size: 14px;
    letter-spacing: .05em;
  }

  .rail-no {
    font-size: 9px;
  }

  .novel-title-row h1 {
    font-size: clamp(32px, 5.4vw, 46px);
  }

  .novel-stamp {
    width: 64px;
    height: 64px;
    font-size: 10px;
  }

  .chapter-card {
    grid-template-columns: 155px minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  /* The game's title dialog is a full-viewport overlay on phones. Keep the
     top bar above it so the novel room stays reachable before play. */
  .game-shell > .topbar {
    position: relative;
    z-index: 130;
  }
}

@media (max-width: 700px) {
  .novel-btn {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

  .novel-btn span {
    display: none;
  }

  .novel-shell {
    padding: 14px 10px 0;
  }

  .novel-header {
    padding: 0 2px;
  }

  .novel-brand {
    gap: 9px;
    font-size: 16px;
    letter-spacing: .1em;
  }

  .novel-brand small {
    font-size: 6px;
    letter-spacing: .18em;
  }

  .novel-mark {
    width: 28px;
    height: 28px;
  }

  .novel-close {
    padding: 7px;
    border-radius: 50%;
  }

  .novel-close span {
    display: none;
  }

  .novel-layout {
    grid-template-columns: 66px minmax(0, 1fr);
    gap: 8px;
    padding: 12px 0 0;
  }

  .novel-rail {
    align-self: start;
    position: sticky;
    top: 0;
    height: max-content;
    padding: 10px 5px;
    border-radius: 17px;
  }

  .rail-caption {
    display: none;
  }

  .rail-btn {
    min-height: 68px;
    padding: 8px 5px;
    border-radius: 12px;
    text-align: center;
  }

  .rail-btn b {
    margin-top: 7px;
    font-size: 11px;
    letter-spacing: 0;
  }

  .rail-no {
    font-size: 8px;
  }

  .rail-game {
    margin-top: 8px;
    padding-top: 12px;
  }

  .novel-select {
    padding: 0 3px 32px 0;
  }

  .novel-title-row {
    align-items: flex-start;
    padding: 3px 3px 17px;
  }

  .novel-stamp {
    display: none;
  }

  .novel-kicker {
    font-size: 8px;
    letter-spacing: .16em;
  }

  .novel-title-row h1 {
    margin: 8px 0 7px;
    font-size: 31px;
    letter-spacing: .1em;
  }

  .novel-title-row p {
    font-size: 11px;
  }

  .novel-cards {
    gap: 11px;
  }

  .chapter-card {
    grid-template-columns: 108px minmax(0, 1fr);
    min-height: 205px;
    border-radius: 4px 17px 5px 17px;
  }

  .chapter-cover {
    border-right-color: rgba(231, 201, 153, .1);
  }

  .cover-art::before {
    inset: 10px;
  }

  .cover-no {
    left: 12px;
    top: 11px;
    font-size: 9px;
  }

  .cover-caption {
    left: 12px;
    bottom: 11px;
    font-size: 8px;
  }

  .cover-glyph {
    right: -4px;
    bottom: -8px;
    font-size: 92px;
  }

  .card-body {
    padding: 13px 12px 12px;
  }

  .card-ordinal {
    font-size: 9px;
  }

  .card-read {
    font-size: 8px;
  }

  .card-body h2 {
    margin: 10px 0 5px;
    font-size: 18px;
  }

  .card-sub {
    margin-bottom: 8px;
    font-size: 10px;
    line-height: 1.55;
  }

  .card-synopsis {
    display: -webkit-box;
    overflow: hidden;
    margin-bottom: 8px;
    font-size: 10px;
    line-height: 1.7;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }

  .card-tags,
  .card-progress {
    display: none;
  }

  .card-meta {
    font-size: 8px;
  }

  .card-bottom {
    margin-top: auto;
  }

  .card-cta {
    margin-top: 8px;
    font-size: 10px;
  }

  .reading-path {
    margin-top: 17px;
    padding: 9px 10px;
    gap: 5px;
  }

  .path-label {
    width: 100%;
    margin: 0 0 3px;
    font-size: 8px;
  }

  .reading-path b {
    font-size: 10px;
  }

  .novel-note {
    margin-top: 14px;
    padding-top: 13px;
  }

  .novel-note p {
    font-size: 10px;
  }

  .reader-toolbar {
    min-height: 32px;
    padding-bottom: 7px;
  }

  .reader-back {
    font-size: 10px;
  }

  .reader-percent {
    font-size: 9px;
  }

  .font-btn {
    width: 26px;
    height: 26px;
    font-size: 10px;
  }

  .reader-scroll {
    padding: 9px 1px 32px;
  }

  .novel-article {
    padding: 29px 19px 36px;
    border-radius: 3px 13px 4px 13px;
  }

  .novel-article::after {
    left: 9px;
  }

  .chapter-head {
    padding-bottom: 20px;
  }

  .chapter-head .chapter-kicker {
    font-size: 7px;
    letter-spacing: .17em;
  }

  .chapter-roman {
    margin-top: 9px;
    font-size: 10px;
  }

  .chapter-head h1 {
    margin: 13px 0 8px;
    font-size: 29px;
    letter-spacing: .04em;
  }

  .chapter-sub {
    font-size: 10px;
  }

  .chapter-quote {
    margin-top: 16px;
    font-size: 10px;
  }

  .chapter-meta {
    margin-top: 16px;
    font-size: 8px;
  }

  .chapter-toc {
    margin-top: 16px;
    gap: 4px;
  }

  .toc-chip {
    padding: 4px 7px;
    font-size: 8px;
  }

  .chapter-body {
    padding-top: 10px;
  }

  .novel-section {
    padding-top: 25px;
  }

  .novel-section h2 {
    margin-bottom: 13px;
    padding-bottom: 8px;
    font-size: 16px;
  }

  .novel-section p {
    line-height: 1.97;
    letter-spacing: .005em;
  }

  .chapter-end {
    margin-top: 28px;
    padding-top: 21px;
  }

  .chapter-next {
    margin-top: 20px;
    padding: 14px 14px;
  }

  .chapter-next b {
    font-size: 15px;
  }
}

@media (max-width: 390px) {
  .novel-shell {
    padding-left: 7px;
    padding-right: 7px;
  }

  .novel-layout {
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 6px;
  }

  .rail-btn {
    min-height: 63px;
    padding: 7px 3px;
  }

  .rail-btn b {
    font-size: 10px;
  }

  .novel-article {
    padding-left: 15px;
    padding-right: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .novel-screen,
  .novel-view:not([hidden]) .novel-title-row,
  .novel-view:not([hidden]) .chapter-card,
  .novel-view:not([hidden]) .novel-article,
  .n-mote {
    animation: none !important;
  }

  .reader-scroll {
    scroll-behavior: auto;
  }
}
