:root {
  color-scheme: dark;
  --bg: #0c0c0f;
  --surface: #15151a;
  --surface-2: #1c1c23;
  --surface-3: #24242d;
  --text: #f5f3f4;
  --muted: #a9a5ad;
  --subtle: #77727c;
  --accent: #ff4f78;
  --accent-warm: #ff8a4c;
  --accent-soft: rgba(255, 79, 120, 0.14);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --focus: #ffb36c;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
  --container: 1440px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 85% -10%, rgba(255, 79, 120, 0.08), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

button,
input {
  color: inherit;
  font: inherit;
}

img {
  max-width: 100%;
}

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

h1,
h2,
h3,
a,
p,
dd,
dt,
span {
  overflow-wrap: anywhere;
}

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

.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;
}

.skip-link {
  position: absolute;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.site-header {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid var(--border);
  background: rgba(12, 12, 15, 0.96);
}

.header-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: center;
  padding-block: 12px;
}

.site-brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-mark {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 17px;
  filter: drop-shadow(0 0 8px rgba(255, 79, 120, 0.42));
}

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

.home-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-weight: 700;
}

.site-search {
  display: flex;
  grid-column: 1 / -1;
  min-width: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.site-search:focus-within {
  border-color: rgba(255, 79, 120, 0.65);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.site-search input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  border: 0;
  outline: 0;
  background: transparent;
}

.site-search input::placeholder {
  color: var(--subtle);
}

.site-search button {
  flex: 0 0 auto;
  min-width: 66px;
  margin: 3px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), #e83967);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.category-nav {
  padding-block: 8px;
}

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

.category-grid a {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 7px 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: center;
  line-height: 1.25;
}

.hot-searches {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-block: 8px 11px;
  border-top: 1px solid var(--border);
}

.hot-searches__label {
  flex: 0 0 auto;
  padding-top: 4px;
  color: var(--accent-warm);
  font-size: 13px;
  font-weight: 800;
}

.hot-searches__links {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 5px 8px;
}

.hot-searches__links a {
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 13px;
}

.sponsor-banner,
.sponsor-banner.container {
  display: grid;
  box-sizing: border-box;
  width: 100% !important;
  max-width: none !important;
  margin: 2px 0 !important;
  padding: 0 !important;
  gap: 2px 6px;
  grid-template-columns: minmax(0, 1fr);
}

.sponsor-banner__item,
.sponsor-banner__item a,
.sponsor-banner__item img {
  display: block;
  width: 100%;
  height: 100%;
}

.sponsor-banner__item img {
  border-radius: 2px;
  object-fit: fill;
}

.site-main {
  padding-block: 18px 26px;
}

.page-heading {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 79, 120, 0.07), rgba(255, 138, 76, 0.02) 45%, var(--surface));
}

.page-heading--compact {
  padding-block: 13px;
}

.page-heading h1,
.play-heading h1 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 4.8vw, 2rem);
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.eyebrow,
.section-kicker {
  margin-bottom: 3px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.page-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin-bottom: 0;
}

.page-stats--single {
  grid-template-columns: minmax(0, 1fr);
}

.page-stats > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.18);
}

.page-stats dt {
  color: var(--muted);
  font-size: 12px;
}

.page-stats dd {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.content-section + .content-section,
.related-section {
  margin-top: 24px;
}

.content-section--first {
  margin-top: 0;
}

.section-heading {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.section-heading h2,
.friend-links h2 {
  margin-bottom: 0;
  font-size: clamp(1.08rem, 4vw, 1.35rem);
  line-height: 1.3;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
  grid-auto-rows: 1fr;
}

.video-grid:empty::after {
  display: flex;
  grid-column: 1 / -1;
  min-height: 112px;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  content: attr(data-empty-text);
  text-align: center;
}

.video-card {
  min-width: 0;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.12);
}

.video-card__link {
  display: flex;
  height: 100%;
  min-width: 0;
  flex-direction: column;
  border-radius: inherit;
}

.video-card__media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  background: #070709;
}

.video-card__media::after {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(8, 8, 10, 0.68);
  color: #fff;
  content: "▶";
  font-size: 9px;
  line-height: 20px;
  text-align: center;
  text-indent: 1px;
}

.video-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.92;
  transition: transform 180ms ease, opacity 180ms ease;
}

.video-card__media img.is-image-error {
  opacity: 0.35;
}

.video-card__body {
  display: flex;
  min-width: 0;
  flex: 1;
  padding: 9px 10px 10px;
}

.video-card h3 {
  display: -webkit-box;
  width: 100%;
  height: 2.8em;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.list-sort {
  display: flex;
  min-height: 40px;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 11px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.list-sort a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  color: var(--muted);
}

.list-sort a.active,
.list-sort a.current,
.list-sort a[aria-current="page"] {
  background: var(--accent-soft);
  color: #ff8ca8;
  font-weight: 800;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 22px;
}

.page-link {
  display: inline-flex;
  min-width: 38px;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
}

.page-link.active,
.page-link.current,
.page-link.on,
.page-link[aria-current="page"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.play-page {
  min-width: 0;
}

.play-heading {
  margin-bottom: 11px;
}

.player-shell {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: #000;
  box-shadow: var(--shadow);
  overscroll-behavior: none;
}

.player-shell iframe {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  overflow: hidden;
  background: #000;
  overscroll-behavior: none;
}

.player-shell.is-player-unavailable::after {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #08080a;
  color: var(--muted);
  content: "播放地址暂时不可用";
  text-align: center;
}

.video-actions {
  min-height: 44px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.video-actions a,
.video-actions button {
  min-height: 34px;
}

.site-footer {
  margin-top: 4px;
  border-top: 1px solid var(--border);
  background: #0a0a0c;
}

.site-footer > .container {
  padding-block: 20px;
}

.friend-links {
  padding-bottom: 17px;
  border-bottom: 1px solid var(--border);
}

.friend-links__list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin-top: 10px;
}

.friend-links__list a {
  max-width: 100%;
  color: var(--muted);
  font-size: 13px;
}

.footer-bottom {
  display: grid;
  gap: 4px;
  padding-top: 16px;
  color: var(--subtle);
  font-size: 12px;
}

.footer-bottom p {
  margin-bottom: 0;
}

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

.error-panel {
  width: min(100%, 560px);
  padding: 28px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.error-brand {
  justify-content: center;
  margin-bottom: 18px;
}

.error-code {
  margin-bottom: 2px;
  color: var(--accent);
  font-size: clamp(3.6rem, 20vw, 7rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.error-panel h1 {
  margin-bottom: 9px;
  font-size: clamp(1.5rem, 7vw, 2.2rem);
}

.error-panel > p:not(.error-code) {
  color: var(--muted);
}

.primary-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  margin: 7px 0 18px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.error-panel small {
  display: block;
  color: var(--subtle);
}

@media (hover: hover) {
  .home-link:hover,
  .category-grid a:hover,
  .page-link:hover {
    border-color: rgba(255, 79, 120, 0.52);
    background: var(--surface-2);
    color: #fff;
  }

  .hot-searches__links a:hover,
  .list-sort a:hover,
  .friend-links__list a:hover {
    color: #fff;
  }

  .video-card:hover {
    border-color: rgba(255, 79, 120, 0.42);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
  }

  .video-card:hover .video-card__media img {
    opacity: 1;
    transform: scale(1.025);
  }

  .site-search button:hover,
  .primary-link:hover {
    filter: brightness(1.08);
  }
}

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

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

  .video-grid {
    gap: 13px;
  }

  .video-card h3 {
    font-size: 14px;
  }
}

@media (min-width: 641px) {
  .sponsor-banner,
  .sponsor-banner.container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header-main {
    grid-template-columns: minmax(160px, 0.7fr) minmax(260px, 1.4fr) auto;
    padding-block: 13px;
  }

  .site-search {
    grid-column: auto;
  }

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

  .site-main {
    padding-block: 22px 30px;
  }

  .page-heading {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 17px 18px;
  }

  .page-heading__title {
    min-width: 0;
  }

  .page-stats {
    width: auto;
    min-width: 290px;
  }

  .page-stats--single {
    min-width: 145px;
  }

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

  .footer-bottom {
    grid-template-columns: auto minmax(0, 1fr);
    justify-content: space-between;
  }

  .footer-bottom p:last-child {
    text-align: right;
  }
}

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

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

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

  .content-section + .content-section,
  .related-section {
    margin-top: 28px;
  }
}

@media (min-width: 1320px) {
  .video-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
