:root {
  color-scheme: dark;
  --color-bg: #08090c;
  --color-surface: #111318;
  --color-surface-raised: #171a20;
  --color-surface-soft: #20232b;
  --color-border: #2a2e37;
  --color-text: #f5f5f6;
  --color-muted: #9ca1ac;
  --color-subtle: #707681;
  --color-accent: #ef233c;
  --color-accent-hover: #ff4056;
  --color-accent-deep: #a80f25;
  --color-focus: #ffbf69;
  --radius-sm: 5px;
  --radius-md: 9px;
  --radius-lg: 13px;
  --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-card: 0 9px 24px rgba(0, 0, 0, 0.25);
  --shadow-accent: 0 0 20px rgba(239, 35, 60, 0.22);
  --container-width: 1500px;
  --header-height: 66px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 75% -10%, rgba(239, 35, 60, 0.09), transparent 25rem),
    var(--color-bg);
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

button,
input {
  font: inherit;
}

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

svg {
  display: block;
}

.container {
  width: min(100% - 24px, var(--container-width));
  margin-right: auto;
  margin-left: 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: 100;
  top: 8px;
  left: 8px;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  background: var(--color-text);
  color: var(--color-bg);
  transform: translateY(-150%);
}

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

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

.header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--header-height);
  padding-top: 10px;
  padding-bottom: 10px;
}

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

.brand-mark {
  position: relative;
  display: grid;
  flex: 0 0 31px;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: var(--shadow-accent);
}

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

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

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

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

.site-search:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(239, 35, 60, 0.13);
}

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

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

.site-search button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 74px;
  padding: 0 13px;
  border: 0;
  border-radius: 0 7px 7px 0;
  background: var(--color-accent);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.site-search button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.hot-searches {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-top: 3px;
  padding-bottom: 10px;
  font-size: 13px;
}

.hot-label {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(239, 35, 60, 0.14);
  color: #ff7586;
  font-weight: 800;
}

.hot-links {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 4px 13px;
  color: var(--color-muted);
}

.hot-links a {
  max-width: 13rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.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 {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.sponsor-banner a,
.sponsor-banner__item a {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.sponsor-banner img,
.sponsor-banner__item img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border-radius: 2px;
  object-fit: fill;
}

.category-nav {
  padding-top: 8px;
  padding-bottom: 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: 38px;
  align-items: center;
  justify-content: center;
  padding: 7px 5px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--color-surface-raised), var(--color-surface));
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
}

.page-main {
  padding-top: var(--space-4);
  padding-bottom: var(--space-7);
}

.page-heading {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: var(--space-5);
  padding: 14px 15px;
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-md);
  background: linear-gradient(110deg, rgba(239, 35, 60, 0.08), rgba(17, 19, 24, 0.95) 35%);
}

.page-heading h1,
.section-heading h2,
.friend-section h2,
.error-panel h1 {
  margin: 0;
  line-height: 1.25;
}

.page-heading h1 {
  display: -webkit-box;
  overflow: hidden;
  font-size: clamp(21px, 4.8vw, 31px);
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.eyebrow {
  margin: 0 0 3px;
  color: #ff7182;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.17em;
}

.heading-note,
.result-count {
  margin: 0;
  color: var(--color-muted);
  font-size: 13px;
}

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

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

.category-stats div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: rgba(8, 9, 12, 0.65);
  text-align: center;
}

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

.category-stats dd {
  margin: 1px 0 0;
  overflow: hidden;
  color: var(--color-text);
  font-size: 17px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-section + .content-section,
.player-section + .content-section {
  margin-top: var(--space-6);
}

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

.section-heading > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.section-heading h2 {
  min-width: 0;
  overflow: hidden;
  font-size: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-accent {
  width: 4px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 4px;
  background: var(--color-accent);
  box-shadow: 0 0 10px rgba(239, 35, 60, 0.55);
}

.section-note {
  flex: 0 1 auto;
  max-width: 45%;
  overflow: hidden;
  color: var(--color-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.video-card {
  min-width: 0;
  height: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.video-card > a {
  display: flex;
  width: 100%;
  height: 100%;
  min-width: 0;
  flex-direction: column;
}

.video-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  background: #050608;
}

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

.video-cover img.is-loaded,
.video-cover img:not([data-src]) {
  opacity: 1;
}

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

.play-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(239, 35, 60, 0.9);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.38);
}

.play-badge::after {
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid #fff;
  content: "";
}

.video-card h3 {
  display: -webkit-box;
  min-height: calc(1.45em * 2 + 24px);
  max-height: calc(1.45em * 2 + 24px);
  margin: 0;
  padding: 10px 10px 14px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.empty-state {
  display: block;
  margin: 12px 0 0;
  padding: 22px 14px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-muted);
  text-align: center;
}

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

.search-empty strong,
.search-empty span {
  display: block;
}

.search-empty strong {
  margin-bottom: 4px;
  color: var(--color-text);
  font-size: 16px;
}

.sort-panel {
  min-height: 42px;
  margin-bottom: var(--space-3);
  padding: 7px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.sort-panel ul,
.sort-panel ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.sort-panel .active,
.sort-panel .current,
.sort-panel .on {
  border-color: var(--color-accent);
  background: rgba(239, 35, 60, 0.13);
  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 11px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-muted);
  font-weight: 700;
}

.page-link.current,
.page-link.active,
.page-link.on {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}

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

.player-section {
  min-width: 0;
}

.player-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 0;
  padding: 0;
  border: 1px solid #2f333d;
  border-radius: var(--radius-md);
  background: #000;
  box-shadow: 0 15px 38px rgba(0, 0, 0, 0.42);
  overflow: hidden;
  overscroll-behavior: none;
}

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

.player-frame.is-loading::after {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  color: var(--color-muted);
  content: "播放器加载中…";
  font-size: 13px;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.player-frame iframe {
  position: relative;
  z-index: 1;
}

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

.video-actions-wrap button,
.video-actions-wrap a {
  min-height: 34px;
  border-radius: var(--radius-sm);
}

.player-status {
  min-height: 0;
  margin: 5px 0 0;
  color: #ff8c99;
  font-size: 12px;
}

.player-status:empty {
  display: none;
}

.site-footer {
  border-top: 1px solid var(--color-border);
  background: #0b0c10;
}

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

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

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

.friend-links a {
  display: inline-block;
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--color-subtle);
  font-size: 12px;
}

.footer-meta p {
  margin: 0;
}

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

.error-main {
  padding-top: 24px;
  padding-bottom: 24px;
}

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

.error-code {
  margin: 0 0 4px;
  color: var(--color-accent);
  font-size: clamp(50px, 18vw, 88px);
  font-weight: 950;
  letter-spacing: -0.06em;
  line-height: 1;
}

.error-panel h1 {
  font-size: 25px;
}

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

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

.error-domain {
  display: block;
  margin-top: 18px;
  color: var(--color-subtle);
  font-size: 12px;
}

a:hover,
button:hover {
  color: #fff;
}

.category-grid a:hover,
.home-link:hover,
.friend-links a:hover,
.page-link:hover,
.sort-panel a:hover {
  border-color: rgba(239, 35, 60, 0.68);
  background-color: rgba(239, 35, 60, 0.1);
  color: #fff;
}

.video-card:hover {
  border-color: rgba(239, 35, 60, 0.58);
}

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

.site-search button:hover,
.primary-link:hover {
  background: var(--color-accent-hover);
}

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

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

  .video-grid {
    gap: 13px;
  }

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

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

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

  .header-inner {
    grid-template-columns: minmax(170px, auto) minmax(280px, 620px) auto;
  }

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

  .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: center;
    justify-content: space-between;
    padding: 16px 18px;
  }

  .category-stats {
    width: auto;
    min-width: 285px;
  }

  .heading-note,
  .result-count {
    max-width: 42%;
    text-align: right;
  }

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

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

  .page-main {
    padding-top: var(--space-5);
    padding-bottom: var(--space-8);
  }

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

  .video-card h3 {
    padding-right: 12px;
    padding-left: 12px;
    font-size: 15px;
  }
}

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

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

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