:root {
  --paper: #f7f2e8;
  --paper-cool: #e9efe7;
  --ink: #243128;
  --ink-soft: rgba(36, 49, 40, 0.68);
  --ink-dim: rgba(36, 49, 40, 0.42);
  --line: rgba(73, 89, 74, 0.11);
  --line-strong: rgba(73, 89, 74, 0.2);
  --sage: #6b8660;
  --gold: #ba9465;
  --cream: #fffdf9;
  --panel: rgba(255, 252, 246, 0.74);
  --radius-xl: 42px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 46px rgba(98, 106, 96, 0.1);
  --shadow-stage: 0 34px 110px rgba(91, 104, 92, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: "Manrope", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 16% 14%, rgba(155, 176, 136, 0.2), transparent 23%),
    radial-gradient(circle at 84% 12%, rgba(219, 194, 150, 0.22), transparent 24%),
    radial-gradient(circle at 52% 108%, rgba(172, 191, 160, 0.18), transparent 36%),
    linear-gradient(135deg, var(--paper) 0%, #fbf8f1 44%, var(--paper-cool) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background:
    linear-gradient(90deg, rgba(36, 49, 40, 0.02) 0, rgba(36, 49, 40, 0.02) 1px, transparent 1px, transparent 100%),
    linear-gradient(180deg, rgba(36, 49, 40, 0.014) 0, rgba(36, 49, 40, 0.014) 1px, transparent 1px, transparent 100%);
  background-size: 132px 132px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.52), transparent 80%);
}

.poster {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  width: min(100%, 1500px);
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  padding: 22px clamp(18px, 3vw, 40px) 16px;
}

.viewer-stage {
  min-height: 0;
}

.viewer-frame {
  position: relative;
  height: 100%;
  min-height: 588px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(73, 89, 74, 0.12);
  background:
    radial-gradient(circle at 50% 44%, rgba(250, 250, 244, 0.96), rgba(244, 239, 229, 0.88) 46%, rgba(232, 238, 228, 0.94) 100%),
    linear-gradient(180deg, #fffdf8, #f2ecdf);
  box-shadow: var(--shadow-stage);
}

.viewer-frame::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: calc(var(--radius-xl) - 12px);
  border: 1px solid rgba(73, 89, 74, 0.08);
  pointer-events: none;
  z-index: 4;
}

.stage-rings,
.stage-grid,
.stage-glow,
.image-shadow,
.image-frame,
.vignette {
  position: absolute;
  inset: 0;
}

.stage-rings {
  background:
    radial-gradient(circle at center, transparent 0 20%, rgba(118, 140, 106, 0.08) 20.2% 20.7%, transparent 20.9% 34%, rgba(118, 140, 106, 0.05) 34.2% 34.6%, transparent 34.8% 48%, rgba(186, 148, 101, 0.06) 48.2% 48.6%, transparent 48.8%),
    radial-gradient(circle at center, rgba(255, 255, 255, 0.48), transparent 60%);
}

.stage-grid {
  inset: 10%;
  border-radius: calc(var(--radius-xl) - 12px);
  background:
    linear-gradient(90deg, rgba(73, 89, 74, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(73, 89, 74, 0.04) 1px, transparent 1px);
  background-size: 84px 84px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.72), transparent 84%);
  opacity: 0.26;
}

.stage-glow {
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.18) 42%, transparent 62%);
}

.image-shadow {
  inset: auto 18% 9% 18%;
  height: 15%;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(87, 97, 86, 0.2), rgba(87, 97, 86, 0.04) 58%, transparent 72%);
  filter: blur(20px);
  transform: scaleX(0.86);
}

.image-frame {
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-layer {
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  height: clamp(84%, 91%, 96%);
  max-width: none;
  transform: translate(-50%, -50%) rotate(90deg) scale(1.18);
  transform-origin: center;
  filter:
    drop-shadow(0 32px 30px rgba(80, 92, 79, 0.16))
    drop-shadow(0 10px 12px rgba(80, 92, 79, 0.08))
    saturate(1.02)
    contrast(1.02);
  pointer-events: none;
  user-select: none;
}

.vignette {
  pointer-events: none;
  background:
    radial-gradient(circle at center, transparent 56%, rgba(228, 233, 224, 0.14) 78%, rgba(224, 229, 219, 0.34) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 22%, transparent 78%, rgba(232, 235, 229, 0.22));
}

.timeline-dock {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.34)),
    var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
  padding: 7px 8px 6px;
}

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

.controls-center {
  min-width: 0;
}

.progress-bar {
  cursor: pointer;
  touch-action: none;
  padding: 3px 0;
}

.progress-track {
  position: relative;
  height: 1.5px;
  border-radius: var(--radius-pill);
  background: rgba(73, 89, 74, 0.11);
}

.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sage), var(--gold));
  box-shadow: 0 0 14px rgba(136, 156, 117, 0.18);
}

.progress-thumb {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 36%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.34)),
    var(--cream);
  border: 1px solid rgba(73, 89, 74, 0.16);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.62),
    0 5px 8px rgba(90, 98, 89, 0.1);
  transform: translate(-50%, -50%);
  transition: transform 0.18s ease;
}

.progress-bar:hover .progress-thumb {
  transform: translate(-50%, -50%) scale(1.04);
}

.btn-play,
.btn-speed,
.tick {
  appearance: none;
  border: 0;
  font: inherit;
}

.btn-play {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: #162018;
  background: linear-gradient(135deg, #efe0c2, #93a57f);
  box-shadow: 0 6px 14px rgba(90, 98, 89, 0.1);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn-play:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(90, 98, 89, 0.14);
}

.play-icon {
  fill: currentColor;
}

.btn-speed,
.tick-time {
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.btn-speed {
  min-width: 38px;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink-soft);
  font-size: 0.56rem;
  font-weight: 600;
  transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.btn-speed:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  color: var(--ink);
}

.timeline-ticks {
  display: grid;
  grid-template-columns: repeat(var(--tick-count, 1), minmax(0, 1fr));
  gap: 4px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(73, 89, 74, 0.06);
}

.tick {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 3px 0 1px;
  background: transparent;
  color: var(--ink-dim);
  cursor: pointer;
  transition: color 0.18s ease;
}

.tick:hover {
  color: var(--ink-soft);
}

.tick.active {
  color: var(--ink);
}

.tick::before {
  content: "";
  width: 100%;
  height: 1px;
  margin-bottom: 1px;
  background: rgba(73, 89, 74, 0.06);
  transition: background 0.2s ease, transform 0.2s ease;
}

.tick.active::before {
  background: linear-gradient(90deg, transparent, rgba(186, 148, 101, 0.64), transparent);
  transform: scaleX(1.04);
}

.tick-icon {
  font-size: 0.68rem;
  line-height: 1;
}

.tick-time {
  font-size: 0.48rem;
  color: inherit;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .poster {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .viewer-frame {
    min-height: 460px;
  }

  .image-layer {
    height: clamp(76%, 84%, 90%);
  }
}

@media (max-width: 640px) {
  .poster {
    gap: 8px;
    padding: 14px 12px 12px;
  }

  .viewer-frame {
    min-height: 380px;
  }

  .image-layer {
    height: clamp(68%, 76%, 82%);
    transform: translate(-50%, -49%) rotate(90deg) scale(1.12);
  }

  .btn-play {
    width: 28px;
    height: 28px;
  }

  .btn-speed {
    min-width: 34px;
    height: 22px;
    font-size: 0.52rem;
  }

  .timeline-ticks {
    gap: 4px;
  }
}
