/* =========================================================
 * 全局字体设置
 * 自定义情感字体：若加载失败会回退到系统字体
 * ======================================================= */
/* Global Custom Font */
@font-face {
  font-family: 'BirthdayFont';
  src: url('../assets/fonts/font.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* 页面基础布局与排版色彩（柔和粉色径向背景） */
body {
  margin: 0;
  font-family: 'BirthdayFont', 'Segoe UI', system-ui, sans-serif;
  background: radial-gradient(circle at 30% 30%, #ffe7d9, #ffc9b9, #ffb6c1);
  color: #5a2d2d;
  -webkit-font-smoothing: antialiased;
}
#app {
  min-height: 100dvh;
  padding: clamp(12px, 4vw, 40px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.scene h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
}
/* 通用按钮样式：圆角胶囊 + 柔和下投影 */
button {
  cursor: pointer;
  background: #ff8da1;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 4px 12px -2px rgba(255, 80, 120, 0.4);
  transition: 0.3s;
}
/* 场景内 BGM 开关按钮（音符图标 + 斜杠指示静音） */
.bgm-btn {
  position: relative;
  font-size: 0.85rem;
  width: 42px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.bgm-btn.muted::after {
  content: '';
  position: absolute;
  width: 70%;
  height: 3px;
  background: linear-gradient(90deg, #fff, #ffd1d9);
  top: 50%;
  left: 15%;
  transform: rotate(-40deg);
  border-radius: 3px;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.6);
}
.bgm-btn.muted {
  opacity: 0.8;
}
button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px -4px rgba(255, 80, 120, 0.45);
}
button:active {
  transform: translateY(0);
}
/* data-debounce 状态：防止多次点按 */
button.debouncing {
  opacity: 0.55 !important;
  pointer-events: none !important;
  transform: none !important;
}
/* 通用选项按钮容器（视觉小说 & 其它分支场景共享） */
.choices {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 400px;
}
/* 轻微抖动反馈动画（错误/提醒） */
button.shake {
  animation: shake 0.5s;
}
@keyframes shake {
  10%,
  90% {
    transform: translateX(-1px);
  }
  20%,
  80% {
    transform: translateX(2px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-4px);
  }
  40%,
  60% {
    transform: translateX(4px);
  }
}
/* ======================== Scene 2: 考试小游戏 ======================== */
.scene-exam .tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.scene-exam .board {
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(8px);
  padding: 1rem;
  border-radius: 16px;
  min-height: 140px;
}
.scene-exam .exam-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.scene-exam .meta {
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.4);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
}
.scene-exam .diff {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 6px;
  margin-right: 0.3rem;
  background: #ddd;
  color: #333;
}
.scene-exam .diff-easy {
  background: #c8f7c5;
  color: #267a24;
}
.scene-exam .diff-medium {
  background: #ffe9a9;
  color: #8a6300;
}
.scene-exam .diff-hard {
  background: #ffb4c1;
  color: #8a0727;
}
.scene-exam .paper {
  position: relative;
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.scene-exam .paper .actions {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.6rem;
}
.scene-exam .paper .hint-area {
  font-size: 0.8rem;
  color: #a8445c;
  margin-top: 0.3rem;
}
.scene-exam .progress-mini {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  opacity: 0.75;
}
.scene-exam .summary {
  margin-top: 1rem;
}
.scene-exam .summary-card {
  background: rgba(255, 255, 255, 0.55);
  padding: 1rem 1.2rem;
  border-radius: 18px;
  box-shadow: 0 4px 12px -3px rgba(0, 0, 0, 0.1);
}
/* 彩蛋提示卡：三类不同成就/情境 */
/* 新版彩蛋展示：使用 GIF 图片，去除伪元素动画与 skip-part 类型 */
.scene-exam .summary-card .easter-block {
  margin-top: 0.7rem;
  padding: 0.7rem 0.9rem;
  border-radius: 16px;
  font-size: 0.85rem;
  line-height: 1.45;
  display: flex;
  gap: 0.8rem;
  align-items: center;
}
.scene-exam .summary-card .easter-block img {
  width: 70px;
  height: 70px;
  flex: 0 0 auto;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 10px -3px rgba(0, 0, 0, 0.18);
  animation: gifPop 0.6s ease;
}
.scene-exam .summary-card .easter-block .text {
  flex: 1;
}
.scene-exam .summary-card .easter-skip {
  background: linear-gradient(135deg, #ffe2e9, #ffc1d0);
  color: #8a1c34;
  box-shadow: 0 0 0 1px rgba(255, 90, 130, 0.25) inset;
}
.scene-exam .summary-card .easter-pampered-wrong {
  background: linear-gradient(135deg, #e5f6ff, #cce9ff);
  color: #114b66;
  box-shadow: 0 0 0 1px rgba(60, 140, 190, 0.25) inset;
}
@keyframes gifPop {
  0% {
    transform: scale(0.35);
    opacity: 0;
  }
  60% {
    transform: scale(1.12);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}
.shake-mini {
  animation: shakeMini 0.5s;
}
@keyframes shakeMini {
  10%,
  90% {
    transform: translateX(-2px);
  }
  20%,
  80% {
    transform: translateX(3px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-5px);
  }
  40%,
  60% {
    transform: translateX(5px);
  }
}
/* 试卷中的交互控件 */
.paper input,
.paper select {
  padding: 0.4rem 0.6rem;
  border: 1px solid #ff9fb1;
  border-radius: 6px;
  font-size: 1rem;
}

/* Additional extracted styles from js/scenes/scene2_exam.js */
.scene-exam .q-opts {
  display: block;
  margin: 6px 0;
}
.scene-exam .q-opts {
  display: flex;
  flex-direction: column;
  gap: 0.6rem; /* 选项间距 */
  margin: 8px 0;
}
.scene-exam .q-opts .q-opt {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  padding: 0.5rem 0.6rem; /* 选项内边距 */
  border: 1px solid rgba(120, 90, 100, 0.12); /* 明显边框 */
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 245, 248, 0.85));
  border-radius: 10px;
  transition: box-shadow 0.16s ease, transform 0.12s ease, border-color 0.12s ease;
}
.scene-exam .q-opts .q-opt:hover {
  box-shadow: 0 8px 20px rgba(122, 40, 60, 0.06);
  transform: translateY(-2px);
  border-color: rgba(255, 90, 130, 0.22);
}
.scene-exam .q-opt-label {
  margin-left: 10px;
  vertical-align: middle;
}
/* checkbox styled as circular control to match radio */
.scene-exam .q-opt-input[type='checkbox'] {
  /* 视觉隐藏：保留在 DOM 中以保持可访问性与表单行为，但不显示默认圆形复选框 */
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  white-space: nowrap !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}
.scene-exam .q-opt-input[type='checkbox']:focus + .q-opt-prefix,
.scene-exam .q-opt-input[type='checkbox']:focus-visible + .q-opt-prefix {
  outline: 2px dashed rgba(122, 40, 60, 0.18);
  outline-offset: 4px;
}
.scene-exam .q-opt-input[type='radio'] {
  vertical-align: middle;
}
.scene-exam .q-opt {
  user-select: none;
}

/* Extracted checkbox/option animation & prefix styles (moved from js/scenes/scene2_exam.js) */
.scene-exam .q-opt {
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.18rem 0.4rem;
  border-radius: 8px;
}
.scene-exam .q-opt.checked-anim {
  transform: scale(0.985);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}
.scene-exam .q-opt-prefix {
  display: inline-flex;
  width: 1.4em;
  height: 1.4em;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  font-weight: 600;
}
.scene-exam .q-opt-input:checked + .q-opt-prefix {
  background: linear-gradient(90deg, #ff8fb5, #ff6f9d);
  color: #fff;
  border-color: transparent;
}

/* 使整个选项成为点击目标（替代隐藏的原生复选框） */
.scene-exam .q-opt {
  position: relative;
}
.scene-exam .q-opt-label {
  flex: 1;
}

/* Tabs (选项卡) styles for scene 2 — make them more prominent and theme-consistent */
.scene-exam .tabs {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.scene-exam .tab {
  background: linear-gradient(180deg, #fff, #ffeef4);
  border: 1px solid rgba(255, 90, 130, 0.12);
  padding: 0.45rem 0.8rem;
  border-radius: 12px;
  font-weight: 700;
  color: #6a2630;
  box-shadow: 0 6px 14px -8px rgba(122, 40, 60, 0.45);
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}
.scene-exam .tab:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px -10px rgba(122, 40, 60, 0.45);
}
.scene-exam .tab.active {
  background: linear-gradient(90deg, #ff9eb7, #ff7ea0);
  color: #fff;
  box-shadow: 0 10px 28px -6px rgba(255, 110, 150, 0.28);
}
.scene-exam .tab.displayed {
  outline: 2px dashed rgba(255, 110, 150, 0.18);
}

/* difficulty badges (compact variant) */
.scene-exam .diff {
  display: inline-block;
  margin-right: 8px;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 0.85em;
  color: #1b1b1b;
  background: #f3f3f3;
}
.scene-exam .diff.diff-easy {
  background: #e6f9ec;
  color: #1b6f2b;
}
.scene-exam .diff.diff-medium {
  background: #fff6e6;
  color: #b46a00;
}
.scene-exam .diff.diff-hard {
  background: #fdecea;
  color: #a32020;
}

/* question type label */
.scene-exam .q-type-label {
  display: inline-block;
  margin: 0 8px;
  padding: 3px 8px;
  border-radius: 12px;
  background: #eef4ff;
  color: #1e57d8;
  font-size: 0.9em;
}
/* ======================== Scene 3: 大学时间线排序 ==================== */
.scene-timeline ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.scene-timeline li {
  background: rgba(255, 255, 255, 0.5);
  padding: 0.8rem 1rem;
  border-radius: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.scene-timeline li[draggable='true'] {
  cursor: grab;
}
.scene-timeline ul.touch-mode li {
  position: relative;
}
.scene-timeline ul.touch-mode li.pending {
  outline: 2px dashed #ff6f90;
  background: rgba(255, 255, 255, 0.9);
}
.scene-timeline ul.touch-mode li:active {
  transform: scale(0.97);
}
.result {
  font-weight: 600;
  margin-top: 0.4rem;
}
/* ======================== Scene 4: 表白场景 ========================= */
.scene-confession .dialogue {
  position: relative;
  background: rgba(255, 255, 255, 0.45);
  padding: 1rem 1.2rem;
  border-radius: 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.scene-confession .line {
  margin: 0.4rem 0;
  opacity: 1;
  transition: 0.4s;
}
.scene-confession .line.hidden {
  opacity: 0;
  height: 0;
  overflow: hidden;
}
.scene-confession .choices button {
  margin: 0.25rem 0.4rem 0.25rem 0;
}
.scene-confession .choices.hidden,
.scene-confession .reply.hidden,
.scene-confession .toNext.hidden {
  display: none;
}
.scene-confession .reply {
  margin-top: 0.6rem;
  font-weight: 600;
  color: #c44563;
}
.scene-confession .secret-btn {
  font-size: 0.8rem;
  background: #ff7d94;
}
.floating-heart {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  animation: floatUp 3s ease forwards;
  background: #ff6f90;
  color: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
}
@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -60px);
  }
}
/* ======================== Scene 5: 约会（卡牌 + 菜单） =============== */
.scene-date .menu {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.scene-date .menu li {
  background: rgba(255, 255, 255, 0.55);
  padding: 0.6rem 0.8rem;
  border-radius: 14px;
  cursor: pointer;
  position: relative;
  transition: 0.3s;
}
.scene-date .menu li.chosen {
  outline: 2px solid #ff6f90;
  background: rgba(255, 255, 255, 0.85);
}
.scene-date .theatre {
  position: relative;
  height: 140px;
  background: #3d2f36;
  border-radius: 16px;
  margin-bottom: 0.8rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffe3ec;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.scene-date .lights .beam {
  position: absolute;
  top: -10%;
  width: 120px;
  height: 240px;
  background: linear-gradient(180deg, rgba(255, 240, 250, 0.65), rgba(255, 130, 160, 0));
  filter: blur(1px);
  transform-origin: top center;
  animation: beamSwing 5s ease-in-out infinite;
}
.scene-date .lights .beam:nth-child(1) {
  left: 15%;
  animation-delay: 0s;
}
.scene-date .lights .beam:nth-child(2) {
  left: 45%;
  animation-delay: 1.2s;
}
.scene-date .lights .beam:nth-child(3) {
  left: 75%;
  animation-delay: 2.1s;
}
@keyframes beamSwing {
  0%,
  100% {
    transform: rotate(-6deg);
  }
  50% {
    transform: rotate(6deg);
  }
}
/* 约会卡牌玩法：多关选择 + 协同标签 */
.scene-date .level-info {
  font-size: 0.75rem;
  opacity: 0.8;
  background: rgba(255, 255, 255, 0.4);
  padding: 0.35rem 0.7rem;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 0.4rem;
}
.scene-date .card-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  margin: 0.9rem 0 1rem;
}
.scene-date .card {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(6px);
  border-radius: 16px;
  padding: 0.7rem 0.75rem 0.85rem;
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.12);
  position: relative;
  cursor: pointer;
  transition: 0.28s;
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.scene-date .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 18px -6px rgba(255, 80, 120, 0.35);
}
.scene-date .card.selected {
  outline: 2px solid #ff6f90;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 4px 14px -4px rgba(255, 80, 120, 0.4);
}
.scene-date .card.locked {
  cursor: not-allowed;
  opacity: 0.5;
  filter: grayscale(0.4);
}
.scene-date .card .title {
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.25;
}
.scene-date .card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.scene-date .card .tag {
  font-size: 0.55rem;
  padding: 2px 6px;
  border-radius: 8px;
  letter-spacing: 0.3px;
  background: linear-gradient(135deg, #ffdce4, #ffc5d2);
  color: #8a2d44;
  font-weight: 500;
  box-shadow: 0 0 0 1px rgba(255, 120, 150, 0.35) inset;
}
.scene-date .card .tag.type-show {
  background: linear-gradient(135deg, #e4f2ff, #c9e4ff);
  color: #114b66;
}
.scene-date .card .tag.type-food {
  background: linear-gradient(135deg, #fff6d8, #ffe8a6);
  color: #725c00;
}
.scene-date .card .tag.type-drink {
  background: linear-gradient(135deg, #e6ffe7, #c6f7c7);
  color: #1c6a22;
}
.scene-date .card .tag.synergy {
  background: linear-gradient(135deg, #ffe1ff, #f7c5ff);
  color: #6a2d72;
}
.scene-date .card .base {
  font-size: 0.6rem;
  opacity: 0.65;
}
.scene-date .card .hint {
  font-size: 0.6rem;
  opacity: 0.55;
}
.scene-date .chosen-panel {
  background: rgba(255, 255, 255, 0.45);
  padding: 0.6rem 0.75rem;
  border-radius: 14px;
  font-size: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.scene-date .chosen-panel .list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.scene-date .chosen-pill {
  background: #ff8da1;
  color: #fff;
  font-size: 0.55rem;
  padding: 2px 6px;
  border-radius: 999px;
}
.scene-date .actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}
.scene-date .score-box {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  min-height: 1.2rem;
}
.scene-date .next-level-btn.hidden,
.scene-date .final-btn.hidden {
  display: none;
}
.scene-date .synergy-pop {
  position: fixed;
  left: 50%;
  top: 60%;
  transform: translate(-50%, 0) scale(0.7);
  background: #ff6f90;
  color: #fff;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-size: 0.75rem;
  opacity: 0;
  box-shadow: 0 6px 18px -6px rgba(255, 80, 120, 0.5);
  transition: 0.6s cubic-bezier(0.25, 0.8, 0.3, 1);
  z-index: 9999;
}
.scene-date .synergy-pop.show {
  transform: translate(-50%, -70px) scale(1);
  opacity: 1;
}
.scene-date .level-end {
  margin-top: 0.8rem;
  font-size: 0.7rem;
  opacity: 0.85;
}
.scene-date .summary-card {
  background: rgba(255, 255, 255, 0.55);
  padding: 1rem 1.2rem;
  border-radius: 18px;
  box-shadow: 0 4px 15px -4px rgba(0, 0, 0, 0.12);
  margin-top: 1rem;
}
/* ======================== Scene 6: 围巾编织 ========================= */
.scene-scarf .grid {
  display: grid;
  grid-template-columns: repeat(14, 18px);
  gap: 4px;
  background: rgba(255, 255, 255, 0.35);
  padding: 10px;
  border-radius: 16px;
  width: max-content;
}
.scene-scarf .stitch {
  width: 18px;
  height: 18px;
  background: #ffd7e0;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
  cursor: crosshair;
  transition: 0.2s;
}
.scene-scarf .stitch.on {
  background: linear-gradient(135deg, #ff6f90, #ffa9c0);
  box-shadow: 0 0 4px rgba(255, 80, 120, 0.6);
}
.scene-scarf .bar {
  width: 100%;
  background: #ffd1d9;
  height: 12px;
  border-radius: 8px;
  margin: 0.8rem 0 0.4rem;
  overflow: hidden;
}
.scene-scarf .bar .fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ff5f7a, #ffa4b8);
  transition: width 0.3s;
}
.scene-scarf .toNext.hidden {
  display: none;
}
/* ======================== Scene 7: 未来愿望星空 ===================== */
.scene-future .sky {
  position: relative;
  height: 300px;
  background: radial-gradient(circle at 50% 60%, #ffc2d2, #ff9ab4);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 16px -4px rgba(255, 80, 120, 0.4);
}
.scene-future .star {
  position: absolute;
  width: 12px;
  height: 12px;
  background: radial-gradient(circle, #fff, #ffd1e0);
  border-radius: 50%;
  animation: twinkle 3s ease-in-out infinite;
  box-shadow: 0 0 8px 2px rgba(255, 255, 255, 0.7);
}
@keyframes twinkle {
  0%,
  100% {
    transform: scale(0.8);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}
.scene-future .wish-panel {
  margin: 0.6rem 0;
  display: flex;
  gap: 0.5rem;
}
.scene-future .wish-panel input {
  flex: 1;
  padding: 0.55rem 0.7rem;
  border: 1px solid #ff9fb1;
  border-radius: 8px;
}
.scene-future .wish-item {
  font-size: 0.9rem;
  margin: 0.25rem 0;
}
.scene-future .final.hidden {
  display: none;
}
.scene-future .final {
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.5);
  padding: 1rem;
  border-radius: 18px;
}
.scene-future .celebrate {
  margin: 0.6rem 0;
  display: flex;
  justify-content: center;
}
.scene-future .reality-note {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-top: 0.4rem;
}
.scene-future .final h2 {
  margin-top: 0;
  font-size: 2rem;
  background: linear-gradient(90deg, #ff6f90, #ffd36f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ======================== 响应式：移动端适配 ======================== */
@media (hover: none) {
  button {
    padding: 0.75rem 1.15rem;
    font-size: 1.05rem;
  }
  .scene-date .card {
    padding: 0.85rem 0.85rem 1rem;
  }
  .scene-scarf .grid {
    touch-action: none;
  }
  .scene-scarf .stitch {
    width: 20px;
    height: 20px;
  }
}
@media (max-width: 600px) {
  body {
    font-size: 15px;
  }
  .scene h1 {
    font-size: clamp(1.4rem, 7vw, 2.1rem);
  }
  .scene-date .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
  .scene-date .card .title {
    font-size: 0.8rem;
  }
}

@media (min-width: 800px) {
  #app {
    max-width: 900px;
    margin: 0 auto;
  }
}

/* ======================== Scene 0: 注册仪式 ========================= */
.scene-register .desc {
  font-size: 0.9rem;
  opacity: 0.85;
  line-height: 1.5;
}
.scene-register .reg-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-width: 380px;
  background: rgba(255, 255, 255, 0.45);
  padding: 1rem 1.2rem;
  border-radius: 18px;
  box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.12);
}
.scene-register label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
}
.scene-register input {
  padding: 0.55rem 0.7rem;
  border: 1px solid #ff9fb1;
  border-radius: 8px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.8);
}
.scene-register .reg-form button[type='submit'] {
  align-self: flex-start;
}
.scene-register .reg-form .forgot-btn {
  background: #ffb3c4;
  color: #6a1e34;
  font-size: 0.75rem;
  padding: 0.45rem 0.8rem;
}
.scene-register .msg {
  min-height: 1.2rem;
  font-size: 0.8rem;
  margin-top: 0.2rem;
}
.scene-register .msg .ok {
  color: #c0285b;
  font-weight: 600;
}
.scene-register .msg .err {
  color: #b10e2e;
}
.scene-register .tips {
  margin-top: 0.8rem;
  font-size: 0.7rem;
  opacity: 0.7;
}
.scene-register .already {
  color: #a73855;
  font-weight: 600;
}
.scene-register .quick-enter {
  margin-top: 0.4rem;
  background: #ff6f90;
  font-size: 0.8rem;
  padding: 0.5rem 0.8rem;
}
.scene-register .reset-enter {
  margin-top: 0.4rem;
  background: #ffc5d3;
  color: #7a2a3f;
  font-size: 0.7rem;
  padding: 0.45rem 0.75rem;
}
.scene-register .clues {
  margin-top: 0.6rem;
  background: rgba(255, 255, 255, 0.35);
  padding: 0.6rem 0.8rem;
  border-radius: 14px;

  /* Scoped floating label input styles for Scene 0 */
}
.scene-register .form-control {
  position: relative;
  margin: 12px 0 18px;
  width: 190px;
}
.scene-register .form-control input {
  background: none;
  border: none;
  border-bottom: 2px solid #7a2940; /* 基础直线 */
  border-radius: 0; /* 避免两端出现圆角视觉 */
  display: block;
  width: 100%;
  padding: 12px 0 10px; /* 底部稍收紧让线条更贴近文本 */
  font-size: 16px;
  color: #3a1b28;
  box-shadow: none;
  outline: none;
  position: relative;
}
.scene-register .form-control input:focus,
.scene-register .form-control input:valid {
  outline: 0;
  border-bottom-color: #ff6f90;
}
.scene-register .form-control input::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 2px;
  width: 100%;
  background: #ff6f90;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.28s ease;
  pointer-events: none;
}
.scene-register .form-control input:focus::after {
  transform: scaleX(1);
}
.scene-register .form-control label {
  flex-direction: row;
  position: absolute;
  top: 12px;
  left: 0;
  pointer-events: none;
}
.scene-register .form-control label span {
  display: inline-block;
  font-size: 16px;
  min-width: 5px;
  color: rgba(58, 27, 40, 0.9);
  transition: 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.scene-register .form-control input:focus + label span,
.scene-register .form-control input:valid + label span {
  color: #ff6f90;
  transform: translateY(-24px);
}
.scene-register .clues.hidden {
  display: none;
}
.scene-register .clues .clue-line.hidden {
  display: none;
}
.scene-register .clues .clue-line.revealed {
  animation: clueFade 0.5s ease;
}
.scene-register .forgot-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
@keyframes clueFade {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
.scene-register .clues .clue-line em {
  font-style: normal;
  font-weight: 600;
  color: #c12d55;
}
.scene-register .clues .clue-line.full {
  background: linear-gradient(90deg, #ffe1eb, #ffd5e1);
  padding: 0.4rem 0.5rem;
  border-radius: 10px;
  margin-top: 0.4rem;
}

/* ======================== Scene 1: 高中穿越（视觉小说） =============== */
/* 已重构为纯分支：此处保留对话框/说话人 UI 样式 */
.scene-intro .phase-msg {
  font-size: 0.8rem;
  opacity: 0.85;
  background: rgba(255, 255, 255, 0.4);
  padding: 0.4rem 0.7rem;
  border-radius: 12px;
  display: inline-block;
}
.scene-intro .title-egg {
  margin-top: 0.4rem;
  font-size: 0.7rem;
  opacity: 0.8;
  color: #a22d52;
}
.scene-intro .title-egg.hidden {
  display: none;
}

/* VN 单对话框布局与说话人徽标 */
.scene-intro .vn-wrapper {
  position: relative;
  margin: 2rem auto 1.5rem;
  width: 90%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  align-items: stretch;
}
.scene-intro .vn-box {
  position: relative;
  width: 100%;
  background: rgba(40, 15, 25, 0.58);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 1.05rem 1.35rem 1.25rem;
  border-radius: 20px;
  box-shadow: 0 10px 28px -8px rgba(40, 0, 25, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  color: #ffeef4;
  line-height: 1.55;
  font-size: clamp(0.9rem, 1.05rem, 1.05rem);
  box-sizing: border-box;
}
.scene-intro .vn-wrapper .choices {
  max-width: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.scene-intro .vn-wrapper .choices button {
  align-self: flex-start;
}
.scene-intro .vn-text {
  min-height: 3.2em;
  white-space: pre-wrap;
  letter-spacing: 0.5px;
  animation: fadeInLine 0.25s ease;
}
.scene-intro .vn-text.flash-line {
  animation: fadeInLine 0.28s ease;
}
@keyframes fadeInLine {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.scene-intro .vn-speaker {
  position: absolute;
  top: -0.85rem;
  padding: 0.35rem 0.8rem 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #ff8fb5, #ff6f9d);
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 4px 12px -3px rgba(255, 80, 130, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.35) inset;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  user-select: none;
}
.scene-intro .vn-speaker.right {
  right: 1.1rem;
}
.scene-intro .vn-speaker.left {
  left: 1.1rem;
}
.scene-intro .vn-speaker.speaker-me {
  background: linear-gradient(135deg, #5b9dff, #3e6dff);
  box-shadow: 0 4px 12px -3px rgba(40, 90, 200, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.35) inset;
}
.scene-intro .vn-speaker.speaker-her {
  background: linear-gradient(135deg, #ff8fb5, #ff6f9d);
  box-shadow: 0 4px 12px -3px rgba(255, 80, 130, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.35) inset;
}
.scene-intro .vn-speaker.speaker-system {
  background: linear-gradient(135deg, #ff5656, #d91e3a);
  box-shadow: 0 4px 12px -3px rgba(220, 40, 60, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.35) inset;
}
.scene-intro .vn-speaker.hidden {
  display: none;
}

/* 小屏设备（手机）下的 VN 适配 */
@media (max-width: 700px) {
  .scene-intro .vn-wrapper {
    width: 94%;
    margin: 1.4rem auto 1rem;
  }
  .scene-intro .vn-box {
    padding: 0.9rem 1rem 1.05rem;
    border-radius: 18px;
  }
  .scene-intro .vn-text {
    font-size: 0.95rem;
  }
  .scene-intro .vn-speaker {
    font-size: 0.7rem;
    top: -0.7rem;
  }
}

/* ======================== Transition: 转场动画系统 =================== */
.transition-wrapper {
  position: relative;
  flex: 1;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  animation: transFadeIn 0.4s ease;
}
@keyframes transFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.pulse-heart {
  width: 120px;
  height: 120px;
  background: radial-gradient(circle at 30% 30%, #ff89a3, #ff5f7f);
  position: relative;
  clip-path: path('M60 110 C-20 50 20 -10 60 20 C100 -10 140 50 60 110 Z');
  filter: drop-shadow(0 6px 14px rgba(255, 80, 120, 0.45));
  animation: heartPulse 1.4s ease-in-out infinite;
}
@keyframes heartPulse {
  0% {
    transform: scale(0.8);
  }
  35% {
    transform: scale(1);
  }
  60% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(0.8);
  }
}
.particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.particle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  background: radial-gradient(circle, #fff, #ffd3de);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.4);
  animation: particleFly 0.9s cubic-bezier(0.25, 0.8, 0.3, 1) forwards;
  box-shadow: 0 0 6px -1px rgba(255, 255, 255, 0.85);
}
@keyframes particleFly {
  0% {
    opacity: 0.9;
  }
  70% {
    opacity: 1;
    transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--tx) * 1.4), calc(-50% + var(--ty) * 1.4)) scale(0.2);
  }
}
.transition-tip {
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.55);
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.15);
  animation: tipFloat 3s ease-in-out infinite;
}
@keyframes tipFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}
/* style 可扩展：不同 data-style 可自定义心样式或替换图形 */
/* flash12（原 heart）样式当前使用默认心跳，无额外覆盖 */
/* 若后续需要给 flash12 单独配色，可添加：[data-style='flash12'] .pulse-heart { ... } */

/* flash45 样式：多张回忆图片快速闪回（走马灯式记忆） */
[data-style='flash45'] .transition-tip {
  background: rgba(0, 0, 0, 0.55);
  color: #ffeef5;
  letter-spacing: 2px;
  font-weight: 600;
  box-shadow: 0 4px 18px -4px rgba(0, 0, 0, 0.45);
}
[data-style='flash45'] {
  background: #000;
}
.flash45-seq {
  position: relative;
  width: 100%;
  max-width: 680px;
  height: 380px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 22px;
  box-shadow: 0 10px 28px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  background: #111;
}
.flash45-frame {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  animation: flash45Frame 1s linear forwards;
  filter: brightness(0.9) contrast(1.1) saturate(1.15);
}
.flash45-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 255, 255, 0.35),
    rgba(255, 255, 255, 0) 60%
  );
  mix-blend-mode: overlay;
  opacity: 0.4;
}
.flash45-frame:nth-child(odd) {
  filter: brightness(1) contrast(1.15) saturate(1.25);
}
@keyframes flash45Frame {
  0% {
    opacity: 0;
    transform: scale(1.12);
  }
  6% {
    opacity: 1;
  }
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}
/* 通过 --i 计算延迟 */
.flash45-frame {
  /* 每帧的延迟与持续时间由 JS 注入的 --delay/--dur 决定，单位 ms */
  animation-delay: var(--delay, calc(var(--i) * 0.22s));
  animation-duration: calc(var(--dur, 900ms));
}
/* 闪白叠层 */
.flash45-seq::before,
.flash45-seq::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.flash45-seq::before {
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 255, 255, 0.18),
    rgba(255, 255, 255, 0) 70%
  );
  mix-blend-mode: overlay;
  animation: flashPulse 2.4s ease-in-out infinite;
}
.flash45-seq::after {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.08)
  );
  opacity: 0.3;
  animation: scan 2.2s linear infinite;
}
@keyframes flashPulse {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.6;
  }
}
@keyframes scan {
  0% {
    transform: translateX(-40%);
  }
  100% {
    transform: translateX(40%);
  }
}

/* ======================== Scene 3: Nonogram (extracted) ============= */
.scene-nonogram {
  padding: 16px;
  font-family: inherit;
}
.nonogram-shell {
  display: grid;
  grid-template-columns: auto max-content;
  grid-template-rows: auto max-content;
  gap: 4px;
  max-width: 100%;
  width: fit-content;
  margin: 0 auto;
}
.nonogram-shell .quad {
  position: relative;
}
.top-clues-area {
  overflow: hidden;
}
.left-clues-area {
  overflow: hidden;
}

/* Split overlay used to cut the reveal area into 2x2 and animate images into corners */
.split-overlay {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
  z-index: 60;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.split-overlay[hidden] {
  display: none !important;
}
.split-overlay .split-slots {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.split-overlay .split-slot {
  position: relative;
  overflow: hidden;
}
.split-overlay .split-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.split-overlay .split-line {
  position: absolute;
  background: rgba(255, 255, 255, 0.9);
}
.split-overlay .split-line.vline {
  width: 1px;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}
.split-overlay .split-line.hline {
  height: 1px;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}
.split-overlay .split-temp {
  position: absolute;
  inset: 12px;
  margin: auto;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  object-fit: contain;
  transition: transform 0.7s cubic-bezier(0.2, 0.9, 0.25, 1),
    width 0.45s cubic-bezier(0.2, 0.9, 0.25, 1), height 0.45s cubic-bezier(0.2, 0.9, 0.25, 1),
    opacity 0.3s ease;
  border-radius: 6px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  transform-origin: center center;
  transform: translate(0, 0) scale(1);
  pointer-events: none;
}
.split-overlay .split-slot .split-locked {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  transition: opacity 0.35s ease;
}
:root {
  --nonogram-bg: #777;
  --nonogram-cell: #fafafa;
  --nonogram-cell-filled: #ff6f9d;
  --nonogram-cell-filled-grad: linear-gradient(135deg, #ff6f9d, #ff94b4 55%, #ffc0d4);
  --nonogram-cell-mark: #ff4f78;
  --nonogram-grid-gap: 4px;
  --nonogram-border: #e8b9c7;
  --nonogram-accent: #ff6f9d;
  --nonogram-clue-done: #ff3f7d;
  --nonogram-hover: #ffe0ec;
  --nonogram-hover-line: rgba(255, 170, 200, 0.35);
}
@media (prefers-color-scheme: dark) {
  :root {
    --nonogram-bg: #555;
    --nonogram-cell: #f5f5f5;
    --nonogram-cell-filled: #111;
    --nonogram-border: #666;
    --nonogram-hover: #775f1a;
    --nonogram-hover-line: rgba(255, 210, 120, 0.25);
  }
}
.grid-scroller {
  overflow: auto;
  max-width: 100%;
  max-height: 70vh;
  border: 1px solid var(--nonogram-border);
  background: transparent;
  justify-self: start;
  width: fit-content; /* 隐藏滚动条但保留滚动 */
  -ms-overflow-style: none;
  scrollbar-width: none;
}
/* WebKit 隐藏滚动条 */
.grid-scroller::-webkit-scrollbar {
  display: none;
}
.grid-container {
  display: grid;
  gap: var(--nonogram-grid-gap);
  position: relative;
}
.left-inner .row-clue + .row-clue {
  margin-top: var(--nonogram-grid-gap);
} /* 与网格垂直 gap 对齐 */
.top-inner .col-clue + .col-clue {
  margin-left: var(--nonogram-grid-gap);
} /* 与网格水平 gap 对齐 */
.row-clue {
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 6px;
  box-sizing: border-box;
  white-space: nowrap;
  border-bottom: 1px solid #ddd;
  border-right: 1px solid #bbb;
  transition: background 0.15s, color 0.15s;
}
.left-inner {
  display: flex;
  flex-direction: column;
}
.col-clue {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 2px 0;
  box-sizing: border-box;
  border-right: 1px solid #ddd;
  transition: background 0.15s, color 0.15s;
}
.top-inner {
  display: flex;
}
.col-clue span {
  font-size: 11px;
  line-height: 1.1;
}
.col-clue .blank {
  visibility: hidden;
}
.top-inner.clues-hidden,
.left-inner.clues-hidden {
  /* visually hide clues while collapsing their space so reveal image can occupy area */
  opacity: 0;
  pointer-events: none;
  height: 0 !important;
  overflow: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, height 0.18s ease, transform 0.18s ease;
}
.nonogram-grid .cell,
.grid-container .cell {
  background: var(--nonogram-cell);
  cursor: pointer;
  user-select: none;
  position: relative;
  outline: 1px solid rgba(255, 110, 150, 0.15);
  transition: background 0.18s ease, transform 0.12s ease, box-shadow 0.25s;
  border-radius: 8px;
  box-shadow: 0 2px 4px -2px rgba(255, 80, 130, 0.35), 0 0 0 1px rgba(255, 120, 160, 0.15) inset;
}
.grid-container .cell {
  box-sizing: border-box;
}
.grid-container .cell.filled {
  background: var(--nonogram-cell-filled-grad, var(--nonogram-cell-filled));
  box-shadow: 0 4px 10px -3px rgba(255, 90, 140, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.4) inset,
    0 0 0 2px rgba(255, 110, 150, 0.25) inset;
}
.grid-container .cell.marked {
  background: repeating-linear-gradient(135deg, #fff, #fff 6px, #ffe3ef 6px, #ffe3ef 12px);
}
.grid-container .cell.marked::after {
  color: var(--nonogram-cell-mark);
  font-size: 16px;
  font-weight: 600;
  display: block;
  text-align: center;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  line-height: inherit;
  opacity: 0.9;
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.6);
}
.grid-container .cell:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 16px -4px rgba(255, 90, 140, 0.55), 0 0 0 1px rgba(255, 140, 170, 0.4) inset;
}
.grid-container .cell:active {
  transform: scale(0.92);
}
.clue-done {
  color: var(--nonogram-clue-done);
  font-weight: bold;
}
/* 新增：完成与超出提示颜色 */
.clue-ok {
  color: #0a7;
  font-weight: 600;
}
.clue-over {
  color: #d62828;
  font-weight: 600;
}
/* Hover 行列高亮 */
.grid-container:hover .cell {
  --hovered: 0;
}
/* 移除悬停背景变色，仅保留轻微放大（上方统一的 :hover 规则已处理） */
.grid-container .cell.hover-row {
  background: var(--nonogram-hover-line);
}
.grid-container .cell.hover-col {
  background: var(--nonogram-hover-line);
}
/* 填色出现的小动画 */
.grid-container .cell.filled::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 6px;
  background: radial-gradient(
      circle at 30% 30%,
      rgba(255, 255, 255, 0.85),
      rgba(255, 255, 255, 0) 55%
    ),
    var(--nonogram-cell-filled-grad, var(--nonogram-cell-filled));
  mix-blend-mode: screen;
  opacity: 0.85;
  animation: scaleIn 0.28s ease;
}
@keyframes scaleIn {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
/* ==== 完成动画状态 ==== */
.grid-scroller {
  position: relative;
}
/* 重新定义完成动画：心跳(2s 两次) -> 网格淡出(0.6s) -> 图片淡入(0.9s) */
.grid-scroller .nonogram-reveal-img {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  opacity: 0;
  object-fit: contain;
  image-rendering: pixelated;
  transition: opacity 0.9s linear;
  pointer-events: none;
}
.grid-scroller .nonogram-reveal-img.show {
  opacity: 1;
}
.completed-locked {
  pointer-events: none;
}
@keyframes gridFadeOut {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
.grid-fade-out {
  animation: gridFadeOut 0.6s linear forwards;
}
/* 暗色模式适配（已在变量中处理） */
.scene-nonogram .controls {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.scene-nonogram .controls .inline.small {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.scene-nonogram .controls input[type='range'] {
  vertical-align: middle;
}
.scene-nonogram .btn-next.hidden,
.scene-nonogram .rules-overlay.hidden {
  display: none;
}
.scene-nonogram .status-msg {
  margin-top: 8px;
  font-weight: bold;
  color: #0a7;
}
.scene-nonogram .rules-overlay {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.scene-nonogram .original-img-box,
.scene-nonogram .rules-box {
  background: #fff;
  padding: 16px 20px;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  max-width: 600px;
  max-height: 80vh;
  overflow: auto;
}
.scene-nonogram .original-img {
  max-width: 60vw;
  max-height: 70vh;
  image-rendering: pixelated;
}
.scene-nonogram .tips {
  font-size: 12px;
  opacity: 0.75;
  margin-top: 10px;
}
.scene-nonogram .rules-content ul {
  padding-left: 20px;
  margin: 6px 0 10px;
}

/* ======================== 成就提示样式（Achievement Toast） ======================== */
/* 容器：右下角垂直堆叠，整体不阻断页面交互 */
#ach-toast-container {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  pointer-events: none;
  z-index: 120000;
}

.ach-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
  max-width: 360px;
  background: linear-gradient(135deg, rgba(255, 250, 246, 0.98), rgba(255, 243, 250, 0.98));
  color: #3b1f28;
  padding: 12px 14px;
  border-radius: 14px;
  box-shadow: 0 12px 34px rgba(24, 10, 20, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px) saturate(120%);
  transform-origin: right bottom;
  font-size: 13px;
}

.ach-toast .ach-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff8da1, #ff6f9d);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(255, 100, 140, 0.18);
  font-size: 18px;
}
.ach-toast strong {
  display: block;
  font-size: 14px;
  color: #2b0e18;
  line-height: 1.05;
}
.ach-toast > div {
  font-size: 12px;
  opacity: 0.95;
  color: #41232b;
}

@keyframes achPop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.ach-toast {
  animation: achPop 0.32s cubic-bezier(0.2, 0.9, 0.25, 1);
}

/* 小屏幕下适配 */
@media (max-width: 540px) {
  #ach-toast-container {
    left: 12px;
    right: 12px;
    bottom: 16px;
    align-items: center;
  }
  .ach-toast {
    width: calc(100% - 36px);
    max-width: none;
  }
}
