/* ==========================================================================
   传播心动事件簿 · 全局样式
   设计目标：乙女游戏结构 + 淡粉色系 + 圆润自然 + 每屏背景语言不同 + 仅 SVG
   说明：所有颜色都通过 :root CSS 变量管理，改这里即可整体换肤
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* ▼▼▼ 色彩与基础变量 ▼▼▼ */
:root {
  /* 粉色阶梯：由浅到深共 6 级 */
  --rose-50:   #fff6f9;
  --rose-100:  #ffe8ef;
  --rose-200:  #fdd3e0;
  --rose-300:  #f9b6cb;
  --rose-400:  #f48aad;
  --rose-500:  #ec5b8b;
  --rose-deep: #c23864;
  /* 文字色（粉调深色，不使用纯黑，保持柔和） */
  --ink:       #5a2a3d;
  --ink-soft:  #8a6374;
  --ink-dim:   #b58b9c;
  /* 其它强调 */
  --gold:      #d8a45e;  /* HE 结局徽章 */
  --teal:      #7ab8a0;  /* OE 结局徽章 */
  --red:       #e06a7b;  /* BE 结局徽章 */
  /* 阴影 */
  --shadow-soft: 0 10px 30px rgba(236, 91, 139, .10);
  --shadow-hard: 0 18px 40px rgba(236, 91, 139, .22);
  /* 缓动 */
  --ease: cubic-bezier(.22, .8, .32, 1);
  --ease-soft: cubic-bezier(.22, 1, .36, 1);
  /* 圆角 */
  --radius-card: 24px;
  --radius-btn:  999px;
  /* 背景渐变 */
  --grad-bg: linear-gradient(160deg, #fff6f9 0%, #ffe8ef 55%, #fde0ea 100%);
}

/* ▼▼▼ 基础重置 ▼▼▼ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--grad-bg);
  -webkit-font-smoothing: antialiased;
}
button { border: none; background: none; cursor: pointer; font-family: inherit; color: inherit; }
::selection { background: var(--rose-300); color: #fff; }
/* 滚动条极简化（档案/结局等长内容页用得上） */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rose-300); border-radius: 3px; }

/* ==========================================================================
   背景粒子：淡粉色花瓣/光点，贯穿所有屏幕
   ========================================================================== */
#particles {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ==========================================================================
   屏幕切换：每个 .screen 占满整个视口，通过 .active 控制显示
   ========================================================================== */
.screen {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  opacity: 0; visibility: hidden;
  transform: scale(1.02);
  transition: opacity .6s var(--ease), transform .6s var(--ease), visibility 0s .6s;
  z-index: 1;
  overflow: hidden;
}
.screen.active {
  opacity: 1; visibility: visible;
  transform: scale(1);
  transition: opacity .6s var(--ease), transform .6s var(--ease), visibility 0s 0s;
}
/* 需要滚动的屏幕（档案/结局/图鉴/介绍） */
.screen.is-scroll {
  align-items: flex-start; justify-content: flex-start;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   通用：返回按钮 · 章节标题 · 主按钮 · 卡片
   ========================================================================== */
.back-btn {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0) + 18px);
  left: 18px;
  font-size: 11px; letter-spacing: .3em;
  color: var(--ink-soft);
  padding: 8px 14px;
  border: 1px solid var(--rose-200);
  background: rgba(255, 255, 255, .65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 999px;
  cursor: pointer;
  transition: all .3s var(--ease);
  z-index: 100;
}
.back-btn:hover, .back-btn:active {
  color: var(--rose-deep);
  border-color: var(--rose-400);
  background: #fff;
}

.section-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 18px; font-weight: 700;
  letter-spacing: .4em;
  color: var(--ink);
  text-align: center;
  padding-left: .4em;
  position: relative;
}
.section-title::after {
  content: '';
  display: block;
  width: 44px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--rose-400), transparent);
  margin: 10px auto 0;
}
.section-sub {
  font-size: 12px; color: var(--ink-soft); letter-spacing: .15em;
  text-align: center; margin-top: 8px;
}

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  font-size: 14px; font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #ff8fb1, #ec5b8b);
  border-radius: var(--radius-btn);
  box-shadow: 0 10px 24px rgba(236, 91, 139, .35);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.btn-primary:hover, .btn-primary:active { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(236, 91, 139, .4); }

/* ==========================================================================
   全局弹层：通知 · 闪光 · 墨染 · 模态框
   ========================================================================== */
.screen-flash {
  position: fixed; inset: 0;
  background: var(--rose-200);
  opacity: 0; pointer-events: none;
  z-index: 3000;
  transition: opacity .1s;
}
.screen-flash.flash { opacity: .35; }

/* 粉墨晕染：Meta / 关键提示使用（替代参考文件里的 glitch 效果） */
.ink-overlay {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 2500;
  opacity: 0;
  background:
    radial-gradient(circle at 30% 40%, rgba(249, 182, 203, .55) 0%, transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(236, 91, 139, .35) 0%, transparent 40%);
}
.ink-overlay.active {
  animation: inkBloom 1.2s var(--ease-soft) forwards;
}
@keyframes inkBloom {
  0%   { opacity: 0; filter: blur(0); transform: scale(.7); }
  40%  { opacity: 1; }
  100% { opacity: 0; filter: blur(30px); transform: scale(1.15); }
}

.notification {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(.9);
  padding: 20px 32px;
  font-family: 'Noto Serif SC', serif;
  font-size: 13px; font-weight: 600;
  letter-spacing: .3em;
  color: var(--rose-deep);
  background: rgba(255, 255, 255, .95);
  border: 1px solid var(--rose-300);
  border-radius: 16px;
  box-shadow: 0 0 60px rgba(236, 91, 139, .25);
  text-align: center;
  max-width: 85vw;
  opacity: 0; pointer-events: none;
  z-index: 4000;
  transition: all .5s var(--ease-soft);
}
.notification.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(90, 42, 61, .4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  z-index: 5000;
  transition: opacity .4s var(--ease);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-content {
  background: #fff;
  border: 1px solid var(--rose-200);
  border-radius: var(--radius-card);
  max-width: 520px; width: 100%;
  padding: 32px 26px;
  max-height: 80vh; overflow-y: auto;
  box-shadow: var(--shadow-hard);
  transform: translateY(20px);
  transition: transform .5s var(--ease-soft);
}
.modal-overlay.active .modal-content { transform: translateY(0); }

/* ==========================================================================
   S1 · 主菜单：柔光晕 + 花瓣漂浮背景语言
   ========================================================================== */
.screen-menu {
  background:
    radial-gradient(ellipse at 25% 30%, rgba(255, 255, 255, .85) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 70%, rgba(249, 182, 203, .55) 0%, transparent 50%),
    var(--grad-bg);
}
/* 柔光晕大圆：缓慢漂浮 */
.screen-menu::before, .screen-menu::after {
  content: ""; position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  pointer-events: none;
}
/* ▼▼▼ 主菜单光斑：按用户要求把"那抹黄"换成浅粉，整屏只剩粉色渐变 ▼▼▼ */
.screen-menu::before { width: 260px; height: 260px; background: #ffc6d7; top: -80px; left: -80px; animation: drift 16s ease-in-out infinite alternate; }
.screen-menu::after  { width: 220px; height: 220px; background: #ffd4e1; bottom: -80px; right: -80px; animation: drift 18s ease-in-out infinite alternate-reverse; }
/* ▲▲▲ 光斑颜色改动 ▲▲▲ */
@keyframes drift {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(30px,-20px) scale(1.12); }
}

.menu-inner {
  display: flex; align-items: center; justify-content: center;
  gap: 60px;
  width: 100%; max-width: 880px;
  padding: 30px 24px;
  position: relative; z-index: 2;
}
.menu-char-frame {
  flex-shrink: 0;
  position: relative;
}
.menu-char-img {
  width: 220px; height: 320px;
  object-fit: cover; object-position: top center;
  display: block;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, .9);
  box-shadow: 0 20px 40px rgba(236, 91, 139, .15), 0 0 0 1px var(--rose-200);
  background: var(--rose-50);
  transition: transform .6s var(--ease);
}
.menu-char-img:hover { transform: translateY(-4px); }
/* 立绘画框后的光斑 */
.menu-char-frame::before {
  content: ""; position: absolute;
  inset: -14px;
  border-radius: 24px;
  background: radial-gradient(circle, rgba(249, 182, 203, .5) 0%, transparent 70%);
  filter: blur(14px);
  z-index: -1;
}
.menu-char-tag {
  font-family: 'Noto Serif SC', serif;
  font-size: 10px; letter-spacing: .4em;
  color: var(--ink-soft);
  text-align: center;
  margin-top: 14px;
}
.menu-content {
  display: flex; flex-direction: column; align-items: flex-start;
}
.title-block { margin-bottom: 36px; position: relative; }
.title-sub {
  font-family: 'Noto Serif SC', serif;
  font-size: 11px; letter-spacing: .6em;
  color: var(--ink-dim);
  margin-bottom: 12px;
  animation: slideDown 1s var(--ease) .2s both;
}
.title-main {
  font-family: 'Noto Serif SC', serif;
  font-size: 44px; font-weight: 700;
  line-height: 1.1; letter-spacing: .12em;
  background: linear-gradient(135deg, #c23864 0%, #ec5b8b 55%, #ff9dbd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: slideDown 1s var(--ease) .4s both;
}
.title-main::after {
  content: ''; display: block;
  width: 60px; height: 2px;
  background: linear-gradient(90deg, var(--rose-400), transparent);
  margin-top: 12px;
}
.title-tag {
  font-size: 11px; letter-spacing: .25em;
  color: var(--ink-dim);
  margin-top: 18px;
  animation: slideDown 1s var(--ease) .6s both;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   主菜单"精简居中"变种
   （由 index.html 的 .menu-inner-center / .menu-content-center /
    .title-block-center / .menu-list-center 触发）
   因为已经去掉了左立绘，只剩标题 + 菜单，所以整组元素居中摆放。
   ============================================================ */
.menu-inner.menu-inner-center {
  justify-content: center;
}
.menu-content.menu-content-center {
  align-items: center;
  text-align: center;
}
.title-block.title-block-center {
  text-align: center;
  margin-bottom: 56px;
}
.title-block.title-block-center .title-main {
  text-align: center;
  font-size: 48px;
  letter-spacing: .18em;
}
/* 标题下面那条小短线也要对称居中 */
.title-block.title-block-center .title-main::after {
  margin: 18px auto 0;
  background: linear-gradient(90deg, transparent, var(--rose-400), transparent);
  width: 80px;
}
.menu-list.menu-list-center {
  align-items: center;
}
.menu-list.menu-list-center .menu-item {
  text-align: center;
  padding: 12px 28px;
  min-width: 220px;
}
/* 移动端再收小一点 */
@media (max-width: 560px) {
  .title-block.title-block-center .title-main { font-size: 34px; letter-spacing: .14em; }
}

/* ============================================================
   ▼▼▼ 主菜单左上角"论点说明块" .menu-topic-note
   用途：不再把论点当大标题，而是作为"左上角的小字说明"，
        交代"本作整份文件围绕什么论点 + 每位攻略对象都是论据"
   ============================================================ */
.menu-topic-note {
  position: absolute;
  top: 20px;
  left: 22px;
  z-index: 5;
  max-width: 260px;
  padding: 12px 16px 12px 14px;
  background: rgba(255, 255, 255, .62);        /* 半透明小卡，不抢主标题视觉 */
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 182, 206, .5);
  border-left: 3px solid var(--rose-400);      /* 左边一条粉色细线，像便签 */
  border-radius: 4px 10px 10px 4px;
  box-shadow: 0 6px 18px rgba(236, 91, 139, .08);
  animation: slideDown .9s var(--ease) .1s both;
  pointer-events: none;                         /* 纯装饰，不挡点击 */
}
.menu-topic-kicker {
  font-family: 'Noto Serif SC', serif;
  font-size: 10px;
  letter-spacing: .35em;
  color: var(--rose-600, #c23864);
  margin-bottom: 6px;
  font-weight: 600;
}
.menu-topic-text {
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink-dim);
  letter-spacing: .02em;
}
.menu-topic-text strong {
  color: var(--ink);
  font-weight: 600;
}

/* ▼▼▼ 主菜单副标题小字（在大标题"攻略一下！"下方）▼▼▼ */
.title-sub-line {
  margin-top: 14px;
  font-family: 'Noto Serif SC', serif;
  font-size: 11px;
  letter-spacing: .3em;
  color: var(--ink-dim);
  animation: slideDown 1s var(--ease) .55s both;
}

/* ▼▼▼ 把"攻略一下！"这个 CTA 型标题再调一下手感：略小、更灵动 ▼▼▼ */
.title-block.title-block-center .title-main.title-cta {
  font-size: 56px;
  letter-spacing: .14em;
}

/* ▼▼▼ 移动端：论点说明恢复「左上角小卡」（用户反馈顶栏居中版不好看）▼▼▼ */
@media (max-width: 560px) {
  .menu-topic-note {
    left: 12px;
    right: auto;
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    transform: none;
    max-width: 72vw;
    width: auto;
    padding: 10px 12px;
    text-align: left;
    /* 恢复与桌面一致的「左侧粉线便签」样式 */
    border: 1px solid rgba(255, 182, 206, .5);
    border-left: 3px solid var(--rose-400);
    border-radius: 4px 10px 10px 4px;
    animation: slideDown .9s var(--ease) .1s both;
  }
  .menu-topic-kicker {
    font-size: 9px;
    letter-spacing: .3em;
    text-align: left;
  }
  .menu-topic-text {
    font-size: 11px;
    letter-spacing: .02em;
    line-height: 1.65;
    text-align: left;
  }
  .title-block.title-block-center .title-main.title-cta {
    font-size: 38px; letter-spacing: .1em;
  }
  .title-sub-line { font-size: 10px; letter-spacing: .2em; }
  /* 给左上角论点卡留高，避免压住中间「攻略一下！」 */
  .screen-menu .menu-inner.menu-inner-center {
    padding-top: clamp(96px, 26vh, 168px);
    box-sizing: border-box;
  }
}

/* ============================================================
   ▼▼▼ 立绘区域 · 已取消 CSS 叠字「@池驭」
   用户已把原画师署名做进图片文件，并改用图床外链；若再叠一层会重复、也挡脸。
   仍保留 .portrait-img-shell / .target-portrait 的定位与裁切，方便以后改样式。
   对话页人物脚下渐变仍只用 .char-img-wrap::after（见下文 S4）。
   ============================================================ */
.target-portrait,
.intro-portrait,
.profile-portrait {
  position: relative;
}

/* ▼ 仅包一层 <img> 的壳：介绍页、档案页共用（圆角裁切、overflow） ▼ */
.portrait-img-shell {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
}

/* ============================================================
   ▼▼▼ 全站素材声明条 · 固定在页面底部
   满足"图片外面下方用小字标注素材来源"的要求。
   做成全站一条常驻小字，避免每张图下各标一次带来的视觉噪音。
   pointer-events:none → 不挡住任何按钮/点击。
   ============================================================ */
.asset-credit {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 30;
  padding: 5px 14px 6px;
  font-size: 10px;
  letter-spacing: .18em;
  color: #b07a8d;
  text-align: center;
  background: rgba(255, 244, 248, .72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-top: 1px solid rgba(249, 182, 203, .45);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.asset-credit strong {
  color: #8a4a62;
  font-weight: 600;
  letter-spacing: .12em;
}
@media (max-width: 560px) {
  .asset-credit { font-size: 9px; letter-spacing: .12em; padding: 4px 8px 5px; }
}

.menu-list {
  list-style: none;
  display: flex; flex-direction: column; gap: 4px;
  animation: slideDown 1s var(--ease) .8s both;
}
.menu-item {
  padding: 12px 40px 12px 14px;
  font-size: 14px; letter-spacing: .35em;
  color: var(--ink-soft);
  cursor: pointer;
  position: relative;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: all .4s var(--ease);
}
.menu-item:hover, .menu-item:active {
  color: var(--rose-deep);
  border-color: var(--rose-200);
  background: rgba(255, 255, 255, .5);
  padding-left: 26px;
}
.menu-item::before {
  content: ""; position: absolute;
  left: 8px; top: 50%; transform: translateY(-50%);
  width: 0; height: 1.5px;
  background: var(--rose-400);
  transition: width .3s var(--ease);
}
.menu-item:hover::before { width: 12px; }

/* ==========================================================================
   S2 · 攻略对象选择：米白底 + 斜线质感（区别于主菜单柔光晕）
   ========================================================================== */
.screen-select.is-scroll { padding: 0; }
.screen-select {
  background:
    linear-gradient(180deg, #fffaf2 0%, #fff2f6 100%);
}
.screen-select::before {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(135deg, rgba(249, 182, 203, .14) 0 1px, transparent 1px 24px);
  pointer-events: none;
}
.select-inner {
  width: 100%; max-width: 900px;
  padding: 80px 20px 40px;
  position: relative; z-index: 1;
}

.target-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 28px;
}
.target-card {
  background: #fff;
  border: 1px solid var(--rose-200);
  border-radius: var(--radius-card);
  padding: 20px 18px 22px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all .45s var(--ease);
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}
.target-card:hover, .target-card:active {
  transform: translateY(-4px);
  border-color: var(--rose-400);
  box-shadow: var(--shadow-hard);
}
.target-card::before {
  content: ""; position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--rose-400), transparent);
  opacity: 0;
  transition: opacity .4s;
}
.target-card:hover::before { opacity: 1; }
.target-portrait {
  width: 160px; height: 220px;
  margin-bottom: 14px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #fff2f7, #fde0ea);
  box-shadow: inset 0 0 0 1px var(--rose-200);
}
.target-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.target-tag {
  font-family: 'Noto Serif SC', serif;
  font-size: 10px; letter-spacing: .3em;
  color: var(--rose-400);
  margin-bottom: 6px;
}
.target-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 16px; font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.4;
}
.target-nick {
  font-size: 12px; color: var(--rose-deep);
  letter-spacing: .2em;
  margin-bottom: 10px;
}
.target-brief {
  font-size: 12px; color: var(--ink-soft);
  line-height: 1.7;
  padding: 0 4px;
}
/* 进度小条（角色卡底部） */
.target-progress {
  width: 100%; height: 2px;
  margin-top: 14px;
  background: var(--rose-100);
  border-radius: 2px;
  overflow: hidden;
}
.target-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rose-300), var(--rose-500));
  transition: width 1s var(--ease);
}
/* 已完成角标 */
.target-badge {
  position: absolute;
  top: 14px; right: 14px;
  padding: 3px 8px;
  font-size: 10px; letter-spacing: .2em;
  background: var(--rose-100);
  color: var(--rose-deep);
  border-radius: 999px;
}
/* 锁定状态（隐藏角色默认锁） */
/* ▼▼▼ 隐藏角色卡片（未解锁状态）
   之前版本用 ::after 盖一层 "? ? ?"，但因为 JS 里已经实际把
   target-name / target-nick / target-brief 的文字都换成 ??? 了，
   这里就不再叠加蒙层，避免两层 "?" 打架。只保留：
     · 整张卡灰度/半透
     · 不可点击
   ▼▼▼ */
.target-card.is-locked {
  filter: grayscale(.55);
  opacity: .78;
  cursor: not-allowed;
  border-style: dashed;
  border-color: var(--rose-300, #f4b6cf);
}
.target-card.is-locked:hover { transform: none; box-shadow: var(--shadow-soft); }
.target-card.is-locked:hover::before { opacity: 0; }

/* 立绘位改成一个大"?"剪影 */
.target-portrait.target-portrait-locked {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #ffeaf2, #fdd2e0);
}
.locked-silhouette {
  font-family: 'Noto Serif SC', serif;
  font-size: 88px; font-weight: 700;
  color: rgba(194, 56, 100, .45);
  letter-spacing: 0;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(236, 91, 139, .15);
}
/* "LOCKED" 小角标：右下角 */
.target-badge.target-badge-locked {
  background: rgba(194, 56, 100, .12);
  color: #c23864;
  font-size: 10px;
  letter-spacing: .35em;
  font-weight: 600;
}

.target-card.is-hidden-char { border-color: var(--gold); }
.target-card.is-hidden-char.is-unlocked { box-shadow: 0 0 24px rgba(216, 164, 94, .35); }

/* ==========================================================================
   S3 · 攻略对象介绍：琥珀米色 + 左右分屏（区别于选择页的网格）
   ========================================================================== */
.screen-intro {
  background:
    linear-gradient(180deg, #fff6ef 0%, #fff0f5 50%, #fde6ee 100%);
}
.screen-intro::before {
  content: ""; position: absolute;
  top: -40px; right: -80px;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 180, .5) 0%, transparent 70%);
  pointer-events: none;
}
.screen-intro.is-scroll { padding: 80px 20px 40px; }
.intro-inner {
  width: 100%; max-width: 880px;
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 30px;
  position: relative; z-index: 1;
}
.intro-portrait {
  position: sticky; top: 80px;
  align-self: start;
}
/* ▼ 画框在 .portrait-img-shell：圆角与裁切与立绘一致 ▼ */
.intro-portrait .portrait-img-shell {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff2f7, #fde0ea);
  box-shadow: var(--shadow-hard);
  border: 2px solid #fff;
}
.intro-portrait .portrait-img-shell img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top center;
}
.intro-nick {
  font-family: 'Noto Serif SC', serif;
  font-size: 14px; letter-spacing: .3em;
  color: var(--rose-deep);
  text-align: center;
  margin-top: 14px;
}
.intro-desc { padding-top: 4px; }
.intro-tag {
  font-family: 'Noto Serif SC', serif;
  font-size: 11px; letter-spacing: .4em;
  color: var(--rose-400);
  margin-bottom: 10px;
}
.intro-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 26px; font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 6px;
}
.intro-aka {
  font-size: 12px; color: var(--ink-soft);
  letter-spacing: .2em;
  margin-bottom: 22px;
}
.intro-section {
  margin-bottom: 22px;
  padding-left: 16px;
  border-left: 2px solid var(--rose-200);
}
.intro-label {
  font-family: 'Noto Serif SC', serif;
  font-size: 10px; letter-spacing: .5em;
  color: var(--rose-deep);
  margin-bottom: 8px;
}
.intro-text {
  font-size: 13.5px; color: var(--ink);
  line-height: 1.95;
}

/* 章节列表（在介绍页内） */
.chapter-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.chapter-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid var(--rose-200);
  border-radius: 12px;
  font-size: 13px;
  transition: all .3s var(--ease);
  cursor: pointer;
}
.chapter-item:hover, .chapter-item:active {
  border-color: var(--rose-400);
  background: #fff;
  transform: translateX(4px);
}
.chapter-item-index {
  font-family: 'Noto Serif SC', serif;
  font-size: 11px; letter-spacing: .3em;
  color: var(--rose-deep);
  margin-right: 12px;
}
.chapter-item-title { flex: 1; color: var(--ink); font-weight: 500; }
.chapter-item-status {
  font-size: 10px; letter-spacing: .2em;
  padding: 2px 8px;
  border-radius: 999px;
}
.chapter-item.is-done  .chapter-item-status { background: var(--rose-100); color: var(--rose-deep); }
.chapter-item.is-locked { opacity: .4; cursor: not-allowed; }
.chapter-item.is-locked .chapter-item-status { background: #f3e6eb; color: var(--ink-dim); }

/* ==========================================================================
   S4 · 对话游戏界面：角色立绘 + 对话框 + 默契条
   ========================================================================== */
.screen-game {
  background: var(--grad-bg);
  padding: 0;
}
.game-scene {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 70px 20px 260px;
  pointer-events: none;
  overflow: hidden;
}
/* 场景底色（不同角色不同氛围，由 JS 切换 data-scene） */
.scene-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(255, 255, 255, .7) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 90%, rgba(249, 182, 203, .45) 0%, transparent 50%);
  transition: background 1s ease;
}
.screen-game[data-scene="yuhu"]   .scene-bg { background: radial-gradient(ellipse at 30% 30%, rgba(255, 234, 241, .8), transparent 55%), radial-gradient(ellipse at 70% 80%, rgba(216, 164, 94, .25), transparent 55%), #fff4f8; }
.screen-game[data-scene="haojing"].scene-bg { background: radial-gradient(ellipse at 50% 30%, rgba(255, 223, 138, .4), transparent 55%), radial-gradient(ellipse at 50% 90%, rgba(249, 182, 203, .55), transparent 55%), #fff3f0; }
.screen-game[data-scene="jinghong"].scene-bg{ background: radial-gradient(ellipse at 30% 20%, rgba(200, 180, 255, .35), transparent 55%), radial-gradient(ellipse at 70% 80%, rgba(249, 182, 203, .45), transparent 55%), #fdf0f5; }
.screen-game[data-scene="ayu"]    .scene-bg { background: radial-gradient(ellipse at 50% 30%, rgba(255, 225, 190, .45), transparent 55%), radial-gradient(ellipse at 50% 90%, rgba(249, 182, 203, .45), transparent 55%), #fff6ee; }

.character-area {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
}
.char-img-wrap { position: relative; display: inline-block; }
.char-img {
  height: min(48vh, 340px);
  width: auto;
  max-width: 90vw;
  object-fit: contain;
  display: block;
  animation: charGlow 5s ease-in-out infinite;
  transition: filter .5s;
}
@keyframes charGlow {
  0%, 100% { filter: drop-shadow(0 10px 30px rgba(236, 91, 139, .18)); }
  50%      { filter: drop-shadow(0 12px 42px rgba(236, 91, 139, .32)); }
}
/* 立绘底部渐变融入背景，让人物"长"在场景里 */
.char-img-wrap::after {
  content: ""; position: absolute;
  bottom: 0; left: 0; width: 100%; height: 32%;
  background: linear-gradient(0deg, var(--rose-50) 0%, transparent 100%);
  pointer-events: none;
}
.char-name-tag {
  font-family: 'Noto Serif SC', serif;
  font-size: 12px; letter-spacing: .4em;
  color: var(--rose-deep);
  margin-top: 8px;
  padding: 4px 14px;
  background: rgba(255, 255, 255, .8);
  border-radius: 999px;
}

/* 默契值显示 */
.affection-display {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0) + 18px);
  right: 18px;
  text-align: right;
  z-index: 100;
  padding: 10px 14px;
  background: rgba(255, 255, 255, .75);
  border: 1px solid var(--rose-200);
  border-radius: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.affection-label {
  font-family: 'Noto Serif SC', serif;
  font-size: 9px; letter-spacing: .3em;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.affection-bar {
  width: 130px; height: 4px;
  background: var(--rose-100);
  border-radius: 2px;
  overflow: hidden;
  margin-left: auto;
  position: relative;
}
.affection-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rose-300), var(--rose-500), #ff9dbd);
  transition: width 1.2s var(--ease-soft);
  box-shadow: 0 0 6px var(--rose-400);
}
.affection-value {
  font-family: 'Noto Serif SC', serif;
  font-size: 20px; font-weight: 700;
  color: var(--rose-deep);
  margin-top: 4px;
  transition: all .4s;
}
.affection-change {
  position: absolute;
  right: 14px; top: 14px;
  font-size: 12px; font-weight: 700;
  color: var(--rose-deep);
  opacity: 0;
  transition: all .6s var(--ease-soft);
  pointer-events: none;
}
.affection-change.show { opacity: 1; transform: translateY(-18px); }
.affection-change.negative { color: var(--red); }

/* 对话框 */
.dialog-box {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  min-height: 200px;
  max-height: 55vh;
  padding: 32px 22px 36px;
  background:
    linear-gradient(180deg, transparent 0%, rgba(255, 246, 249, .95) 15%, rgba(255, 232, 239, .98) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--rose-200);
  z-index: 10;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column;
}
.dialog-speaker {
  font-family: 'Noto Serif SC', serif;
  font-size: 13px; font-weight: 700;
  letter-spacing: .3em;
  color: var(--rose-deep);
  margin-bottom: 10px;
  flex-shrink: 0;
}
.dialog-text {
  font-size: 15px; line-height: 2;
  color: var(--ink);
  max-width: 720px;
  min-height: 48px;
  flex-shrink: 0;
}
.dialog-text .typing-cursor {
  display: inline-block;
  width: 2px; height: 16px;
  background: var(--rose-500);
  margin-left: 3px;
  vertical-align: text-top;
  animation: blink .8s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.choices-container {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 18px;
  max-width: 560px;
  flex-shrink: 0;
}
.choice-btn {
  padding: 14px 22px 14px 22px;
  background: rgba(255, 255, 255, .85);
  border: 1px solid var(--rose-200);
  border-radius: 14px;
  color: var(--ink);
  font-size: 14px;
  letter-spacing: .05em;
  text-align: left;
  position: relative;
  cursor: pointer;
  transition: all .4s var(--ease);
  overflow: hidden;
}
.choice-btn:hover, .choice-btn:active {
  background: #fff;
  border-color: var(--rose-400);
  color: var(--rose-deep);
  padding-left: 36px;
  box-shadow: var(--shadow-soft);
}
.choice-btn::before {
  content: ""; position: absolute;
  left: 14px; top: 50%; transform: translateY(-50%);
  width: 0; height: 1.5px;
  background: var(--rose-500);
  transition: width .3s var(--ease);
}
.choice-btn:hover::before, .choice-btn:active::before { width: 14px; }
.choice-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px; color: var(--ink-dim);
  letter-spacing: .15em;
}
.choice-btn.selected {
  border-color: var(--rose-500);
  background: linear-gradient(135deg, #fff0f5, #fde0ea);
  color: var(--rose-deep);
  pointer-events: none;
}

.continue-prompt {
  font-family: 'Noto Serif SC', serif;
  font-size: 11px; letter-spacing: .35em;
  color: var(--ink-soft);
  text-align: right;
  margin-top: 14px;
  cursor: pointer;
  animation: pulseFade 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulseFade { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
.continue-prompt:hover { color: var(--rose-deep); }

/* ==========================================================================
   S5 · 角色档案：Tabs + 属性条 + 标签 + 攻略指南
   ========================================================================== */
.screen-profile.is-scroll { padding: 80px 20px 40px; }
.screen-profile {
  background:
    linear-gradient(180deg, #fffaf2 0%, #fff3f7 100%);
}
.profile-outer { width: 100%; display: flex; flex-direction: column; align-items: center; }
.profile-container { max-width: 780px; width: 100%; }
.profile-tabs {
  display: flex; flex-wrap: wrap; gap: 4px;
  border-bottom: 1px solid var(--rose-200);
  margin: 24px 0 28px;
}
.profile-tab {
  padding: 12px 20px;
  font-size: 12px; letter-spacing: .3em;
  color: var(--ink-soft);
  cursor: pointer;
  position: relative;
  transition: all .3s;
}
.profile-tab:hover { color: var(--ink); }
.profile-tab.is-active { color: var(--rose-deep); }
.profile-tab.is-active::after {
  content: ""; position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: var(--rose-500);
}

.profile-body {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 28px;
  animation: fadeInUp .5s var(--ease-soft);
}
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
/* ▼ 档案页立绘：圆角与阴影在壳上，水印相对壳定位 ▼ */
.profile-portrait .portrait-img-shell {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  border: 2px solid #fff;
  box-shadow: var(--shadow-soft);
  background: linear-gradient(180deg, #fff8fc, #fde8f0);
}
.profile-portrait .portrait-img-shell img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top center;
}
.profile-section { margin-bottom: 22px; padding-left: 14px; border-left: 2px solid var(--rose-200); }
.profile-section-label {
  font-family: 'Noto Serif SC', serif;
  font-size: 10px; letter-spacing: .4em;
  color: var(--rose-deep);
  margin-bottom: 6px;
}
.profile-section-value {
  font-size: 14px; line-height: 1.9; color: var(--ink);
}
.profile-section-value.quote {
  font-family: 'Noto Serif SC', serif; font-style: italic;
  color: var(--ink-soft);
  padding-left: 12px;
  border-left: 2px solid var(--rose-300);
}
.stat-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.stat-label { font-size: 11px; width: 64px; color: var(--ink-soft); flex-shrink: 0; letter-spacing: .1em; }
.stat-bar { flex: 1; height: 3px; background: var(--rose-100); border-radius: 2px; overflow: hidden; }
.stat-fill { height: 100%; background: linear-gradient(90deg, var(--rose-300), var(--rose-500)); transition: width 1.2s var(--ease-soft); }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 4px 12px; font-size: 11px; letter-spacing: .1em;
  border: 1px solid var(--rose-200);
  border-radius: 999px;
  color: var(--ink-soft);
  transition: all .3s;
}
.tag:hover { border-color: var(--rose-400); color: var(--rose-deep); }

/* ==========================================================================
   S6 · 结局回廊：结局卡片 + 未解锁模糊遮罩
   ========================================================================== */
.screen-endings.is-scroll { padding: 80px 20px 40px; }
.screen-endings {
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 228, 236, .8) 0%, transparent 55%),
    radial-gradient(circle at 80% 90%, rgba(255, 242, 230, .6) 0%, transparent 55%),
    #fff4f7;
}
.ending-outer { width: 100%; max-width: 960px; display: flex; flex-direction: column; align-items: center; margin: 0 auto; }
.ending-count-line {
  font-size: 12px; letter-spacing: .3em;
  color: var(--ink-soft);
  text-align: center;
  margin: 16px 0 24px;
}
.ending-count-line span { font-family: 'Noto Serif SC', serif; color: var(--rose-deep); font-size: 16px; font-weight: 700; }

.endings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  width: 100%;
}
.ending-card {
  background: #fff;
  border: 1px solid var(--rose-200);
  border-radius: 20px;
  padding: 22px 20px 24px;
  position: relative;
  overflow: hidden;
  transition: all .4s var(--ease);
  cursor: pointer;
}
.ending-card.is-locked {
  filter: blur(3px) grayscale(.6);
  opacity: .35;
  pointer-events: none;
  user-select: none;
}
.ending-card:hover, .ending-card:active {
  transform: translateY(-3px);
  border-color: var(--rose-400);
  box-shadow: var(--shadow-hard);
}
.ending-type-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 10px; letter-spacing: .25em;
  border-radius: 999px;
  margin-bottom: 10px;
}
.ending-type-badge.HE { background: #fff4e6; color: var(--gold); }
.ending-type-badge.OE { background: #e6f4ee; color: var(--teal); }
.ending-type-badge.BE { background: #fde5ea; color: var(--red); }
.ending-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 20px; font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}
.ending-from {
  font-size: 11px; color: var(--ink-soft);
  letter-spacing: .15em;
  margin-bottom: 10px;
}
.ending-desc {
  font-size: 12.5px; line-height: 1.9; color: var(--ink-soft);
  margin-bottom: 8px;
}

/* ==========================================================================
   S7 · 路线图鉴：角色 × 结局分支
   ========================================================================== */
.screen-routemap.is-scroll { padding: 80px 20px 40px; }
.screen-routemap {
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 245, 232, .6), transparent 60%),
    linear-gradient(180deg, #fff4f7 0%, #fde0ea 100%);
}
.screen-routemap::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(236, 91, 139, .18) 1px, transparent 1.5px);
  background-size: 26px 26px;
  opacity: .45;
  pointer-events: none;
}
.routemap-outer { width: 100%; max-width: 880px; display: flex; flex-direction: column; align-items: center; margin: 0 auto; position: relative; z-index: 1; }
.routemap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  width: 100%;
  margin-top: 28px;
}
.route-target-card {
  background: #fff;
  border: 1px solid var(--rose-200);
  border-radius: 20px;
  padding: 22px 20px 24px;
}
.route-target-card.is-hidden-char { border: 1px dashed var(--gold); background: linear-gradient(180deg, #fffaf0, #fff4f7); }
.route-target-card-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 15px; font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.route-target-card-sub {
  font-size: 11px; color: var(--ink-soft); letter-spacing: .2em;
  margin-bottom: 14px;
}
.route-branch {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--rose-50);
  border: 1px solid var(--rose-100);
  border-radius: 10px;
  font-size: 12.5px;
  transition: all .3s;
}
.route-branch.is-got { border-color: var(--rose-400); background: #fff; }
.route-branch.is-got .route-branch-status { color: var(--rose-deep); font-weight: 700; }
.route-branch-left { display: flex; align-items: center; gap: 10px; }
.route-branch-type {
  font-size: 10px; letter-spacing: .2em;
  padding: 2px 8px; border-radius: 999px;
}
.route-branch-type.HE { background: #fff4e6; color: var(--gold); }
.route-branch-type.OE { background: #e6f4ee; color: var(--teal); }
.route-branch-type.BE { background: #fde5ea; color: var(--red); }
.route-branch-name { color: var(--ink); }
.route-branch-status { font-size: 10px; color: var(--ink-dim); letter-spacing: .2em; }

/* 路线图鉴底部说明（告诉玩家默契阈值） */
.routemap-legend {
  margin-top: 28px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, .85);
  border: 1px solid var(--rose-200);
  border-radius: 16px;
  font-size: 12px;
  line-height: 2;
  color: var(--ink-soft);
  max-width: 560px; width: 100%;
  text-align: center;
}
.routemap-legend strong { color: var(--rose-deep); font-family: 'Noto Serif SC', serif; }

/* ==========================================================================
   结局详情弹窗（modal 内部）
   ========================================================================== */
.ending-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rose-100);
}
.ending-modal-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 22px; font-weight: 700;
  color: var(--ink);
}
.ending-modal-type {
  font-size: 10px; letter-spacing: .3em;
  padding: 3px 10px; border-radius: 999px;
}
.ending-modal-text {
  font-size: 13.5px; line-height: 2.1;
  color: var(--ink);
  white-space: pre-line;
  margin-bottom: 20px;
}
.ending-modal-theory {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--rose-50);
  border-left: 3px solid var(--rose-400);
  border-radius: 0 12px 12px 0;
  font-size: 12.5px;
  line-height: 2;
  color: var(--ink);
}
.ending-modal-theory-label {
  font-family: 'Noto Serif SC', serif;
  font-size: 10px; letter-spacing: .4em;
  color: var(--rose-deep);
  margin-bottom: 6px;
}
.modal-close {
  display: inline-block;
  margin-top: 18px;
  font-size: 11px; letter-spacing: .3em;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 8px 16px;
  border: 1px solid var(--rose-200);
  border-radius: 999px;
  text-align: center;
}
.modal-close:hover { color: var(--rose-deep); border-color: var(--rose-400); }

/* ==========================================================================
   小屏适配
   ========================================================================== */
@media (max-width: 720px) {
  .menu-inner { flex-direction: column; gap: 28px; padding: 30px 20px; }
  .menu-char-img { width: 160px; height: 232px; }
  .title-block { text-align: center; }
  .title-main { font-size: 34px; }
  .title-main::after { margin-left: auto; margin-right: auto; }
  .menu-content { align-items: center; }
  .menu-item { padding: 10px 14px; width: 220px; text-align: center; }
  .menu-item::before { display: none; }

  .intro-inner { grid-template-columns: 1fr; }
  .intro-portrait { position: static; max-width: 220px; margin: 0 auto; }

  .profile-body { grid-template-columns: 1fr; }
  .profile-portrait { max-width: 220px; margin: 0 auto; }

  .char-img { height: min(42vh, 280px); }
  .dialog-box { padding: 26px 18px 30px; }
  .dialog-text { font-size: 14px; }
}

@media (max-width: 400px) {
  .title-main { font-size: 28px; letter-spacing: .1em; }
  .affection-display { padding: 8px 10px; }
  .affection-bar { width: 100px; }
  .affection-value { font-size: 17px; }
}

/* ==========================================================================
   尊重无障碍：用户开启"减少动效"时禁用大部分动画
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .2s !important;
  }
}
