﻿:root {
  color-scheme: dark;
  --bg: #05070f;
  --panel: rgba(13, 18, 33, 0.78);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text: #f5f7fb;
  --muted: #aab3c5;
  --accent: #50d7ff;
  --accent-2: #8b5cf6;
  --danger: #ff6b7a;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 20%, rgba(80, 215, 255, 0.18), transparent 25rem),
    radial-gradient(circle at 80% 10%, rgba(139, 92, 246, 0.18), transparent 22rem),
    linear-gradient(135deg, #04050a 0%, #0b1020 55%, #05070f 100%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

button,
input { font: inherit; }

.page-shell {
  min-height: 100vh;
  padding: clamp(12px, 2vw, 26px);
  display: grid;
  place-items: center;
}

.player-card {
  width: min(920px, 100%);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 20px 64px rgba(0, 0, 0, 0.42);
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.topbar {
  height: 54px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--panel-border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #05101c;
  font-weight: 900;
}

.ghost-btn {
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
}

.ghost-btn:hover { background: rgba(255, 255, 255, 0.12); }

.player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.video,
.embed-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #000;
}

.video[hidden],
.embed-frame[hidden] {
  display: none;
}

.click-layer {
  position: absolute;
  inset: 0 0 58px 0;
  z-index: 6;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.click-layer[hidden] { display: none; }

.play-hint {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  margin: auto;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.46);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.click-layer:hover .play-hint,
.play-hint.is-visible {
  opacity: 1;
  transform: scale(1);
}

.state {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background:
    linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.65)),
    radial-gradient(circle at 50% 35%, rgba(80, 215, 255, 0.16), transparent 24rem),
    #02040a;
}

.state[hidden] { display: none; }

.state h1 {
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
}

.state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.state-error h1 { color: var(--danger); }

.spinner {
  width: 52px;
  height: 52px;
  justify-self: center;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  animation: spin 0.85s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.url-form {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--panel-border);
}

.url-form input {
  min-width: 0;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.url-form input:focus {
  border-color: rgba(80, 215, 255, 0.75);
  box-shadow: 0 0 0 4px rgba(80, 215, 255, 0.14);
}

.url-form button {
  border: 0;
  border-radius: 14px;
  padding: 0 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #05070f;
  font-weight: 800;
  cursor: pointer;
}

.url-form .history-toggle-btn,
.url-form .clear-btn {
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.url-form button:hover { filter: brightness(1.08); }
.url-form .history-toggle-btn:hover,
.url-form .clear-btn:hover { background: rgba(255, 255, 255, 0.14); }

.url-form .history-toggle-btn.is-active {
  border-color: rgba(80, 215, 255, 0.65);
  background: rgba(80, 215, 255, 0.16);
}

.history-panel {
  padding: 0 14px 14px;
}

.history-title {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  overflow: hidden;
}

.history-item:hover {
  border-color: rgba(80, 215, 255, 0.5);
  background: rgba(80, 215, 255, 0.1);
}

.history-name,
.history-url {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-name {
  font-size: 14px;
  font-weight: 700;
}

.history-url {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

code {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #d8f6ff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .page-shell { padding: 0; }
  .player-card {
    min-height: 100vh;
    border-radius: 0;
    border: 0;
  }
  .topbar { height: 54px; }
  .ghost-btn { display: none; }
  .player-wrap { aspect-ratio: 16 / 10; }
  .url-form { grid-template-columns: 1fr; }
  .url-form button { height: 46px; }
  .click-layer { bottom: 54px; }
}



