:root {
  color-scheme: dark;
  --bg: #08090b;
  --surface: #111318;
  --surface-2: #171a20;
  --surface-3: #20242c;
  --text: #f5f5f6;
  --muted: #9da1ab;
  --muted-strong: #c6c8ce;
  --accent: #f02d3a;
  --accent-deep: #bb1725;
  --accent-soft: rgba(240, 45, 58, 0.14);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --focus: #ffb3b8;
  --radius-sm: 5px;
  --radius: 9px;
  --radius-lg: 13px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --container: 1480px;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  --transition: 160ms ease;
}

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

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

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 78% 0, rgba(240, 45, 58, 0.055), transparent 25rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  overflow-wrap: anywhere;
}

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

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

img,
svg {
  max-width: 100%;
}

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

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

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

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

:where(a, button, input, iframe):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.site-header {
  position: relative;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 9, 11, 0.96);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  align-items: center;
  padding-block: var(--space-3);
}

.brand {
  display: inline-flex;
  width: fit-content;
  min-width: 0;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-name {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, #ff3b49, #b20e1c);
  box-shadow: 0 7px 18px rgba(240, 45, 58, 0.24);
}

.brand-mark span {
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid #fff;
}

.site-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.site-search:focus-within {
  border-color: rgba(240, 45, 58, 0.72);
  box-shadow: 0 0 0 3px rgba(240, 45, 58, 0.11);
}

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

.site-search input::placeholder {
  color: #777c87;
}

.site-search button {
  display: inline-flex;
  min-width: 48px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 3px;
  padding: 0 13px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  transition: background var(--transition), transform var(--transition);
}

.site-search button span {
  display: none;
}

.site-search button:hover {
  background: #ff3b48;
}

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

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

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

.category-nav {
  position: relative;
  border-block: 1px solid var(--border);
  background: #0d0f13;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  padding-block: 5px;
  background: var(--border);
}

.category-link {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 7px 5px;
  background: #0d0f13;
  color: var(--muted-strong);
  text-align: center;
  overflow-wrap: anywhere;
  transition: color var(--transition), background var(--transition);
}

.category-link:hover,
.category-link:focus-visible,
.category-home {
  background: var(--surface-2);
  color: #fff;
}

.category-home {
  box-shadow: inset 0 -2px var(--accent);
}

.hot-searches {
  border-bottom: 1px solid var(--border);
  background: rgba(17, 19, 24, 0.72);
}

.hot-searches-inner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding-block: 9px;
}

.hot-label {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: #ff7b84;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

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

.hot-links a {
  max-width: 14rem;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hot-links a:hover {
  color: var(--text);
}

.site-main {
  min-height: 48vh;
  padding-block: var(--space-5) var(--space-7);
}

.page-heading {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  justify-content: space-between;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.eyebrow,
.section-kicker {
  display: block;
  margin: 0 0 3px;
  color: #ff6b75;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}

.page-heading h1,
.section-heading h2,
.friend-section h2,
.empty-state h2 {
  margin: 0;
  overflow-wrap: anywhere;
}

.page-heading h1 {
  font-size: clamp(23px, 5.5vw, 34px);
  line-height: 1.22;
  letter-spacing: -0.035em;
}

.heading-summary,
.result-count {
  max-width: 34rem;
  margin: 0;
  color: var(--muted);
}

.result-count strong {
  color: var(--text);
  font-size: 1.12em;
}

.content-section + .content-section {
  margin-top: var(--space-7);
}

.section-heading {
  display: flex;
  min-width: 0;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.section-heading h2 {
  font-size: clamp(19px, 4vw, 25px);
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.section-heading h2::before {
  display: inline-block;
  width: 3px;
  height: 0.8em;
  margin-right: 8px;
  border-radius: 3px;
  background: var(--accent);
  content: "";
}

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

.video-card {
  min-width: 0;
  height: 100%;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.video-card:hover {
  transform: translateY(-2px);
  border-color: rgba(240, 45, 58, 0.38);
  box-shadow: var(--shadow);
}

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

.video-cover {
  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: #050608;
}

.video-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 220ms ease, transform 260ms ease;
}

.video-cover img.is-loaded,
.video-cover img[data-image-ready="true"] {
  opacity: 1;
}

.video-card:hover .video-cover img {
  transform: scale(1.018);
}

.play-indicator {
  position: absolute;
  right: 9px;
  bottom: 8px;
  width: 29px;
  height: 29px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(240, 45, 58, 0.91);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.3);
}

.play-indicator::after {
  position: absolute;
  top: 8px;
  left: 11px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid #fff;
  content: "";
}

.video-card h3 {
  display: -webkit-box;
  height: calc(1.45em * 2 + 20px);
  min-height: calc(1.45em * 2 + 20px);
  margin: 0;
  padding: 10px 11px;
  overflow: hidden;
  color: #ebebed;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.video-card-link:hover h3 {
  color: #fff;
}

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

.category-stats div {
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

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

.category-stats dd {
  margin: 1px 0 0;
  overflow: hidden;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sort-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: var(--space-4);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.sort-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.sort-options {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 7px;
}

.sort-options a,
.sort-options button,
.sort-options span {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 5px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted-strong);
}

.sort-options a:hover,
.sort-options .active,
.sort-options .current,
.sort-options .on {
  border-color: rgba(240, 45, 58, 0.65);
  background: var(--accent-soft);
  color: #fff;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: var(--space-6);
}

.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-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted-strong);
  font-weight: 700;
}

.page-link:hover {
  border-color: var(--accent);
  color: #fff;
}

.page-link.current,
.page-link.active,
.page-link.on,
.page-link.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 15px rgba(240, 45, 58, 0.2);
}

.empty-state {
  display: flex;
  min-height: 190px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: var(--space-4);
  padding: var(--space-6);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
}

.video-grid:has(.video-card) + .empty-state {
  display: none;
}

.empty-icon {
  display: grid;
  width: 45px;
  height: 45px;
  margin-bottom: 9px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: #ff7c85;
  font-size: 25px;
}

.empty-state h2 {
  font-size: 19px;
}

.empty-state p {
  max-width: 32rem;
  margin: 6px 0 13px;
  color: var(--muted);
}

.empty-state a,
.primary-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 750;
}

.play-heading {
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
}

.player-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #000;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.38);
  overscroll-behavior: none;
}

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

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

.video-actions,
.video-actions > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.video-actions a,
.video-actions button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted-strong);
  cursor: pointer;
}

.video-actions a:hover,
.video-actions button:hover {
  border-color: rgba(240, 45, 58, 0.65);
  color: #fff;
}

.related-section {
  margin-top: var(--space-7);
}

.site-footer {
  border-top: 1px solid var(--border);
  background: #090a0d;
}

.footer-inner {
  padding-block: var(--space-6);
}

.friend-section {
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border);
}

.friend-section h2 {
  margin-bottom: 10px;
  font-size: 16px;
}

.friend-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 16px;
}

.friend-links a {
  max-width: 14rem;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-links a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: var(--space-4);
  color: #747983;
  font-size: 12px;
}

.footer-bottom p {
  margin: 0;
}

.error-page {
  min-height: 100vh;
}

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

.error-panel {
  width: min(100%, 520px);
  padding: clamp(24px, 7vw, 42px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.error-brand {
  margin-inline: auto;
}

.error-code {
  margin: 20px 0 -4px;
  color: var(--accent);
  font-size: clamp(54px, 17vw, 94px);
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 1;
}

.error-panel h1 {
  margin: 0;
  font-size: clamp(24px, 7vw, 34px);
}

.error-panel > p:not(.error-code) {
  margin: 10px auto 18px;
  color: var(--muted);
}

.error-panel small {
  display: block;
  margin-top: 18px;
  color: #686d76;
}

@media (min-width: 520px) {
  .category-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sort-panel {
    flex-direction: row;
    align-items: center;
  }
}

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

  .sponsor-banner,
  .sponsor-banner.container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header-inner {
    grid-template-columns: minmax(180px, 0.7fr) minmax(320px, 1.3fr);
    gap: var(--space-5);
    padding-block: 14px;
  }

  .site-search button span {
    display: inline;
  }

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

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

  .page-heading {
    flex-direction: row;
    align-items: end;
  }

  .heading-summary,
  .result-count {
    text-align: right;
  }

  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    gap: 20px;
  }
}

@media (min-width: 900px) {
  .category-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .site-main {
    padding-block: var(--space-6) var(--space-7);
  }

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

  .category-stats {
    width: 360px;
  }
}

@media (min-width: 1280px) {
  .header-inner {
    grid-template-columns: minmax(230px, 0.7fr) minmax(440px, 1.1fr) minmax(120px, 0.35fr);
  }

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

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

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

  .video-card:hover,
  .video-card:hover .video-cover img {
    transform: none;
  }
}
