:root {
  color-scheme: dark;
  --bg: #0b1220;
  --panel: rgba(10, 17, 31, 0.78);
  --panel-border: rgba(160, 174, 192, 0.18);
  --text: #eef2ff;
  --muted: #b8c2d8;
  --accent: #f97316;
  --accent-soft: rgba(249, 115, 22, 0.18);
  --track: rgba(255, 255, 255, 0.14);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(249, 115, 22, 0.22), transparent 32%),
    linear-gradient(160deg, #08101d 0%, #111d35 52%, #09111e 100%);
}

.page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.player-shell {
  width: min(100%, 960px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.player-header {
  padding: 24px 24px 12px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.player-header h1 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 2rem);
  font-weight: 700;
  word-break: break-all;
}

.video-frame {
  padding: 0 16px;
}

.video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 18px;
}

.controls {
  padding: 18px 16px 20px;
}

.timeline-group {
  margin-bottom: 18px;
}

.seek {
  width: 100%;
  appearance: none;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 0%, var(--track) 0%, var(--track) 100%);
  outline: none;
}

.seek::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 0;
  background: #fff;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.seek::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.time-row {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
}

button,
select {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
}

button {
  min-height: 44px;
  padding: 0 16px;
  cursor: pointer;
}

button:hover,
button:focus-visible,
select:hover,
select:focus-visible {
  border-color: rgba(249, 115, 22, 0.45);
  background: rgba(249, 115, 22, 0.12);
}

.speed-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 152px;
  padding: 0 12px 0 14px;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  flex: 0 0 auto;
}

.speed-control span {
  color: var(--muted);
  white-space: nowrap;
}

.speed-control select {
  appearance: none;
  min-width: 72px;
  min-height: 36px;
  padding: 0 30px 0 10px;
  border: 0;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23eef2ff' d='M1.41.59 6 5.17 10.59.59 12 2l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px 8px;
  box-shadow: none;
}

@media (max-width: 640px) {
  .page {
    padding: 12px;
  }

  .player-shell {
    border-radius: 18px;
  }

  .player-header {
    padding: 18px 18px 10px;
  }

  .video-frame,
  .controls {
    padding-left: 12px;
    padding-right: 12px;
  }

  .button-row > * {
    flex: 1 1 calc(50% - 12px);
    justify-content: center;
  }

  .speed-control {
    min-width: 0;
    justify-content: center;
  }

  .speed-control select {
    min-width: 64px;
  }
}

@media (max-height: 540px) and (orientation: landscape) {
  .page {
    padding: 8px;
    place-items: stretch;
  }

  .player-shell {
    width: 100%;
    height: calc(100dvh - 16px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    grid-template-rows: auto minmax(0, 1fr);
    column-gap: 14px;
    grid-template-areas:
      "video header"
      "video controls";
    border-radius: 16px;
  }

  .player-header {
    grid-area: header;
    padding: 12px 12px 8px 8px;
    align-self: end;
  }

  .eyebrow {
    margin-bottom: 6px;
    font-size: 0.7rem;
  }

  .player-header h1 {
    font-size: 1.1rem;
    line-height: 1.2;
  }

  .video-frame {
    grid-area: video;
    padding: 8px;
    min-width: 0;
    min-height: 0;
    display: flex;
  }

  .video {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: contain;
    border-radius: 14px;
  }

  .controls {
    grid-area: controls;
    padding: 8px 12px 12px 8px;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .timeline-group {
    margin-bottom: 0;
  }

  .seek {
    height: 6px;
  }

  .time-row {
    margin-top: 8px;
    font-size: 0.82rem;
  }

  .button-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .button-row > * {
    width: 100%;
  }

  button {
    min-height: 38px;
    padding: 0 12px;
  }

  .speed-control {
    min-width: 0;
    min-height: 38px;
    justify-content: space-between;
  }

  .speed-control select {
    min-width: 62px;
    min-height: 32px;
  }
}
