/* ============================================================
   《纸上魔法使》粉丝展示站 · 设计系统
   视觉基调：奶油纸 × 墨色 × 抹茶绿 × 宝石点彩（源自游戏 UI 与章节宝石）
   ============================================================ */

/* 内嵌字体子集（仅含站内用字）：标题衬线＝中易宋体，台词楷体＝楷体 */
@font-face {
  font-family: "Kami Serif";
  src: url("../assets/fonts/kami-serif.woff2") format("woff2");
  font-weight: normal; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Kami Kai";
  src: url("../assets/fonts/kami-kai.woff2") format("woff2");
  font-weight: normal; font-style: normal; font-display: swap;
}

:root {
  /* 纸与墨 */
  --paper: #f7f2e5;
  --paper-2: #efe8d4;
  --paper-3: #e7dcc2;
  --card: #fbf8ef;
  --ink: #3b3126;
  --ink-2: #5c5040;
  --ink-3: #8a7a63;
  --line: rgba(138, 122, 99, .28);

  /* 品牌（ウグイスカグラ logo 绿 + 樱红） */
  --leaf: #6faf58;
  --leaf-deep: #4c7c3f;
  --leaf-soft: #dcead2;
  --sakura: #e8837a;

  /* 章节宝石 */
  --gem-hisui: #35a06c;
  --gem-ruby: #d4546b;
  --gem-sapphire: #3d7bc4;
  --gem-amethyst: #8d6bbf;
  --gem-apatite: #56b0a4;
  --gem-rose: #e298b4;
  --gem-blackpearl: #4a4a55;
  --gem-fluorite: #79c2b0;
  --gem-whitepearl: #b9b2a0;
  --gem-obsidian: #35323e;
  --gem-onyx: #2e2b34;
  --gem-lapis: #2f5fa8;
  --gem-alex: #3fae9a;

  --shadow: 0 10px 30px rgba(59, 49, 38, .12);
  --shadow-soft: 0 4px 14px rgba(59, 49, 38, .10);
  --radius: 14px;
  --serif: "Kami Serif", "Noto Serif SC", "Source Han Serif SC", "SimSun", "Yu Mincho", serif;
  --kai: "Kami Kai", "KaiTi", "STKaiti", "楷体", var(--serif);
  --sans: "Microsoft YaHei", "PingFang SC", "Segoe UI", "Helvetica Neue", sans-serif;
  --nav-h: 62px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.85;
  letter-spacing: .02em;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--leaf-deep); text-decoration: none; }
a:hover { color: var(--leaf); }
ul, ol { list-style: none; }

::selection { background: rgba(111, 175, 88, .35); }

/* 纸张纹理覆盖层 */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='.05'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===================== 导航 ===================== */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 44px);
  background: rgba(247, 242, 229, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: transform .35s ease, box-shadow .35s ease;
}
.site-nav.scrolled { box-shadow: var(--shadow-soft); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); }
.brand-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  object-fit: cover; display: block;
  border: 2px solid var(--leaf);
  box-shadow: 0 0 0 2px rgba(251,248,239,.9), var(--shadow-soft);
}
.brand-name { font-size: 18px; color: var(--ink); letter-spacing: .12em; }
.brand-name small { display: block; font-size: 10px; color: var(--ink-3); letter-spacing: .3em; }

.nav-links { display: flex; gap: clamp(10px, 2.4vw, 30px); }
.nav-links a {
  position: relative; color: var(--ink-2); font-size: 15px; padding: 6px 2px;
  letter-spacing: .08em;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--leaf); border-radius: 2px; transition: width .3s ease;
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--leaf-deep); font-weight: 600; }

.nav-burger { display: none; background: none; border: none; cursor: pointer; width: 40px; height: 40px; position: relative; }
.nav-burger span, .nav-burger span::before, .nav-burger span::after {
  content: ""; position: absolute; left: 8px; width: 24px; height: 2px; background: var(--ink); transition: .3s;
}
.nav-burger span { top: 19px; }
.nav-burger span::before { left: 0; top: -8px; }
.nav-burger span::after { left: 0; top: 8px; }
.nav-open .nav-burger span { background: transparent; }
.nav-open .nav-burger span::before { top: 0; transform: rotate(45deg); }
.nav-open .nav-burger span::after { top: 0; transform: rotate(-45deg); }

/* 阅读进度条 */
.progress-bar {
  position: fixed; top: var(--nav-h); left: 0; height: 3px; width: 0; z-index: 59;
  background: linear-gradient(90deg, var(--leaf), var(--gem-alex));
}

/* ===================== 通用布局 ===================== */
.wrap { width: min(1120px, 92vw); margin: 0 auto; position: relative; z-index: 2; }
section { position: relative; padding: clamp(56px, 9vw, 110px) 0; }
.sec-head { text-align: center; margin-bottom: clamp(30px, 5vw, 56px); }
.sec-head .sec-en {
  font-family: var(--serif); color: var(--leaf-deep); letter-spacing: .35em;
  font-size: 13px; text-transform: uppercase;
}
.sec-head h2 {
  font-family: var(--serif); font-size: clamp(26px, 4vw, 38px); letter-spacing: .14em;
  margin: 6px 0 10px; color: var(--ink);
}
.sec-head .sec-note { color: var(--ink-3); font-size: 14px; }
.gem-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 6px; vertical-align: middle; box-shadow: 0 0 8px currentColor; }

/* 分隔丝带 */
.divider-tape {
  width: 120px; height: 26px; margin: 0 auto;
  background: repeating-linear-gradient(45deg, rgba(111,175,88,.25) 0 8px, rgba(232,131,122,.22) 8px 16px);
  border-left: 2px dashed var(--leaf); border-right: 2px dashed var(--sakura);
  border-radius: 3px; opacity: .8;
}

/* ===================== 入场动画 ===================== */
.rv { opacity: 0; transform: translateY(34px); transition: opacity .9s ease, transform .9s cubic-bezier(.16,.84,.3,1); }
.rv.in { opacity: 1; transform: none; }
.rv-l { opacity: 0; transform: translateX(-40px); transition: opacity 1s ease, transform 1s cubic-bezier(.16,.84,.3,1); }
.rv-r { opacity: 0; transform: translateX(40px); transition: opacity 1s ease, transform 1s cubic-bezier(.16,.84,.3,1); }
.rv-l.in, .rv-r.in { opacity: 1; transform: none; }
[data-delay="1"] { transition-delay: .15s; }
[data-delay="2"] { transition-delay: .3s; }
[data-delay="3"] { transition-delay: .45s; }
[data-delay="4"] { transition-delay: .6s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
html.still *, html.still *::before, html.still *::after {
  animation-play-state: paused !important; transition: none !important;
}
html.still .book-fx, html.still .book-fx *, html.still .book.lift,
html.still .bfly, html.still .bfly * {
  animation-play-state: running !important;
}
html.still .hero-bg { transform: none !important; }
html.still #particles { display: none; }
html.still .rv, html.still .rv-l, html.still .rv-r { opacity: 1 !important; transform: none !important; }

/* ===================== 页面切换帷幕 ===================== */
.page-curtain {
  position: fixed; inset: 0; z-index: 200; pointer-events: none;
  background: var(--paper-2); opacity: 0; transition: opacity .4s ease;
}
.page-curtain.closing { opacity: 1; pointer-events: auto; }
body.leaving a { pointer-events: none; }

/* ===================== 英雄区 ===================== */
.hero {
  min-height: 100vh; display: grid; place-items: center; text-align: center;
  position: relative; overflow: hidden; padding-top: var(--nav-h);
}
.hero-bg {
  position: absolute; inset: -6% 0; z-index: 0;
  background-size: cover; background-position: center;
  animation: kenburns 26s ease-in-out infinite alternate;
  filter: saturate(1.05);
}
@keyframes kenburns {
  from { transform: scale(1.02) translateY(0); }
  to   { transform: scale(1.12) translateY(-2.5%); }
}
.hero-veil {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(ellipse at 50% 44%, rgba(247,242,229,.86) 0%, rgba(247,242,229,.5) 46%, rgba(247,242,229,.16) 76%, rgba(247,242,229,.5) 100%);
}
.hero-inner { position: relative; z-index: 2; padding: 40px 20px; }
.hero-kicker {
  font-family: var(--serif); color: var(--leaf-deep); letter-spacing: .5em; text-indent: .5em;
  font-size: clamp(12px, 1.6vw, 15px); margin-bottom: 18px;
  text-shadow: 0 1px 8px rgba(247,242,229,.95);
}
.hero-title-jp {
  writing-mode: vertical-rl; font-family: var(--serif); color: var(--ink);
  position: absolute; right: clamp(6px, 6vw, 90px); top: 50%; transform: translateY(-50%);
  font-size: clamp(18px, 2.6vw, 30px); letter-spacing: .42em; opacity: .55;
  border-right: 1px solid var(--line); padding-right: 14px; height: min(52vh, 420px);
}
.hero-title {
  font-family: var(--serif); font-weight: 700; color: var(--ink);
  font-size: clamp(44px, 9vw, 96px); letter-spacing: .18em; text-indent: .18em;
  line-height: 1.25;
  text-shadow: 0 0 26px rgba(247,242,229,.95), 0 0 10px rgba(247,242,229,.8), 0 2px 0 rgba(255,255,255,.65), 0 14px 34px rgba(59,49,38,.22);
}
.hero-title .accent { color: var(--leaf-deep); text-shadow: 0 0 26px rgba(247,242,229,.95), 0 0 10px rgba(247,242,229,.8), 0 2px 0 rgba(255,255,255,.65); }
.hero-sub {
  margin-top: 18px; color: var(--ink); font-family: var(--kai);
  font-size: clamp(15px, 2.2vw, 20px); letter-spacing: .22em;
  text-shadow: 0 0 14px rgba(247,242,229,.95), 0 0 6px rgba(247,242,229,.85);
}
.hero-cta { margin-top: 34px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 30px; border-radius: 999px; font-size: 15px; letter-spacing: .14em;
  border: 1px solid var(--leaf-deep); color: var(--leaf-deep); background: rgba(251,248,239,.75);
  transition: all .3s ease; cursor: pointer; font-family: var(--serif);
}
.btn:hover { background: var(--leaf-deep); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow); }
.btn.solid { background: var(--leaf-deep); color: #fff; }
.btn.solid:hover { background: var(--leaf); border-color: var(--leaf); }
.btn.ghost { border-color: var(--line); color: var(--ink-2); }
.btn.ghost:hover { border-color: var(--ink-3); background: var(--card); color: var(--ink); }

.scroll-cue {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 2;
  color: var(--ink-3); font-size: 12px; letter-spacing: .3em; text-align: center;
}
.scroll-cue::after {
  content: ""; display: block; width: 1px; height: 44px; margin: 10px auto 0;
  background: linear-gradient(var(--ink-3), transparent);
  animation: cue 2s ease infinite;
}
@keyframes cue { 0% { transform: scaleY(0); transform-origin: top; } 55% { transform: scaleY(1); } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* 粒子画布 */
#particles { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .8; }

/* ===================== 开场 loading ===================== */
.loader {
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: center;
  background: linear-gradient(160deg, #2e2a24, #4a4238 70%, #3b3126);
  color: var(--paper); transition: opacity 1s ease, visibility 1s;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader-book { text-align: center; }
.loader-quill { font-size: 44px; animation: floaty 3s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-10px) rotate(4deg); } }
.loader-text { margin-top: 18px; font-family: var(--serif); letter-spacing: .4em; font-size: 15px; }
.loader-bar { width: 200px; height: 2px; background: rgba(247,242,229,.2); margin: 22px auto 0; overflow: hidden; border-radius: 2px; }
.loader-bar i { display: block; height: 100%; width: 40%; background: var(--leaf-soft); border-radius: 2px; animation: loadslide 1.4s ease-in-out infinite; }
@keyframes loadslide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

/* 开场白（打字机） */
.prologue-sec { background: linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%); }
.typed-card {
  position: relative; max-width: 720px; margin: 0 auto; padding: clamp(30px, 5vw, 56px);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.typed-card::before {
  content: ""; position: absolute; inset: 10px; border: 1px dashed rgba(138,122,99,.35); border-radius: 10px; pointer-events: none;
}
.typed-card .washi { position: absolute; top: -14px; left: 50%; transform: translateX(-50%) rotate(-2deg); width: 110px; height: 28px; background: rgba(111,175,88,.35); box-shadow: var(--shadow-soft); }
.typed-text { font-family: var(--kai); font-size: clamp(16px, 2.4vw, 21px); line-height: 2.3; letter-spacing: .1em; min-height: 8.5em; }
.typed-text .caret { display: inline-block; width: 1px; height: 1.1em; background: var(--leaf-deep); vertical-align: -0.15em; margin-left: 3px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.typed-sign { text-align: right; color: var(--ink-3); font-size: 13px; letter-spacing: .2em; margin-top: 14px; }

/* ===================== 首页 · 三概念卡 ===================== */
.concept-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.concept-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 34px 28px; position: relative; overflow: hidden; box-shadow: var(--shadow-soft);
  transition: transform .4s ease, box-shadow .4s ease;
}
.concept-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.concept-card .glyph {
  font-size: 30px; width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center; margin-bottom: 18px;
  background: var(--leaf-soft); color: var(--leaf-deep);
}
.concept-card:nth-child(2) .glyph { background: #fbe4e1; color: #c05a52; }
.concept-card:nth-child(3) .glyph { background: #dfe9f5; color: #35619e; }
.concept-card h3 { font-family: var(--serif); font-size: 20px; letter-spacing: .1em; margin-bottom: 10px; }
.concept-card p { color: var(--ink-2); font-size: 14.5px; }
.concept-card .num {
  position: absolute; right: 14px; top: 6px; font-family: var(--serif); font-size: 52px;
  color: rgba(138,122,99,.14); font-style: italic;
}

/* ===================== 书架 · 章节时间线 ===================== */
.shelf-sec { background: linear-gradient(180deg, var(--paper-2), var(--paper)); }
.shelf {
  position: relative; padding: 40px 0 0;
}
.shelf-row {
  display: flex; align-items: flex-end; justify-content: center; gap: clamp(4px, .8vw, 10px);
  flex-wrap: nowrap; overflow-x: auto; padding: 30px 10px 34px; scrollbar-width: thin;
}
.book {
  position: relative; width: clamp(58px, 7vw, 74px); height: clamp(210px, 24vw, 270px);
  border-radius: 6px 10px 10px 6px; color: #fff; cursor: pointer; flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 16px 4px 14px; transition: transform .35s cubic-bezier(.2,.9,.3,1.4), box-shadow .35s;
  box-shadow: inset -6px 0 12px rgba(0,0,0,.22), 0 8px 18px rgba(59,49,38,.22);
  writing-mode: vertical-rl; text-orientation: upright;
}
.book::before {
  content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px;
  background: rgba(255,255,255,.5);
}
.book:hover, .book:focus-visible { transform: translateY(-16px) rotate(-1.5deg); outline: none; }
.book .b-no { font-size: 10px; opacity: .85; letter-spacing: 2px; }
.book .b-title { font-family: var(--serif); font-size: 15px; letter-spacing: 4px; line-height: 1.4; }
.book .b-gem {
  width: 14px; height: 14px; border-radius: 50%; background: rgba(255,255,255,.92);
  box-shadow: 0 0 10px rgba(255,255,255,.8), inset 0 -3px 4px rgba(0,0,0,.25);
}
.shelf-board {
  height: 14px; border-radius: 4px;
  background: linear-gradient(180deg, #8a6f4d, #6b543a);
  box-shadow: 0 8px 20px rgba(59,49,38,.35), inset 0 2px 0 rgba(255,255,255,.25);
}
.shelf-hint { text-align: center; color: var(--ink-3); font-size: 13px; margin-top: 16px; letter-spacing: .1em; }

/* ===================== 首页 · 角色速览 ===================== */
.cast-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.cast-chip {
  position: relative; border-radius: var(--radius); overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow-soft);
  transition: transform .4s ease, box-shadow .4s ease; min-height: 300px;
}
.cast-chip:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.cast-chip .chip-bg { position: absolute; inset: 0; background-size: cover; background-position: center top; transition: transform .6s ease; }
.cast-chip:hover .chip-bg { transform: scale(1.05); }
.cast-chip .chip-veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(59,49,38,0) 42%, rgba(43,36,28,.82) 100%); }
.cast-chip .chip-info { position: absolute; left: 16px; right: 16px; bottom: 12px; color: #fff; }
.cast-chip .chip-name { font-family: var(--serif); font-size: 22px; letter-spacing: .12em; }
.cast-chip .chip-role { font-size: 12px; opacity: .85; letter-spacing: .1em; }
.cast-chip .chip-gem {
  position: absolute; top: 12px; left: 12px; font-size: 11px; color: #fff; letter-spacing: .15em;
  padding: 3px 10px; border-radius: 999px; background: rgba(43,36,28,.5); backdrop-filter: blur(4px);
}
.voice-dot {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.55); background: rgba(43,36,28,.35); color: #fff;
  display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(4px); font-size: 13px;
  transition: .3s;
}
.voice-dot:hover, .voice-dot.playing { background: var(--leaf-deep); border-color: var(--leaf); }
.voice-dot.playing { animation: pulse 1.2s ease infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(111,175,88,.25); } }
.cast-chip .chip-sprite {
  position: absolute; left: 50%; bottom: -4px; height: 88%; transform: translateX(-50%);
  filter: drop-shadow(0 10px 16px rgba(59,49,38,.4)); transition: transform .5s ease;
}
.cast-chip:hover .chip-sprite { transform: translateX(-50%) translateY(-7px); }

/* ===================== 首页 · 画廊预览 ===================== */
.gal-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.gal-strip figure {
  position: relative; border-radius: 10px; overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow-soft); aspect-ratio: 16/9;
}
.gal-strip img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s ease; }
.gal-strip figure:hover img { transform: scale(1.08); }

/* ===================== 页脚 ===================== */
.site-footer {
  background: #2e2a24; color: #cfc4b0; padding: 54px 0 30px; position: relative; z-index: 2;
}
.site-footer .wrap { display: grid; gap: 26px; }
.foot-top { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.foot-brand { font-family: var(--serif); font-size: 22px; color: var(--paper); letter-spacing: .16em; }
.foot-brand small { display: block; font-size: 11px; color: #8a7a63; letter-spacing: .3em; margin-top: 4px; }
.foot-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-nav a { color: #cfc4b0; font-size: 14px; }
.foot-nav a:hover { color: #fff; }
.foot-note { font-size: 12.5px; color: #93866f; line-height: 2; border-top: 1px solid rgba(207,196,176,.15); padding-top: 20px; }
.foot-brandimg { height: 44px; border-radius: 8px; opacity: .9; }

/* ===================== 剧情页 ===================== */
.page-hero {
  padding: calc(var(--nav-h) + clamp(50px, 8vw, 90px)) 0 clamp(40px, 6vw, 70px);
  position: relative; overflow: hidden; text-align: center;
}
.page-hero .ph-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  filter: blur(2px) saturate(.9); transform: scale(1.1);
}
.page-hero .ph-veil { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(247,242,229,.55), rgba(247,242,229,.94) 78%); }
.page-hero .ph-inner { position: relative; z-index: 2; }
.page-hero h1 { font-family: var(--serif); font-size: clamp(30px, 5vw, 46px); letter-spacing: .2em; }
.page-hero .ph-sub { color: var(--ink-2); letter-spacing: .3em; font-size: 14px; margin-top: 8px; }
.crumb { font-size: 12.5px; color: var(--ink-2); letter-spacing: .12em; margin-bottom: 14px; text-shadow: 0 1px 6px rgba(247,242,229,.9); }
.crumb a { color: var(--ink-2); }
.crumb a:hover { color: var(--leaf-deep); }

/* 设定卡 */
.rule-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.rule-card {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--leaf);
  border-radius: 10px; padding: 22px 24px; box-shadow: var(--shadow-soft);
}
.rule-card h3 { font-family: var(--serif); font-size: 17.5px; letter-spacing: .08em; margin-bottom: 8px; }
.rule-card p { color: var(--ink-2); font-size: 14px; }
.rule-card.q { border-left-color: var(--sakura); }
.rule-card.k { border-left-color: var(--gem-sapphire); }

/* 书册列表 */
.booklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.booklist li {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow-soft);
  font-size: 14px;
}
.booklist .swatch { width: 16px; height: 16px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 8px currentColor; }
.booklist b { font-family: var(--serif); letter-spacing: .04em; font-weight: 600; }
.booklist small { color: var(--ink-3); display: block; }

/* 章节时间线 */
.timeline { position: relative; max-width: 900px; margin: 0 auto; }
.timeline::before {
  content: ""; position: absolute; left: 26px; top: 0; bottom: 0; width: 2px;
  background: repeating-linear-gradient(180deg, var(--line) 0 10px, transparent 10px 18px);
}
.chapter-item { position: relative; padding: 0 0 clamp(40px, 6vw, 64px) 72px; }
.chapter-item .node {
  position: absolute; left: 12px; top: 6px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--card); border: 2px solid currentColor; display: grid; place-items: center;
  font-family: var(--serif); font-size: 12.5px; font-weight: 700; box-shadow: 0 0 0 5px var(--paper);
}
.chapter-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-soft); transition: box-shadow .4s, transform .4s;
}
.chapter-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.chapter-card.flash { box-shadow: 0 0 0 3px currentColor, var(--shadow); transform: translateY(-4px); }
.chapter-card .ch-media { position: relative; cursor: pointer; overflow: hidden; }
.chapter-card .ch-media img { width: 100%; aspect-ratio: 2/1; object-fit: cover; transition: transform .8s ease; }
.chapter-card .ch-media:hover img { transform: scale(1.04); }
.chapter-card .ch-gem {
  position: absolute; top: 12px; left: 12px; color: #fff; font-size: 12px; letter-spacing: .16em;
  padding: 4px 12px; border-radius: 999px; background: currentColor; box-shadow: var(--shadow-soft);
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.chapter-card .ch-body { padding: 22px clamp(18px, 3vw, 30px) 26px; }
.chapter-card h3 { font-family: var(--serif); font-size: clamp(18px, 2.6vw, 23px); letter-spacing: .08em; }
.chapter-card h3 small { color: var(--ink-3); font-size: 13px; margin-left: 10px; letter-spacing: .18em; }
.chapter-card p { color: var(--ink-2); font-size: 14.5px; margin-top: 10px; }
.chapter-card .ch-quote {
  margin-top: 14px; padding: 12px 16px; border-left: 3px solid currentColor;
  background: rgba(138,122,99,.07); border-radius: 0 8px 8px 0;
  font-family: var(--kai); font-size: 14.5px; color: var(--ink-2);
}
.chapter-card .ch-quote i { display: block; font-style: normal; font-size: 12px; color: var(--ink-3); margin-top: 4px; letter-spacing: .14em; }

/* 深色章（缟玛瑙/黑曜石/黑珍珠） */
.chapter-item.dark .chapter-card { background: #2c2933; border-color: rgba(255,255,255,.08); }
.chapter-item.dark .chapter-card h3, .chapter-item.dark .chapter-card .ch-quote { color: #e9e2d2; }
.chapter-item.dark .chapter-card p { color: #bfb6a4; }
.chapter-item.dark .chapter-card .ch-quote i { color: #8d8371; }
.chapter-item.dark .node { background: #2c2933; color: #cf9; box-shadow: 0 0 0 5px var(--paper-2); }
.chapter-item.dark .node { color: #e9e2d2; }

/* 结局卡 */
.ending-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.ending-card {
  border-radius: var(--radius); padding: 30px 28px; color: #fff; position: relative; overflow: hidden;
  box-shadow: var(--shadow);
}
.ending-card::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 130px; height: 130px; border-radius: 50%;
  background: rgba(255,255,255,.12);
}
.ending-card h3 { font-family: var(--serif); font-size: 22px; letter-spacing: .1em; }
.ending-card .tag { font-size: 11px; letter-spacing: .3em; opacity: .85; display: block; margin-bottom: 8px; }
.ending-card p { font-size: 14px; opacity: .92; margin-top: 10px; }
.ending-card.another { color: var(--ink); background: var(--card); border: 1px dashed var(--line); }
.ending-card.another p { color: var(--ink-2); }
.ending-card.another::after { background: rgba(138,122,99,.1); }
.ending-sub { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

/* ===================== 角色页 ===================== */
.cast-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.cast-card {
  position: relative; border-radius: var(--radius); overflow: hidden; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-soft);
  transition: transform .45s cubic-bezier(.2,.9,.3,1.2), box-shadow .45s;
}
.cast-card:hover { transform: translateY(-8px); box-shadow: var(--shadow); }
.cast-card .cc-stage { position: relative; height: 340px; overflow: hidden; }
.cast-card .cc-bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: saturate(.9); transition: transform .8s ease; }
.cast-card:hover .cc-bg { transform: scale(1.07); }
.cast-card .cc-sprite {
  position: absolute; left: 50%; bottom: -6px; height: 96%; transform: translateX(-50%);
  filter: drop-shadow(0 12px 18px rgba(59,49,38,.35)); transition: transform .5s ease;
}
.cast-card:hover .cc-sprite { transform: translateX(-50%) translateY(-8px); }
.cast-card .cc-veil { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(43,36,28,.78)); }
.cast-card .cc-info { position: absolute; left: 18px; right: 18px; bottom: 14px; color: #fff; }
.cast-card .cc-name { font-family: var(--serif); font-size: 24px; letter-spacing: .14em; }
.cast-card .cc-en { font-size: 11.5px; letter-spacing: .22em; opacity: .8; }
.cast-card .cc-kw { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.cast-card .cc-kw span {
  font-size: 11px; padding: 2px 10px; border-radius: 999px; background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(3px);
}
.cast-card .cc-gemline { position: absolute; top: 0; left: 0; right: 0; height: 5px; }

/* 角色详情页 */
.char-hero {
  position: relative; overflow: hidden; min-height: 92vh; display: grid; align-items: center;
  padding: calc(var(--nav-h) + 40px) 0 60px;
}
.char-hero .chx-bg { position: absolute; inset: 0; background-size: cover; background-position: center; animation: kenburns 30s ease-in-out infinite alternate; }
.char-hero .chx-veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(247,242,229,.08) 0%, rgba(247,242,229,.4) 55%, rgba(247,242,229,.72) 100%),
    linear-gradient(180deg, rgba(247,242,229,.5), rgba(247,242,229,.15) 40%, rgba(247,242,229,.62) 70%, rgba(247,242,229,.97) 94%);
}
.char-hero .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 60px); align-items: end; }
.charx-stage { position: relative; height: clamp(420px, 62vh, 640px); }
.charx-sprite {
  position: absolute; left: 50%; bottom: 0; height: 100%; transform: translateX(-50%);
  filter: drop-shadow(0 18px 30px rgba(59,49,38,.4));
  transition: opacity .45s ease, transform .45s ease;
}
.charx-sprite.swap { opacity: 0; transform: translateX(-50%) translateY(14px); }
.charx-namebox { padding-bottom: 30px; text-shadow: 0 1px 10px rgba(247,242,229,.9), 0 0 22px rgba(247,242,229,.7); }
.charx-namebox h1 { text-shadow: 0 0 18px rgba(247,242,229,.95), 0 2px 0 rgba(255,255,255,.55); }
.charx-namebox .gem-line { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12.5px; letter-spacing: .28em; }
.charx-namebox h1 { font-family: var(--serif); font-size: clamp(38px, 6vw, 62px); letter-spacing: .16em; line-height: 1.2; color: var(--ink); }
.charx-namebox .ruby-jp { color: var(--ink-3); font-size: clamp(15px, 2vw, 19px); letter-spacing: .4em; margin-top: 4px; font-family: var(--serif); }
.charx-namebox .charx-quote {
  margin-top: 22px; font-family: var(--kai); font-size: clamp(15px, 2vw, 19px); color: var(--ink-2);
  border-left: 3px solid currentColor; padding-left: 14px; line-height: 2;
}
.charx-namebox .crumb, .charx-namebox .crumb a { color: var(--ink-3); }
.charx-controls { margin-top: 24px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.expr-btn {
  border: 1px solid var(--line); background: rgba(251,248,239,.8); color: var(--ink-2);
  padding: 7px 16px; border-radius: 999px; font-size: 13px; cursor: pointer; transition: .25s; letter-spacing: .06em;
}
.expr-btn:hover { border-color: var(--leaf); color: var(--leaf-deep); }
.expr-btn.on { background: var(--leaf-deep); border-color: var(--leaf-deep); color: #fff; }
.voice-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border-radius: 999px;
  border: 1px solid var(--sakura); color: #c05a52; background: rgba(251,248,239,.85); cursor: pointer; transition: .3s; font-size: 13px;
}
.voice-btn:hover, .voice-btn.playing { background: #c05a52; color: #fff; }
.voice-btn.playing { animation: pulse 1.2s ease infinite; }

/* 档案表 */
.profile-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft); }
.profile-table th, .profile-table td { padding: 13px 18px; border-bottom: 1px dashed var(--line); text-align: left; font-size: 14.5px; }
.profile-table tr:last-child th, .profile-table tr:last-child td { border-bottom: none; }
.profile-table th { width: 7.5em; color: var(--ink-3); font-weight: normal; letter-spacing: .2em; font-family: var(--serif); }

/* 剧透块 */
.spoiler { position: relative; }
.spoiler .sp-body {
  filter: blur(7px); opacity: .5; pointer-events: none; user-select: none;
  transition: filter .6s ease, opacity .6s ease;
}
.spoiler.open .sp-body { filter: none; opacity: 1; pointer-events: auto; user-select: auto; }
.spoiler .sp-cover {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 2; cursor: pointer;
}
.spoiler .sp-cover span {
  background: rgba(43,36,28,.82); color: #fff; padding: 10px 26px; border-radius: 999px;
  font-size: 13px; letter-spacing: .2em; backdrop-filter: blur(3px); box-shadow: var(--shadow);
  transition: .3s;
}
.spoiler .sp-cover:hover span { background: var(--sakura); }
.spoiler.open .sp-cover { display: none; }
.spoiler-toggle {
  display: inline-flex; align-items: center; gap: 8px; border: 1px dashed var(--line);
  background: none; color: var(--ink-3); padding: 8px 20px; border-radius: 999px; cursor: pointer;
  font-size: 13px; letter-spacing: .16em; transition: .3s; margin: 6px 0 22px;
}
.spoiler-toggle:hover { color: var(--sakura); border-color: var(--sakura); }
.spoiler-toggle.on { color: #fff; background: #c05a52; border-color: #c05a52; }

/* 语录卡 */
.quote-wall { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.quote-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 26px; position: relative; box-shadow: var(--shadow-soft);
}
.quote-card::before {
  content: "„"; position: absolute; top: 2px; left: 14px; font-size: 54px; color: rgba(111,175,88,.3); font-family: var(--serif); line-height: 1;
}
.quote-card p { font-family: var(--kai); font-size: 17px; line-height: 2.1; letter-spacing: .04em; }
.quote-card i { display: block; text-align: right; font-style: normal; font-size: 12.5px; color: var(--ink-3); margin-top: 8px; letter-spacing: .12em; }

/* 相关 CG */
.rel-cg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.rel-cg figure { border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-soft); cursor: pointer; position: relative; }
.rel-cg img { aspect-ratio: 16/9; object-fit: cover; width: 100%; transition: transform .6s; }
.rel-cg figure:hover img { transform: scale(1.06); }

/* 角色前后导航 */
.charx-pn { display: flex; justify-content: space-between; gap: 14px; margin-top: 50px; }
.charx-pn a {
  flex: 1; display: flex; flex-direction: column; padding: 18px 22px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--card); transition: .3s; box-shadow: var(--shadow-soft);
}
.charx-pn a:hover { border-color: var(--leaf); transform: translateY(-3px); }
.charx-pn .pn-label { font-size: 12px; color: var(--ink-3); letter-spacing: .2em; }
.charx-pn .pn-name { font-family: var(--serif); font-size: 18px; margin-top: 4px; letter-spacing: .1em; }
.charx-pn a.next { text-align: right; }

/* ===================== 画廊 ===================== */
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 34px; }
.filter-chip {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  padding: 7px 18px; border-radius: 999px; cursor: pointer; font-size: 13.5px; letter-spacing: .1em; transition: .3s;
}
.filter-chip:hover { border-color: var(--leaf); color: var(--leaf-deep); }
.filter-chip.on { background: var(--leaf-deep); border-color: var(--leaf-deep); color: #fff; }
.gal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.gal-item {
  position: relative; border-radius: 12px; overflow: hidden; cursor: zoom-in;
  box-shadow: var(--shadow-soft); aspect-ratio: 16/9; background: var(--paper-3);
}
.gal-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease, filter .5s; }
.gal-item:hover img { transform: scale(1.06); }
.gal-item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 16px 12px; color: #fff; font-size: 13px;
  background: linear-gradient(transparent, rgba(43,36,28,.85)); opacity: 0; transition: .4s; letter-spacing: .08em;
}
.gal-item:hover figcaption { opacity: 1; }
.gal-item.hide { display: none; }

/* 灯箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 250; display: none; place-items: center;
  background: rgba(30,26,20,.92); padding: 4vh 4vw;
}
.lightbox.show { display: grid; }
.lightbox img { max-width: 92vw; max-height: 84vh; border-radius: 8px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.lightbox .lb-cap { color: #cfc4b0; margin-top: 14px; text-align: center; font-size: 14px; letter-spacing: .12em; }
.lightbox .lb-close {
  position: absolute; top: 20px; right: 26px; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.08); color: #fff; font-size: 20px; cursor: pointer;
}
.lightbox .lb-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.06); color: #fff; font-size: 18px; cursor: pointer;
}
.lightbox .lb-prev { left: 18px; } .lightbox .lb-next { right: 18px; }

/* ===================== 音乐页 ===================== */
.bgm-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.bgm-row {
  display: flex; align-items: center; gap: 16px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px;
  transition: .3s; cursor: pointer; box-shadow: var(--shadow-soft);
}
.bgm-row:hover { border-color: var(--leaf); transform: translateY(-2px); }
.bgm-row.playing { border-color: var(--leaf-deep); background: var(--leaf-soft); }
.bgm-row .bq-icon {
  width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
  background: var(--leaf-soft); color: var(--leaf-deep); font-size: 15px; transition: .3s;
}
.bgm-row.playing .bq-icon { background: var(--leaf-deep); color: #fff; }
.bgm-row .bq-icon.spin { animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bgm-row .bq-info { flex: 1; min-width: 0; }
.bgm-row b { font-family: var(--serif); font-size: 15.5px; letter-spacing: .06em; }
.bgm-row small { color: var(--ink-3); display: block; font-size: 12px; }
.bgm-row .bq-dur { color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }

.now-playing {
  position: sticky; top: calc(var(--nav-h) + 12px); z-index: 5;
  background: rgba(43,36,28,.92); color: var(--paper); border-radius: 999px;
  display: flex; align-items: center; gap: 14px; padding: 10px 22px; margin-bottom: 30px;
  box-shadow: var(--shadow); backdrop-filter: blur(6px);
}
.now-playing .np-disc { width: 34px; height: 34px; border-radius: 50%; background: conic-gradient(#555 0 25%, #333 0 50%, #555 0 75%, #333 0); display: grid; place-items: center; }
.now-playing .np-disc::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--leaf-soft); }
.now-playing .np-disc.spin { animation: spin 5s linear infinite; }
.now-playing b { font-family: var(--serif); font-size: 14.5px; letter-spacing: .1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-playing .np-x { margin-left: auto; color: #cfc4b0; cursor: pointer; border: none; background: none; font-size: 18px; }

/* 全局迷你播放器 */
.bgm-dock {
  position: fixed; right: 18px; bottom: 18px; z-index: 80;
  display: flex; align-items: center; gap: 10px;
  background: rgba(43,36,28,.9); color: var(--paper); border-radius: 999px;
  padding: 8px 16px 8px 10px; box-shadow: var(--shadow); backdrop-filter: blur(8px);
  transform: translateY(0); transition: .4s; cursor: pointer; border: 1px solid rgba(207,196,176,.2);
}
.bgm-dock.hidden { transform: translateY(90px); opacity: 0; pointer-events: none; }
.bgm-dock .dk-disc { width: 34px; height: 34px; border-radius: 50%; background: conic-gradient(#6b6155 0 25%, #3d372f 0 50%, #6b6155 0 75%, #3d372f 0); display: grid; place-items: center; }
.bgm-dock .dk-disc::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--leaf-soft); }
.bgm-dock.playing .dk-disc { animation: spin 5s linear infinite; }
.bgm-dock .dk-name { font-size: 12.5px; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .05em; }
.bgm-dock .dk-eq { display: flex; gap: 2px; align-items: flex-end; height: 14px; }
.bgm-dock .dk-eq i { width: 2.5px; background: var(--leaf-soft); height: 30%; }
.bgm-dock.playing .dk-eq i { animation: eq 1s ease-in-out infinite; }
.bgm-dock.playing .dk-eq i:nth-child(2) { animation-delay: .2s; }
.bgm-dock.playing .dk-eq i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%,100% { height: 25%; } 50% { height: 100%; } }

/* ===================== 宝石之书 · 点击进入动画 ===================== */
.book-fx {
  position: fixed; inset: 0; z-index: 210; pointer-events: none; overflow: hidden;
  background: rgba(247, 242, 229, .25);
  animation: bfx-in .18s ease both;
}
.book-fx.out { animation: bfx-out .45s ease both; }
@keyframes bfx-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes bfx-out { to { opacity: 0; } }
.book-fx .bf-layer { position: absolute; inset: 0; }
.book-fx .bf-layer > i { position: absolute; display: block; will-change: transform, opacity; }
.book-fx .bf-gem {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-family: var(--serif); color: var(--g); font-size: clamp(22px, 4vw, 34px);
  letter-spacing: .3em; text-indent: .3em; white-space: nowrap;
  text-shadow: 0 1px 0 #fff, 0 6px 24px rgba(59,49,38,.25);
  animation: bfx-gem .5s ease both, bfx-gem-out .3s ease .95s both;
  z-index: 5;
}
@keyframes bfx-gem { from { opacity: 0; transform: translate(-50%, -38%); letter-spacing: .6em; } to { opacity: 1; transform: translate(-50%, -50%); letter-spacing: .3em; } }
@keyframes bfx-gem-out { to { opacity: 0; transform: translate(-50%, -56%); } }

/* 翡翠 · 墨滴晕染 */
.bf-ink { width: 60vmax; height: 60vmax; border-radius: 50%; transform: scale(0); animation: bf-ink 1s ease-out both; }
@keyframes bf-ink { 0% { transform: scale(0); opacity: .95; } 70% { opacity: .5; } 100% { transform: scale(1.6); opacity: 0; } }

/* 红宝石 · 花瓣迸放 */
.bf-petal { width: 14px; height: 20px; border-radius: 60% 60% 60% 60% / 80% 80% 40% 40%; opacity: 0; animation: bf-petal 1s cubic-bezier(.15,.6,.4,1) var(--d) both; }
@keyframes bf-petal { 0% { transform: translate(0,0) rotate(0) scale(.4); opacity: 0; } 18% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rz)) scale(1); opacity: 0; } }

/* 蓝宝石 · 涟漪 */
.bf-ring { left: 50%; top: 50%; width: 22vmax; height: 22vmax; margin: -11vmax; border-radius: 50%; border: 3px solid; opacity: 0; animation: bf-ring 1s ease-out var(--d) both; }
@keyframes bf-ring { 0% { transform: scale(.05); opacity: .9; } 100% { transform: scale(2.2); opacity: 0; } }

/* 紫水晶 · 晶簇 */
.bf-shard { left: 50%; top: 50%; width: 60px; height: 90px; clip-path: polygon(50% 0, 100% 38%, 78% 100%, 22% 100%, 0 38%); opacity: 0; animation: bf-shard .95s ease-out var(--d) both; }
@keyframes bf-shard { 0% { transform: translate(0,0) rotate(0) scale(.3); opacity: 0; } 20% { opacity: .95; } 100% { transform: translate(var(--x), var(--y)) rotate(var(--rz)) scale(1); opacity: 0; } }

/* 磷灰石 · 气泡 */
.bf-bub { bottom: -30px; border-radius: 50%; animation: bf-bub var(--t) ease-in var(--d) both; }
@keyframes bf-bub { 0% { transform: translateY(0) scale(.6); opacity: 0; } 20% { opacity: .95; } 100% { transform: translateY(-84vh) scale(1); opacity: 0; } }

/* 芙蓉石 · 花落 */
.bf-fall { top: -30px; border-radius: 60% 60% 60% 60% / 80% 80% 40% 40%; animation: bf-fall var(--t) ease-in var(--d) both; }
@keyframes bf-fall { 0% { transform: translate(0,0) rotate(0); opacity: 0; } 15% { opacity: .95; } 100% { transform: translate(3vw, 92vh) rotate(var(--rz)); opacity: 0; } }

/* 黑珍珠 · 蚀日 */
.bf-orb { left: 50%; top: 50%; width: 20vmax; height: 20vmax; margin: -10vmax; border-radius: 50%; animation: bf-orb 1.05s cubic-bezier(.5,0,.2,1) both; }
@keyframes bf-orb { 0% { transform: scale(0); } 62% { transform: scale(7); } 100% { transform: scale(7.6); } }
.bf-glint { left: 38%; top: 34%; width: 10px; height: 10px; border-radius: 50%; background: #fff; box-shadow: 0 0 18px 6px rgba(255,255,255,.8); opacity: 0; animation: bf-glint .8s ease .35s both; }
@keyframes bf-glint { 0%, 100% { opacity: 0; transform: scale(.4); } 40% { opacity: 1; transform: scale(1.2); } }

/* 萤石 · 流彩 */
.bf-sheen { inset: -10% -30%; width: 160%; height: 120%; filter: blur(18px); opacity: 0; background: linear-gradient(var(--h), transparent 20%, var(--g) 50%, transparent 80%); animation: bf-sheen 1s ease-in-out var(--d) both; }
@keyframes bf-sheen { 0% { transform: translateX(-70%); opacity: 0; } 35% { opacity: .8; } 100% { transform: translateX(70%); opacity: 0; } }

/* 白珍珠 · 泡沫 */
.bf-foam { bottom: -20px; border-radius: 50%; background: radial-gradient(circle at 34% 30%, rgba(255,255,255,.95), rgba(233,228,214,.6) 60%, rgba(210,204,188,.3)); box-shadow: 0 0 8px rgba(255,255,255,.5); animation: bf-foam var(--t) ease-in var(--d) both; }
@keyframes bf-foam { 0% { transform: translate(0,0); opacity: 0; } 20% { opacity: .9; } 100% { transform: translate(var(--dx), -90vh); opacity: 0; } }

/* 黑曜石 · 裂片 */
.bf-slab { top: 50%; left: 50%; width: 120%; height: 34%; margin-top: -17%; animation: bf-slab .6s cubic-bezier(.6,0,.2,1) var(--d) both; }
@keyframes bf-slab { 0% { transform: translateX(var(--o)) skewY(0) rotate(0); } 100% { transform: translateX(0) skewY(-4deg) rotate(var(--r)); } }

/* 缟玛瑙 · 层纹 */
.bf-band { left: 0; right: 0; height: 15%; animation: bf-band .55s cubic-bezier(.5,0,.3,1) var(--d) both; }
@keyframes bf-band { 0% { transform: translateX(var(--o)); } 100% { transform: translateX(0); } }

/* 青金石 · 星屑 */
.bf-wash { inset: 0; width: 100%; height: 100%; animation: bf-wash .8s ease both; }
@keyframes bf-wash { 0% { opacity: 0; transform: scale(1.15); } 100% { opacity: 1; transform: none; } }
.bf-star { border-radius: 50%; background: #ffe9a8; box-shadow: 0 0 8px 2px rgba(255,233,168,.75); opacity: 0; animation: bf-star 1s ease var(--d) infinite alternate; }
@keyframes bf-star { 0% { opacity: .15; transform: scale(.7); } 100% { opacity: 1; transform: scale(1.15); } }

/* 紫翠玉 · 变色 */
.bf-morph { inset: -12%; width: 124%; height: 124%; clip-path: polygon(0 0, 100% 0, 100% 0, 0 0); }
.bf-morph.a { background: linear-gradient(150deg, #3fae9a, #1d6f5f); animation: bf-morph 1s cubic-bezier(.6,0,.25,1) both; }
.bf-morph.b { background: linear-gradient(150deg, #b8455a, #6e1f30); animation: bf-morph 1s cubic-bezier(.6,0,.25,1) .28s both; }
@keyframes bf-morph { 0% { clip-path: polygon(0 0, 100% 0, 100% 0, 0 0); } 60%, 100% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); } }
.book-fx[data-fx="shift"] .bf-gem { color: #fff; text-shadow: 0 2px 14px rgba(0,0,0,.45); animation: bfx-gem .5s ease .3s both, bfx-gem-out .3s ease .95s both; }
.book-fx[data-fx="stars"] .bf-gem { color: #ffe9a8; text-shadow: 0 0 18px rgba(0,0,0,.5); }
.book-fx[data-fx="eclipse"] .bf-gem, .book-fx[data-fx="shatter"] .bf-gem, .book-fx[data-fx="bands"] .bf-gem { color: #f3ede0; text-shadow: 0 2px 14px rgba(0,0,0,.5); }

/* 书架上的书 · 点击跃起 */
.book.lift { animation: book-lift .9s cubic-bezier(.2,.8,.3,1.3) both; z-index: 3; }
@keyframes book-lift { 0% { transform: translateY(0); } 35% { transform: translateY(-30px) rotate(-2deg) scale(1.07); box-shadow: 0 0 0 3px var(--bc), 0 18px 34px rgba(59,49,38,.35); } 100% { transform: translateY(-16px) rotate(-1.5deg) scale(1.05); } }

/* ---------- 书飞出 · 自动翻页 ---------- */
.bfly { position: fixed; inset: 0; z-index: 205; pointer-events: none; }
.bfly-shade { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 55%, rgba(59,49,38,.16), rgba(59,49,38,.4)); animation: bfly-shade 2.6s ease both; }
@keyframes bfly-shade { from { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 1; } }
.bfly-book {
  position: fixed; z-index: 2;
  left: 50%; top: 50%; width: 250px; height: 330px;
  margin: -165px 0 0 -125px;
  transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(var(--sx, 1), var(--sy, 1)) rotate(-5deg);
  transform-style: preserve-3d; perspective: 1400px;
  will-change: transform;
  transition: transform .82s cubic-bezier(.2,.85,.25,1);
  filter: drop-shadow(0 24px 38px rgba(43,36,28,.45));
}
.bfly-book.fly { transform: translate(0, 0) scale(1, 1) rotate(0deg); }
.bfly.done { opacity: 0; transition: opacity .4s ease; }
.bfly-book > * { position: absolute; inset: 0; backface-visibility: hidden; }

/* 书脊（起飞形态）：竖排章号 */
.bfly-spine {
  background: var(--g);
  background: linear-gradient(160deg, var(--g), color-mix(in srgb, var(--g) 72%, #241f19));
  border-radius: 5px 9px 9px 5px;
  box-shadow: inset -5px 0 10px rgba(0,0,0,.28), inset 3px 0 0 rgba(255,255,255,.28);
  display: grid; place-items: center; transition: opacity .3s ease .35s;
}
.bfly-spine span {
  writing-mode: vertical-rl; text-orientation: upright;
  font-family: var(--serif); color: #fff; font-size: 15px; letter-spacing: 6px;
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
}

/* 展开形态下：左页（衬页） */
.bfly-left {
  background: linear-gradient(90deg, #efe8d6, #f9f5ea 60%, #e8dfc9);
  border-radius: 10px 0 0 10px;
  box-shadow: inset -14px 0 22px rgba(120,104,80,.18);
  padding: 26px 20px; display: flex; flex-direction: column; gap: 12px;
}
.bfly-left i { height: 7px; border-radius: 4px; background: rgba(120,104,80,.22); }
.bfly-left i:nth-child(2) { width: 86%; } .bfly-left i:nth-child(3) { width: 94%; }
.bfly-left i:nth-child(4) { width: 72%; } .bfly-left i:nth-child(5) { width: 90%; } .bfly-left i:nth-child(6) { width: 56%; }

/* 可翻页片（封面 + 三张内页） */
.bfly-sheet { transform-origin: left center; transform-style: preserve-3d; will-change: transform; transition: transform .62s cubic-bezier(.3,-0.08,.26,1.04); }
.bfly-sheet .f, .bfly-sheet .b { transition: filter .3s ease; }
.bfly-book.flip1 .bfly-sheet.cover .f,
.bfly-book.flip2 .bfly-sheet.s1 .f,
.bfly-book.flip3 .bfly-sheet.s2 .f,
.bfly-book.flip3 .bfly-sheet.s3 .f { filter: brightness(1.05); }
.bfly-sheet .f, .bfly-sheet .b { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 0 8px 8px 0; overflow: hidden; }
.bfly-sheet .b { transform: rotateY(180deg); }
.bfly-sheet .f i, .bfly-sheet .f span { display: block; }
.bfly-sheet .f i { height: 7px; border-radius: 4px; background: rgba(120,104,80,.2); margin: 0 18px 12px; }
.bfly-sheet .f { background: linear-gradient(90deg, #f3eddc, #fbf7ec 55%, #efe7d2); padding-top: 30px; }
.bfly-sheet .f i:nth-child(2) { width: 78%; } .bfly-sheet .f i:nth-child(3) { width: 88%; } .bfly-sheet .f i:nth-child(4) { width: 60%; }
.bfly-sheet .b { background: linear-gradient(270deg, #f3eddc, #efe7d2); box-shadow: inset 10px 0 18px rgba(120,104,80,.16); }

/* 封面片 */
.bfly-sheet.cover { z-index: 6; }
.bfly-sheet.cover .f {
  background: var(--g);
  background: linear-gradient(155deg, color-mix(in srgb, var(--g) 88%, #fff) 0%, var(--g) 46%, color-mix(in srgb, var(--g) 70%, #1d1913) 100%);
  box-shadow: inset 4px 0 0 rgba(255,255,255,.4), inset -8px 0 16px rgba(0,0,0,.25);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 0;
}
.bfly-sheet.cover .f .cno2 { font-family: var(--serif); color: rgba(255,255,255,.85); font-size: 12px; letter-spacing: .5em; text-indent: .5em; }
.bfly-sheet.cover .f .ct2 { font-family: var(--serif); color: #fff; font-size: 23px; letter-spacing: .2em; text-indent: .2em; text-shadow: 0 2px 10px rgba(0,0,0,.35); }
.bfly-sheet.cover .f i { display: none; }
.bfly-sheet.s1 { z-index: 5; } .bfly-sheet.s2 { z-index: 4; } .bfly-sheet.s3 { z-index: 3; }

/* 翻动姿态（后翻的页落在先翻的页上面） */
.bfly-book.flip1 .bfly-sheet.cover { transform: rotateY(-168deg); z-index: 2; }
.bfly-book.flip2 .bfly-sheet.s1 { transform: rotateY(-164deg); z-index: 3; }
.bfly-book.flip3 .bfly-sheet.s2 { transform: rotateY(-162deg); z-index: 4; }
.bfly-book.flip3 .bfly-sheet.s3 { transform: rotateY(-160deg); z-index: 5; }

/* 书脊光：翻页时从中缝亮起 */
.bfly-glow {
  left: 0; top: 0; bottom: 0; width: 60px; transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(255,252,238,.95), transparent);
  opacity: 0; border-radius: 0 0 0 0; mix-blend-mode: screen;
}
.bfly-book.bloom .bfly-glow { animation: bfly-glow .8s ease both; }
@keyframes bfly-glow { 0% { opacity: 0; transform: translateX(-50%) scaleX(.4); } 45% { opacity: 1; transform: translateX(-50%) scaleX(2.6); } 100% { opacity: 0; transform: translateX(-50%) scaleX(4.2); } }

/* 起飞后：书脊字隐去 */
.bfly-book.fly .bfly-spine span { opacity: 0; transition: opacity .25s ease .3s; }
.bfly-book.open .bfly-spine { opacity: 0; }


/* ===================== 图标（SVG） ===================== */
.icon { display: inline-block; vertical-align: -0.18em; fill: currentColor; }
.glyph-svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.loader-quill-img {
  width: 92px; border-radius: 16px;
  border: 3px solid rgba(247,242,229,.28);
  box-shadow: 0 14px 34px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.2);
  animation: floaty 3s ease-in-out infinite;
}

/* ===================== 响应式 ===================== */
@media (max-width: 960px) {
  .concept-grid, .ending-grid, .quote-wall, .rule-grid { grid-template-columns: 1fr 1fr; }
  .cast-grid, .cast-strip { grid-template-columns: 1fr 1fr; }
  .gal-strip { grid-template-columns: repeat(3, 1fr); }
  .gal-grid { grid-template-columns: 1fr 1fr; }
  .bgm-list { grid-template-columns: 1fr; }
  .char-hero .wrap { grid-template-columns: 1fr; }
  .charx-stage { height: clamp(360px, 52vh, 520px); order: -1; }
  .hero-title-jp { display: none; }
  .ending-sub { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links {
    position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; gap: 0;
    background: rgba(247,242,229,.98); border-bottom: 1px solid var(--line);
    padding: 10px 0 18px; transform: translateY(-130%); transition: transform .4s ease; z-index: 55;
    box-shadow: var(--shadow);
  }
  .nav-open .nav-links { transform: none; }
  .nav-links a { padding: 13px 28px; font-size: 16px; }
  .nav-burger { display: block; }
  .concept-grid, .ending-grid, .quote-wall, .rule-grid, .cast-grid, .cast-strip, .gal-grid, .ending-sub { grid-template-columns: 1fr; }
  .rel-cg { grid-template-columns: 1fr 1fr; }
  .gal-strip { grid-template-columns: repeat(2, 1fr); }
  .timeline::before { left: 18px; }
  .chapter-item { padding-left: 52px; }
  .chapter-item .node { left: 4px; width: 26px; height: 26px; font-size: 11px; }
  .now-playing { top: calc(var(--nav-h) + 8px); }
}

/* ===================== 旧版作品页入口（外站链接） ===================== */
.site-nav .nav-legacy {
  margin-left: 14px;
  display: inline-flex; align-items: center;
  padding: 6px 14px;
  border: 1px solid var(--leaf);
  border-radius: 999px;
  font-family: var(--serif);
  font-size: 13px; letter-spacing: .06em; white-space: nowrap;
  color: var(--leaf-deep);
  background: rgba(111,175,88,.06);
  transition: background .3s ease, color .3s ease, border-color .3s ease, transform .3s ease;
}
.site-nav .nav-legacy:hover {
  background: var(--leaf); color: #fbf8ef; border-color: var(--leaf-deep);
  transform: translateY(-1px);
}
@media (max-width: 960px) {
  .site-nav .nav-legacy { margin-left: 10px; padding: 5px 11px; font-size: 12px; }
}
@media (max-width: 640px) {
  .site-nav .nav-legacy { margin-left: 6px; padding: 5px 9px; font-size: 11px; letter-spacing: .02em; }
  .brand-name small { display: none; }
  .brand-name { font-size: 16px; letter-spacing: .06em; }
}
