:root {
  color-scheme: dark;
  --bg: #07090d;
  --surface: #0c1016;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f5f7fa;
  --muted: #8e98a8;
  --accent: #5ea4ff;
  --accent-strong: #2c83f7;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
}

body {
  color: var(--text);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.demo-page {
  width: min(100%, 1600px);
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(22px, 3vw, 44px) clamp(18px, 4vw, 64px) 24px;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

.demo-page::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% -10%, rgba(58, 117, 207, 0.15), transparent 42%),
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: auto, 100% 72px;
  mask-image: linear-gradient(to bottom, black, transparent 90%);
}

.page-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-bottom: clamp(20px, 3vh, 34px);
  animation: enter-down 620ms cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(43, 113, 215, 0.24);
}

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

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.18em;
}

h1 {
  margin: 0;
  font-size: clamp(19px, 2vw, 25px);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.demo-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b7c0cd;
  font-size: 12px;
}

.demo-status span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #66db9d;
  box-shadow: 0 0 12px rgba(102, 219, 157, 0.7);
  animation: status-pulse 2.4s ease-in-out infinite;
}

.player-shell {
  width: 100%;
  margin: auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: clamp(16px, 2vw, 24px);
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  animation: player-enter 760ms 80ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.video-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100svh - 250px);
  min-height: 200px;
  display: grid;
  place-items: center;
  background: #000;
  overflow: hidden;
  cursor: pointer;
}

video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

.center-play {
  position: absolute;
  inset: 50% auto auto 50%;
  width: clamp(62px, 7vw, 84px);
  height: clamp(62px, 7vw, 84px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  background: rgba(11, 15, 21, 0.64);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  transition: transform 180ms ease, opacity 220ms ease, background 180ms ease;
}

.center-play:hover {
  transform: translate(-50%, -50%) scale(1.07);
  background: rgba(25, 64, 113, 0.78);
}

.center-play:active {
  transform: translate(-50%, -50%) scale(0.97);
}

.center-play svg {
  width: 34%;
  margin-left: 5%;
  fill: white;
}

.player-shell.is-playing .center-play {
  opacity: 0;
  pointer-events: none;
}

.video-message {
  position: absolute;
  inset: auto 24px 24px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(30, 10, 12, 0.88);
  color: #ffdadd;
  font-size: 13px;
  text-align: center;
}

.timeline-wrap {
  height: 21px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  background: #0b0f15;
}

.timeline,
.volume {
  --progress: 0%;
  height: 4px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  background: linear-gradient(to right, var(--accent) 0 var(--progress), rgba(255, 255, 255, 0.18) var(--progress) 100%);
  cursor: pointer;
}

.timeline {
  width: 100%;
}

.timeline::-webkit-slider-thumb,
.volume::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--accent-strong);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 160ms ease, transform 160ms ease;
}

.timeline:hover::-webkit-slider-thumb,
.timeline:focus-visible::-webkit-slider-thumb,
.volume:hover::-webkit-slider-thumb,
.volume:focus-visible::-webkit-slider-thumb {
  opacity: 1;
  transform: scale(1);
}

.timeline::-moz-range-thumb,
.volume::-moz-range-thumb {
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent-strong);
}

.controls {
  min-height: 62px;
  padding: 8px 16px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: #0b0f15;
}

.control-group,
.volume-control {
  display: flex;
  align-items: center;
}

.control-group {
  gap: 12px;
}

.volume-control {
  gap: 2px;
}

.icon-button,
.text-button {
  height: 40px;
  border: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.icon-button {
  width: 40px;
}

.text-button {
  gap: 7px;
  padding: 0 11px;
  color: #cbd2dc;
  font-size: 13px;
}

.icon-button:hover,
.text-button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.icon-button:active,
.text-button:active {
  transform: scale(0.94);
}

.icon-button:focus-visible,
.text-button:focus-visible,
.timeline:focus-visible,
.volume:focus-visible,
.center-play:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon-button svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.text-button svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.icon-pause,
.icon-muted {
  display: none;
}

.player-shell.is-playing .icon-play,
.player-shell.is-muted .icon-volume {
  display: none;
}

.player-shell.is-playing .icon-pause,
.player-shell.is-muted .icon-muted {
  display: block;
}

.time-display {
  min-width: 98px;
  color: #949eac;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.volume {
  --progress: 100%;
  width: 76px;
}

.page-footer {
  margin-top: clamp(18px, 2.4vh, 28px);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #66717f;
  font-size: 11px;
  letter-spacing: 0.06em;
  animation: enter-up 620ms 260ms ease both;
}

/* Fullscreen uses a real two-row layout so the control background cannot
   expand into the large empty block shown by some browser implementations. */
.player-shell:fullscreen,
.player-shell:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  color: #17202c;
  background: #fff;
  box-shadow: none;
}

.player-shell:fullscreen .video-stage,
.player-shell:-webkit-full-screen .video-stage {
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  flex: 1 1 auto;
  aspect-ratio: auto;
  background: #fff;
}

.player-shell:fullscreen video,
.player-shell:-webkit-full-screen video {
  background: #fff;
}

.player-shell:fullscreen .timeline-wrap,
.player-shell:-webkit-full-screen .timeline-wrap {
  height: 12px;
  min-height: 12px;
  padding-inline: 16px;
  flex: 0 0 12px;
  background: #fff;
}

.player-shell:fullscreen .controls,
.player-shell:-webkit-full-screen .controls {
  min-height: 54px;
  padding: 3px 16px 7px;
  flex: 0 0 54px;
  background: #fff;
  box-shadow: 0 -1px 0 rgba(20, 31, 45, 0.08);
}

.player-shell:fullscreen .icon-button,
.player-shell:fullscreen .text-button,
.player-shell:-webkit-full-screen .icon-button,
.player-shell:-webkit-full-screen .text-button {
  height: 38px;
}

.player-shell:fullscreen .icon-button,
.player-shell:fullscreen .text-button,
.player-shell:-webkit-full-screen .icon-button,
.player-shell:-webkit-full-screen .text-button {
  color: #253142;
}

.player-shell:fullscreen .icon-button:hover,
.player-shell:fullscreen .text-button:hover,
.player-shell:-webkit-full-screen .icon-button:hover,
.player-shell:-webkit-full-screen .text-button:hover {
  color: #0d1520;
  background: rgba(23, 32, 44, 0.07);
}

.player-shell:fullscreen .time-display,
.player-shell:-webkit-full-screen .time-display {
  color: #5c6878;
}

.player-shell:fullscreen .timeline,
.player-shell:fullscreen .volume,
.player-shell:-webkit-full-screen .timeline,
.player-shell:-webkit-full-screen .volume {
  background: linear-gradient(
    to right,
    var(--accent) 0 var(--progress),
    rgba(23, 32, 44, 0.18) var(--progress) 100%
  );
}

.footer-tip {
  letter-spacing: 0;
}

@keyframes player-enter {
  from { opacity: 0; transform: translateY(22px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes enter-down {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes enter-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes status-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.88); }
  50% { opacity: 1; transform: scale(1); }
}

@media (max-width: 680px) {
  .demo-page {
    min-height: 100svh;
    padding: 18px 12px 16px;
  }

  .page-header {
    gap: 11px;
    margin-inline: 4px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .demo-status {
    font-size: 11px;
  }

  .player-shell {
    margin: 52px 0 auto;
    border-radius: 14px;
  }

  .video-stage {
    max-height: none;
    min-height: 0;
  }

  .timeline-wrap {
    padding-inline: 12px;
  }

  .controls {
    min-height: 58px;
    padding: 6px 8px 10px;
    gap: 4px;
  }

  .control-group {
    gap: 3px;
  }

  .volume {
    display: none;
  }

  .text-button {
    padding-inline: 8px;
  }

  .time-display {
    min-width: 91px;
    font-size: 11px;
  }

  .page-footer {
    margin-inline: 4px;
  }

  .footer-tip {
    display: none;
  }
}

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