/* ==========================================================================
   MRDS 风格视频聚合站 · 暗色视觉基底
   方向：近黑底 + 金色品牌强调 + 高信息密度网格
   广告位统一以虚线框标注（.ad-slot），接入 Adcash 后由 ads.js 填充
   ========================================================================== */

:root {
  --bg: #08080a;
  --bg-2: #0e0e12;
  --card: #131317;
  --card-hover: #1a1a20;
  --line: #1f1f26;
  --line-2: #2a2a33;
  --text: #f2f2f5;
  --text-2: #a0a0ab;
  --text-3: #6b6b78;
  --gold: #f5c518;
  --red: #e8322f;
  --hot: #ff3b30;
  --ad-line: #3a3a24;
  --ad-bg: #12120c;
  --radius: 4px;
  --header-h: 96px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans SC', -apple-system, 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold); }

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

.wrap {
  width: min(1400px, calc(100% - 32px));
  margin-inline: auto;
}

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(8, 8, 10, .96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 48px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-family: 'Oswald', sans-serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--gold);
  white-space: nowrap;
}

.logo__mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  background: var(--gold);
  color: #000;
  border-radius: 3px;
  font-size: 16px;
  font-weight: 700;
}

.header-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 15px;
}

.header-search input {
  width: 150px;
  height: 30px;
  padding: 0 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

.header-search input:focus { border-color: var(--gold); }

.header-icons { display: flex; gap: 12px; color: var(--text-3); font-size: 15px; }

/* 分类导航：双行密集 */
.nav-rows {
  border-top: 1px solid var(--line);
  padding: 6px 0 8px;
}

.nav-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 3px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-row::-webkit-scrollbar { display: none; }

.nav-row a {
  flex-shrink: 0;
  font-size: 13.5px;
  color: var(--text-2);
  white-space: nowrap;
  transition: color .15s;
}

.nav-row a:hover { color: var(--gold); }

.nav-row--sub a { font-size: 12.5px; color: var(--text-3); }

.nav-row .nav-more { color: var(--gold); }

/* ---------- 站点标题 ---------- */
.site-title {
  text-align: center;
  padding: 22px 0 18px;
}

.site-title h1 {
  margin: 0 0 6px;
  font-family: 'Oswald', sans-serif;
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--gold);
}

.site-title p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-3);
}

/* ---------- 演示数据提示（接入真实接口后自动隐藏） ---------- */
.demo-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 9px 14px;
  background: #14120a;
  border: 1px solid var(--ad-line);
  border-radius: var(--radius);
  font-size: 12.5px;
  color: #c9b877;
}

.demo-notice strong { color: var(--gold); }

.demo-notice button {
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
  background: none;
  border: 1px solid var(--ad-line);
  color: #c9b877;
  border-radius: 3px;
  padding: 2px 9px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
}

/* ==========================================================================
   广告位
   所有广告栏统一留空，虚线框标注 slot id，接入 Adcash 后由 ads.js 填充
   ========================================================================== */

.ad-slot {
  position: relative;
  display: grid;
  place-items: center;
  margin: 18px 0;
  background: var(--ad-bg);
  border: 1px dashed var(--ad-line);
  border-radius: var(--radius);
  overflow: hidden;
}

.ad-slot::before {
  content: attr(data-ad-label);
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #8a7f43;
  text-align: center;
  padding: 0 12px;
}

/* 广告渲染后隐藏标注，让真实素材占满。
   注意 skipped 状态（本地预览 / 服务器渲染）刻意保留标注，
   建站阶段需要看清每个位置对应哪个 zone；上线后 showPlaceholders=false 会整体隐藏。 */
.ad-slot[data-ad-state="filled"]::before,
.ad-slot[data-ad-state="loading"]::before { content: ''; }

.ad-slot[data-ad-state="loading"]::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(245, 197, 24, .05), transparent);
  animation: adshimmer 1.4s linear infinite;
}

@keyframes adshimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

/* 通栏：对齐真实联盟素材的常见比例 */
.ad-slot--banner { min-height: 100px; }
.ad-slot--banner-lg { min-height: 220px; }

/* 网格内的插入位 */
.ad-slot--infeed {
  grid-column: 1 / -1;
  min-height: 100px;
  margin: 6px 0 18px;
}

/* 侧栏竖版 */
.ad-slot--sidebar { min-height: 600px; }

/* 详情页 */
.ad-slot--detail-top { min-height: 100px; }
.ad-slot--detail-mid { min-height: 250px; }
.ad-slot--detail-bottom { min-height: 100px; }

/* 视频前贴 */
.ad-slot--preroll {
  min-height: 0;
  aspect-ratio: 16 / 9;
  margin: 0;
  border-style: solid;
  border-color: var(--line);
}

/* 右下角浮动窗 */
.ad-float {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 150;
  width: 300px;
  min-height: 250px;
  display: none;
}

.ad-float[data-ad-active="1"] { display: grid; place-items: center; }

.ad-float__close {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .7);
  border: 1px solid var(--line-2);
  border-radius: 50%;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
}

/* 移动端底部吸底 */
.ad-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 150;
  margin: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  min-height: 60px;
  display: none;
}

.ad-sticky[data-ad-active="1"] { display: grid; place-items: center; }

/* ==========================================================================
   视频网格
   ========================================================================== */

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 26px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  margin: 0;
  font-family: 'Oswald', sans-serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .03em;
}

.section-head .count { font-size: 12px; color: var(--text-3); }

.section-head .more { margin-left: auto; font-size: 12.5px; color: var(--text-2); }

.grid {
  display: grid;
  /* 用 minmax(0, 1fr) 而非 1fr：1fr 的隐式 min-width:auto 会被卡片内
     的信息行撑开，导致窄屏下第二列被挤出视口。 */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 12px;
}

.grid > * { min-width: 0; }

/* ---------- 视频卡片 ---------- */
.card {
  position: relative;
  display: block;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s, background .15s;
}

.card:hover { border-color: var(--line-2); background: var(--card-hover); }

.card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #1c1c24 0%, #26262f 50%, #15151b 100%);
  overflow: hidden;
}

/* 无真实缩略图时的占位纹理 —— 接入接口后由 <img> 覆盖 */
.card__thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .014) 0 8px, transparent 8px 16px),
    radial-gradient(ellipse at 30% 20%, rgba(245, 197, 24, .07), transparent 60%);
}

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

.card__badges {
  position: absolute;
  top: 6px;
  left: 6px;
  display: flex;
  gap: 5px;
  z-index: 2;
}

.badge {
  padding: 2px 6px;
  border-radius: 2px;
  font-family: 'Oswald', sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  line-height: 1.4;
}

.badge--hot { background: var(--hot); color: #fff; }
.badge--new { background: var(--gold); color: #000; }
.badge--top { background: rgba(255, 255, 255, .16); color: #fff; }

.card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  border: 1px solid rgba(255, 255, 255, .25);
  opacity: 0;
  transition: opacity .18s;
  z-index: 2;
}

.card:hover .card__play { opacity: 1; }

.card__play svg { fill: #fff; }

.card__meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 22px 8px 7px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .88));
}

.card__title {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.card__info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  color: var(--text-2);
}

.card__info span { white-space: nowrap; }

.card__duration {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 3;
  padding: 1px 5px;
  background: rgba(0, 0, 0, .8);
  border-radius: 2px;
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  letter-spacing: .04em;
}

/* 列表分页 */
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 30px 0 10px;
  flex-wrap: wrap;
}

.pager a, .pager span {
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-2);
}

.pager a:hover { border-color: var(--gold); color: var(--gold); }
.pager .is-current { background: var(--gold); border-color: var(--gold); color: #000; font-weight: 600; }

/* ==========================================================================
   详情 / 播放页
   ========================================================================== */

.player-wrap {
  position: relative;
  margin: 18px 0 14px;
  background: #000;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.detail-head h1 {
  margin: 4px 0 8px;
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 600;
  line-height: 1.35;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
  color: var(--text-3);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.detail-meta .tag {
  padding: 2px 9px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text-2);
}

.detail-meta .tag:hover { border-color: var(--gold); color: var(--gold); }

.detail-desc {
  margin: 16px 0;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.75;
}

.detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 26px;
  align-items: start;
}

/* 侧栏排行榜 */
.rank-list { list-style: none; margin: 0; padding: 0; }

.rank-list li {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.rank-list li:last-child { border-bottom: none; }

.rank-num {
  flex-shrink: 0;
  width: 20px;
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-3);
  text-align: center;
}

.rank-list li:nth-child(-n+3) .rank-num { color: var(--gold); }

.rank-info { min-width: 0; }

.rank-info a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.4;
}

.rank-info span { display: block; margin-top: 2px; font-size: 11px; color: var(--text-3); }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 18px;
}

.panel h3 {
  margin: 0 0 10px;
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--gold);
}

/* ==========================================================================
   页脚
   ========================================================================== */

.site-footer {
  margin-top: 40px;
  padding: 26px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 12.5px;
}

.site-footer .links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-bottom: 12px;
}

.site-footer .links a:hover { color: var(--gold); }

.site-footer p { margin: 0 0 6px; }

.footer-note {
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  line-height: 1.7;
}

/* ==========================================================================
   文档页（关于 / 隐私 / 条款 / DMCA / 2257）
   ========================================================================== */

.page-doc {
  max-width: 840px;
  margin: 26px auto 10px;
}

.page-doc h1 {
  margin: 0 0 6px;
  font-family: 'Oswald', sans-serif;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 600;
  letter-spacing: .02em;
}

.page-doc .updated {
  margin: 0 0 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text-3);
  font-size: 12.5px;
}

.page-doc h2 {
  margin: 28px 0 8px;
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--gold);
}

.page-doc p,
.page-doc li {
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.85;
}

.page-doc p { margin: 0 0 12px; }
.page-doc ul { padding-left: 20px; margin: 0 0 14px; }
.page-doc li { margin-bottom: 6px; }
.page-doc strong { color: var(--text); }
.page-doc a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }

/* ==========================================================================
   响应式
   ========================================================================== */

@media (max-width: 1180px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-body { grid-template-columns: minmax(0, 1fr) 260px; }
}

@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-body { grid-template-columns: minmax(0, 1fr); }
  .ad-float { display: none !important; }
  /* 侧栏广告位是桌面端专属：移动端单列布局下它只会变成一个 600px 的空白块。
     移动端的高频展示由 sticky_bottom 吸底位承接。 */
  .ad-slot--sidebar { display: none !important; }
}

@media (max-width: 640px) {
  .wrap { width: calc(100% - 20px); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 8px; }
  .header-search input { width: 96px; }
  .header-icons { display: none; }
  .site-title { padding: 16px 0 12px; }
  .card__title { font-size: 12px; }
  .ad-slot--banner { min-height: 90px; }
  .ad-slot--banner-lg { min-height: 160px; }
  /* 移动端改由底部吸底位承接高频展示 */
  .ad-sticky { min-height: 56px; }
  body.has-sticky { padding-bottom: 64px; }
}

@media (prefers-reduced-motion: no-preference) {
  .grid:not(.is-static) .card { animation: cardin .34s ease backwards; }
  .card:nth-child(1) { animation-delay: .01s; }
  .card:nth-child(2) { animation-delay: .03s; }
  .card:nth-child(3) { animation-delay: .05s; }
  .card:nth-child(4) { animation-delay: .07s; }
  .card:nth-child(5) { animation-delay: .09s; }
  .card:nth-child(6) { animation-delay: .11s; }
  .card:nth-child(7) { animation-delay: .13s; }
  .card:nth-child(8) { animation-delay: .15s; }
  @keyframes cardin {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
  }
}
