﻿@charset "UTF-8";

:root {
  --cream: #fffdf8;
  --white: #fff;
  --ink: #322e55;
  --pink: #eccbd2;
  --pink-label: #dfc0c9;
  --pink-line: #efb2c3;
  --blue-deco: #c3d2e6;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 10px; }
body {
  margin: 0;
  overflow-x: clip;
  color: #333;
  background: var(--cream);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body, h2, h3, p, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button { padding: 0; border: 0; color: inherit; background: none; font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; }
svg { display: block; }
::selection { color: #fff; background: var(--ink); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--pink-line); outline-offset: 5px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  padding: 1rem 1.6rem;
  color: #fff;
  background: var(--ink);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* Loading screen */
.loader {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  background: var(--cream);
  transition: opacity .5s var(--ease), visibility .5s;
  animation: loader-failsafe 0s 15s forwards;
}
.loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { display: grid; justify-items: center; gap: 1.8rem; }
.loader-title {
  color: var(--ink);
  font-family: "Klee One", serif;
  font-size: 2.6rem;
  font-weight: 300;
  letter-spacing: .26em;
}
.loader-bar {
  position: relative;
  display: block;
  width: 16rem;
  height: 2px;
  overflow: hidden;
  background: rgba(236, 203, 210, .7);
}
.loader-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 42%;
  background: var(--ink);
  animation: loader-slide 1.1s ease-in-out infinite;
}
.loader-note {
  color: var(--pink-label);
  font-family: "El Messiri", sans-serif;
  font-size: 1.1rem;
  letter-spacing: .3em;
}
@keyframes loader-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(340%); }
}
@keyframes loader-failsafe {
  to { opacity: 0; visibility: hidden; }
}

/* Header */
.site-header { position: relative; z-index: 100; }
.menu-cat {
  position: fixed;
  right: 1.6rem;
  bottom: 6.3rem;
  z-index: 110;
  display: block;
  width: 8rem;
  height: 8rem;
  filter: none;
  transition: filter .3s, transform .3s var(--ease);
}
.menu-cat img { width: 100%; height: 100%; }
.menu-cat:hover { filter: drop-shadow(0 -.3rem .5rem rgba(50, 46, 85, .2)); transform: translateY(-.3rem); }
.menu-cat[aria-expanded="true"] { transform: translateY(-.3rem) rotate(6deg); }
.menu-panel {
  position: fixed;
  bottom: 15.3rem;
  right: 1.6rem;
  z-index: 105;
  width: 26rem;
  padding: 1rem 2.4rem;
  color: var(--ink);
  background: rgba(255, 255, 255, .97);
  border-radius: 1.6rem;
  box-shadow: 0 1.6rem 5rem rgba(50, 46, 85, .16);
}
.menu-panel[hidden] { display: none; }
.menu-panel a {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  padding: 1.6rem 0;
  border-bottom: 1px dotted var(--pink);
  font-family: "El Messiri", sans-serif;
  font-size: 1.8rem;
  letter-spacing: .08em;
}
.menu-panel a:last-child { border-bottom: 0; }
.menu-panel a > span { color: var(--pink-label); font-size: 1.2rem; }
.menu-panel small {
  grid-column: 2;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 1.1rem;
  letter-spacing: .12em;
}
.menu-panel .menu-lang {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .2rem;
  width: 100%;
  padding: 1.4rem 0;
  color: var(--ink);
  font-family: "El Messiri", sans-serif;
  font-size: 1.8rem;
  letter-spacing: .08em;
  text-align: left;
  border-bottom: 1px dotted var(--pink);
}

/* Section title */
.character {
  position: relative;
  background-color: var(--cream);
}
.section-title { position: absolute; top: 0; left: 0; width: fit-content; }
.section-title-text { display: flex; flex-direction: row; align-items: center; gap: 2.7rem; }
.section-title-en {
  position: relative;
  font-family: "El Messiri", serif;
  font-size: 9.6rem;
  font-weight: 700;
  line-height: 1.333333;
  letter-spacing: .04em;
  text-transform: uppercase;
  width: 69.4rem;
  white-space: nowrap;
  background: linear-gradient(84deg, var(--pink) 0%, var(--ink) 50%, var(--ink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: opacity .24s var(--ease), transform .24s var(--ease);
}
.section-title-en.is-swapping { opacity: 0; transform: translateY(-.8rem); }
.section-title-ja {
  padding-bottom: 2.4rem;
  color: var(--ink);
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .2em;
  white-space: nowrap;
}
.title-deco { position: absolute; top: 1.8rem; right: -9.6rem; width: 7rem; height: 8.2rem; }
.title-deco svg { position: absolute; }
.deco-pink {
  top: 0;
  right: .2rem;
  width: 3rem;
  color: var(--pink);
  filter: drop-shadow(0 0 .5rem rgba(236, 203, 210, .9));
  animation: deco-twinkle 4.2s ease-in-out infinite;
}
.deco-blue {
  right: 2.4rem;
  bottom: .2rem;
  width: 5.2rem;
  color: var(--blue-deco);
  filter: drop-shadow(0 0 .7rem rgba(195, 210, 230, .95));
  animation: deco-twinkle 5.6s ease-in-out .8s infinite;
}
@keyframes deco-twinkle {
  0%, 100% { transform: scale(.9); opacity: .7; }
  50% { transform: scale(1.04); opacity: 1; }
}

/* Scroll-driven stage */
.stage-track { position: relative; height: 100vh; }
.stage {
  position: sticky;
  top: 0;
  display: grid;
  height: 100vh;
  place-items: center;
  overflow: hidden;
}
.stage-scale {
  width: 124rem;
  height: 88rem;
  transform: scale(var(--stage-scale, 1));
  transform-origin: center center;
}
.stage-canvas { position: relative; width: 124rem; height: 88rem; }

/* Left knob: a physical dial disc carrying both screens, spinning in front of a fixed camera */
.knob {
  position: absolute;
  top: 12.5rem;
  left: 0;
  /* 比卡片宽：给 CG 页加宽后的卡片留出位置，同时作为翻页时的裁切窗口 */
  width: 124rem;
  height: 70rem;
}
.knob-clip {
  position: absolute;
  inset: 0;
  /* 卡片转出时在卡片区域外裁掉，只露出鼓面正面 */
  overflow: hidden;
  background: none;
}
/* 裁切窗口必须和卡片严丝合缝，否则相邻页会从卡片下沿露出几像素 */
@media screen and (min-width: 768px) {
  .knob-clip {
    clip-path: inset(.75rem 0 .95rem 0);
  }
}
.cylinder-scene {
  position: absolute;
  inset: 0;
  perspective: none;
}
.cylinder {
  position: absolute;
  inset: 0;
  transform: none;
  will-change: transform;
}
.knob-gloss {
  display: none;
}
.drum3d {
  position: absolute;
  inset: 0;
}
/* 鼓面上的每一页：整页刚体旋转，不再切条，所以没有接缝和拉伸感 */
.page3d {
  position: absolute;
  top: .75rem;
  left: 0;
  width: 95rem;
  height: 68.3rem;
  padding-block: 5.2rem 3.2rem;
  padding-inline: clamp(16px, -86.064px + 13.29vw, 130px);
  color: var(--ink);
  background: var(--white);
  border-radius: 3.2rem;
}
.panel {
  position: absolute;
  inset: 0;
  display: none;
  padding-block: 5.2rem 3.2rem;
  padding-inline: clamp(16px, -86.064px + 13.29vw, 130px);
  color: var(--ink);
  background: var(--white);
  pointer-events: auto;
  backface-visibility: hidden;
  will-change: transform;
}
.panel.is-off { pointer-events: none; }
.panel-intro { transform: translateZ(38rem); }
.panel-gallery { transform: rotateX(180deg) translateZ(38rem); }
.page-inner { position: relative; z-index: 2; width: 60%; max-width: 44.7rem; }

/* Right portrait: never moves while the pages rotate */
.character-visual { position: absolute; top: 17rem; right: 0; z-index: 10; width: 62rem; height: 64.5rem; pointer-events: none; }
.character-image-wrap { position: relative; width: 100%; height: 100%; overflow: hidden; }
.character-image { position: relative; z-index: 2; width: 100%; height: 100%; transition: opacity .35s var(--ease), transform .35s var(--ease); }
.character-image.is-fading { opacity: 0; transform: translateY(.8rem); }
.character-image img { width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.character-bg {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1;
  border-right: 1px solid var(--pink-line);
  border-bottom: 1px solid var(--pink-line);
  background-color: #f8e6ef;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, .9) .17rem, transparent .19rem),
    radial-gradient(circle at 48% 34%, rgba(255, 255, 255, .92), transparent 40%),
    linear-gradient(140deg, #fff7fb 0%, #f5dce9 62%, #f0cfe1 100%);
  background-size: 3.2rem 3.2rem, 100% 100%, 100% 100%;
  border-radius: 50%;
  box-shadow: inset 0 0 7rem rgba(255, 255, 255, .42);
}
.character-bg::before {
  content: "";
  position: absolute;
  top: .8rem;
  right: .8rem;
  width: 100%;
  height: 100%;
  border: 1px solid var(--pink-line);
  border-radius: 0 50% 0 0;
}
.character-catchcopy {
  position: absolute;
  top: 5.6rem;
  left: 4.6rem;
  z-index: 4;
  display: flex;
  width: 10.4rem;
  min-height: 55.4rem;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
  font-family: "Zen Maru Gothic", sans-serif;
  font-weight: 700;
}
.character-catchcopy span {
  display: block;
  width: max-content;
  writing-mode: vertical-rl;
  color: #fff;
  text-shadow: 0 1px 0 rgba(194, 138, 150, .18);
}
.catchcopy-main {
  padding: 1.2rem .8rem;
  background: linear-gradient(180deg, #e9bdcc, #dfabbb);
  font-size: 2.8rem;
  line-height: 1.25;
  letter-spacing: .04em;
}
.catchcopy-sub {
  padding: 1rem .6rem;
  background: linear-gradient(180deg, #efd1dd, #e6bdcb);
  font-size: 2rem;
  line-height: 1.25;
  letter-spacing: .08em;
}
.character-nav {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 12;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  transform: translateY(-50%);
}
.character-arrow {
  display: grid;
  width: 6.4rem;
  height: 6.4rem;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  transition: opacity .3s, transform .3s var(--ease);
}
.character-arrow svg { width: 2.8rem; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: .1 3.2; }
.character-next svg { transform: rotate(180deg); }
.character-arrow:hover { opacity: .8; transform: scale(1.06); }

/* Page content */
.character-name-wrap { color: var(--ink); }
.character-name-en { position: relative; top: -1.4rem; margin-bottom: 1.2rem; color: var(--pink); font-size: 2rem; font-weight: 500; line-height: 1; letter-spacing: .2em; }
.character-name {
  margin-top: 1.2rem;
  font-family: "Klee One", "Zen Maru Gothic", serif;
  font-size: 7.2rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: .12em;
  white-space: nowrap;
  color: var(--ink);
  min-height: 1.1em; /* 中日字体行盒略有差异，固定占位保证切换时名字与下方内容不跳动 */
}
.character-cv { margin-top: 1.2rem; font-size: 1.4rem; font-weight: 400; line-height: 1; letter-spacing: .2em; }
.character-desc { margin-top: 4rem; font-size: 1.6rem; font-weight: 400; line-height: 1.6; }
.character-profile { display: flex; flex-direction: column; gap: 1rem; margin-top: 2.6rem; }
.character-profile-item { display: flex; gap: 1.2rem; align-items: center; font-family: "M PLUS Rounded 1c", sans-serif; font-size: 1.75rem; font-weight: 500; line-height: 1.4; }
.character-profile-label { display: flex; flex-shrink: 0; gap: 1rem; align-items: center; justify-content: center; min-width: 9.6rem; padding: .45rem .9rem; color: #fff; background: var(--pink-label); font-size: 1.5rem; }
.trait-body { margin-top: 2.6rem; color: var(--ink); font-size: 1.55rem; font-weight: 400; line-height: 2; }
.trait-body p + p { margin-top: 1.6rem; }
.trait-key { display: inline-block; margin: 0 .8rem .2rem 0; padding: .25rem .9rem; color: #fff; background: var(--pink-label); font-family: "M PLUS Rounded 1c", sans-serif; font-size: 1.2rem; letter-spacing: .1em; }
.trait-quote {
  display: inline-block;
  max-width: none;
  margin-top: 1.6rem;
  padding: 1.35rem 1.8rem;
  white-space: nowrap;
  color: #fff;
  background: linear-gradient(135deg, #f2bcc9, #e5a0b3);
  border-radius: 1.2rem;
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-size: 2.15rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: .04em;
  box-shadow: 0 .6rem 1.6rem rgba(229, 160, 179, .35);
}
.character-profile-label svg { width: 1.6rem; height: 1.6rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.character-profile dd { margin: 0; }

.character-name rt { font-size: .34em; font-weight: 400; letter-spacing: .08em; }

/* 中文模式下名字改用霞鹜文楷，最接近日文 Klee One 的圆润手写笔触 */
html[lang="zh-CN"] .character-name,
html[lang="zh-CN"] .loader-title {
  font-family: "LXGW WenKai", "ZCOOL XiaoWei", "Noto Sans SC", "Noto Sans JP", serif;
  font-weight: 400;
  letter-spacing: .04em;
}

/* 语言切换：文本淡出 → 换文 → 淡入 */
[data-i18n], [data-i18n-html] { transition: opacity .16s ease; }
body.lang-swapping [data-i18n],
body.lang-swapping [data-i18n-html] { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  [data-i18n], [data-i18n-html] { transition: none; }
}

.page-label { color: var(--pink); font-family: "El Messiri", sans-serif; font-size: 1.6rem; font-weight: 700; line-height: 1; letter-spacing: .24em; }
.page-title {
  margin-top: 1rem;
  color: var(--ink);
  font-family: "Klee One", "Zen Maru Gothic", serif;
  font-size: 4.2rem;
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: .16em;
}
.page-note { margin-top: 1.4rem; font-size: 1.3rem; line-height: 1.8; color: var(--ink); opacity: .72; }

/* Spoiler gate & story */
.spoiler-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.spoiler-bang {
  margin-top: 2.4rem;
  font-family: "M PLUS Rounded 1c", "Zen Maru Gothic", sans-serif;
  font-size: 12.4rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, #f5c8d4, #e08fa6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 .8rem 1.8rem rgba(229, 160, 179, .4));
  animation: spoiler-bounce 2.8s var(--ease) infinite;
}
@keyframes spoiler-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-.9rem); }
}
.spoiler-title {
  margin-top: 1rem;
  color: var(--ink);
  font-family: "Klee One", "Zen Maru Gothic", serif;
  font-size: 3.4rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .2em;
}
.spoiler-note {
  margin-top: 1.8rem;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 2;
  opacity: .72;
}
.story-body { margin-top: 2.8rem; color: var(--ink); font-size: 1.55rem; font-weight: 400; line-height: 2.05; }
.story-body p + p { margin-top: 1.8rem; }

/* Expressions */
.expression-feature { display: flex; gap: 1.4rem; margin-top: 2.8rem; }
.expression-feature li { width: 12rem; }
.expression-feature button {
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: 0 50%;
  transition: transform .3s var(--ease), filter .3s;
}
.expression-feature button[aria-pressed="true"] { filter: drop-shadow(0 0 .6rem rgba(239, 178, 195, .9)); }
.expression-feature img { height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 0 50%; }
.expression-picker { position: relative; display: flex; flex-wrap: wrap; gap: 1.2rem .8rem; margin-top: 2.6rem; padding-block: 2rem .4rem; }
.expression-picker::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: .3rem;
  background-image: radial-gradient(circle, var(--pink) .15rem, transparent .16rem);
  background-repeat: repeat-x;
  background-size: 1.2rem .3rem;
  transform: translateY(-50%);
}
.expression-picker li { width: 6.7rem; }
.expression-picker button {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: visible;
  border: 1px solid transparent;
  border-radius: 50%;
  opacity: .5;
  transition: opacity .3s, transform .3s var(--ease);
}
.expression-picker button[aria-pressed="true"] { border-color: transparent; opacity: 1; filter: drop-shadow(0 0 .5rem rgba(239, 178, 195, .95)); transform: scale(1.06); cursor: auto; }
.expression-picker img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 8.6rem;
  left: 21.6rem;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  color: var(--pink-line);
  font-family: "El Messiri", serif;
  font-size: 1.2rem;
  letter-spacing: .24em;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity .25s var(--ease);
}
.scroll-hint.is-hidden { opacity: 0; }
.scroll-hint svg {
  width: 1.8rem;
  height: 1.8rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: hint-bob 1.8s ease-in-out infinite;
}
.scroll-hint.is-up svg { animation-name: hint-bob-up; }
@keyframes hint-bob {
  0%, 100% { opacity: .5; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(.5rem); }
}
@keyframes hint-bob-up {
  0%, 100% { opacity: .5; transform: translateY(0) rotate(180deg); }
  50% { opacity: 1; transform: translateY(-.5rem) rotate(180deg); }
}
@media screen and (max-width: 767px) {
  .scroll-hint { display: none; }
}

/* Page indicator */.stage-indicator {
  position: absolute;
  bottom: 1.6rem;
  left: 50%;
  z-index: 20;
  display: flex;
  gap: 1.4rem;
  transform: translateX(-50%);
}
.stage-indicator button { color: var(--pink); opacity: .35; transition: opacity .3s, transform .3s var(--ease); }
.stage-indicator button:hover { opacity: .7; }
.stage-indicator button.is-active { opacity: 1; transform: translateY(-.2rem); }
.stage-indicator svg { width: 2.6rem; height: 2.6rem; }

/* CG gallery */
/* CG 页隐藏立绘：透明度由 JS 按翻页进度驱动，让立绘与白色卡片同时消失 */
body.is-cg-page .character-visual { pointer-events: none; }
/* 故事页允许点击右侧立绘切换表情，并给出可点击的指针反馈 */
body.is-story-page .character-visual { pointer-events: auto; cursor: pointer; }
.panel-cg .page-inner { width: 100%; max-width: none; }
.page3d:is(.is-cg, .is-cg-2) .page-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  height: 100%;
}
/* CG 页上下留白取相同值，图片组才是真正垂直居中在白色卡片里 */
.page3d:is(.is-cg, .is-cg-2) { padding-block: 3rem; }
.page3d:is(.is-cg, .is-cg-2) .cg-grid { align-content: start; margin-block: auto; }
/* CG 页：卡片向右延展并居中，填满页面中间区域（桌面） */
@media screen and (min-width: 768px) {
  body.cg-wide .page3d:is(.is-cg, .is-cg-2) {
    left: 2rem;
    width: 120rem;
  }
}
.cg-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.4rem;
}
.cg-grid button {
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: 1.2rem;
  box-shadow: 0 .4rem 1.4rem rgba(50, 46, 85, .12);
  transition: transform .3s var(--ease), box-shadow .3s;
}
.cg-grid img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform .4s var(--ease);
}
.cg-grid button:hover { transform: translateY(-.3rem); box-shadow: 0 .8rem 2rem rgba(50, 46, 85, .16); }
.cg-grid button:hover img { transform: scale(1.04); }

.cg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  grid-template-columns: 7rem 1fr 7rem;
  align-items: center;
  justify-items: center;
  padding: 4rem 2rem;
  background: rgba(30, 26, 48, .84);
  backdrop-filter: blur(4px);
}
.cg-lightbox[hidden] { display: none; }
.cg-lightbox-figure { position: relative; max-width: min(112rem, 84vw); margin: 0; }
.cg-lightbox-figure img {
  width: 100%;
  height: auto;
  border-radius: 1.2rem;
  box-shadow: 0 2rem 6rem rgba(0, 0, 0, .45);
}
/* 放大后翻页：新图从对应方向轻轻滑入并淡入 */
@keyframes cg-slide-next {
  from { opacity: .3; transform: translateX(4%) scale(.98); }
  to { opacity: 1; transform: none; }
}
@keyframes cg-slide-prev {
  from { opacity: .3; transform: translateX(-4%) scale(.98); }
  to { opacity: 1; transform: none; }
}
.cg-lightbox-figure.is-slide-next { animation: cg-slide-next .46s cubic-bezier(.22, .61, .36, 1) both; }
.cg-lightbox-figure.is-slide-prev { animation: cg-slide-prev .46s cubic-bezier(.22, .61, .36, 1) both; }
@media (prefers-reduced-motion: reduce) {
  .cg-lightbox-figure.is-slide-next,
  .cg-lightbox-figure.is-slide-prev { animation: none; }
}
.cg-lightbox-cap {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  margin-top: 1.2rem;
  color: #fff;
  font-family: "El Messiri", sans-serif;
  font-size: 1.4rem;
  letter-spacing: .2em;
  text-align: center;
}
.cg-lightbox-nav {
  display: grid;
  width: 5.2rem;
  height: 5.2rem;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  transition: background .25s, transform .25s var(--ease);
}
.cg-lightbox-nav svg,
.cg-lightbox-close svg {
  width: 52%;
  height: 52%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cg-lightbox-nav:hover { background: rgba(255, 255, 255, .26); transform: scale(1.06); }
.cg-lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2.4rem;
  display: grid;
  width: 4.4rem;
  height: 4.4rem;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  transition: background .25s;
}
.cg-lightbox-close:hover { background: rgba(255, 255, 255, .26); }
body.is-cg-open { overflow: hidden; }

@media (max-width: 1354px) {
  html { font-size: .7385524372vw; }
}

@media screen and (max-width: 846px) and (min-width: 768px) {
  .section-title { margin-inline: auto; }
  .title-deco { right: -6rem; }
}

/* Desktop: 锁定视口，避免滚动条出现/消失造成左右抖动 */
@media screen and (min-width: 768px) {
  html, body { height: 100%; overflow: hidden; }
}

/* Mobile: 同款旋钮翻页，改成左右滑动 */
@media screen and (max-width: 767px) {
  html { font-size: 10px; }
  html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
  .menu-cat { right: 1.2rem; bottom: 1.2rem; width: 6rem; height: 6rem; }
  .menu-panel { bottom: 8rem; right: 1.2rem; width: 22rem; }

  .cg-grid { grid-template-columns: repeat(3, 1fr); gap: .8rem; margin-top: 1.4rem; }
  .cg-grid button { border-radius: .8rem; }
  /* CG 页：隐藏立绘后卡片向上撑满，腾出空间放大 CG */
  body.is-cg-page .knob { height: calc(72vh - 3.8rem); }
  body.is-cg-page .cg-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .cg-lightbox { grid-template-columns: 4rem 1fr 4rem; padding: 2.4rem .8rem; }
  .cg-lightbox-figure { max-width: 72vw; }
  .cg-lightbox-nav { width: 4rem; height: 4rem; }
  .cg-lightbox-close { top: 1rem; right: 1rem; width: 3.6rem; height: 3.6rem; }

  .character { height: 100dvh; padding: 0; overflow: hidden; }
  .stage-track { height: 100%; }
  .stage { position: relative; height: 100%; overflow: hidden; padding-inline: 20px; }
  .stage-scale { width: 100%; height: 100%; transform: none; }
  .stage-canvas {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 100%;
    overflow: hidden;
    margin-inline: auto;
  }
  .section-title { position: absolute; top: 1.4rem; left: 0; width: 100%; margin: 0; }
  .stage-indicator { display: none; }
  .section-title-text { flex-direction: column; gap: 0; }
  .section-title-en { width: 100%; text-align: center; font-size: 3.4rem; line-height: 1.2; letter-spacing: .05em; }
  .section-title-ja { margin-top: .3rem; padding-bottom: 0; font-size: 1.4rem; letter-spacing: .2em; }
  .title-deco { top: -.4rem; right: .2rem; transform: scale(.42); transform-origin: top right; }

  .character-visual {
    position: absolute;
    top: 7.6rem;
    left: 0;
    right: auto;
    width: 100%;
    height: 40vh;
    margin: 0;
    overflow: hidden;
  }
  .character-bg {
    right: auto;
    bottom: 0;
    left: 50%;
    width: min(100%, 33rem);
    transform: translateX(-50%);
    border: 0;
    box-shadow: inset 0 0 4rem rgba(255, 255, 255, .42);
  }
  .character-bg::before { display: none; }
  .character-image { height: 100%; }
  .character-image img { width: 100%; height: auto; }
  .character-catchcopy { top: 2.6rem; left: 1rem; transform: scale(.52); transform-origin: top left; }

  .knob { position: absolute; top: auto; bottom: 7.4rem; left: 0; width: 100%; max-width: 100%; height: calc(46vh - 3.8rem); margin: 0; }
  .knob-clip {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: var(--white);
    border-radius: 2.8rem 2.8rem 0 0;
    box-shadow: 0 .4rem 2.4rem #f5e9e5;
  }
  .cylinder-scene, .cylinder, .drum3d { position: absolute; inset: 0; }
  .cylinder { transform: none !important; }
  .knob-gloss { display: none; }
  .page3d {
    top: 0;
    width: 100%;
    height: 100%;
    padding: 1.8rem 1.6rem 2.2rem;
    background: none;
    border-radius: 0;
  }
  .page-inner { width: 100%; max-width: none; }
  .page-label { font-size: 1rem; }
  .page-title { font-size: 2.6rem; }
  .page-note { margin-top: .8rem; font-size: 1.1rem; }
  .spoiler-bang { margin-top: 1rem; font-size: 7rem; filter: drop-shadow(0 .4rem .9rem rgba(229, 160, 179, .4)); }
  .spoiler-title { margin-top: .5rem; font-size: 2.2rem; }
  .spoiler-note { margin-top: 1rem; font-size: 1.1rem; line-height: 1.8; }
  .story-body { margin-top: 1.4rem; font-size: 1.15rem; line-height: 1.8; }
  .story-body p + p { margin-top: .8rem; }
  .character-name-en { font-size: 1.1rem; }
  .character-name { margin-top: .4rem; font-size: 3.6rem; letter-spacing: .1em; }
  .character-cv { margin-top: .5rem; font-size: 1.1rem; }
  .character-desc { margin-top: 1.6rem; font-size: 1.25rem; line-height: 1.6; }
  .character-profile { margin-top: 1.4rem; gap: .7rem; }
  .character-profile-item { gap: 1rem; font-size: 1.4rem; }
  .character-profile-label { min-width: 8rem; padding: .3rem .7rem; font-size: 1.2rem; }
  .trait-body { margin-top: 1.4rem; font-size: 1.25rem; line-height: 1.85; }
  .trait-body p + p { margin-top: 1rem; }
  .trait-quote { display: block; width: 100%; text-align: center; margin-top: 1.2rem; padding: 1rem 1.4rem; font-size: 1.6rem; line-height: 1.45; white-space: normal; }
  .expression-feature { display: flex; gap: .8rem; margin-top: 1.4rem; }
  .expression-feature li { width: calc((100% - 1.6rem) / 3); }
  .expression-feature button { height: 7rem; }
  .expression-picker { margin-top: 1.2rem; padding-block: 1.2rem .2rem; gap: .6rem .5rem; justify-content: center; }
  .expression-picker li { width: 3.6rem; }

  .scroll-hint { bottom: .6rem; left: 50%; font-size: 1rem; letter-spacing: .18em; }
  .scroll-hint svg { animation: none; transform: rotate(90deg); }
  .scroll-hint.is-up svg { transform: rotate(-90deg); }
}

/* 矮屏手机：故事文本较长，收紧字号与行距，避免被卡片裁切 */
@media screen and (max-width: 767px) and (max-height: 760px) {
  .page-label { font-size: .9rem; }
  .page-title { font-size: 2.3rem; }
  .story-body { margin-top: 1rem; font-size: 1.05rem; line-height: 1.72; }
  .story-body p + p { margin-top: .6rem; }
}

@media (max-width: 414px) {
  html { font-size: 2.4154589372vw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---- 左下角音乐播放器 ---- */
.music-player {
  position: fixed;
  left: 1.6rem;
  bottom: 1.6rem;
  z-index: 112;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 1.2rem;
}
.music-toggle {
  display: grid;
  place-items: center;
  width: 5.6rem;
  height: 5.6rem;
  border: 1px solid var(--pink-line);
  border-radius: 50%;
  background: linear-gradient(150deg, #f6dee6, #e4b4c4);
  color: var(--white);
  box-shadow: 0 .4rem 1.2rem rgba(200, 140, 160, .3);
  transition: transform .3s var(--ease), box-shadow .3s;
}
.music-toggle svg { width: 2.7rem; height: 2.7rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.music-toggle:hover { transform: translateY(-.2rem); box-shadow: 0 .6rem 1.6rem rgba(200, 140, 160, .42); }
.music-player[data-open="true"] .music-toggle { transform: rotate(-8deg); }
.music-panel {
  width: 30rem;
  padding: 1.4rem 1.6rem 1.2rem;
  border: 1px solid var(--pink-line);
  border-radius: 1.6rem;
  background: rgba(255, 253, 248, .96);
  box-shadow: 0 1rem 3rem rgba(50, 46, 85, .14);
  backdrop-filter: blur(8px);
}
.music-head {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.music-title {
  flex: 1;
  overflow: hidden;
  color: var(--ink);
  font-size: 1.4rem;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.music-fav {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  flex: none;
  border-radius: 50%;
  color: #d5a9b7;
  transition: transform .2s var(--ease), color .2s;
}
.music-fav svg { width: 2rem; height: 2rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; transition: fill .2s; }
.music-fav:hover { transform: scale(1.12); }
.music-fav.is-fav { color: #e2688a; }
.music-fav.is-fav svg { fill: currentColor; }
.music-progress { margin-top: 1rem; }
.music-progress input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: .6rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #e9a6ba var(--p, 0%), #f0e3e7 var(--p, 0%));
  cursor: pointer;
}
.music-progress input[type="range"]::-webkit-slider-thumb,
.music-volume input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.4rem;
  height: 1.4rem;
  border: 2px solid #e9a6ba;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 .1rem .4rem rgba(50, 46, 85, .18);
}
.music-progress input[type="range"]::-moz-range-thumb,
.music-volume input[type="range"]::-moz-range-thumb {
  width: 1.2rem;
  height: 1.2rem;
  border: 2px solid #e9a6ba;
  border-radius: 50%;
  background: var(--white);
}
.music-time {
  display: flex;
  justify-content: space-between;
  margin-top: .4rem;
  color: #9a8fa8;
  font-size: 1.1rem;
  letter-spacing: .02em;
}
.music-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
  margin-top: .8rem;
}
.music-controls button {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  color: var(--ink);
  transition: background .2s, transform .2s var(--ease);
}
.music-controls button svg { width: 2rem; height: 2rem; fill: currentColor; }
.music-controls button:hover { background: #f7e9ee; }
.music-play {
  width: 4.4rem !important;
  height: 4.4rem !important;
  background: linear-gradient(150deg, #ee9db6, #e0779a) !important;
  color: var(--white) !important;
  box-shadow: 0 .3rem 1rem rgba(224, 119, 154, .4);
}
.music-play svg { width: 2.2rem !important; height: 2.2rem !important; }
.music-play:hover { transform: scale(1.06); }
.music-play .icon-pause { display: none; }
.music-player[data-playing="true"] .music-play .icon-play { display: none; }
.music-player[data-playing="true"] .music-play .icon-pause { display: block; }
.music-volume {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-top: .9rem;
}
.music-volume svg { width: 1.8rem; height: 1.8rem; flex: none; fill: none; stroke: #b08fa0; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.music-volume input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: .5rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #e9a6ba var(--v, 60%), #f0e3e7 var(--v, 60%));
  cursor: pointer;
}
@media (max-width: 767px) {
  .music-player { left: 1rem; bottom: 1rem; }
  .music-toggle { width: 4.8rem; height: 4.8rem; }
  .music-panel { width: min(27rem, calc(100vw - 2rem)); }
}

/* 播放器横向布局：从音符按钮向右延伸，展开/收起带过渡动画 */
.music-player {
  flex-direction: row;
  align-items: center;
}
.music-panel {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  width: 64rem;
  max-width: calc(100vw - 12rem);
  padding: 1.1rem 1.6rem;
  transform-origin: left bottom;
  transform: translateX(-1rem) scale(.97);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .26s var(--ease), transform .3s var(--ease), visibility 0s linear .3s;
}
.music-player[data-open="true"] .music-panel {
  transform: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .26s var(--ease), transform .3s var(--ease), visibility 0s;
}
.music-head { flex: 0 0 15rem; min-width: 8rem; }
.music-title { display: block; }
.music-progress { flex: 1 1 16rem; min-width: 9rem; margin-top: 0; }
.music-controls { margin-top: 0; gap: 1rem; }
.music-volume { flex: 0 0 9rem; margin-top: 0; }
.music-panel .music-fav { flex: none; }
/* 紧凑尺寸：整体缩小，文字与控制更贴近 */
.music-toggle { width: 4.6rem; height: 4.6rem; }
.music-toggle svg { width: 2.2rem; height: 2.2rem; }
.music-panel { gap: .8rem; width: 54rem; padding: .8rem 1rem; }
.music-head { flex: 0 0 10rem; }
.music-title { font-size: 1.2rem; }
.music-fav { width: 2.4rem; height: 2.4rem; }
.music-fav svg { width: 1.7rem; height: 1.7rem; }
.music-controls { gap: .6rem; }
.music-controls button { width: 2.8rem; height: 2.8rem; }
.music-controls button svg { width: 1.7rem; height: 1.7rem; }
.music-play { width: 3.6rem !important; height: 3.6rem !important; }
.music-play svg { width: 1.8rem !important; height: 1.8rem !important; }
.music-progress { display: flex; align-items: center; gap: .6rem; flex: 0 0 auto; min-width: 0; margin-top: 0; }
.music-progress input[type="range"] { flex: 0 0 9rem; width: 9rem; height: .5rem; }
.music-time { display: flex; align-items: center; justify-content: flex-start; gap: .3rem; margin-top: 0; font-size: 1rem; white-space: nowrap; }
.music-time-sep { opacity: .5; }
.music-volume { flex: 0 0 10.5rem; gap: .6rem; min-width: 0; }
.music-volume input[type="range"] { flex: 1 1 auto; min-width: 0; width: auto; }
.music-volume svg { width: 1.5rem; height: 1.5rem; }
.music-volume input[type="range"] { height: .45rem; }
@media (max-width: 767px) {
  .music-player {
    left: .6rem;
    bottom: .6rem;
    gap: .5rem;
    align-items: center;
  }
  .music-toggle { width: 3.4rem; height: 3.4rem; }
  .music-toggle svg { width: 1.7rem; height: 1.7rem; }
  .music-panel {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: .5rem;
    width: auto;
    max-width: calc(100vw - 5.6rem);
    padding: .4rem .7rem;
  }
  .music-head { flex: 0 1 7.5rem; min-width: 0; }
  .music-title { font-size: 1rem; }
  .music-controls { flex: 0 0 auto; gap: .15rem; }
  .music-controls button { width: 2rem; height: 2rem; }
  .music-controls button svg { width: 1.2rem; height: 1.2rem; }
  .music-play { width: 2.5rem !important; height: 2.5rem !important; }
  .music-play svg { width: 1.3rem !important; height: 1.3rem !important; }
  .music-progress { flex: 0 0 5rem; min-width: 0; }
  .music-progress input[type="range"] { flex: 1 1 auto; width: auto; min-width: 0; }
  .music-time { display: none; }
  .music-volume { display: none; }
  .music-fav { width: 1.9rem; height: 1.9rem; }
  .music-fav svg { width: 1.4rem; height: 1.4rem; }
}
