/* ============================================================
   纯静态视频站 - 全局样式（深色主题 + 响应式）
   适配：手机 / 平板 / PC，无框架、无构建步骤
   ============================================================ */

:root {
  --bg: #0e1116;
  --bg-soft: #151a21;
  --panel: #1a2029;
  --text: #e8edf3;
  --muted: #98a2b3;
  --line: #2a3340;
  --accent: #e5484d;
  --accent-soft: #7f1d1d;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

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

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .5px;
  white-space: nowrap;
}

.brand-mark {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--accent), #ff9a6c);
  box-shadow: 0 0 12px rgba(229, 72, 77, .5);
}

.back {
  color: var(--muted);
  font-size: 14px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}
.back:hover { color: var(--text); border-color: var(--accent); }

.search {
  display: flex;
  gap: 8px;
  flex: 0 1 380px;
}
.search input {
  flex: 1;
  min-width: 0;
  padding: 9px 14px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
}
.search input:focus { border-color: var(--accent); }
.search input::placeholder { color: #6b7686; }
.search button {
  padding: 9px 18px;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.search button:hover { background: #f0565b; }

/* ---------- 分类筛选 ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 20px 0 4px;
}
.chip {
  padding: 6px 14px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  transition: .15s;
}
.chip:hover { color: var(--text); border-color: #475569; }
.chip.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* ---------- 区块标题 ---------- */
.heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 22px 0 14px;
}
.heading h1 { font-size: 20px; margin: 0; }
.count { color: var(--muted); font-size: 13px; }

/* ---------- 视频卡片网格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  padding-bottom: 40px;
}

.card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.card-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #232b36, #10151c);
}
/* 图片加载失败时的文字占位 */
.card-cover::before {
  content: attr(data-title);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: #64748b;
  font-size: 14px;
  text-align: center;
}
.card-cover img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}
.card:hover .card-cover img { transform: scale(1.04); }

.badge {
  position: absolute;
  z-index: 2;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .65);
  color: #fff;
}
.badge.top { top: 8px; left: 8px; background: var(--accent); }
.badge.bottom { bottom: 8px; right: 8px; }

.card-body { padding: 12px 14px 14px; }
.card-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-desc {
  margin: 0 0 10px;
  height: 38px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #7c8899;
  font-size: 12px;
}
.card-meta .score { color: #f5b301; }

.empty {
  padding: 60px 0;
  text-align: center;
  color: var(--muted);
}

/* ---------- 播放页 ---------- */
.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
  padding: 20px 0 40px;
}

.player-box {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.player-box video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}
.player-tip {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: #fff;
  background: rgba(0, 0, 0, .78);
  font-size: 14px;
  line-height: 1.8;
}
/* hidden 属性必须显式生效，否则 display:flex 会覆盖它导致遮罩常驻 */
.player-tip[hidden] { display: none; }

.detail {
  margin-top: 18px;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.detail h2 { margin: 0 0 8px; font-size: 20px; }
.detail .sub { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.detail .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.detail .tag {
  padding: 3px 10px;
  font-size: 12px;
  color: #cbd5e1;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.detail .desc { color: #c3ccd8; font-size: 14px; white-space: pre-wrap; }

.panel {
  margin-bottom: 16px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.panel h3 {
  margin: 0 0 12px;
  font-size: 15px;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
}
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}
.ep {
  padding: 8px 4px;
  text-align: center;
  font-size: 13px;
  color: #cbd5e1;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ep:hover { border-color: var(--accent); color: #fff; }
.ep.active { color: #fff; background: var(--accent); border-color: var(--accent); }

.rel-list { display: flex; flex-direction: column; gap: 10px; }
.rel-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px;
  border-radius: 8px;
}
.rel-item:hover { background: var(--bg-soft); }
.rel-item img {
  width: 92px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  flex: none;
  background: #232b36;
}
.rel-item .t {
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rel-item .m { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ---------- 页脚 ---------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 20px 0 30px;
  border-top: 1px solid var(--line);
  color: #6b7686;
  font-size: 12px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .play-layout { grid-template-columns: 1fr; }
  .side-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .side-col .panel { margin-bottom: 0; }
}

@media (max-width: 640px) {
  .wrap { width: calc(100% - 24px); }
  .header-inner { flex-wrap: wrap; padding: 10px 0; gap: 10px; }
  .brand { font-size: 17px; }
  .search { flex: 1 1 100%; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card-body { padding: 10px; }
  .card-title { font-size: 14px; }
  .card-desc { display: none; }
  .card-meta { font-size: 11px; gap: 6px; }
  .side-col { grid-template-columns: 1fr; }
  .detail { padding: 14px; }
  .detail h2 { font-size: 17px; }
  .site-footer { flex-direction: column; }
}

@media (max-width: 360px) {
  .grid { grid-template-columns: 1fr; }
  .card-desc { display: -webkit-box; }
}
