:root {
  color-scheme: dark;
  --ink: #17151f;
  --cream: #fff7df;
  --paper: #f8f5ed;
  --pixel-green: #85ff8f;
  --pixel-blue: #72d8ff;
  --pixel-pink: #ff6da8;
  --pixel-yellow: #ffd76a;
  --line: rgba(255, 255, 255, 0.16);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--cream);
  font-family:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.72;
  background: #090912;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

.phone-shell {
  position: relative;
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--ink);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 0 80px rgba(0, 0, 0, 0.45);
}

.home-page {
  background:
    radial-gradient(circle at 50% 0%, rgba(114, 216, 255, 0.15), transparent 30rem),
    linear-gradient(120deg, #06060b, #161221 52%, #05050b);
}

.pixel-stage {
  position: relative;
  min-height: 620px;
  padding: 18px 16px 24px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(13, 12, 30, 0.08), rgba(13, 12, 30, 0.86)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 24px),
    linear-gradient(180deg, #221b43 0%, #14162c 58%, #1c1730 100%);
}

.pixel-stage::before,
.detail-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 16px 16px;
  animation: gridDrift 9s linear infinite;
}

@keyframes gridDrift {
  to {
    background-position: 32px 48px;
  }
}

.pixel-sky span {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--pixel-yellow);
  box-shadow:
    24px 8px 0 rgba(133, 255, 143, 0.72),
    50px -10px 0 rgba(114, 216, 255, 0.66);
  animation: starBlink 1.8s steps(2) infinite;
}

.pixel-sky span:nth-child(1) { left: 36px; top: 82px; }
.pixel-sky span:nth-child(2) { left: 292px; top: 74px; animation-delay: 0.4s; }
.pixel-sky span:nth-child(3) { left: 226px; top: 178px; animation-delay: 0.8s; }
.pixel-sky span:nth-child(4) { left: 58px; top: 240px; animation-delay: 1.1s; }
.pixel-sky span:nth-child(5) { left: 330px; top: 286px; animation-delay: 1.5s; }

@keyframes starBlink {
  50% { opacity: 0.28; transform: translateY(3px); }
}

.scanline {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background: repeating-linear-gradient(180deg, transparent 0 5px, rgba(255, 255, 255, 0.2) 5px 6px);
  mix-blend-mode: screen;
}

.pixel-lab {
  position: absolute;
  right: 12px;
  bottom: 16px;
  left: 12px;
  height: 210px;
  border: 4px solid #0a0a12;
  background:
    linear-gradient(transparent 0 70%, rgba(0, 0, 0, 0.18) 70%),
    repeating-linear-gradient(90deg, #2c254e 0 24px, #342a59 24px 48px);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.lab-window {
  position: absolute;
  left: 22px;
  top: 22px;
  width: 116px;
  height: 58px;
  border: 4px solid #0d0b18;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), transparent 35%),
    linear-gradient(180deg, #72d8ff, #32365f);
  animation: windowGlow 2.8s ease-in-out infinite;
}

@keyframes windowGlow {
  50% { filter: brightness(1.24); }
}

.lab-tube {
  position: absolute;
  top: 38px;
  width: 22px;
  height: 94px;
  border: 4px solid #0d0b18;
  background: linear-gradient(180deg, transparent 0 36%, var(--pixel-green) 36%);
  animation: bubble 1.6s steps(3) infinite;
}

.tube-a { right: 86px; }
.tube-b { right: 48px; background: linear-gradient(180deg, transparent 0 48%, var(--pixel-pink) 48%); animation-delay: 0.3s; }

@keyframes bubble {
  50% { transform: translateY(-4px); }
}

.pixel-boy {
  position: absolute;
  bottom: 22px;
  width: 42px;
  height: 74px;
  image-rendering: pixelated;
  animation: pixelBounce 0.9s steps(2) infinite;
}

.pixel-boy::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 0;
  width: 24px;
  height: 24px;
  background: #f3b58f;
  box-shadow:
    0 -8px 0 #241323,
    -8px 8px 0 #f3b58f,
    24px 8px 0 #f3b58f,
    8px 12px 0 #16121e,
    16px 12px 0 #16121e;
}

.pixel-boy::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 30px;
  width: 26px;
  height: 30px;
  background: var(--pixel-blue);
  box-shadow:
    -8px 6px 0 #f3b58f,
    26px 6px 0 #f3b58f,
    0 30px 0 #2a2d50,
    18px 30px 0 #2a2d50;
}

.pixel-boy i {
  position: absolute;
  left: 8px;
  bottom: 0;
  width: 10px;
  height: 8px;
  background: #0a0a12;
  box-shadow: 18px 0 0 #0a0a12;
}

.boy-a { left: 82px; }
.boy-b { right: 118px; animation-delay: 0.22s; }
.boy-b::after { background: var(--pixel-pink); }

@keyframes pixelBounce {
  50% { transform: translateY(-5px); }
}

.game-hud {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 900;
  color: var(--pixel-green);
  text-shadow: 2px 2px 0 #000;
}

.game-hud span,
.dialogue,
.level-card,
.pixel-button {
  border: 3px solid #0a0a12;
  box-shadow: 4px 4px 0 #0a0a12;
}

.game-hud span {
  padding: 5px 7px;
  background: rgba(18, 16, 34, 0.86);
}

.home-hero {
  position: relative;
  z-index: 2;
  padding-top: 44px;
}

.pixel-label,
.chapter-kicker {
  margin: 0 0 10px;
  color: var(--pixel-green);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

.home-hero h1 {
  margin: 0 0 18px;
  font-size: 40px;
  line-height: 1.06;
  letter-spacing: 0;
  text-shadow: 4px 4px 0 #090912;
}

.dialogue {
  position: relative;
  margin: 0 0 16px;
  padding: 14px;
  background: #fff7df;
  color: #17151f;
  font-weight: 760;
}

.dialogue::after {
  content: "";
  position: absolute;
  left: 34px;
  bottom: -15px;
  width: 16px;
  height: 16px;
  background: #fff7df;
  border-right: 3px solid #0a0a12;
  border-bottom: 3px solid #0a0a12;
  transform: rotate(45deg);
}

.dialogue p {
  margin-bottom: 8px;
}

.dialogue p:last-child {
  margin-bottom: 0;
}

.home-copy {
  max-width: 330px;
  color: rgba(255, 247, 223, 0.86);
  font-size: 15px;
}

.level-menu {
  position: relative;
  z-index: 2;
  padding: 30px 16px 40px;
  background:
    linear-gradient(180deg, #17151f, #10101a),
    repeating-linear-gradient(0deg, transparent 0 14px, rgba(255, 255, 255, 0.04) 14px 16px);
}

.menu-title h2 {
  margin: 0 0 8px;
  font-size: 30px;
}

.menu-title p:not(.pixel-label) {
  color: rgba(255, 247, 223, 0.72);
  font-size: 14px;
}

.level-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.level-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  padding: 12px;
  background: #242039;
  color: var(--cream);
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease;
}

.level-card:hover {
  transform: translate(-2px, -2px);
  background: #2c2744;
}

.level-card span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  background: var(--pixel-green);
  color: #11131f;
  font-weight: 950;
}

.level-card strong {
  display: block;
  font-size: 17px;
  line-height: 1.2;
}

.level-card em {
  display: block;
  margin-top: 4px;
  color: rgba(255, 247, 223, 0.7);
  font-size: 13px;
  font-style: normal;
}

.level-card--cta {
  background: linear-gradient(135deg, #ff6da8, #ffd76a);
  color: #16121e;
}

.level-card--cta em {
  color: rgba(22, 18, 30, 0.74);
}

.detail-page {
  background: #08080c;
}

.detail-shell {
  min-height: 100vh;
  padding: 16px;
}

.back-link {
  position: relative;
  z-index: 2;
  display: inline-flex;
  margin-bottom: 18px;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  text-decoration: none;
  backdrop-filter: blur(12px);
}

.story,
.test-console {
  position: relative;
  z-index: 2;
  min-height: calc(100vh - 70px);
  border-radius: 18px;
  padding: 24px 18px 28px;
  overflow: hidden;
}

.story h1,
.test-console h1 {
  margin: 0 0 14px;
  font-size: 38px;
  line-height: 1.08;
  letter-spacing: 0;
}

.lead {
  font-size: 17px;
  line-height: 1.7;
}

.image-text {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.art-window {
  min-height: 230px;
  border-radius: 18px;
}

.spec-grid {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.spec-grid div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid currentColor;
  padding: 12px 0;
}

.spec-grid span {
  opacity: 0.52;
}

.theme-apple .detail-shell {
  background: #f6f5f0;
  color: #111;
}

.theme-apple .chapter-kicker,
.theme-apple .back-link {
  color: #111;
}

.story-apple {
  background: #f6f5f0;
}

.apple-window {
  border: 1px solid #111;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.78), transparent 34%),
    radial-gradient(circle at 72% 30%, #111 0 8px, transparent 9px),
    linear-gradient(180deg, #efefef, #d9d9d9);
  box-shadow: 18px 18px 0 #111;
}

.theme-anime .detail-shell {
  background: linear-gradient(180deg, #dff8ff, #fff7fa 45%, #fff4cc);
  color: #293044;
}

.theme-anime .chapter-kicker,
.theme-anime .back-link {
  color: #ff6da8;
}

.anime-panel {
  position: relative;
  margin: 24px 0;
  border-radius: 26px;
  padding: 120px 18px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.86)),
    repeating-linear-gradient(90deg, rgba(114, 216, 255, 0.25) 0 2px, transparent 2px 18px);
  box-shadow: 0 22px 50px rgba(88, 127, 152, 0.22);
}

.anime-sun {
  position: absolute;
  left: 22px;
  top: 20px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd76a, #ff8db8);
  animation: floaty 3.4s ease-in-out infinite;
}

.soft-notes {
  display: grid;
  gap: 12px;
}

.soft-notes p {
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.62);
}

@keyframes floaty {
  50% { transform: translateY(-10px); }
}

.theme-cyber .detail-shell {
  background:
    radial-gradient(circle at 80% 10%, rgba(255, 109, 168, 0.28), transparent 190px),
    linear-gradient(180deg, #06111c, #10071b);
  color: #e9fbff;
}

.cyber-card {
  border: 1px solid rgba(114, 216, 255, 0.35);
  background: rgba(5, 12, 22, 0.74);
  box-shadow: 0 0 50px rgba(114, 216, 255, 0.16);
}

.neon-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 22px 0;
}

.neon-tags span {
  border: 1px solid #72d8ff;
  border-radius: 999px;
  padding: 6px 10px;
  color: #72d8ff;
  box-shadow: 0 0 18px rgba(114, 216, 255, 0.28);
}

.cyber-window {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.28), transparent 30%),
    repeating-linear-gradient(90deg, rgba(255, 109, 168, 0.46) 0 2px, transparent 2px 16px),
    linear-gradient(135deg, #041c2c, #2d0d36);
  box-shadow: 0 0 36px rgba(255, 109, 168, 0.32);
}

.theme-summer .detail-shell {
  background: linear-gradient(180deg, #bfead8, #fff3c0 62%, #f4c79d);
  color: #3d3a24;
}

.theme-summer .chapter-kicker,
.theme-summer .back-link {
  color: #3d7b4d;
}

.postcard-stack {
  display: grid;
  gap: 18px;
  margin: 24px 0;
}

.postcard-stack figure {
  margin: 0;
  border-radius: 18px;
  padding: 10px;
  background: #fffaf0;
  box-shadow: 0 18px 38px rgba(88, 70, 32, 0.18);
  transform: rotate(-1.5deg);
}

.postcard-stack figure:nth-child(2) {
  transform: rotate(1.2deg);
}

.postcard-img {
  min-height: 220px;
  border-radius: 12px;
  background: linear-gradient(135deg, #72d8ff, #ffd76a);
}

.postcard-img.nz { background: linear-gradient(135deg, #a5f0c8, #72d8ff 62%, #ffffff); }
.postcard-img.west { background: linear-gradient(135deg, #f7d47d, #9fd9b4 48%, #5577a6); }

figcaption {
  padding: 10px 4px 2px;
  font-size: 14px;
}

.theme-arcade .detail-shell {
  background: #25172f;
  color: #fff7df;
}

.arcade-panel {
  border: 4px solid #0a0a12;
  background:
    radial-gradient(circle at 90% 8%, rgba(255, 215, 106, 0.38), transparent 150px),
    linear-gradient(180deg, #ff6da8, #2b1d45 34%, #17151f);
  box-shadow: 7px 7px 0 #0a0a12;
}

.combo-list {
  display: grid;
  gap: 12px;
  margin: 22px 0;
}

.combo-list p {
  border: 3px solid #0a0a12;
  padding: 14px;
  background: #fff7df;
  color: #17151f;
  box-shadow: 4px 4px 0 #0a0a12;
}

.theme-noir .detail-shell {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, #08080b, #1b0d12);
  background-size: 34px 34px, auto;
}

.noir-sheet {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: #f3f0e8;
}

.notice-list {
  margin: 22px 0;
  border-left: 4px solid #ff6da8;
  padding-left: 14px;
}

.theme-neon .detail-shell {
  background:
    radial-gradient(circle at 50% 20%, rgba(133, 255, 143, 0.18), transparent 180px),
    linear-gradient(180deg, #050711, #171022);
}

.neon-story {
  border: 1px solid rgba(133, 255, 143, 0.3);
  background: rgba(8, 12, 22, 0.78);
}

.glow-quote {
  margin: 26px 0;
  border-radius: 22px;
  padding: 22px;
  background: linear-gradient(135deg, rgba(133, 255, 143, 0.14), rgba(114, 216, 255, 0.08));
  box-shadow: 0 0 40px rgba(133, 255, 143, 0.18);
  color: #dfffe2;
  font-size: 22px;
  line-height: 1.5;
}

.theme-test .detail-shell {
  background:
    repeating-linear-gradient(0deg, rgba(133, 255, 143, 0.08) 0 2px, transparent 2px 18px),
    linear-gradient(180deg, #10131e, #08090d);
}

.test-console {
  border: 3px solid #0a0a12;
  background: #191d2c;
  box-shadow: 6px 6px 0 #0a0a12;
}

.match-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.match-form label span,
.match-form legend {
  display: block;
  margin-bottom: 7px;
  color: var(--pixel-green);
  font-size: 13px;
  font-weight: 900;
}

input,
textarea {
  width: 100%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff7df;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--pixel-green);
  box-shadow: 0 0 0 4px rgba(133, 255, 143, 0.12);
}

fieldset {
  display: grid;
  gap: 9px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  margin: 8px 0 0;
  padding: 14px;
}

fieldset label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: rgba(255, 247, 223, 0.86);
}

fieldset input {
  width: 17px;
  min-width: 17px;
  height: 17px;
  margin-top: 5px;
  accent-color: var(--pixel-green);
}

.pixel-button {
  min-height: 52px;
  border: 3px solid #0a0a12;
  background: var(--pixel-green);
  color: #11131f;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 5px 5px 0 #0a0a12;
}

.result-card {
  margin-top: 18px;
  border: 3px solid #0a0a12;
  padding: 16px;
  background: #fff7df;
  color: #17151f;
  box-shadow: 5px 5px 0 #0a0a12;
}

.result-card__meter {
  height: 14px;
  background: #17151f;
}

.result-card__meter span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ff6da8, #ffd76a, #85ff8f);
  transition: width 700ms steps(12);
}

.result-card__score {
  margin: 16px 0 0;
  font-size: 46px;
  font-weight: 950;
  line-height: 1;
}

@media (min-width: 431px) {
  .phone-shell {
    margin-top: 20px;
    margin-bottom: 20px;
    border-radius: 28px;
  }
}

@media (max-width: 360px) {
  .home-hero h1,
  .story h1,
  .test-console h1 {
    font-size: 33px;
  }

  .level-card {
    grid-template-columns: 38px 1fr;
  }
}

/* v3: cinematic pixel fortress home */
.fortress-shell {
  max-width: 430px;
  background: #091018;
}

.fortress-hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #091018;
  isolation: isolate;
}

.fortress-bg {
  position: fixed;
  left: 50%;
  top: 0;
  z-index: -3;
  width: min(100vw, 430px);
  height: 100vh;
  object-fit: cover;
  transform: translateX(-50%);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: saturate(0.86) contrast(1.18) brightness(0.68);
}

.fortress-hero::before {
  content: "";
  position: fixed;
  inset: 0;
  left: 50%;
  width: min(100vw, 430px);
  transform: translateX(-50%);
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 10, 16, 0.58) 0%, rgba(7, 12, 18, 0.1) 34%, rgba(7, 12, 18, 0.86) 100%),
    radial-gradient(circle at 62% 32%, rgba(255, 122, 92, 0.2), transparent 130px),
    radial-gradient(circle at 18% 60%, rgba(76, 190, 178, 0.24), transparent 150px);
}

.rain-layer {
  position: fixed;
  inset: 0;
  left: 50%;
  z-index: -1;
  width: min(100vw, 430px);
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0.32;
  background-image:
    linear-gradient(105deg, transparent 0 46%, rgba(180, 230, 255, 0.58) 47%, transparent 49%),
    linear-gradient(105deg, transparent 0 62%, rgba(180, 230, 255, 0.42) 63%, transparent 65%);
  background-size: 68px 120px, 96px 170px;
  animation: rainFall 0.8s linear infinite;
}

@keyframes rainFall {
  to {
    background-position: -68px 120px, -96px 170px;
  }
}

.mist-layer {
  position: fixed;
  left: 50%;
  bottom: -20px;
  z-index: -1;
  width: min(100vw, 430px);
  height: 34vh;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0.58;
  background:
    radial-gradient(ellipse at 30% 70%, rgba(175, 230, 220, 0.18), transparent 58%),
    radial-gradient(ellipse at 72% 54%, rgba(255, 190, 140, 0.12), transparent 60%);
  filter: blur(10px);
  animation: mistMove 7s ease-in-out infinite alternate;
}

@keyframes mistMove {
  to {
    transform: translateX(-52%) translateY(-18px);
  }
}

.fortress-title {
  position: relative;
  z-index: 2;
  min-height: 330px;
  padding: 28px 18px 0;
}

.fortress-title .pixel-label {
  color: #bfe8e1;
  font-size: 10px;
  text-shadow: 0 1px 8px rgba(87, 213, 196, 0.75);
}

.fortress-title h1 {
  margin: 0 0 16px;
  max-width: 340px;
  color: #fff7e4;
  font-family:
    "Arial Black", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: clamp(44px, 15vw, 66px);
  font-weight: 950;
  line-height: 0.98;
  letter-spacing: 0;
  text-shadow:
    0 2px 0 #1b2c33,
    0 10px 34px rgba(0, 0, 0, 0.55),
    0 0 22px rgba(255, 210, 150, 0.24);
}

.glass-dialogue {
  width: min(100%, 350px);
  border: 1px solid rgba(216, 244, 239, 0.22);
  border-radius: 10px 22px 10px 22px;
  padding: 14px 15px;
  background: rgba(8, 19, 25, 0.5);
  color: rgba(255, 247, 228, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 18px 50px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
}

.glass-dialogue p {
  margin-bottom: 6px;
  font-size: 14px;
}

.glass-dialogue p:last-child {
  margin-bottom: 0;
}

.floor-map {
  position: relative;
  z-index: 2;
  min-height: 780px;
  padding-bottom: 180px;
}

.floor-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 124px;
  border: 1px solid rgba(204, 242, 233, 0.32);
  border-radius: 6px 16px 6px 16px;
  padding: 7px 11px 7px 7px;
  background: rgba(7, 18, 23, 0.62);
  color: #fff4dc;
  text-decoration: none;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.16),
    0 10px 24px rgba(0, 0, 0, 0.34),
    0 0 24px rgba(79, 211, 191, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(9px);
  animation: signFloat 3.6s ease-in-out infinite;
}

.floor-chip::before {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(72, 214, 193, 0.18), transparent 68%);
  opacity: 0;
  transition: opacity 160ms ease;
}

.floor-chip:hover::before {
  opacity: 1;
}

.floor-chip span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 4px 10px 4px 10px;
  background: linear-gradient(135deg, #ef7f63, #ffd08b);
  color: #101821;
  font-size: 12px;
  font-weight: 950;
}

.floor-chip strong {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
  white-space: nowrap;
}

.floor-chip:nth-child(2n) {
  animation-delay: 0.45s;
}

.floor-chip:nth-child(3n) {
  animation-delay: 0.9s;
}

@keyframes signFloat {
  50% {
    transform: translateY(-5px);
  }
}

.floor-01 { top: 18px; left: 24px; }
.floor-02 { top: 118px; right: 18px; }
.floor-03 { top: 218px; left: 34px; }
.floor-04 { top: 326px; right: 34px; }
.floor-05 { top: 434px; left: 18px; }
.floor-06 { top: 540px; right: 22px; }
.floor-07 { top: 642px; left: 44px; }
.floor-08 {
  top: 738px;
  right: 26px;
  border-color: rgba(255, 207, 139, 0.58);
  background: rgba(80, 36, 32, 0.74);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.36),
    0 0 30px rgba(239, 127, 99, 0.36);
}

.fortress-footer {
  position: relative;
  z-index: 2;
  margin: 0 16px 24px;
  border: 1px solid rgba(255, 247, 228, 0.16);
  border-radius: 22px;
  padding: 16px;
  background: rgba(5, 12, 16, 0.68);
  color: rgba(255, 247, 228, 0.78);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.fortress-footer p {
  margin-bottom: 6px;
  font-size: 13px;
}

.fortress-footer p:last-child {
  margin-bottom: 0;
}

@media (min-width: 431px) {
  .fortress-bg,
  .fortress-hero::before,
  .rain-layer,
  .mist-layer {
    border-radius: 28px;
  }
}

/* v4: calm floating pixel-lab home, based on pastel water pixel references */
.harbor-page {
  background: #5fa8a6;
}

.harbor-shell {
  max-width: 430px;
  background: #75bbb7;
  box-shadow: none;
}

.harbor-scene {
  position: relative;
  min-height: 1180px;
  overflow: hidden;
  color: #2f3340;
  background:
    linear-gradient(180deg, #75bbb7 0%, #74bbb7 49%, #8bc6bd 50%, #74bbb7 51%, #69aaa8 100%);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.harbor-scene::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 444px;
  height: 2px;
  background: rgba(232, 239, 210, 0.75);
  box-shadow:
    0 28px 0 rgba(232, 239, 210, 0.28),
    0 94px 0 rgba(232, 239, 210, 0.2),
    0 192px 0 rgba(232, 239, 210, 0.18);
  animation: waterPulse 2.8s steps(2) infinite;
}

@keyframes waterPulse {
  50% {
    opacity: 0.68;
    transform: translateY(2px);
  }
}

.cloud {
  position: absolute;
  height: 36px;
  background: #d7ddc7;
  opacity: 0.95;
  filter: drop-shadow(0 4px 0 rgba(78, 128, 126, 0.25));
  animation: cloudDrift 12s linear infinite;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  bottom: 0;
  border-radius: 50% 50% 0 0;
  background: #d7ddc7;
}

.cloud::before {
  left: 18px;
  width: 76px;
  height: 62px;
}

.cloud::after {
  right: 18px;
  width: 96px;
  height: 78px;
}

.cloud-a {
  left: -38px;
  top: 64px;
  width: 172px;
}

.cloud-b {
  right: -72px;
  top: 128px;
  width: 226px;
  animation-delay: -4s;
}

.cloud-c {
  left: 250px;
  top: 314px;
  width: 118px;
  transform: scale(0.72);
  animation-delay: -8s;
}

@keyframes cloudDrift {
  from { translate: -12px 0; }
  to { translate: 18px 0; }
}

.water-lines {
  position: absolute;
  inset: 490px 0 0;
  opacity: 0.5;
  background:
    linear-gradient(90deg, transparent 0 12%, rgba(232, 239, 210, 0.9) 12% 20%, transparent 20% 100%) 0 28px / 210px 80px,
    linear-gradient(90deg, transparent 0 46%, rgba(232, 239, 210, 0.72) 46% 60%, transparent 60% 100%) 0 0 / 280px 96px;
  animation: waterSlide 8s linear infinite;
}

@keyframes waterSlide {
  to { background-position: 210px 28px, -280px 0; }
}

.harbor-title {
  position: relative;
  z-index: 5;
  padding: 34px 22px 0;
}

.harbor-title .pixel-label {
  color: #4f716f;
  font-size: 10px;
  font-weight: 900;
}

.harbor-title h1 {
  margin: 0 0 16px;
  color: #2f3340;
  font-family: "Arial Black", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: clamp(42px, 14vw, 58px);
  font-weight: 950;
  line-height: 1.02;
  letter-spacing: 0;
  text-shadow:
    0 3px 0 #d7ddc7,
    0 6px 0 rgba(79, 113, 111, 0.24);
}

.harbor-dialogue {
  width: min(100%, 346px);
  border: 3px solid #2f3340;
  border-radius: 0;
  padding: 13px 14px;
  background: #f0ead2;
  box-shadow: 7px 7px 0 rgba(47, 51, 64, 0.2);
}

.harbor-dialogue p {
  margin-bottom: 6px;
  color: #333743;
  font-size: 14px;
  font-weight: 700;
}

.harbor-dialogue p:last-child {
  margin-bottom: 0;
}

.harbor-dialogue .sample-line {
  display: inline-block;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(215, 221, 199, 0.52);
  color: #2f8d86;
  font-family:
    "YouYuan", "Arial Rounded MT Bold", "Trebuchet MS", "PingFang SC", "Microsoft YaHei",
    system-ui, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 1px 1px 0 rgba(255, 247, 223, 0.72);
}

.boat-world {
  position: absolute;
  left: 0;
  right: 0;
  top: 330px;
  height: 350px;
}

.boat-hull {
  position: absolute;
  left: 54px;
  top: 132px;
  width: 292px;
  height: 92px;
  border: 4px solid #2f3340;
  border-top-width: 5px;
  background:
    linear-gradient(90deg, transparent 0 78%, #6c6170 78% 100%),
    linear-gradient(180deg, #c6c8a9 0%, #a8ad8f 100%);
  clip-path: polygon(0 0, 86% 0, 100% 32%, 88% 100%, 12% 100%, 0 48%);
  box-shadow: inset 0 -12px 0 rgba(83, 96, 93, 0.17);
}

.boat-hull::before {
  content: "";
  position: absolute;
  inset: 18px 20px;
  opacity: 0.28;
  background:
    linear-gradient(#2f3340 0 2px, transparent 2px 100%) 0 0 / 46px 28px,
    linear-gradient(90deg, #2f3340 0 2px, transparent 2px 100%) 0 0 / 46px 28px;
}

.porthole {
  position: absolute;
  z-index: 2;
  width: 28px;
  height: 28px;
  border: 4px solid #4f535b;
  border-radius: 50%;
  background: #dce7dc;
  box-shadow: inset -4px -4px 0 #7fa6a0;
}

.p1 { left: 58px; top: 34px; }
.p2 { left: 142px; top: 38px; }
.p3 { right: 56px; top: 34px; }

.boat-cabin {
  position: absolute;
  left: 148px;
  top: 42px;
  width: 148px;
  height: 98px;
  border: 4px solid #2f3340;
  background:
    linear-gradient(90deg, rgba(47, 51, 64, 0.12) 0 2px, transparent 2px 100%) 0 0 / 24px 24px,
    #bdc3a4;
}

.boat-cabin .roof {
  position: absolute;
  left: -22px;
  top: -18px;
  width: 190px;
  height: 20px;
  border: 4px solid #2f3340;
  background: #e4e1c9;
}

.boat-cabin .door {
  position: absolute;
  right: 22px;
  bottom: 0;
  width: 42px;
  height: 66px;
  border: 4px solid #2f3340;
  background: #6f918a;
}

.boat-cabin .round-window {
  position: absolute;
  left: 24px;
  top: 28px;
  width: 34px;
  height: 34px;
  border: 4px solid #2f3340;
  border-radius: 50%;
  background: #dce7dc;
  box-shadow: inset -5px -5px 0 #7fa6a0;
}

.boat-cabin .chimney {
  position: absolute;
  right: 38px;
  top: -58px;
  width: 32px;
  height: 42px;
  border: 4px solid #2f3340;
  background: #b7b99e;
  box-shadow: 0 -16px 0 #d8d8c0;
}

.crane {
  position: absolute;
  right: 36px;
  top: 18px;
  width: 76px;
  height: 126px;
  border-top: 8px solid #7d5568;
  border-right: 8px solid #7d5568;
}

.crane::before {
  content: "";
  position: absolute;
  right: 18px;
  top: 0;
  width: 8px;
  height: 112px;
  background: #2f3340;
}

.crane::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 106px;
  width: 18px;
  height: 22px;
  border: 4px solid #2f3340;
  border-top: 0;
}

.dock {
  position: absolute;
  left: 10px;
  top: 164px;
  width: 126px;
  height: 18px;
  border: 4px solid #2f3340;
  background: #8b5f68;
  box-shadow: 0 24px 0 #64556b;
}

.dock::before {
  content: "";
  position: absolute;
  left: 4px;
  top: -54px;
  width: 96px;
  height: 52px;
  background:
    linear-gradient(45deg, transparent 44%, #2f3340 45% 55%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, #2f3340 45% 55%, transparent 56%),
    #9c6671;
  box-shadow:
    34px 0 0 #8d5a66,
    68px 0 0 #9c6671;
}

.reflection {
  position: absolute;
  left: 26px;
  top: 234px;
  width: 344px;
  height: 156px;
  opacity: 0.28;
  transform: scaleY(-1);
  background:
    linear-gradient(180deg, rgba(47, 51, 64, 0.22), transparent 72%),
    linear-gradient(90deg, transparent 0 15%, rgba(47, 51, 64, 0.28) 15% 82%, transparent 82%);
  clip-path: polygon(10% 0, 90% 0, 100% 42%, 88% 100%, 18% 100%, 0 36%);
  animation: reflect 2.4s steps(2) infinite;
}

@keyframes reflect {
  50% { translate: 0 4px; opacity: 0.2; }
}

.boat-shadow {
  position: absolute;
  left: 72px;
  top: 238px;
  width: 276px;
  height: 12px;
  background: rgba(47, 51, 64, 0.22);
}

.cargo {
  position: absolute;
  border: 4px solid #2f3340;
  background:
    linear-gradient(45deg, transparent 44%, #2f3340 45% 55%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, #2f3340 45% 55%, transparent 56%),
    #9b6672;
}

.cargo-a {
  left: 72px;
  top: 106px;
  width: 42px;
  height: 42px;
}

.cargo-b {
  left: 116px;
  top: 106px;
  width: 38px;
  height: 38px;
  background-color: #875d6d;
}

.harbor-map {
  position: absolute;
  left: 0;
  right: 0;
  top: 326px;
  z-index: 8;
  height: 720px;
  pointer-events: none;
}

.harbor-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  border: 3px solid #2f3340;
  width: 142px;
  min-height: 76px;
  overflow: hidden;
  padding: 40px 8px 8px;
  background:
    linear-gradient(180deg, rgba(47, 51, 64, 0.08), rgba(47, 51, 64, 0.5)),
    var(--thumb) center / cover;
  color: #2f3340;
  text-decoration: none;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  box-shadow: 4px 4px 0 rgba(47, 51, 64, 0.24);
  pointer-events: auto;
  animation: labelBob 2.6s steps(2) infinite;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.harbor-chip span {
  position: relative;
  z-index: 1;
  display: inline-grid;
  width: 24px;
  height: 22px;
  place-items: center;
  border: 2px solid #2f3340;
  background: #f4c27d;
  color: #2f3340;
  font-size: 11px;
  font-weight: 950;
}

.harbor-chip b {
  position: relative;
  z-index: 1;
  border: 2px solid #2f3340;
  padding: 4px 6px;
  background: rgba(240, 234, 210, 0.9);
  font: inherit;
  box-shadow: 3px 3px 0 rgba(47, 51, 64, 0.22);
}

.harbor-chip:hover {
  translate: -2px -2px;
}

@keyframes labelBob {
  50% { transform: translateY(-3px); }
}

.chip-01 { left: 136px; top: 24px; }
.chip-02 { left: 218px; top: 120px; }
.chip-03 { left: 24px; top: 178px; }
.chip-04 { right: 18px; top: 260px; }
.chip-05 { left: 42px; top: 366px; }
.chip-06 { right: 34px; top: 452px; }
.chip-07 { left: 28px; top: 560px; }
.chip-08 {
  right: 28px;
  top: 636px;
}

.harbor-footer {
  position: absolute;
  left: 22px;
  right: 22px;
  top: 940px;
  z-index: 5;
  border: 3px solid #2f3340;
  padding: 13px 14px;
  background: rgba(240, 234, 210, 0.88);
  box-shadow: 7px 7px 0 rgba(47, 51, 64, 0.18);
}

.harbor-footer p {
  margin-bottom: 6px;
  color: #333743;
  font-size: 13px;
  font-weight: 700;
}

.harbor-footer p:last-child {
  margin-bottom: 0;
}

.footer-signature {
  display: block;
  text-align: right;
}

.reference-panel {
  position: relative;
  margin: 20px 0 24px;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.18);
}

.reference-panel img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.theme-apple .reference-panel {
  border: 1px solid #111;
  border-radius: 0;
  box-shadow: 14px 14px 0 #111;
}

.theme-anime .reference-panel,
.theme-summer .reference-panel {
  border: 8px solid rgba(255, 255, 255, 0.72);
}

.theme-cyber .reference-panel,
.theme-neon .reference-panel {
  border: 1px solid rgba(114, 216, 255, 0.35);
  box-shadow: 0 0 36px rgba(114, 216, 255, 0.18);
}

.theme-arcade .reference-panel,
.theme-noir .reference-panel {
  border: 4px solid #0a0a12;
  border-radius: 0;
  box-shadow: 6px 6px 0 #0a0a12;
}

.edit-toolbar {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 9999;
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  width: min(220px, calc(100vw - 24px));
  border: 2px solid #2f3340;
  padding: 10px;
  background: #fff7df;
  color: #2f3340;
  box-shadow: 6px 6px 0 rgba(47, 51, 64, 0.25);
  font-size: 12px;
}

.edit-toolbar button {
  border: 2px solid #2f3340;
  padding: 7px 8px;
  background: #75bbb7;
  color: #2f3340;
  font-weight: 800;
}

.edit-toolbar.is-saved::after {
  content: "已保存";
  color: #2e7d5b;
  font-weight: 900;
}

.edit-mode [data-edit-key] {
  outline: 2px dashed rgba(238, 147, 124, 0.8);
  outline-offset: 3px;
  cursor: text;
}

.edit-mode [data-edit-key][data-dirty="true"] {
  outline-color: #2f3340;
  background: rgba(255, 246, 220, 0.26);
}

@media (max-width: 370px) {
  .harbor-title h1 {
    font-size: 40px;
  }

  .boat-world {
    left: -20px;
    transform: scale(0.94);
    transform-origin: top center;
  }

  .harbor-chip {
    font-size: 11px;
  }
}

/* v5: restore clean directory labels; use supplied images as detail page backgrounds */
.harbor-dialogue .sample-line {
  display: inline-block;
  border-radius: 18px;
  padding: 7px 10px;
  background: rgba(215, 221, 199, 0.58);
  color: #2b8f87;
  font-family:
    "YouYuan", "幼圆", "Microsoft YaHei UI", "PingFang SC", "Microsoft YaHei",
    system-ui, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.75;
  letter-spacing: 0;
  text-shadow: 1px 1px 0 rgba(255, 247, 223, 0.86);
}

.harbor-map {
  top: 300px;
  height: 620px;
}

.harbor-chip {
  width: auto;
  min-height: 0;
  overflow: visible;
  padding: 6px 8px;
  background: #efe9cf;
  color: #2f3340;
  font-size: 12px;
  box-shadow: 4px 4px 0 rgba(47, 51, 64, 0.24);
}

.harbor-chip span {
  width: 24px;
  height: 22px;
  border: 0;
  background: #e9937c;
}

.harbor-chip b {
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.harbor-chip:hover {
  background: #fff6dc;
}

.chip-01 { left: 154px; top: 52px; }
.chip-02 { left: 214px; top: 120px; }
.chip-03 { left: 38px; top: 166px; }
.chip-04 { right: 26px; top: 218px; }
.chip-05 { left: 72px; top: 300px; }
.chip-06 { right: 40px; top: 360px; }
.chip-07 { left: 44px; top: 436px; }
.chip-08 {
  right: 44px;
  top: 504px;
  background: #f7c680;
}

.theme-apple .detail-shell {
  background:
    linear-gradient(180deg, rgba(246, 245, 240, 0.7), rgba(246, 245, 240, 0.92)),
    url("./assets/sections/section-01.png") center / cover;
}

.theme-anime .detail-shell {
  background:
    linear-gradient(180deg, rgba(223, 248, 255, 0.62), rgba(255, 247, 250, 0.9)),
    url("./assets/sections/section-02.png") center / cover;
}

.theme-cyber .detail-shell {
  background:
    linear-gradient(180deg, rgba(6, 17, 28, 0.58), rgba(16, 7, 27, 0.92)),
    url("./assets/sections/section-03.png") center / cover;
}

.theme-summer .detail-shell {
  background:
    linear-gradient(180deg, rgba(191, 234, 216, 0.52), rgba(255, 243, 192, 0.86)),
    url("./assets/sections/section-04.png") center / cover;
}

.travel-gallery {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.travel-gallery figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 7px solid rgba(255, 250, 240, 0.86);
  border-radius: 18px;
  background: #fffaf0;
  box-shadow:
    0 18px 42px rgba(61, 58, 36, 0.2),
    inset 0 0 0 1px rgba(61, 58, 36, 0.12);
}

.travel-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.travel-hero img {
  aspect-ratio: 4 / 3;
}

.travel-gallery figcaption {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(16, 24, 28, 0.58);
  color: #fffaf0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.travel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.travel-grid figure {
  border-width: 5px;
  border-radius: 14px;
  transform: rotate(-0.8deg);
}

.travel-grid figure:nth-child(2n) {
  transform: rotate(0.8deg);
}

.travel-grid img {
  aspect-ratio: 3 / 4;
}

.travel-grid figcaption {
  left: 6px;
  right: 6px;
  bottom: 6px;
  border-radius: 9px;
  padding: 6px 7px;
  font-size: 11px;
  line-height: 1.35;
}

.travel-wide {
  grid-column: 1 / -1;
  min-height: 0;
  transform: none !important;
}

.travel-wide img,
.travel-grid .travel-wide img {
  aspect-ratio: 16 / 11;
  min-height: 205px;
}

.travel-wide figcaption {
  top: 12px;
  bottom: 12px;
  width: 42px;
  right: auto;
  left: 12px;
  display: grid;
  place-items: center;
  padding: 10px 7px;
  border-radius: 999px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0;
  font-size: 12px;
  line-height: 1.2;
}

.travel-wide.caption-right figcaption {
  right: 12px;
  left: auto;
}

.travel-wide.caption-left figcaption {
  left: 12px;
  right: auto;
}

.theme-summer .story > .lead,
.theme-summer .story > p:not(.chapter-kicker) {
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 250, 240, 0.46);
  backdrop-filter: blur(8px);
}

.theme-arcade .detail-shell {
  background:
    linear-gradient(180deg, rgba(37, 23, 47, 0.42), rgba(37, 23, 47, 0.9)),
    url("./assets/sections/section-05.png") center / cover;
}

.theme-noir .detail-shell {
  background:
    linear-gradient(180deg, rgba(8, 8, 11, 0.42), rgba(27, 13, 18, 0.92)),
    url("./assets/sections/section-06.png") center / cover;
}

.theme-neon .detail-shell {
  background:
    linear-gradient(180deg, rgba(5, 7, 17, 0.42), rgba(23, 16, 34, 0.9)),
    url("./assets/sections/section-07.png") center / cover;
}

/* v6: per-page background corrections */
.theme-apple .detail-shell {
  background:
    linear-gradient(180deg, rgba(246, 245, 240, 0.08), rgba(246, 245, 240, 0.22)),
    url("./assets/sections/section-01.png") center / cover;
  color: #28313b;
}

.theme-apple .story-apple {
  background: transparent;
  box-shadow: none;
}

.theme-apple .story,
.theme-anime .story {
  border: 0;
  backdrop-filter: none;
}

.theme-apple .lead,
.theme-apple .story p,
.theme-apple .spec-grid {
  text-shadow: 1px 1px 0 rgba(246, 245, 240, 0.78);
}

.theme-anime .detail-shell {
  background:
    linear-gradient(180deg, rgba(255, 235, 238, 0.06), rgba(255, 235, 238, 0.2)),
    url("./assets/sections/section-02.png") center / cover;
  color: #34324a;
}

.theme-anime .soft-notes p {
  background: transparent;
  padding: 0;
  text-shadow: 1px 1px 0 rgba(255, 235, 238, 0.82);
}

.theme-anime .lead {
  text-shadow: 1px 1px 0 rgba(255, 235, 238, 0.82);
}

.theme-cyber .detail-shell {
  background:
    linear-gradient(180deg, rgba(6, 17, 28, 0.15), rgba(16, 7, 27, 0.46)),
    url("./assets/sections/section-03.png") center / cover;
}

.theme-cyber .cyber-card {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.theme-cyber .lead,
.theme-cyber .story > p:not(.chapter-kicker),
.theme-cyber .neon-tags {
  border-radius: 14px;
  padding: 12px;
  background: rgba(5, 14, 22, 0.58);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.theme-summer .detail-shell {
  background:
    linear-gradient(180deg, rgba(191, 234, 216, 0.52), rgba(255, 243, 192, 0.86)),
    url("./assets/sections/section-04.png") center / cover;
}

.theme-arcade .detail-shell {
  background:
    linear-gradient(180deg, rgba(37, 23, 47, 0.1), rgba(37, 23, 47, 0.44)),
    url("./assets/sections/section-05.png") center / cover;
}

.theme-arcade .arcade-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.theme-arcade .lead,
.theme-arcade .story > p:not(.chapter-kicker),
.theme-arcade .combo-list p {
  border: 3px solid #0a0a12;
  padding: 12px;
  background: rgba(255, 247, 223, 0.88);
  color: #17151f;
  box-shadow: 4px 4px 0 rgba(10, 10, 18, 0.5);
}

.theme-noir .detail-shell {
  background: linear-gradient(180deg, rgba(8, 8, 11, 0.42), rgba(27, 13, 18, 0.92));
  color: #f3f0e8;
}

.theme-noir .detail-shell::after {
  content: "";
  position: absolute;
  inset: -14px;
  z-index: 0;
  pointer-events: none;
  background: url("./assets/sections/section-06.png") center / cover;
  filter: blur(7px);
  opacity: 0.78;
  transform: scale(1.04);
}

.theme-noir .back-link,
.theme-noir .story {
  position: relative;
  z-index: 2;
}

.theme-noir .noir-sheet {
  background: rgba(8, 8, 11, 0.56);
  backdrop-filter: blur(3px);
}

.theme-neon .detail-shell {
  background: #050711;
  color: #fff7df;
}

.theme-neon .detail-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url("./assets/sections/section-07.png") center top / contain no-repeat;
  opacity: 1;
}

.theme-neon .back-link {
  position: relative;
  z-index: 3;
}

.theme-neon .neon-story {
  position: relative;
  z-index: 2;
  min-height: 0;
  margin-top: 62px;
  margin-left: auto;
  margin-right: auto;
  width: min(62%, 250px);
  max-height: 225px;
  overflow: auto;
  border: 0;
  border-radius: 0;
  padding: 8px 10px;
  background: rgba(31, 151, 196, 0.82);
  box-shadow: inset 0 0 0 3px rgba(255, 247, 223, 0.28);
  color: #fff7df;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.32);
}

.theme-neon .neon-story h1 {
  margin-bottom: 8px;
  font-size: 18px;
}

.theme-neon .neon-story .lead,
.theme-neon .neon-story p {
  margin-bottom: 8px;
  font-size: 11px;
  line-height: 1.55;
}

.theme-neon .glow-quote {
  margin: 8px 0;
  border-radius: 0;
  padding: 7px;
  background: rgba(255, 247, 223, 0.18);
  box-shadow: none;
  color: #fff7df;
  font-size: 12px;
}

.theme-test .detail-shell {
  background:
    linear-gradient(180deg, rgba(16, 19, 30, 0.18), rgba(8, 9, 13, 0.72)),
    url("./assets/sections/section-03.png") center / cover;
}

.theme-test .test-console {
  background: rgba(25, 29, 44, 0.78);
  backdrop-filter: blur(4px);
}

/* v7: final visual tuning and game-screen quiz */
.theme-apple .detail-shell,
.theme-anime .detail-shell {
  background: #d7ddc7;
}

.theme-apple .detail-shell::after,
.theme-anime .detail-shell::after {
  content: "";
  position: absolute;
  inset: -14px;
  z-index: 0;
  pointer-events: none;
  filter: blur(5px);
  opacity: 0.78;
  transform: scale(1.03);
}

.theme-apple .detail-shell::after {
  background: url("./assets/sections/section-01.png") center / cover;
}

.theme-anime .detail-shell::after {
  background: url("./assets/sections/section-02.png") center / cover;
}

.theme-apple .back-link,
.theme-apple .story,
.theme-anime .back-link,
.theme-anime .story {
  position: relative;
  z-index: 2;
}

.theme-cyber .lead,
.theme-cyber .story > p:not(.chapter-kicker),
.theme-cyber .neon-tags {
  background: rgba(5, 14, 22, 0.42);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.theme-arcade .lead,
.theme-arcade .story > p:not(.chapter-kicker),
.theme-arcade .combo-list p {
  background: rgba(255, 247, 223, 0.62);
  backdrop-filter: blur(8px);
}

.theme-noir .noir-sheet {
  border: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

.theme-noir .lead,
.theme-noir .notice-list,
.theme-noir .story > p:not(.chapter-kicker) {
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.8);
}

.theme-neon .detail-shell {
  background:
    linear-gradient(180deg, rgba(6, 17, 28, 0.18), rgba(16, 7, 27, 0.5)),
    url("./assets/sections/section-03.png") center / cover;
}

.theme-neon .detail-shell::after {
  display: none;
}

.theme-neon .neon-story {
  width: auto;
  max-height: none;
  overflow: visible;
  margin-top: 0;
  border-radius: 16px;
  padding: 20px 18px 24px;
  background: rgba(6, 17, 28, 0.58);
  backdrop-filter: blur(8px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
}

.theme-neon .neon-story h1 {
  font-size: 32px;
}

.theme-neon .neon-story .lead,
.theme-neon .neon-story p {
  font-size: 15px;
  line-height: 1.7;
}

.theme-neon .glow-quote {
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 247, 223, 0.16);
  font-size: 16px;
}

.theme-test .detail-shell {
  background: #050711;
  color: #fff7df;
}

/* v11: plain 01/02 text and life photo strip */
.theme-apple .lead,
.theme-apple .story p,
.theme-apple .spec-grid,
.theme-apple .spec-grid strong,
.theme-apple .spec-grid span,
.theme-anime .lead,
.theme-anime .soft-notes p {
  color: #101010;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  text-shadow: none !important;
}

.life-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.life-gallery figure {
  margin: 0;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

.life-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 3 / 4;
}


/* v10: refreshed 01/02/07 backgrounds and cat gallery */
.theme-apple .detail-shell::after,
.theme-anime .detail-shell::after {
  filter: blur(2px);
  opacity: 0.9;
  transform: scale(1.01);
}

.theme-apple .lead,
.theme-apple .story p,
.theme-apple .spec-grid,
.theme-anime .lead,
.theme-anime .soft-notes p {
  text-shadow:
    1px 1px 0 rgba(255, 250, 244, 0.82),
    0 0 14px rgba(255, 250, 244, 0.72);
}

.neon-tags .tag-break {
  flex-basis: 100%;
  width: 0;
  height: 0;
  margin: 0;
  margin-bottom: -9px;
  border: 0;
  padding: 0;
  line-height: 0;
  box-shadow: none;
  pointer-events: none;
}

.theme-neon .detail-shell {
  background:
    linear-gradient(180deg, rgba(26, 43, 88, 0.12), rgba(245, 114, 156, 0.2)),
    url("./assets/sections/section-07.png") center / cover;
  color: #243047;
}

.theme-neon .cat-story {
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 248, 244, 0.72);
  backdrop-filter: blur(4px);
  box-shadow: 0 18px 48px rgba(47, 39, 82, 0.22);
}

.theme-neon .cat-story .chapter-kicker,
.theme-neon .cat-story h1,
.theme-neon .cat-story .lead {
  color: #243047;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.7);
}

.theme-neon .cat-story h1 {
  margin-bottom: 10px;
}

.cat-gallery {
  margin-top: 18px;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cat-gallery figure {
  margin: 0;
  overflow: hidden;
  border: 5px solid rgba(255, 255, 255, 0.82);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow:
    0 16px 32px rgba(47, 39, 82, 0.16),
    inset 0 0 0 1px rgba(47, 39, 82, 0.08);
}

.cat-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cat-grid figure:not(.cat-wide) img {
  aspect-ratio: 3 / 4;
}

.cat-wide {
  grid-column: 1 / -1;
}

.cat-wide img {
  aspect-ratio: 16 / 11;
  min-height: 205px;
}

.theme-test .detail-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url("./assets/sections/section-07-cropped.png") center top / contain no-repeat;
}

.theme-test .back-link {
  position: relative;
  z-index: 3;
}

.theme-test .test-console {
  position: relative;
  z-index: 2;
  min-height: 0;
  margin-top: 18px;
  margin-left: auto;
  margin-right: auto;
  width: min(58%, 236px);
  height: 246px;
  max-height: none;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  padding: 8px 10px;
  background: rgba(31, 151, 196, 0.84);
  box-shadow: inset 0 0 0 3px rgba(255, 247, 223, 0.28);
  color: #fff7df;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.32);
}

.theme-test .test-console h1 {
  margin-bottom: 6px;
  font-size: 20px;
}

/* v12: final plain text override for 01/02 */
.theme-apple .lead,
.theme-apple .story p,
.theme-apple .spec-grid,
.theme-apple .spec-grid strong,
.theme-apple .spec-grid span,
.theme-anime .lead,
.theme-anime .soft-notes p {
  color: #101010;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  text-shadow: none !important;
}

.theme-test .test-console .lead,
.theme-test .test-console p {
  margin-bottom: 6px;
  font-size: 11px;
  line-height: 1.42;
}

.quiz-progress {
  height: 10px;
  margin: 8px 0 10px;
  background: rgba(255, 247, 223, 0.22);
}

.quiz-progress span {
  display: inline-block;
  min-width: 28px;
  margin-right: 6px;
  color: #fff7df;
  font-size: 10px;
  font-weight: 900;
}

.quiz-progress i {
  display: inline-block;
  width: 12.5%;
  height: 8px;
  background: #fff7df;
  vertical-align: middle;
  transition: width 220ms steps(4);
}

.quiz-card {
  display: grid;
  gap: 8px;
}

.quiz-card label {
  color: #fff7df;
  font-size: 14px;
  font-weight: 900;
}

.quiz-card p {
  opacity: 0.9;
}

.quiz-card textarea {
  min-height: 86px;
  max-height: 96px;
  border: 2px solid rgba(255, 247, 223, 0.68);
  padding: 8px;
  background: rgba(8, 24, 40, 0.46);
  color: #fff7df;
  font-size: 12px;
  resize: vertical;
}

.quiz-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.quiz-button {
  border: 2px solid rgba(255, 247, 223, 0.75);
  min-height: 42px;
  padding: 8px;
  background: #fff7df;
  color: #1f97c4;
  font-size: 12px;
  font-weight: 900;
  box-shadow: none;
}

.quiz-button--ghost {
  border-color: rgba(255, 247, 223, 0.58);
  background: rgba(255, 247, 223, 0.08);
  color: rgba(255, 247, 223, 0.72);
}

.quiz-button:disabled {
  opacity: 0.35;
}

.theme-test .result-card {
  border: 0;
  padding: 6px 0 0;
  background: transparent;
  box-shadow: none;
  color: #fff7df;
}

.theme-test .result-card__score {
  font-size: 34px;
}

.theme-test .result-card h2 {
  font-size: 18px;
}

.answer-summary {
  display: grid;
  gap: 6px;
  max-height: 86px;
  overflow: auto;
  margin-top: 8px;
}

.answer-summary p {
  margin: 0;
  border-top: 1px solid rgba(255, 247, 223, 0.22);
  padding-top: 5px;
}

.answer-summary strong {
  display: block;
  color: #fff7df;
}

.result-share-button {
  width: 100%;
  margin: 10px 0 4px;
  border-color: rgba(178, 255, 136, 0.95);
  background: #fff7df;
  color: #118a8a;
  box-shadow: 0 0 0 3px rgba(178, 255, 136, 0.2);
}

.result-share-button.is-attention {
  animation: shareButtonPulse 1.35s ease-in-out 3;
}

@keyframes shareButtonPulse {
  0%,
  100% {
    transform: translateY(0);
    box-shadow: 0 0 0 3px rgba(178, 255, 136, 0.2);
  }
  50% {
    transform: translateY(-2px);
    box-shadow: 0 0 0 6px rgba(178, 255, 136, 0.36);
  }
}

.share-copy-box {
  width: 100%;
  min-height: 112px;
  margin: 8px 0 12px;
  border: 2px solid #17151f;
  border-radius: 8px;
  padding: 10px;
  resize: vertical;
  background: #fff7df;
  color: #17151f;
  font: 700 13px/1.55 "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* v8: editable detail pages and visible game-console quiz controls */
.edit-toolbar small {
  color: rgba(47, 51, 64, 0.72);
  line-height: 1.35;
}

.edit-toolbar a {
  border: 2px solid #2f3340;
  padding: 7px 8px;
  background: #fff7df;
  color: #2f3340;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.edit-toolbar.is-saved::after {
  content: "已保存";
}

.edit-panel {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: 112px;
  z-index: 9998;
  max-height: min(62vh, 520px);
  overflow: auto;
  border: 2px solid #2f3340;
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 247, 223, 0.96);
  color: #2f3340;
  box-shadow: 8px 8px 0 rgba(47, 51, 64, 0.22);
}

.edit-panel[hidden] {
  display: none;
}

.edit-panel__head {
  position: sticky;
  top: -12px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -12px -12px 10px;
  border-bottom: 2px solid rgba(47, 51, 64, 0.18);
  padding: 10px 12px;
  background: #fff7df;
}

.edit-panel__head button {
  border: 2px solid #2f3340;
  padding: 5px 8px;
  background: #75bbb7;
  color: #2f3340;
  font-weight: 900;
}

.edit-panel__fields {
  display: grid;
  gap: 10px;
}

.edit-field {
  display: grid;
  gap: 5px;
}

.edit-field span {
  font-size: 12px;
  font-weight: 900;
  opacity: 0.72;
}

.edit-field textarea {
  min-height: 74px;
  border: 2px solid rgba(47, 51, 64, 0.38);
  border-radius: 8px;
  padding: 9px;
  background: #fffdf5;
  color: #2f3340;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
}

.edit-mode .story [data-edit-key],
.edit-mode .test-console [data-edit-key],
.edit-mode .harbor-scene [data-edit-key] {
  border-radius: 6px;
  outline: 2px dashed rgba(255, 247, 223, 0.9);
  outline-offset: 4px;
}

.edit-mode .story [data-edit-key]:focus,
.edit-mode .test-console [data-edit-key]:focus,
.edit-mode .harbor-scene [data-edit-key]:focus {
  outline-style: solid;
  background: rgba(255, 247, 223, 0.28);
}

.theme-test .detail-shell {
  padding-bottom: 120px;
}

.theme-test .test-console {
  height: 246px;
  overflow-y: auto;
  padding: 8px 9px 10px;
  scrollbar-color: rgba(255, 247, 223, 0.85) rgba(8, 24, 40, 0.36);
  scrollbar-width: thin;
}

.theme-test .test-console h1 {
  font-size: 16px;
  line-height: 1.12;
}

.theme-test .test-console .lead,
.theme-test .test-console p {
  font-size: 9.5px;
  line-height: 1.34;
}

.quiz-progress {
  margin: 6px 0 8px;
}

.quiz-card {
  gap: 6px;
}

.quiz-card.is-changing {
  animation: quizPop 260ms steps(4);
}

@keyframes quizPop {
  0% { transform: translateY(8px); opacity: 0.3; }
  100% { transform: translateY(0); opacity: 1; }
}

.quiz-card label {
  font-size: 12px;
  line-height: 1.18;
}

.quiz-card textarea {
  min-height: 78px;
  max-height: 86px;
  resize: none;
}

.quiz-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.console-controls {
  display: none;
}

.share-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 7, 17, 0.72);
  backdrop-filter: blur(8px);
}

.share-modal[hidden] {
  display: none;
}

.share-modal__panel {
  width: min(100%, 350px);
  border: 3px solid #0a0a12;
  border-radius: 12px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 247, 223, 0.94), rgba(255, 221, 139, 0.92)),
    repeating-linear-gradient(0deg, transparent 0 12px, rgba(47, 51, 64, 0.05) 12px 14px);
  color: #17151f;
  box-shadow: 8px 8px 0 rgba(10, 10, 18, 0.45);
}

.share-modal__panel .chapter-kicker {
  color: #2f8d86;
}

.share-modal__panel h2 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.25;
}

.share-modal__panel p {
  font-size: 14px;
  line-height: 1.6;
}

.share-modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.share-modal__actions .quiz-button {
  color: #17151f;
}

.share-modal__actions .quiz-button--ghost {
  background: rgba(23, 21, 31, 0.08);
  color: #17151f;
}

.regret-exit {
  display: block;
  width: min(100%, 290px);
  margin: 14px auto 0;
  filter: drop-shadow(5px 8px 0 rgba(10, 10, 18, 0.24));
}

.regret-exit[hidden] {
  display: none;
}

@keyframes buttonHint {
  50% {
    transform: translateY(-3px);
    filter: brightness(1.08);
  }
}

@keyframes padPulse {
  50% {
    box-shadow:
      0 0 0 3px rgba(255, 247, 223, 0.34),
      0 0 18px rgba(255, 247, 223, 0.46);
  }
}

@keyframes arrowNudge {
  50% {
    transform: translateX(4px);
  }
}

.console-pad--back::after {
  animation-name: arrowNudgeBack;
}

@keyframes arrowNudgeBack {
  50% {
    transform: translateX(-4px);
  }
}

@media (max-width: 380px) {
  .console-controls {
    top: 360px;
    transform: scale(0.92);
    transform-origin: top center;
  }

  .theme-test .test-console {
    width: min(72%, 272px);
    height: 270px;
  }

  .quiz-card textarea {
    min-height: 92px;
  }
}
