:root {
  color-scheme: dark;
  --bg: #0f1114;
  --bg-elevated: #171a1f;
  --card: #1c2028;
  --card-hover: #232933;
  --line: #2e3540;
  --text: #f2ebe3;
  --muted: #9a948c;
  --accent: #e8a85c;
  --accent-soft: #e8a85c22;
  --radius: 16px;
  --tap: min(48px, 12vw);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(1200px 600px at 10% -10%, #2a1f14 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #1a2433 0%, transparent 50%), var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

button,
a.button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  border: 0;
  border-radius: 999px;
  min-height: var(--tap);
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button:focus-visible,
a:focus-visible,
.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: inherit;
}

.brand strong {
  font-size: clamp(22px, 4vw, 28px);
  letter-spacing: 0.12em;
}

.brand span {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.header-note {
  font-size: 13px;
  color: var(--muted);
  text-align: right;
  max-width: 18em;
}

.intro {
  padding: 28px clamp(16px, 4vw, 40px) 8px;
  max-width: 52rem;
}

.intro h1 {
  margin: 0 0 10px;
  font-size: clamp(26px, 5vw, 36px);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.intro p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(15px, 2.5vw, 17px);
}

.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: clamp(14px, 2.5vw, 22px);
  padding: 24px clamp(16px, 4vw, 40px) 48px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.card:hover,
.card:focus-visible {
  background: var(--card-hover);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  transform: translateY(-2px);
}

.thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

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

.thumb-wrap .duration {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: #000a;
  color: #fff;
}

.card-body {
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-body h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.card-body p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.tags span {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

.site-footer {
  padding: 24px clamp(16px, 4vw, 40px) 40px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
}

/* Player */
body.player-page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.player-chrome {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px clamp(16px, 4vw, 32px);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--line);
}

.player-chrome h1 {
  margin: 0;
  font-size: clamp(17px, 3vw, 22px);
  flex: 1 1 12rem;
}

.player-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-primary {
  background: var(--accent);
  color: #1a1208;
  font-weight: 600;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.player-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  min-height: 0;
}

.player-stage iframe {
  width: 100%;
  height: 100%;
  min-height: min(70dvh, 720px);
  border: 0;
}

.player-meta {
  padding: 16px clamp(16px, 4vw, 32px) 28px;
  color: var(--muted);
  font-size: 15px;
}

.player-meta p {
  margin: 0 0 8px;
  max-width: 48rem;
}

.error-box {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}

.error-box a.button {
  margin-top: 16px;
}

@media (max-width: 600px) {
  .header-note {
    display: none;
  }

  .player-stage iframe {
    min-height: 56dvh;
  }
}
