:root {
  --bg: #0b0d12;
  --bg-soft: #121621;
  --panel: #151a25;
  --panel-2: #1a2030;
  --line: rgba(255, 255, 255, 0.08);
  --text: #eef2ff;
  --text-soft: #9da7bf;
  --text-muted: #788199;
  --accent: #ff4d6d;
  --accent-2: #ff7b54;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  --radius: 16px;
  --radius-sm: 12px;
  --container: 1280px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 77, 109, 0.12), transparent 24%),
    linear-gradient(180deg, #090b10 0%, #0f131c 100%);
  line-height: 1.55;
  overflow-x: hidden;
}

img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1;
}

.container {
  width: min(100% - 24px, var(--container));
  margin: 0 auto;
}

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

.site-header {
  position: relative;
  z-index: 10;
  padding: 14px 0 12px;
  background: linear-gradient(180deg, rgba(11, 13, 18, 0.96), rgba(11, 13, 18, 0.88));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 12px;
}

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

.site-brand__logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow);
  font-size: 18px;
  font-weight: 700;
}

.site-brand__name {
  max-width: 180px;
  font-size: 1.1rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-toggle {
  justify-self: end;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 12px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0 12px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.search-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  width: 100%;
}

.search-input {
  min-width: 0;
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: rgba(255, 77, 109, 0.45);
  box-shadow: 0 0 0 4px rgba(255, 77, 109, 0.12);
}

.search-btn {
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 700;
  white-space: nowrap;
}

.main-nav {
  margin-top: 14px;
  display: none;
}

.main-nav.is-open {
  display: block;
}

.main-nav__scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.main-nav__scroll::-webkit-scrollbar {
  display: none;
}

.main-nav__link {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  transition: 0.2s ease;
}

.main-nav__link:hover {
  color: #fff;
  border-color: rgba(255, 77, 109, 0.3);
  background: rgba(255, 77, 109, 0.1);
}

.friend-links {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

.friend-links__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: 8px;
}

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

.friend-links__list a {
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-hero {
  padding: 20px 0 8px;
}

.page-hero--compact {
  padding-top: 16px;
}

.page-hero__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.page-title {
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 2rem);
  line-height: 1.2;
}

.page-subtitle {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 0.96rem;
}

.content-section {
  padding: 16px 0 8px;
}

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

.section-title {
  position: relative;
  margin: 0;
  padding-left: 12px;
  font-size: 1.1rem;
  line-height: 1.3;
}

.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 4px;
  height: 1em;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

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

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

.video-card {
  min-width: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.video-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 77, 109, 0.3);
}

.video-card__thumb {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #0f131c;
}

.video-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-card__badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-card__body {
  padding: 12px;
  min-width: 0;
}

.video-card__title,
.rank-item__title {
  margin: 0;
  font-size: 0.97rem;
  font-weight: 700;
  line-height: 1.4;
}

.video-card__title a,
.rank-item__title a {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  word-break: break-word;
}

.video-card__meta,
.rank-item__meta,
.video-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.pagination__link {
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s ease;
}

.pagination__link:hover {
  color: #fff;
  border-color: rgba(255, 77, 109, 0.35);
  background: rgba(255, 77, 109, 0.12);
}

.play-page {
  padding: 16px 0 24px;
}

.play-layout {
  display: grid;
  gap: 18px;
}

.player-panel,
.related-panel,
.hot-keywords-box,
.rank-list,
.playlist-section {
  min-width: 0;
}

.player-wrap {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

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

.video-detail {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

.video-detail__cover {
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: #0f131c;
}

.video-detail__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-detail__content {
  min-width: 0;
}

.video-detail__title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.35;
  word-break: break-word;
}

.video-detail__desc {
  margin-top: 10px;
  color: var(--text-soft);
  word-break: break-word;
  overflow-wrap: break-word;
}

.playlist-section {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

.episode-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.episode-link {
  min-width: 80px;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: 0.2s ease;
}

.episode-link:hover {
  color: #fff;
  background: rgba(255, 77, 109, 0.14);
  border-color: rgba(255, 77, 109, 0.36);
}

.rank-list {
  display: grid;
  gap: 12px;
}

.rank-item {
  display: grid;
  grid-template-columns: 44px 108px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.rank-item__index {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1rem;
}

.rank-item:nth-child(1) .rank-item__index::before { content: "1"; }
.rank-item:nth-child(2) .rank-item__index::before { content: "2"; }
.rank-item:nth-child(3) .rank-item__index::before { content: "3"; }
.rank-item:nth-child(4) .rank-item__index::before { content: "4"; }
.rank-item:nth-child(5) .rank-item__index::before { content: "5"; }
.rank-item:nth-child(6) .rank-item__index::before { content: "6"; }
.rank-item:nth-child(7) .rank-item__index::before { content: "7"; }
.rank-item:nth-child(8) .rank-item__index::before { content: "8"; }
.rank-item:nth-child(9) .rank-item__index::before { content: "9"; }
.rank-item:nth-child(10) .rank-item__index::before { content: "10"; }
.rank-item:nth-child(11) .rank-item__index::before { content: "11"; }
.rank-item:nth-child(12) .rank-item__index::before { content: "12"; }
.rank-item:nth-child(13) .rank-item__index::before { content: "13"; }
.rank-item:nth-child(14) .rank-item__index::before { content: "14"; }
.rank-item:nth-child(15) .rank-item__index::before { content: "15"; }
.rank-item:nth-child(16) .rank-item__index::before { content: "16"; }
.rank-item:nth-child(17) .rank-item__index::before { content: "17"; }
.rank-item:nth-child(18) .rank-item__index::before { content: "18"; }
.rank-item:nth-child(19) .rank-item__index::before { content: "19"; }
.rank-item:nth-child(20) .rank-item__index::before { content: "20"; }

.rank-item__thumb {
  aspect-ratio: 3 / 2;
  border-radius: 14px;
  overflow: hidden;
  background: #0f131c;
}

.rank-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.keyword-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.keyword-chip {
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: 0.2s ease;
}

.keyword-chip:hover {
  color: #fff;
  border-color: rgba(255, 77, 109, 0.35);
  background: rgba(255, 77, 109, 0.12);
}

.site-footer {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  background: rgba(8, 10, 15, 0.9);
}

.site-footer__inner {
  padding: 18px 0;
}

.site-footer__text {
  margin: 0;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.88rem;
}

.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top, rgba(255, 77, 109, 0.12), transparent 24%),
    linear-gradient(180deg, #090b10 0%, #0f131c 100%);
}

.error-card {
  width: min(100%, 460px);
  padding: 28px 22px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.error-code {
  font-size: 4rem;
  line-height: 1;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.error-title {
  margin: 14px 0 10px;
  font-size: 1.4rem;
}

.error-text {
  margin: 0;
  color: var(--text-soft);
}

.error-btn {
  display: inline-flex;
  margin-top: 18px;
  min-height: 46px;
  padding: 0 18px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
}

@media (min-width: 768px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    gap: 14px;
  }

  .nav-toggle {
    display: none;
  }

  .search-form {
    grid-column: auto;
    max-width: 420px;
    justify-self: end;
  }

  .main-nav {
    display: block;
  }

  .site-brand__name {
    max-width: 320px;
    font-size: 1.2rem;
  }

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

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

  .play-layout {
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.9fr);
    align-items: start;
  }

  .video-detail {
    grid-template-columns: 140px 1fr;
  }
}

@media (min-width: 1024px) {
  .container {
    width: min(100% - 40px, var(--container));
  }

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

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

  .content-section {
    padding: 18px 0 10px;
  }
}