:root {
  color-scheme: dark;
  --gold: #d8a94b;
  --gold-soft: #f1cf82;
  --ink: #050505;
  --panel: rgba(13, 13, 13, 0.88);
  --muted: #9b9b9b;
  --line: rgba(255, 255, 255, 0.14);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--ink);
}

body {
  min-height: 100svh;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 50% 28%, rgba(216, 169, 75, 0.08), transparent 32%),
    linear-gradient(180deg, #0a0a0a 0%, #020202 100%);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

.deck {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100svh;
}

.topbar {
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 64px;
  padding: 0 max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  justify-self: start;
  color: #fff;
  font-family: "Songti SC", "STSong", serif;
  font-size: 16px;
  letter-spacing: 0.18em;
  text-decoration: none;
}

.brand-mark {
  color: var(--gold);
}

.topbar-copy {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: center;
  min-width: 0;
  letter-spacing: 0.04em;
}

.topbar-copy strong {
  overflow: hidden;
  font-family: "Songti SC", "STSong", serif;
  font-size: 16px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-copy span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  justify-self: end;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: rgba(216, 169, 75, 0.62);
  background: rgba(216, 169, 75, 0.1);
  outline: none;
}

.icon-button:active {
  transform: scale(0.96);
}

.icon-button svg,
.nav-arrow svg,
.play-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.stage-shell {
  display: grid;
  min-height: 0;
  padding: 24px clamp(18px, 5vw, 88px);
  place-items: center;
}

.stage {
  position: relative;
  width: min(100%, calc((100svh - 178px) * 16 / 9));
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: #000;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.66), 0 0 0 1px rgba(216, 169, 75, 0.05);
  outline: none;
  touch-action: pan-y;
  user-select: none;
}

.stage:focus-visible {
  border-color: rgba(216, 169, 75, 0.72);
}

.slide-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  opacity: 1;
  transition: opacity 170ms ease, transform 360ms cubic-bezier(0.2, 0.72, 0.25, 1);
}

.slide-image.is-changing {
  opacity: 0.25;
  transform: scale(0.992);
}

.edge-hint {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 11%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}

.edge-hint-left {
  left: 0;
  background: linear-gradient(90deg, rgba(216, 169, 75, 0.12), transparent);
}

.edge-hint-right {
  right: 0;
  background: linear-gradient(-90deg, rgba(216, 169, 75, 0.12), transparent);
}

.nav-arrow {
  position: absolute;
  top: 50%;
  display: grid;
  width: 48px;
  height: 70px;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  cursor: pointer;
  place-items: center;
  transform: translateY(-50%);
  transition: opacity 180ms ease, background 180ms ease;
}

.stage:hover .nav-arrow,
.nav-arrow:focus-visible {
  opacity: 1;
}

.nav-arrow:hover,
.nav-arrow:focus-visible {
  color: var(--gold-soft);
  background: rgba(0, 0, 0, 0.75);
  outline: none;
}

.nav-arrow.prev {
  left: 0;
  border-radius: 0 8px 8px 0;
}

.nav-arrow.next {
  right: 0;
  border-radius: 8px 0 0 8px;
}

.controls {
  z-index: 5;
  padding: 0 max(18px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
}

.progress-track {
  height: 2px;
  margin: 0 -18px 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #99702e, var(--gold-soft));
  transform-origin: left center;
}

.control-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.play-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-width: 88px;
  padding: 8px 14px;
  border: 1px solid rgba(216, 169, 75, 0.44);
  border-radius: 999px;
  background: rgba(216, 169, 75, 0.08);
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}

.play-button:hover,
.play-button:focus-visible {
  border-color: var(--gold);
  background: rgba(216, 169, 75, 0.16);
  outline: none;
}

.play-button .play-icon {
  display: none;
}

.play-button.is-paused .pause-icon {
  display: none;
}

.play-button.is-paused .play-icon {
  display: block;
}

.play-button span {
  font-size: 13px;
}

.counter {
  display: flex;
  gap: 7px;
  align-items: baseline;
  min-width: 58px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.counter strong {
  color: var(--gold-soft);
  font-size: 18px;
}

.counter span {
  font-size: 12px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(14, minmax(12px, 1fr));
  gap: clamp(4px, 0.55vw, 9px);
  min-width: 0;
}

.timeline button {
  position: relative;
  height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.timeline button::before {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.22);
  content: "";
  transform: translateY(-50%);
  transition: height 160ms ease, background 160ms ease;
}

.timeline button:hover::before,
.timeline button:focus-visible::before {
  height: 4px;
  background: rgba(241, 207, 130, 0.64);
}

.timeline button:focus-visible {
  outline: 1px solid var(--gold-soft);
  outline-offset: 2px;
}

.timeline button.is-current::before {
  height: 4px;
  background: var(--gold-soft);
}

.timeline button.is-viewed::before {
  background: rgba(216, 169, 75, 0.56);
}

.shortcut-hint {
  color: #777;
  font-size: 11px;
  white-space: nowrap;
}

kbd {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  margin-left: 3px;
  padding: 0 4px;
  border: 1px solid #3a3a3a;
  border-bottom-width: 2px;
  border-radius: 4px;
  color: #aaa;
  font: 10px/1 system-ui, sans-serif;
  place-items: center;
}

.deck:fullscreen {
  background: #000;
}

.deck:fullscreen .topbar {
  min-height: 54px;
}

.deck:fullscreen .stage-shell {
  padding: 10px 24px;
}

.deck:fullscreen .stage {
  width: min(100%, calc((100svh - 126px) * 16 / 9));
}

@media (max-width: 900px) {
  .topbar-copy span,
  .shortcut-hint {
    display: none;
  }

  .control-row {
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 12px;
  }
}

@media (max-width: 620px) {
  .topbar {
    grid-template-columns: 1fr auto;
    min-height: 54px;
  }

  .brand {
    font-size: 14px;
  }

  .topbar-copy {
    display: none;
  }

  .stage-shell {
    padding: 12px 0;
  }

  .stage {
    width: 100%;
    border-right: 0;
    border-left: 0;
  }

  .nav-arrow {
    display: none;
  }

  .controls {
    padding-right: 14px;
    padding-left: 14px;
  }

  .progress-track {
    margin-right: -14px;
    margin-left: -14px;
  }

  .control-row {
    grid-template-columns: auto auto;
  }

  .timeline {
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 4px;
  }

  .play-button {
    min-width: 80px;
  }

  .counter {
    justify-self: end;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
