:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1e222b;
  --border: #2a2f3a;
  --text: #e8eaed;
  --text-dim: #9aa2b1;
  --accent: #4cc2ff;
  --accent-dim: #1f6f96;
  --radius: 14px;
  --gap: 20px;
  --maxw: 1120px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.3; margin: 0; }

/* ---------- 开始界面 ---------- */

.landing {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px 24px;
  text-align: center;
  overflow: hidden;
  transition: opacity .24s ease, transform .24s ease;
}
.landing.is-hidden { opacity: 0; transform: scale(.985); pointer-events: none; }
.landing[hidden] { display: none; }

.bg { position: absolute; inset: 0; z-index: 0; }
.bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: bg-breathe 20s ease-in-out infinite alternate;
}
@keyframes bg-breathe {
  from { transform: scale(1); }
  to { transform: scale(1.045); }
}

.bg-clouds {
  position: absolute;
  inset: -12% -35%;
  background:
    radial-gradient(460px 140px at 16% 10%, rgba(226,233,243,.17), transparent 70%),
    radial-gradient(560px 160px at 52% 4%, rgba(226,233,243,.13), transparent 70%),
    radial-gradient(400px 130px at 84% 14%, rgba(226,233,243,.16), transparent 70%);
  animation: clouds-drift 80s ease-in-out infinite alternate;
}
@keyframes clouds-drift {
  from { transform: translateX(-4.5%); }
  to { transform: translateX(4.5%); }
}

/* ---------- 公主层（分层合成，独立呼吸/摇曳/发丝） ---------- */

.princess-halo {
  position: absolute;
  left: 50%;
  bottom: 2%;
  width: 60vmin;
  height: 60vmin;
  transform: translateX(6%);
  background: radial-gradient(closest-side,
    rgba(232,190,150,.16), rgba(180,160,150,.07) 45%, transparent 72%);
  filter: blur(4px);
  animation: halo-breathe 9s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes halo-breathe {
  from { opacity: .75; }
  to { opacity: 1; }
}

.princess-stage {
  position: absolute;
  left: 56%;
  bottom: 3%;
  height: 82vmin;
  aspect-ratio: 787 / 1401;
  pointer-events: none;
  animation: princess-sway 7.5s ease-in-out infinite alternate;
  transform-origin: 50% 100%;
}
@keyframes princess-sway {
  from { transform: rotate(-.55deg) scale(1); }
  to { transform: rotate(.5deg) scale(1.014); }
}

.princess {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter:
    drop-shadow(0 0 22px rgba(240,205,160,.14))
    drop-shadow(0 26px 30px rgba(4,6,10,.5));
}

.princess-shadow {
  position: absolute;
  left: 50%;
  bottom: -2.2%;
  width: 86%;
  height: 7%;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(4,6,10,.55), transparent 78%);
  filter: blur(6px);
}

.bg-hair {
  position: absolute;
  inset: -18% -30%;
  width: 160%;
  height: 136%;
  pointer-events: none;
}

.bg-weather {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.bg-vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(8,10,14,.46) 0%, rgba(8,10,14,.08) 28%,
    rgba(8,10,14,0) 52%, rgba(8,10,14,.36) 80%, rgba(8,10,14,.62) 100%);
}

.landing-inner { position: relative; z-index: 2; max-width: 900px; width: 100%; }

.landing-eyebrow {
  margin: 0 0 16px;
  font-size: 14px;
  letter-spacing: 6px;
  font-style: italic;
  color: rgba(233,237,245,.88);
  text-shadow: 0 1px 10px rgba(4,6,10,.7);
  animation: soft-in 1.2s .25s both;
}

.landing-title {
  margin: 0 0 14px;
  font-size: clamp(54px, 12vw, 108px);
  font-weight: 800;
  letter-spacing: 14px;
  text-indent: 14px;
  background: linear-gradient(100deg,
    #5d6879 0%, #a9b5c7 12%, #f0f4fb 22%, #98a4b8 34%,
    #4f5a6d 48%, #ccd6e5 62%, #f4f7fc 70%, #8792a6 82%, #4b5565 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 2px rgba(4,7,11,.65)) drop-shadow(0 12px 26px rgba(4,7,11,.5));
  animation:
    title-in 1.9s cubic-bezier(.2,.7,.2,1) both,
    metal-sheen 11s ease-in-out 1.9s infinite alternate;
}
@keyframes title-in {
  from {
    opacity: 0;
    letter-spacing: 46px;
    text-indent: 46px;
    filter: blur(16px) drop-shadow(0 3px 2px rgba(4,7,11,.65));
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    letter-spacing: 14px;
    text-indent: 14px;
    filter: blur(0) drop-shadow(0 3px 2px rgba(4,7,11,.65)) drop-shadow(0 12px 26px rgba(4,7,11,.5));
    transform: translateY(0);
  }
}
@keyframes metal-sheen {
  from { background-position: 0% 0; }
  to { background-position: 100% 0; }
}

.landing-sub {
  margin: 0 0 52px;
  color: rgba(219,226,236,.78);
  font-size: 16px;
  text-shadow: 0 1px 8px rgba(4,6,10,.65);
  animation: soft-in 1.2s .5s both;
}
@keyframes soft-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.doors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  perspective: 1100px;
}

.door {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 30px 22px;
  background:
    linear-gradient(165deg, rgba(52,64,82,.85), rgba(17,21,29,.95) 58%),
    linear-gradient(180deg, #1c2230, #0c0f16);
  border: 1px solid rgba(150,190,230,.30);
  border-radius: var(--radius);
  backdrop-filter: blur(5px);
  transform-style: preserve-3d;
  box-shadow:
    0 1.5px 0 rgba(255,255,255,.16) inset,
    0 -16px 30px rgba(0,0,0,.55) inset,
    6px 0 14px rgba(0,0,0,.35) inset,
    -6px 0 14px rgba(0,0,0,.35) inset,
    0 24px 48px rgba(2,4,8,.62),
    0 4px 10px rgba(2,4,8,.5);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  animation: door-in 1.1s .7s cubic-bezier(.2,.7,.2,1) both;
  transition: transform .22s cubic-bezier(.2,.7,.2,1), border-color .22s, box-shadow .22s, background .22s;
}
@keyframes door-in {
  from { opacity: 0; transform: translateY(16px) rotateX(10deg); }
  to { opacity: 1; transform: translateY(0) rotateX(0); }
}
.door:nth-child(2) { animation-delay: .85s; }
.door:nth-child(3) { animation-delay: 1s; }

/* 顶面高光棱线，强化厚度 */
.door::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(220,240,255,.5), transparent);
  pointer-events: none;
}

.door:hover {
  transform: translateY(-9px) rotateX(9deg) scale(1.055);
  border-color: rgba(170,220,255,.85);
  background:
    linear-gradient(165deg, rgba(66,84,108,.9), rgba(21,27,38,.96) 58%),
    linear-gradient(180deg, #232c3c, #10141d);
  box-shadow:
    0 1.5px 0 rgba(255,255,255,.28) inset,
    0 -16px 30px rgba(0,0,0,.5) inset,
    0 0 0 1px rgba(140,200,255,.22) inset,
    0 0 34px rgba(120,190,255,.42),
    0 0 90px rgba(90,160,235,.22),
    0 34px 60px rgba(2,4,8,.68);
}
.door:active {
  transform: translateY(-3px) rotateX(3deg) scale(1.02);
  box-shadow:
    0 1px 0 rgba(255,255,255,.12) inset,
    0 -10px 22px rgba(0,0,0,.6) inset,
    0 10px 22px rgba(2,4,8,.6);
}

.door::after {
  content: "";
  position: absolute;
  top: -14%;
  bottom: -14%;
  width: 55%;
  left: -70%;
  background: linear-gradient(105deg,
    transparent, rgba(160,215,255,.22) 40%,
    rgba(255,255,255,.55) 50%,
    rgba(160,215,255,.22) 60%, transparent);
  transform: skewX(-18deg);
  animation: door-sheen 5.5s ease-in-out infinite;
  pointer-events: none;
}
.door:nth-child(2)::after { animation-delay: 1.8s; }
.door:nth-child(3)::after { animation-delay: 3.6s; }
.door:hover::after { animation: door-sheen-fast 1.2s ease-in-out infinite; }
@keyframes door-sheen {
  0% { left: -70%; }
  22%, 100% { left: 140%; }
}
@keyframes door-sheen-fast {
  0% { left: -70%; }
  100% { left: 140%; }
}

.door-icon { width: 44px; height: 44px; color: var(--accent); transition: color .2s, filter .2s; }
.door:hover .door-icon { color: #bfe3ff; filter: drop-shadow(0 0 10px rgba(140,200,255,.65)); }
.door-title { font-size: 18px; font-weight: 600; letter-spacing: 2px; }
.door-desc { font-size: 13px; color: var(--text-dim); }
.landing-foot {
  margin: 46px 0 0;
  font-size: 13px;
  letter-spacing: 3px;
  color: rgba(214,221,232,.6);
  text-shadow: 0 1px 6px rgba(4,6,10,.6);
  animation: soft-in 1.2s 1.2s both;
}

/* 雨声调节：点击循环 静音 → 小 → 中 → 大 */
.sound-toggle {
  position: absolute;
  right: 22px;
  bottom: 20px;
  z-index: 5;
  height: 40px;
  width: auto;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(14,17,23,.6);
  backdrop-filter: blur(6px);
  color: rgba(226,232,240,.85);
  cursor: pointer;
  transition: color .2s, border-color .2s, box-shadow .2s, transform .2s;
  animation: soft-in 1.2s 1.3s both;
}
.sound-toggle:hover {
  color: #cfe9ff;
  border-color: rgba(150,205,255,.7);
  box-shadow: 0 0 18px rgba(110,180,255,.35);
  transform: translateY(-2px);
}
.sound-toggle.is-on {
  color: #9fd4ff;
  border-color: rgba(150,205,255,.8);
  box-shadow: 0 0 16px rgba(110,180,255,.34);
}
.sound-toggle svg { width: 19px; height: 19px; flex: none; }
.sound-toggle .ic-sound { display: none; }
.sound-toggle.is-on .ic-mute { display: none; }
.sound-toggle.is-on .ic-sound { display: block; }

.vol-bars { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.vol-bars i {
  width: 3px;
  border-radius: 1px;
  background: rgba(228,236,246,.26);
  transition: background .18s, box-shadow .18s;
}
.vol-bars i:nth-child(1) { height: 5px; }
.vol-bars i:nth-child(2) { height: 9px; }
.vol-bars i:nth-child(3) { height: 13px; }
.sound-toggle[data-vol="1"] .vol-bars i:nth-child(-n+1),
.sound-toggle[data-vol="2"] .vol-bars i:nth-child(-n+2),
.sound-toggle[data-vol="3"] .vol-bars i {
  background: #9fd4ff;
  box-shadow: 0 0 6px rgba(120,190,255,.75);
}

/* ---------- 内容视图 ---------- */

.app {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .24s ease, transform .24s ease;
}
.app.is-in { opacity: 1; transform: none; }
.app[hidden] { display: none; }

.view-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(15, 17, 21, .88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px 6px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: color .18s, border-color .18s;
}
.back:hover { color: var(--accent); border-color: var(--accent-dim); }
.back svg { width: 16px; height: 16px; }
.view-name { font-size: 14px; color: var(--text-dim); }
.home-link { margin-left: auto; font-size: 14px; font-weight: 600; letter-spacing: 1px; }
.home-link:hover { color: var(--accent); }

.section { max-width: var(--maxw); margin: 0 auto; padding: 64px 24px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.section h2 { font-size: 24px; font-weight: 600; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: color .18s, border-color .18s;
}
.chip:hover { color: var(--text); }
.chip.is-active { color: #06131b; background: var(--accent); border-color: var(--accent); font-weight: 600; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s, border-color .18s;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent-dim); }

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-placeholder { color: var(--text-dim); font-size: 13px; letter-spacing: 1px; }

.play {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(15, 17, 21, .72);
  border: 1px solid var(--accent);
  display: grid;
  place-items: center;
}
.play::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 4px;
  border-left: 15px solid var(--accent);
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
}

.tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(15, 17, 21, .8);
  border: 1px solid var(--border);
}
.tag-webgl { color: var(--accent); border-color: var(--accent-dim); }

.card-body { padding: 16px 18px 18px; }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.card-desc { margin: 0; font-size: 14px; color: var(--text-dim); }

.tech { margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.tech span {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-dim);
}

.empty { color: var(--text-dim); font-size: 14px; padding: 20px 0; }

.about-lead { font-size: 22px; color: var(--text); margin: 0 0 8px; }
.about p { max-width: 720px; color: var(--text-dim); }
.about-tech { margin-top: 18px; }
.contacts { list-style: none; padding: 0; margin-top: 20px; color: var(--text-dim); font-size: 14px; }
.contacts li { margin-bottom: 6px; }
.contacts a { color: var(--accent); }

.footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}

/* ---------- 灯箱 ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(6, 8, 11, .92);
  display: grid;
  place-items: center;
  padding: 24px;
}
.overlay[hidden] { display: none; }

.overlay-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.overlay-close:hover { border-color: var(--accent); }

.overlay-body { width: 100%; max-width: 960px; }
.overlay-body video { width: 100%; border-radius: var(--radius); display: block; background: #000; }
.overlay-body iframe {
  width: 100%;
  height: min(78vh, 620px);
  border: 0;
  border-radius: var(--radius);
  background: #000;
  display: block;
}

/* ---------- 响应式 ---------- */

@media (max-width: 760px) {
  .doors { grid-template-columns: 1fr; }
  .landing-sub { margin-bottom: 32px; }
  .princess-stage { height: 64vmin; left: 58%; opacity: .92; }
  .princess-halo { width: 52vmin; height: 52vmin; }
}

@media (max-width: 640px) {
  .section { padding: 44px 20px; }
  .section-head { align-items: flex-start; }
  .view-bar { padding: 10px 16px; }
  .landing-title { letter-spacing: 8px; text-indent: 8px; }
}
