* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body.video-taxonomy-page {
  background: #ffffff;
  color: #18191c;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

body.video-taxonomy-page a {
  color: inherit;
  text-decoration: none;
}

body.video-taxonomy-page img {
  display: block;
  width: 100%;
}

/* =========================================================
   PC：完全照漫画页的头部层级处理
   外层允许下拉溢出；背景放进独立裁剪层。
   背景只显示 taxonomy-hero.png 原图，不加渐变、不加滤镜。
   ========================================================= */
.taxonomy-header-shell {
  position: relative;
  width: 100%;
  min-height: 380px;
  overflow: visible !important;
  background: #17131b;
}

.taxonomy-header-bg-clip {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.taxonomy-header-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("/static/user/img/taxonomy-hero.png");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  background-color: #17131b;
}

.taxonomy-site-header {
  position: relative;
  z-index: 10000 !important;
  min-height: 64px;
  overflow: visible !important;
  background: transparent !important;
}

.taxonomy-site-header #userHeaderMount {
  position: relative;
  z-index: 10001 !important;
  overflow: visible !important;
  background: transparent !important;
  border-bottom: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.taxonomy-site-header #userHeaderMount .top-nav {
  position: relative;
  z-index: 10002 !important;
  overflow: visible !important;
  background: transparent !important;
  color: #ffffff !important;
  border-bottom: 0 !important;
}

.taxonomy-site-header #userHeaderMount .nav-left,
.taxonomy-site-header #userHeaderMount .nav-right,
.taxonomy-site-header #userHeaderMount .nav-left a,
.taxonomy-site-header #userHeaderMount .nav-right > a,
.taxonomy-site-header #userHeaderMount .header-dynamic-link,
.taxonomy-site-header #userHeaderMount .header-favorite-link,
.taxonomy-site-header #userHeaderMount .header-history-link {
  color: #ffffff !important;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.55) !important;
}

.taxonomy-site-header #userHeaderMount .nav-left a:hover,
.taxonomy-site-header #userHeaderMount .nav-right > a:hover {
  color: #fb7299 !important;
}

.taxonomy-site-header #userHeaderMount .search-box {
  background: rgba(255, 255, 255, 0.96) !important;
  color: #18191c !important;
  text-shadow: none !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

/* 和漫画页一致：任何公共头部浮层都高于头部和 Hero */
.taxonomy-site-header #userHeaderMount [class*="dropdown"],
.taxonomy-site-header #userHeaderMount [class*="popover"],
.taxonomy-site-header #userHeaderMount [class*="popup"],
.taxonomy-site-header #userHeaderMount [class*="panel"],
.taxonomy-site-header #userHeaderMount [class*="menu"] {
  z-index: 20000 !important;
}

/* =========================================================
   Hero
   背景来自 .taxonomy-header-shell，本区域完全透明。
   ========================================================= */
.topic-hero {
  position: relative;
  z-index: 5;
  min-height: 316px;
  display: flex;
  align-items: center;
  background: transparent !important;
  border-radius: 0;
  overflow: visible;
}

.tag-detail-page .tag-topic-hero,
.category-detail-page .category-topic-hero {
  background-image: none !important;
  background: transparent !important;
}

/* 兼容旧 HTML：绝对不允许 overlay 改变原图颜色 */
.topic-hero-overlay {
  display: none !important;
  background: none !important;
  filter: none !important;
  opacity: 0 !important;
}

.topic-hero-content {
  width: min(1680px, calc(100% - 56px));
  margin: 0 auto;
  padding: 42px 44px 54px;
  color: #ffffff;
  text-shadow: 0 2px 9px rgba(0, 0, 0, 0.58);
}

.topic-kicker {
  margin-bottom: 7px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.topic-hero h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.6px;
}

.topic-hero p {
  max-width: 820px;
  margin: 12px 0 0;
  color: #ffffff;
  font-size: 15px;
  line-height: 1.75;
}

.topic-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.topic-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.16);
  color: #ffffff;
  font-size: 12px;
}

/* =========================================================
   主内容
   ========================================================= */
.taxonomy-main {
  width: min(1680px, calc(100% - 56px));
  margin: 0 auto;
  padding: 22px 0 64px;
}

.taxonomy-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  color: #9499a0;
  font-size: 14px;
  line-height: 22px;
}

.taxonomy-breadcrumb a:hover {
  color: #fb7299;
}

.seo-note {
  margin: 12px 0 0;
  padding: 9px 12px;
  border-radius: 8px;
  background: #fff7e6;
  color: #8a5a00;
  font-size: 13px;
}

/* =========================================================
   分类 / 标签横向导航
   ========================================================= */
.taxonomy-nav {
  margin: 16px 0 24px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f2f3;
}

.taxonomy-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.taxonomy-row + .taxonomy-row {
  margin-top: 10px;
}

.taxonomy-label {
  color: #18191c;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.taxonomy-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 5px;
  scrollbar-width: thin;
  scrollbar-color: #d9dce1 transparent;
}

.taxonomy-scroll::-webkit-scrollbar {
  height: 4px;
}

.taxonomy-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #d9dce1;
}

.taxonomy-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #f6f7f8;
  color: #61666d;
  font-size: 14px;
  white-space: nowrap;
  transition: 0.18s ease;
}

.taxonomy-chip small {
  color: #9499a0;
  font-size: 12px;
  font-weight: 400;
}

.taxonomy-chip:hover {
  border-color: #ffd2df;
  background: #fff0f4;
  color: #fb7299;
}

.taxonomy-chip.active {
  border-color: #fb7299;
  background: #fb7299;
  color: #ffffff;
  font-weight: 700;
}

.taxonomy-chip.active small {
  color: rgba(255, 255, 255, 0.88);
}

.taxonomy-all-tags {
  border-color: #e3e5e7;
  background: #ffffff;
}

.muted {
  color: #9499a0;
  font-size: 13px;
}

/* =========================================================
   视频列表
   ========================================================= */
.taxonomy-results {
  min-width: 0;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.result-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.result-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 30px;
  font-weight: 800;
}

.result-count,
.page-state {
  color: #9499a0;
  font-size: 13px;
  white-space: nowrap;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 28px 20px;
  align-items: start;
}

.video-card {
  min-width: 0;
  overflow: hidden;
}

.cover {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: #f1f2f3;
}

.cover img {
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

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

.cover-mask {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 30px 8px 7px;
  color: #ffffff;
  font-size: 12px;
  line-height: 1;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent);
}

.cover-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  white-space: nowrap;
}

.duration {
  flex-shrink: 0;
  white-space: nowrap;
}

.vip-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 2;
  padding: 3px 7px;
  border-radius: 5px;
  background: #fb7299;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.video-title {
  height: 42px;
  margin: 8px 0 4px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
}

.video-title a:hover {
  color: #fb7299;
}

.video-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 18px;
  overflow: hidden;
  color: #9499a0;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

.author-name {
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-dot {
  color: #c9ccd0;
}

.empty {
  grid-column: 1 / -1;
  padding: 54px 20px;
  border-radius: 12px;
  background: #f6f7f8;
  color: #9499a0;
  text-align: center;
}

/* =========================================================
   分页
   ========================================================= */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 38px 0 8px;
}

.page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e3e5e7;
  border-radius: 8px;
  background: #ffffff;
  color: #61666d;
  font-size: 14px;
}

.page-btn:hover {
  border-color: #fb7299;
  color: #fb7299;
}

.page-btn.active {
  border-color: #fb7299;
  background: #fb7299;
  color: #ffffff;
  font-weight: 700;
}

.page-gap {
  color: #9499a0;
}

@media (max-width: 1250px) {
  .video-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .video-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  body.video-taxonomy-page {
    padding-bottom: 66px;
  }

  /* 手机端隐藏 PC 公共头部，使用公共底栏 */
  .taxonomy-site-header,
  .taxonomy-site-header #userHeaderMount {
    display: none !important;
  }

  .taxonomy-header-shell {
    min-height: 230px;
  }

  .taxonomy-header-bg {
    background-position: 64% center;
    background-size: cover;
  }

  .topic-hero {
    min-height: 230px;
  }

  .topic-hero-content {
    width: 100%;
    margin: 0;
    padding: 28px 16px 22px;
    align-self: flex-end;
  }

  .topic-kicker {
    font-size: 11px;
  }

  .topic-hero h1 {
    font-size: 28px;
    line-height: 1.2;
  }

  .topic-hero p {
    max-width: 78%;
    margin-top: 7px;
    font-size: 13px;
    line-height: 1.55;
  }

  .topic-meta {
    margin-top: 10px;
  }

  .taxonomy-main {
    width: auto;
    padding: 12px 10px 28px;
  }

  .taxonomy-breadcrumb {
    margin-bottom: 10px;
    font-size: 13px;
  }

  .taxonomy-nav {
    margin: 10px 0 18px;
    padding: 8px 0 10px;
  }

  .taxonomy-row {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 6px;
  }

  .taxonomy-label {
    font-size: 13px;
  }

  .taxonomy-chip {
    min-height: 32px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 12px;
  }

  .taxonomy-chip small {
    font-size: 11px;
  }

  .result-head {
    margin-bottom: 12px;
  }

  .result-head h2 {
    font-size: 19px;
    line-height: 26px;
  }

  .result-count {
    display: none;
  }

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

  .video-title {
    height: 38px;
    margin-top: 7px;
    font-size: 14px;
    line-height: 1.35;
  }

  .video-meta {
    font-size: 11px;
  }

  .pagination {
    margin-top: 28px;
  }
}
