:root {
  color-scheme: dark;
  --bg: #15120f;
  --panel: #211a16;
  --panel-strong: #2c211b;
  --line: rgba(255, 255, 255, 0.12);
  --text: #fff7ec;
  --muted: #c5b5a5;
  --red: #c94335;
  --amber: #e7a63c;
  --teal: #3ca89b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(21, 18, 15, 0.72), var(--bg) 48%),
    url("https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/TearsOfSteel.jpg") center top / cover fixed;
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  background: rgba(21, 18, 15, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--red);
  color: white;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

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

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-links a {
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.watch-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(300px, 0.75fr);
  gap: 20px;
  min-height: calc(100vh - 80px);
  align-items: center;
  padding: 28px 0;
}

.player-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050505;
  box-shadow: var(--shadow);
}

video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #050505;
}

.now-playing {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(33, 26, 22, 0.92);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.02;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 34px);
}

.now-playing p {
  color: var(--muted);
  line-height: 1.75;
}

.watch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.primary-action,
.ghost-action,
.tab-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.primary-action {
  padding: 0 18px;
  background: var(--red);
  color: white;
  font-weight: 700;
}

.ghost-action {
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--line);
}

.control-bar {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 18, 15, 0.84);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.search-box span {
  color: var(--muted);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-button {
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.tab-button.active {
  background: var(--teal);
  color: white;
}

.library-section,
.series-section {
  padding: 48px 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

#resultCount {
  color: var(--muted);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.video-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(33, 26, 22, 0.94);
  cursor: pointer;
}

.video-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.video-card div {
  padding: 14px;
}

.video-card h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.video-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.tag-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag-line span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(231, 166, 60, 0.12);
  color: #ffd58a;
  font-size: 12px;
}

.series-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.series-grid article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(33, 26, 22, 0.9);
}

.series-grid span {
  color: var(--teal);
  font-weight: 800;
}

.series-grid h3 {
  margin: 12px 0 8px;
}

.series-grid p,
.site-footer {
  color: var(--muted);
}

dialog {
  width: min(820px, calc(100% - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

dialog[open] {
  display: grid;
  grid-template-columns: 42% 1fr;
}

dialog img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
}

dialog div {
  padding: 28px;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  color: white;
  cursor: pointer;
  font-size: 24px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 0 38px;
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .site-header,
  .section-head,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .watch-stage,
  .control-bar,
  dialog[open] {
    grid-template-columns: 1fr;
  }

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

  .video-grid,
  .series-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  dialog img {
    min-height: 220px;
  }
}

@media (max-width: 560px) {
  main {
    width: min(100% - 20px, 1180px);
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
  }

  .video-grid,
  .series-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 34px;
  }
}
