* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: #ffffff;
  color: #18191c;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

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

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

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

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

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

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

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

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

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

.tags-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 */
.tags-site-header #userHeaderMount [class*="dropdown"],
.tags-site-header #userHeaderMount [class*="popover"],
.tags-site-header #userHeaderMount [class*="popup"],
.tags-site-header #userHeaderMount [class*="panel"],
.tags-site-header #userHeaderMount [class*="menu"] {
  z-index: 20000 !important;
}

/* =========================================================
   视频分类导航：一级导航样式，增强视觉权重
   ========================================================= */
.tags-category-nav {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin: 0 0 30px;
  padding: 18px 20px;
  border: 1px solid #e8eaed;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}

.tags-category-label {
  position: relative;
  padding-left: 14px;
  color: #18191c;
  font-size: 18px;
  line-height: 26px;
  font-weight: 800;
  white-space: nowrap;
}

.tags-category-label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 22px;
  border-radius: 999px;
  background: #fb7299;
  transform: translateY(-50%);
}

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

.tags-category-scroll::-webkit-scrollbar {
  height: 5px;
}

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

.tags-category-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid #e6e8eb;
  border-radius: 12px;
  background: #f6f7f8;
  color: #3f4247;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  transition: 0.18s ease;
}

.tags-category-chip small {
  color: #8f949b;
  font-size: 13px;
  font-weight: 500;
}

.tags-category-chip:hover {
  border-color: #ffb8cd;
  background: #fff0f5;
  color: #fb4f93;
  box-shadow: 0 4px 12px rgba(251, 79, 147, 0.08);
  transform: translateY(-1px);
}

.tags-category-chip:hover small {
  color: #fb7299;
}

.tags-category-chip.active {
  border-color: #fb7299;
  background: #fb7299;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 5px 14px rgba(251, 114, 153, 0.2);
}

.tags-category-chip.active small {
  color: rgba(255, 255, 255, 0.9);
}

/* =========================================================
   标签总览 Hero
   背景图由 .tags-header-shell 提供，Hero 本身完全透明。
   ========================================================= */
.tags-hero {
  position: relative;
  z-index: 5;
  min-height: 366px;
  display: flex;
  align-items: center;
  background: transparent !important;
}

/* 兼容旧 HTML；即使还有这个节点，也绝不覆盖图片。 */
.tags-hero-overlay {
  display: none !important;
  background: none !important;
}

.tags-hero-inner {
  width: min(1540px, calc(100% - 64px));
  min-height: 366px;
  margin: 0 auto;
  padding: 38px 0 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  color: #ffffff;
}

.tags-hero-badge {
  width: fit-content;
  margin-bottom: 16px;
  padding: 6px 15px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.16);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.tags-hero h1 {
  margin: 0;
  color: #ffffff;
  font-size: 54px;
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: -1px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.tags-hero p {
  max-width: 720px;
  margin: 14px 0 0;
  color: #ffffff;
  font-size: 17px;
  line-height: 1.7;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.tags-hero-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.tags-hero-meta span {
  display: inline-flex;
  align-items: center;
}

.tags-hero-meta span + span {
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.42);
}

/* =========================================================
   主内容
   ========================================================= */
.tags-page {
  width: min(1540px, calc(100% - 64px));
  margin: 0 auto;
  padding: 26px 0 64px;
}

.tags-breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 18px;
  color: #9499a0;
  font-size: 14px;
  line-height: 22px;
}

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

.tags-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f2f3;
}

.tags-heading h2 {
  margin: 0;
  font-size: 28px;
  line-height: 38px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.tags-heading p {
  margin: 3px 0 0;
  color: #9499a0;
  font-size: 13px;
  line-height: 20px;
}

.tags-total {
  flex-shrink: 0;
  color: #9499a0;
  font-size: 13px;
  white-space: nowrap;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  gap: 9px 10px;
}

.tag-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #e8eaed;
  border-radius: 10px;
  background: #ffffff;
  color: #4d5156;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
  transition: color 0.16s ease, background 0.16s ease,
    border-color 0.16s ease, box-shadow 0.16s ease;
}

.tag-item-name {
  color: inherit;
  font-weight: 500;
}

.tag-item-count {
  color: #a3a7ad;
  font-size: 12px;
  font-weight: 400;
}

.tag-item:hover {
  color: #fb4f93;
  background: #fff8fb;
  border-color: #ffc9dc;
  box-shadow: 0 3px 10px rgba(251, 79, 147, 0.08);
}

.tag-item:hover .tag-item-count {
  color: #fb7299;
}

.tags-empty {
  width: 100%;
  padding: 48px 20px;
  border: 1px dashed #e3e5e7;
  border-radius: 12px;
  color: #9499a0;
  text-align: center;
  font-size: 14px;
}

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

  /* 手机端：不显示 PC 公共头部，继续使用 mobile-bottom-nav */
  .tags-site-header,
  .tags-site-header #userHeaderMount {
    display: none !important;
  }

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

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

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

  .tags-hero-inner {
    width: 100%;
    min-height: 230px;
    margin: 0;
    padding: 26px 16px 22px;
    justify-content: flex-end;
  }

  .tags-hero-badge {
    margin-bottom: 8px;
    padding: 4px 10px;
    font-size: 11px;
  }

  .tags-hero h1 {
    font-size: 31px;
    line-height: 1.14;
  }

  .tags-hero p {
    max-width: 76%;
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.55;
  }

  .tags-hero-meta {
    margin-top: 10px;
    gap: 8px;
    font-size: 11px;
  }

  .tags-hero-meta span + span {
    padding-left: 8px;
  }

  .tags-page {
    width: auto;
    margin: 0;
    padding: 14px 12px 28px;
  }

  .tags-breadcrumb {
    margin-bottom: 11px;
    font-size: 12px;
    line-height: 18px;
  }

  .tags-category-nav {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
    margin-bottom: 18px;
    padding: 12px;
    border-radius: 11px;
  }

  .tags-category-label {
    padding-left: 10px;
    font-size: 14px;
    line-height: 22px;
  }

  .tags-category-label::before {
    width: 3px;
    height: 18px;
  }

  .tags-category-scroll {
    gap: 8px;
  }

  .tags-category-chip {
    min-height: 38px;
    padding: 0 14px;
    gap: 6px;
    border-radius: 9px;
    font-size: 14px;
  }

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

  .tags-heading {
    align-items: flex-start;
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  .tags-heading h2 {
    font-size: 22px;
    line-height: 30px;
  }

  .tags-heading p {
    margin-top: 2px;
    font-size: 12px;
    line-height: 18px;
  }

  .tags-total {
    padding-top: 7px;
    font-size: 11px;
  }

  .tags-list {
    gap: 7px;
  }

  .tag-item {
    min-height: 32px;
    padding: 0 10px;
    gap: 5px;
    border-radius: 8px;
    font-size: 13px;
  }

  .tag-item-count {
    font-size: 11px;
  }
}

@media (max-width: 390px) {
  .tags-page {
    padding-left: 10px;
    padding-right: 10px;
  }

  .tags-heading {
    gap: 10px;
  }

  .tags-heading h2 {
    font-size: 21px;
  }

  .tag-item {
    min-height: 31px;
    padding: 0 9px;
  }
}
