:root {
  color-scheme: dark;
  --bg: #0b0b14;
  --bg-alt: #10101c;
  --surface: #18182a;
  --surface-hover: #22223a;
  --border: #2e2e48;
  --text: #f0f0f5;
  --muted: #9ca3b8;
  --accent: #e94560;
  --accent-hover: #ff5c75;
  --accent-soft: rgba(233, 69, 96, .14);
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 24px rgba(0, 0, 0, .35);
  --shadow-hover: 0 12px 32px rgba(0, 0, 0, .45);
  --transition: .2s ease;
  --header-h: 3.5rem;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-bottom: var(--safe-bottom);
}
body.nav-open { overflow: hidden; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
a {
  -webkit-tap-highlight-color: transparent;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
}
.skip-link:focus { left: 1rem; z-index: 100; background: #fff; color: #000; padding: .5rem; }

/* 顶栏 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 11, 20, .88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  padding: calc(.55rem + var(--safe-top)) 0 .55rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.site-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow);
}
.header-inner { display: flex; flex-direction: column; gap: .65rem; }
.header-top {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}

/* 手机菜单按钮 */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid #3a3a55;
  border-radius: var(--radius);
  background: #111;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 1px;
}

.nav-main ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .6rem;
}
.nav-main a {
  display: inline-block;
  padding: .4rem .7rem;
  color: var(--muted);
  text-decoration: none;
  font-size: .875rem;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.nav-main a:hover { color: var(--text); background: var(--surface-hover); }
.nav-main a.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(233, 69, 96, .25);
  font-weight: 600;
}

.search-form {
  display: flex;
  gap: .4rem;
  flex: 1 1 180px;
  min-width: 0;
  max-width: 100%;
}
.search-form--header { margin-left: auto; }
.search-form input {
  flex: 1;
  min-width: 0;
  padding: .6rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-form input::placeholder { color: var(--muted); }
.search-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
.search-form button {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border: 0;
  color: #fff;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.search-form button:hover { background: var(--accent-hover); }
.search-form button:active { transform: scale(.96); }

/* 首页 Hero */
.hero {
  position: relative;
  padding: 2rem 0 2.25rem;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(233, 69, 96, .18), transparent 55%),
    radial-gradient(ellipse 60% 50% at 90% 30%, rgba(60, 80, 200, .12), transparent 50%);
  pointer-events: none;
}
.hero__inner { position: relative; }
.hero__eyebrow {
  margin: 0 0 .5rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}
.hero__title {
  margin: 0 0 .6rem;
  font-size: clamp(1.5rem, 6vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.03em;
}
.hero__lead {
  margin: 0;
  max-width: 36em;
  color: var(--muted);
  font-size: clamp(.9rem, 2.5vw, 1.05rem);
}

.section { padding: 1.25rem 0 1.75rem; }
.section--alt { background: var(--bg-alt); }
.section--categories { padding-top: .5rem; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
}
.section-head__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.section-head__title::before {
  content: "";
  width: 4px;
  height: 1.1em;
  border-radius: 2px;
  background: var(--accent);
}
.section-head__more {
  flex-shrink: 0;
  font-size: .8rem;
  color: var(--muted);
  text-decoration: none;
}
.section-head__more:hover { color: var(--accent); }

.page-header { margin: 1rem 0 1.25rem; }
.page-header__title {
  margin: 0 0 .35rem;
  font-size: clamp(1.2rem, 4vw, 1.65rem);
  font-weight: 700;
  line-height: 1.3;
}
.page-header__meta { margin: 0; color: var(--muted); font-size: .9rem; }
.page-header__lead { margin: .35rem 0 0; color: var(--muted); font-size: .95rem; }

.vod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}
.vod-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.vod-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(233, 69, 96, .25);
}
.vod-card__link { color: inherit; text-decoration: none; display: block; }
.vod-card__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .45);
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 3;
  pointer-events: none;
}
.vod-card__play::after {
  content: "";
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 4px 16px rgba(233, 69, 96, .5);
  clip-path: polygon(38% 28%, 38% 72%, 72% 50%);
}
.vod-card:hover .vod-card__play { opacity: 1; }
.vod-card__poster { position: relative; }
.vod-card__poster .img-wrap { border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.vod-card__badges { z-index: 2; }
.vod-card__badges {
  position: absolute; left: 0; right: 0; top: 0;
  display: flex; flex-direction: column; align-items: flex-start; gap: .25rem;
  padding: .35rem; pointer-events: none;
}
.vod-badge {
  display: inline-flex; align-items: baseline; gap: .2rem;
  max-width: calc(100% - .5rem);
  background: rgba(0,0,0,.82); color: #fff;
  padding: .12rem .4rem; border-radius: 4px;
  font-size: .62rem; line-height: 1.35;
}
.vod-badge--score { align-self: flex-end; background: rgba(180, 40, 40, .92); }
.vod-badge--remarks { align-self: flex-start; }
.vod-badge--category { align-self: flex-start; background: rgba(30, 60, 120, .88); }
.vod-badge__label {
  opacity: .85; font-weight: 500; flex-shrink: 0;
}
.vod-badge__label::after { content: "："; }
.vod-badge__value {
  font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vod-card__title {
  font-size: .78rem;
  margin: .4rem .45rem .25rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.vod-card__facts {
  margin: 0 .45rem .45rem;
  padding: 0;
  display: grid;
  gap: .2rem;
  font-size: .65rem;
  line-height: 1.35;
}
.vod-card__fact {
  display: flex;
  gap: .25rem;
  align-items: baseline;
  margin: 0;
}
.vod-card__fact dt {
  flex-shrink: 0;
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}
.vod-card__fact dt::after { content: "："; }
.vod-card__fact dd {
  margin: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-panel {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.content-panel__title {
  margin: 0 0 .65rem;
  font-size: 1rem;
  font-weight: 700;
}
.content-panel__body {
  margin: 0;
  color: var(--text);
  font-size: .92rem;
  line-height: 1.75;
}
.content-panel.vod-remarks { border-left: 3px solid var(--accent); }

.detail-facts {
  margin: 0 0 1rem;
  padding: .85rem 1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  gap: .5rem;
}
.detail-actions { margin-top: .25rem; }
.detail-facts__row {
  display: grid;
  grid-template-columns: 4.5em 1fr;
  gap: .5rem;
  align-items: baseline;
  font-size: .9rem;
  margin: 0;
}
.detail-facts dt {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}
.detail-facts dt::after { content: "："; }
.detail-facts dd { margin: 0; color: var(--text); line-height: 1.5; }

.source-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.source-list a {
  display: inline-block;
  padding: .55rem 1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: .88rem;
}
.source-list a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.tag-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-list a {
  display: inline-block;
  padding: .5rem .9rem;
  min-height: 36px;
  line-height: 1.4;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: .85rem;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.tag-list a:hover {
  background: var(--accent-soft);
  border-color: rgba(233, 69, 96, .35);
  color: var(--accent);
}
.tag-list--pills a { font-size: .82rem; }

.empty-state {
  text-align: center;
  padding: 2rem 1.25rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty-state--compact { padding: 1.25rem; }
.empty-state__title { margin: 0 0 .35rem; font-weight: 600; font-size: 1rem; }
.empty-state__hint { margin: 0 0 1rem; color: var(--muted); font-size: .9rem; }
.empty-state .btn-secondary { display: inline-flex; }

.breadcrumbs { margin-bottom: 1rem; overflow-x: auto; }
.breadcrumbs ol {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: nowrap; gap: .35rem;
  font-size: .8rem; white-space: nowrap;
}
.breadcrumbs li:not(:last-child)::after { content: "›"; margin-left: .35rem; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }

.detail-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1rem 0;
}
.detail-header .img-wrap { width: 100%; max-width: 280px; margin: 0 auto; border-radius: var(--radius); overflow: hidden; }

/* 图片加载：骨架屏 + 渐显 */
.img-wrap {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  background: #151528;
  overflow: hidden;
}
.img-wrap--detail { max-width: 280px; }
.img-wrap__shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    #151528 0%,
    #1f1f38 40%,
    #2a2a48 50%,
    #1f1f38 60%,
    #151528 100%
  );
  background-size: 200% 100%;
  animation: img-shimmer 1.2s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}
.img-wrap.is-loaded .img-wrap__shimmer,
.img-wrap.is-error .img-wrap__shimmer { opacity: 0; transition: opacity .2s; }
.img-wrap .img-main {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity .28s ease;
  z-index: 0;
}
.img-wrap.is-loaded .img-main,
.img-wrap.is-error .img-main { opacity: 1; }
.img-wrap.is-error .img-main { filter: grayscale(.15); }
@keyframes img-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.detail-info h1 { font-size: 1.25rem; margin: 0 0 .75rem; line-height: 1.35; }

.btn-play, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 44px;
  padding: .7rem 1.35rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn-play {
  background: linear-gradient(135deg, var(--accent), #c73a52);
  color: #fff;
  box-shadow: 0 4px 14px rgba(233, 69, 96, .35);
}
.btn-play:hover {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  box-shadow: 0 6px 20px rgba(233, 69, 96, .45);
}
.btn-play:active { transform: scale(.98); }
.btn-play--lg { width: 100%; font-size: 1rem; padding: .85rem 1.5rem; }
.btn-play__icon { font-size: .85em; opacity: .9; }
.btn-secondary {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.btn-secondary:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.text-link {
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
}
.text-link:hover { color: var(--accent); }

.pagination { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.75rem 0; justify-content: center; }
.pagination a {
  min-width: 40px; min-height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: .35rem .65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: .9rem;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination a[aria-current="page"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* 页脚前热门搜索词 */
.hot-keywords {
  margin-top: 2rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}
.hot-keywords__title {
  margin: 0 0 .75rem;
  font-size: .95rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .04em;
}
.hot-keywords__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.hot-keywords__list a {
  display: inline-block;
  padding: .45rem .85rem;
  font-size: .82rem;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.hot-keywords__list a:hover {
  color: var(--accent);
  border-color: rgba(233, 69, 96, .4);
  background: var(--accent-soft);
}
.hot-keywords__loading {
  color: var(--muted);
  font-size: .85rem;
  padding: .25rem 0;
}

.site-footer {
  margin-top: 0;
  padding: 1.75rem 0 calc(1.75rem + var(--safe-bottom));
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}
.footer-logo { margin: 0; font-weight: 700; color: var(--text); font-size: 1rem; }
.footer-copy { margin: .25rem 0 0; color: var(--muted); font-size: .8rem; }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem 1rem;
}
.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .85rem;
}
.footer-nav a:hover { color: var(--accent); }

.play-page .player-wrap { margin-bottom: 1rem; }
.play-hint {
  margin: 0;
  padding: .65rem 1rem;
  font-size: .82rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.play-hint a { color: var(--accent); }
.play-back { margin: 1.25rem 0 2rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.player-wrap {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1rem 0;
}
.player-wrap iframe,
.player-wrap video {
  border: 0;
  display: block;
  width: 100%;
  max-height: 56vw;
  min-height: 200px;
}

.meta { color: var(--muted); font-size: .875rem; }
.empty-hint { color: var(--muted); padding: 1rem 0; }

/* 404 */
.error-page { padding: 1rem 0 2rem; }
.error-card {
  text-align: center;
  padding: 1.75rem 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid #2a2a40;
  margin-bottom: 1.5rem;
}
.error-code {
  font-size: clamp(3.5rem, 18vw, 6rem);
  font-weight: 800;
  line-height: 1;
  margin: 0 0 .35rem;
  color: var(--accent);
}
.error-card h1 { margin: 0 0 .75rem; font-size: 1.35rem; }
.error-lead { color: var(--muted); font-size: .9rem; margin: 0 auto 1rem; }
.error-path code {
  font-size: .8rem;
  background: #111;
  padding: .15rem .35rem;
  border-radius: 4px;
  word-break: break-all;
}
.error-actions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  align-items: stretch;
  margin-bottom: 1rem;
}
.error-actions .btn-play,
.error-actions .btn-secondary { width: 100%; }
.error-search { width: 100%; max-width: none; }
.error-section { margin-bottom: 1.5rem; }
.error-section h2 { font-size: 1.1rem; }

/* 平板 */
@media (min-width: 640px) {
  .vod-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 1rem; }
  .error-actions { flex-direction: row; justify-content: center; align-items: center; }
  .error-actions .btn-play,
  .error-actions .btn-secondary { width: auto; }
  .detail-header {
    grid-template-columns: 220px 1fr;
    align-items: start;
  }
  .detail-header img { margin: 0; }
}

/* 桌面 */
@media (min-width: 900px) {
  .header-inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .header-top { flex: 1 1 auto; flex-wrap: nowrap; }
  .nav-main { flex: 1 1 100%; order: 3; }
  .nav-main ul { max-height: none; flex-wrap: wrap; }
  .search-form--header { max-width: min(480px, 42vw); margin-left: auto; flex: 1 1 280px; }
  .vod-grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 1.1rem; }
  .detail-header { grid-template-columns: 280px 1fr; gap: 2rem; }
  .btn-play--lg { width: auto; min-width: 200px; }
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
  .footer-nav { justify-content: flex-end; }
}

/* 手机：折叠分类导航 */
@media (max-width: 899px) {
  .nav-toggle { display: flex; margin-left: auto; }
  .search-form--header { order: 3; flex: 1 1 100%; }
  .nav-main {
    display: none;
    width: 100%;
    max-height: min(55vh, 400px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: .35rem 0;
    border-top: 1px solid var(--border);
    background: var(--bg-alt);
    border-radius: var(--radius);
  }
  .nav-main.is-open { display: block; }
  .nav-main ul { flex-direction: column; gap: 0; }
  .nav-main li { border-bottom: 1px solid var(--border); }
  .nav-main li:last-child { border-bottom: 0; }
  .nav-main a {
    display: block;
    padding: .8rem .65rem;
    white-space: normal;
    font-size: .95rem;
    border-radius: 0;
  }
  .detail-actions {
    position: sticky;
    bottom: calc(.5rem + var(--safe-bottom));
    z-index: 10;
    padding-top: .5rem;
    margin-top: 1rem;
    background: linear-gradient(transparent, var(--bg) 35%);
  }
}
