:root {
  --accent: #ff6b81;
  --bg: #08090d;
  --ink: #f6f7fb;
  --muted: rgba(246, 247, 251, .55);
  --line: rgba(255, 255, 255, .14);
  --glass: rgba(16, 18, 26, .82);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

#app { height: 100%; display: flex; flex-direction: column; }

/* ---------- top bar ---------- */
.topbar {
  flex: 0 0 auto;
  height: 68px;
  padding: 0 clamp(16px, 3vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  background: rgba(8, 9, 13, .9);
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 22px; height: 22px; flex: 0 0 auto;
  border: 2px solid var(--accent);
  border-radius: 6px;
  position: relative;
  transform: rotate(45deg);
}
.brand-mark::after {
  content: ""; position: absolute; inset: 4px;
  background: var(--accent); border-radius: 2px;
}
.brand-text { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.brand-text strong { font-size: 15px; letter-spacing: .04em; white-space: nowrap; }
.chapter {
  font-size: 11px; letter-spacing: .18em; color: var(--muted);
  border-left: 1px solid var(--line); padding-left: 12px; white-space: nowrap;
}
.top-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.ghost-btn {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  padding: 7px 13px; border-radius: 8px; font-size: 12px; letter-spacing: .04em;
  transition: .18s ease;
}
.ghost-btn:hover { color: var(--ink); border-color: var(--accent); background: rgba(255, 255, 255, .05); }

/* ---------- stage ---------- */
.stage {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 18px clamp(14px, 3vw, 40px) 10px;
}
.player {
  position: relative;
  width: min(100%, calc((100vh - 190px) * 16 / 9));
  max-width: 1320px;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .07);
}
.player video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, .28), transparent 22%, transparent 60%, rgba(0, 0, 0, .62));
}
/* ---------- picture + sound sequences ---------- */
.slides-stage {
  position: absolute; inset: 0; background: #05060a; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.slides-stage img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  animation: slideIn .55s ease both;
}
.slides-stage.is-missing img { visibility: hidden; }
.slides-stage.is-missing::after {
  content: "图片加载失败 · 稍后自动继续"; position: absolute; top: 46%; left: 0; right: 0;
  text-align: center; color: var(--muted); font-size: 13px; letter-spacing: .08em;
}
.slide-shade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, .16), transparent 28%, transparent 52%, rgba(0, 0, 0, .74));
}
.slide-caption {
  position: absolute; left: 0; right: 0; bottom: 9%; padding: 0 12%;
  text-align: center; font-size: clamp(14px, 1.35vw, 19px); line-height: 1.8;
  color: rgba(255, 255, 255, .96); text-shadow: 0 2px 14px rgba(0, 0, 0, .95);
}
.slide-counter {
  position: absolute; right: 20px; top: 18px; font-size: 11px; letter-spacing: .18em;
  color: rgba(255, 255, 255, .68); background: rgba(8, 9, 13, .5);
  border: 1px solid rgba(255, 255, 255, .12); padding: 5px 10px; border-radius: 6px;
}
.slide-skip {
  position: absolute; right: 20px; bottom: 18px; z-index: 2;
  border: 1px solid var(--line); background: rgba(16, 18, 26, .72); color: var(--muted);
  padding: 7px 12px; border-radius: 8px; font-size: 12px; backdrop-filter: blur(8px);
}
.slide-skip:hover { color: var(--ink); border-color: var(--accent); }
@keyframes slideIn { from { opacity: 0; transform: scale(1.025); } to { opacity: 1; transform: none; } }

.caption-wrap {
  position: absolute; left: 0; right: 0; bottom: 8%; padding: 0 12%;
  text-align: center; pointer-events: none; transition: opacity .4s ease;
}
.caption {
  margin: 0; display: inline-block; max-width: 780px;
  font-size: clamp(14px, 1.35vw, 19px); line-height: 1.8; letter-spacing: .03em;
  color: rgba(255, 255, 255, .94);
  text-shadow: 0 2px 14px rgba(0, 0, 0, .95);
  animation: fadeUp .7s ease both;
}
.progress-track {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: rgba(255, 255, 255, .12); pointer-events: none;
}
.progress-fill { height: 100%; width: 0; background: var(--accent); transition: width .12s linear; }

.center-status {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  gap: 12px; color: var(--muted); font-size: 13px; letter-spacing: .08em;
}
.spinner {
  width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, .2);
  border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite;
}
.tap-to-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: var(--glass); color: var(--ink); border: 1px solid var(--line);
  padding: 14px 24px; border-radius: 999px; font-size: 14px;
  backdrop-filter: blur(12px);
}
.error-box {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; text-align: center;
  background: rgba(8, 9, 13, .92); padding: 24px;
}
.error-box h3 { margin: 0; font-size: 19px; }
.error-box p { margin: 0; color: var(--muted); font-size: 13px; max-width: 520px; word-break: break-all; }
.error-actions, .end-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; justify-content: center; }
.solid-btn {
  background: var(--accent); color: #fff; border: 0; padding: 12px 24px;
  border-radius: 9px; font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform .16s ease, filter .16s ease;
}
.solid-btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.line-btn {
  background: transparent; color: var(--ink); border: 1px solid var(--line);
  padding: 12px 22px; border-radius: 9px; font-size: 14px; transition: .16s ease;
}
.line-btn:hover { border-color: var(--accent); }

/* ---------- overlays ---------- */
.overlay {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(16px, 4vw, 54px);
  background: radial-gradient(ellipse at center, rgba(8, 9, 13, .72), rgba(8, 9, 13, .94));
  backdrop-filter: blur(9px) saturate(.7);
  animation: overlayIn .45s ease both;
}
.overlay-inner { width: min(760px, 100%); text-align: center; }
.kicker {
  font-size: 11px; letter-spacing: .36em; color: var(--accent); font-weight: 600;
  margin-bottom: 14px; animation: fadeUp .5s .05s ease both;
}
.overlay h2 {
  margin: 0 0 8px; font-size: clamp(26px, 3.3vw, 42px); font-weight: 600; letter-spacing: .04em;
  animation: fadeUp .5s .1s ease both;
}
.overlay-sub { margin: 0 0 30px; color: var(--muted); font-size: 14px; animation: fadeUp .5s .15s ease both; }
.choices { display: grid; gap: 12px; text-align: left; }
.choice-btn {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left;
  padding: 16px 20px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .045); color: var(--ink);
  transition: .2s ease; animation: fadeUp .5s both;
}
.choice-btn:hover, .choice-btn:focus-visible {
  border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, rgba(255, 255, 255, .05));
  transform: translateX(5px); outline: none;
}
.choice-num {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: rgba(255, 255, 255, .09); color: var(--muted);
}
.choice-btn:hover .choice-num { background: var(--accent); color: #fff; }
.choice-body { flex: 1 1 auto; min-width: 0; }
.choice-label { display: block; font-size: clamp(15px, 1.5vw, 18px); font-weight: 600; }
.choice-hint { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.choice-arrow { color: var(--muted); font-size: 20px; transition: .2s ease; }
.choice-btn:hover .choice-arrow { color: var(--accent); transform: translateX(4px); }
.countdown { margin-top: 22px; font-size: 12px; color: var(--muted); letter-spacing: .08em; }

.ending-kicker { color: var(--accent); }
.ending-name { margin: 6px 0 18px; font-size: clamp(20px, 2.4vw, 30px); font-weight: 600; letter-spacing: .08em; }
.ending-text {
  margin: 0 auto; max-width: 600px; font-size: 15px; line-height: 2;
  color: rgba(255, 255, 255, .8);
}
.unlock { margin-top: 20px; font-size: 12px; letter-spacing: .12em; color: var(--muted); }
.unlock b { color: var(--accent); font-weight: 700; }
.end-path { margin-top: 24px; font-size: 11px; color: rgba(255, 255, 255, .38); letter-spacing: .06em; }

.pathbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  min-height: 20px; font-size: 11px; color: rgba(255, 255, 255, .38); letter-spacing: .06em;
}
.pathbar .sep { color: var(--accent); opacity: .7; }
.pathbar .current { color: rgba(255, 255, 255, .78); }
.keyhint { margin: 0; font-size: 11px; color: rgba(255, 255, 255, .26); letter-spacing: .05em; }

/* ---------- intro ---------- */
.intro {
  position: fixed; inset: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 34%, #2b1c40 0%, #14132a 46%, #07080d 100%);
  transition: opacity .7s ease, visibility .7s ease;
}
.intro.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.intro-mask {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 45%, transparent 5%, rgba(5, 6, 11, .78) 78%),
    linear-gradient(180deg, rgba(5, 6, 11, .45), rgba(5, 6, 11, .3) 45%, rgba(5, 6, 11, .9));
}
.intro-content { position: relative; text-align: center; padding: 0 24px; width: min(900px, 100%); }
.intro-kicker {
  font-size: 11px; letter-spacing: .34em; color: rgba(255, 255, 255, .6);
  display: flex; align-items: center; justify-content: center; gap: 14px;
  animation: fadeUp .8s .1s ease both;
}
.intro-kicker i { width: 26px; height: 1px; background: var(--accent); display: inline-block; }
.intro h1 {
  margin: 26px 0 18px;
  font-size: clamp(52px, 9vw, 118px); font-weight: 600; line-height: 1.1;
  letter-spacing: .1em; text-indent: .1em;
  text-shadow: 0 12px 60px rgba(0, 0, 0, .7);
  animation: fadeUp 1s .2s ease both;
}
.intro-sub {
  margin: 0 0 44px; font-size: clamp(14px, 1.7vw, 20px);
  color: rgba(255, 255, 255, .72); letter-spacing: .12em;
  animation: fadeUp 1s .35s ease both;
}
.start-btn {
  display: inline-flex; align-items: center; gap: 20px;
  padding: 17px 32px; border-radius: 999px; border: 0;
  background: var(--accent); color: #fff; font-size: 16px; font-weight: 600; letter-spacing: .1em;
  box-shadow: 0 14px 44px color-mix(in srgb, var(--accent) 40%, transparent);
  transition: transform .2s ease, box-shadow .2s ease;
  animation: fadeUp 1s .5s ease both;
}
.start-btn:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 20px 60px color-mix(in srgb, var(--accent) 55%, transparent); }
.start-btn .arrow { font-size: 20px; }
.resume-btn {
  display: block; margin: 14px auto 0; padding: 8px 20px; border-radius: 999px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .22);
  color: rgba(255, 255, 255, .8); font-size: 12px; letter-spacing: .06em;
  animation: fadeUp 1s .6s ease both; transition: .18s ease;
}
.resume-btn:hover { border-color: var(--accent); color: #fff; background: rgba(255, 107, 129, .12); }
.resume-btn span { color: var(--accent); margin-left: 6px; }
.intro-note {
  margin-top: 26px; font-size: 12px; color: rgba(255, 255, 255, .45); letter-spacing: .1em;
  animation: fadeUp 1s .65s ease both;
}
.intro-footer {
  position: absolute; bottom: 28px; left: 0; right: 0;
  display: flex; justify-content: space-between; padding: 0 clamp(20px, 4vw, 52px);
  font-size: 11px; color: rgba(255, 255, 255, .38); letter-spacing: .08em;
}
.intro-footer a:hover { color: var(--accent); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  .topbar { height: 58px; padding: 0 12px; }
  .brand-text strong { font-size: 13px; }
  .chapter { display: none; }
  .ghost-btn { padding: 6px 9px; font-size: 11px; }
  .top-actions { gap: 5px; }
  .stage { gap: 10px; padding: 12px 10px; }
  .player { width: 100%; border-radius: 8px; }
  .caption-wrap { bottom: 6%; padding: 0 7%; }
  .choice-btn { padding: 13px 14px; gap: 12px; }
  .choice-num { width: 28px; height: 28px; }
  .overlay-sub { margin-bottom: 18px; }
  .keyhint { display: none; }
  .intro-footer { font-size: 10px; }
}
