:root {
  --clr-bg: #ffffff;
  --clr-surface: #f6f7fb;
  --clr-border: #e8eaf0;
  --clr-text: #12141a;
  --clr-muted: #7a8092;
  --clr-primary: #b91c1c;
  --clr-accent: #ef4444;
  --radius-md: 14px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --brand-grad: linear-gradient(90deg, var(--clr-primary), var(--clr-accent));
  --bar-grad: linear-gradient(180deg, var(--clr-primary), var(--clr-accent));
  --fs-body: 15px;
  --fs-body-sm: 14px;
  --fs-aux: 13px;
  --fs-aux-xs: 12px;
  --lh-body: 1.7;
  --gap-section: 40px;
  --space-page-x: 20px;
  --maxw: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--clr-bg);
  color: var(--clr-text);
  font-family: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

a {
  color: var(--clr-text);
  text-decoration: none;
}

a:hover {
  color: var(--clr-primary);
}

:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--clr-border);
}

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--space-page-x);
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo:hover {
  color: transparent;
}

.nav-main {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.nav-main a {
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-body-sm);
  color: var(--clr-text);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.nav-main a:hover {
  background: var(--clr-surface);
  color: var(--clr-primary);
}

.search-box {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-box input {
  width: 170px;
  min-width: 0;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-pill);
  font-size: var(--fs-body-sm);
  font-family: inherit;
  background: var(--clr-surface);
  color: var(--clr-text);
}

.search-box input::placeholder {
  color: var(--clr-muted);
}

.search-btn {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 15px;
  border: 0;
  cursor: pointer;
  border-radius: var(--radius-pill);
  font-size: var(--fs-body-sm);
  font-family: inherit;
  color: #fff;
  background: var(--clr-text);
  transition: opacity 0.2s;
}

.search-btn:hover {
  opacity: 0.85;
}

.menu-btn {
  display: none;
}

/* ---------- 容器与骨架 ---------- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px var(--space-page-x) 0;
}

.container > section,
.container > .layout-main {
  margin-bottom: var(--gap-section);
}

.layout-main {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}

.main-col {
  min-width: 0;
}

.side-col {
  position: sticky;
  top: 88px;
  height: fit-content;
}

/* ---------- 面包屑 ---------- */
.breadcrumb {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: var(--fs-aux);
  color: var(--clr-muted);
  margin: 16px 0;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--clr-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--clr-primary);
}

.breadcrumb span[aria-current="page"] {
  color: var(--clr-text);
}

/* ---------- hub-hero ---------- */
.hub-hero {
  padding: 28px 0 24px;
  border-bottom: 1px solid var(--clr-border);
  animation: fade-up 0.5s ease both;
}

.hub-hero h1 {
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 10px;
}

.hero-sub {
  font-size: 16px;
  color: var(--clr-muted);
  line-height: var(--lh-body);
  margin: 0 0 18px;
  max-width: 720px;
}

.hub-stats {
  display: flex;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.hub-stats li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hub-stats strong {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
}

.hub-stats span {
  font-size: var(--fs-aux);
  color: var(--clr-muted);
}

/* ---------- 区块标题 ---------- */
.section-title {
  display: flex;
  align-items: center;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 16px;
  line-height: 1.4;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 18px;
  margin-right: 10px;
  border-radius: 2px;
  background: var(--bar-grad);
  flex: 0 0 auto;
}

.block-title {
  display: flex;
  align-items: center;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 16px;
  line-height: 1.4;
}

.block-title::before {
  content: "";
  width: 4px;
  height: 18px;
  margin-right: 10px;
  border-radius: 2px;
  background: var(--bar-grad);
  flex: 0 0 auto;
}

/* ---------- 题材磁贴 ---------- */
.cat-tiles {
  animation: fade-up 0.5s ease both;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.tile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  text-decoration: none;
  color: var(--clr-text);
  background: var(--clr-bg);
  transition: border-color 0.2s, transform 0.2s, color 0.2s;
}

.tile:hover {
  border-color: var(--clr-primary);
  color: var(--clr-primary);
  transform: translateY(-2px);
}

.tile span {
  font-size: var(--fs-aux);
  color: var(--clr-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- 剧集列表 ---------- */
.episode-section {
  animation: fade-up 0.5s ease both;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.section-head .section-title {
  margin: 0;
}

.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-body-sm);
  font-family: inherit;
  border: 1px solid var(--clr-border);
  background: #fff;
  color: var(--clr-text);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.filter-btn:hover {
  border-color: var(--clr-primary);
  color: var(--clr-primary);
}

.filter-btn.is-active {
  background: var(--brand-grad);
  border-color: var(--clr-primary);
  color: #fff;
}

.episode-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: block;
}

.episode-item {
  display: flex;
  gap: 16px;
  padding: 14px 12px;
  margin: 0 -12px;
  border-bottom: 1px solid var(--clr-border);
  align-items: flex-start;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.episode-item:hover {
  background: var(--clr-surface);
}

.episode-item:hover .ep-name a {
  color: var(--clr-primary);
}

.ep-no {
  flex: 0 0 40px;
  font-size: 20px;
  font-weight: 700;
  color: var(--clr-muted);
  text-align: center;
  padding-top: 6px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.ep-poster {
  flex: 0 0 120px;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--clr-surface);
}

.ep-body {
  flex: 1;
  min-width: 0;
}

.ep-name {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.4;
}

.ep-name a {
  color: var(--clr-text);
  text-decoration: none;
  transition: color 0.2s;
}

.ep-desc {
  font-size: var(--fs-body-sm);
  color: var(--clr-muted);
  line-height: 1.6;
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ep-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.ep-tag {
  font-size: var(--fs-aux-xs);
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--clr-surface);
  color: var(--clr-muted);
  line-height: 1.6;
}

.ep-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: var(--fs-aux);
  color: var(--clr-muted);
  align-items: center;
}

.ep-meta time {
  font-variant-numeric: tabular-nums;
}

/* ---------- 右栏 ---------- */
.side-block {
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  background: var(--clr-bg);
  padding: 16px;
  margin-bottom: 20px;
}

.side-title {
  display: flex;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
  line-height: 1.4;
}

.side-title::before {
  content: "";
  width: 4px;
  height: 16px;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--bar-grad);
  flex: 0 0 auto;
}

.hot-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hot-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--clr-border);
}

.hot-list li:last-child {
  border-bottom: 0;
}

.hot-list li a {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--clr-text);
  text-decoration: none;
  transition: color 0.2s;
}

.hot-list li a:hover {
  color: var(--clr-primary);
}

.hot-rank {
  flex: 0 0 22px;
  font-weight: 700;
  color: var(--clr-muted);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.hot-name {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-body-sm);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hot-num {
  flex: 0 0 auto;
  font-size: var(--fs-aux);
  color: var(--clr-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hot-list li:nth-child(1) .hot-rank,
.hot-list li:nth-child(2) .hot-rank,
.hot-list li:nth-child(3) .hot-rank {
  color: var(--clr-primary);
}

.update-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.update-list li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--clr-border);
}

.update-list li:last-child {
  border-bottom: 0;
}

.update-list li a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--clr-text);
  text-decoration: none;
  transition: color 0.2s;
}

.update-list li a:hover {
  color: var(--clr-primary);
}

.up-name {
  font-size: 15px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.update-list time {
  font-size: var(--fs-aux);
  color: var(--clr-muted);
  font-variant-numeric: tabular-nums;
}

.tag-pill {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-pill a {
  font-size: var(--fs-aux);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--clr-surface);
  color: var(--clr-muted);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.tag-pill a:hover {
  background: var(--clr-border);
  color: var(--clr-primary);
}

/* ---------- 关于 / FAQ ---------- */
.about-block,
.faq-block {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--clr-border);
}

.about-block p {
  font-size: var(--fs-body-sm);
  line-height: 1.8;
  color: var(--clr-muted);
  margin: 0 0 12px;
}

.about-block p:last-child {
  margin-bottom: 0;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}

.faq-list dt {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--clr-text);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: #fff;
}

.faq-list dt::before {
  content: "Q";
  margin-right: 8px;
  color: var(--clr-muted);
  font-weight: 800;
}

.faq-list dd {
  font-size: var(--fs-body-sm);
  line-height: 1.75;
  color: var(--clr-muted);
  margin: -4px 0 0;
  padding: 0 16px 14px;
  border: 1px solid var(--clr-border);
  border-top: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: #fff;
}

.faq-list dd::before {
  content: "A";
  margin-right: 8px;
  font-weight: 700;
}

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 56px;
  padding: 40px 0 22px;
  background: var(--clr-surface);
  border-top: 1px solid var(--clr-border);
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--space-page-x);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 20px;
}

.footer-nav a {
  font-size: var(--fs-aux);
  color: var(--clr-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-nav a:hover {
  color: var(--clr-primary);
}

.friend-links {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  border-top: 1px dashed var(--clr-border);
  align-items: center;
}

.friend-links span {
  font-size: var(--fs-aux-xs);
  color: var(--clr-muted);
}

.friend-links a {
  font-size: var(--fs-aux-xs);
  color: var(--clr-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.friend-links a:hover {
  color: var(--clr-primary);
}

.footer-bottom {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 20px 0;
  border-top: 1px dashed var(--clr-border);
  text-align: center;
}

.footer-bottom p {
  margin: 3px 0;
  font-size: var(--fs-aux-xs);
  color: var(--clr-muted);
  line-height: 1.8;
}

.footer-bottom a {
  color: var(--clr-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-bottom a:hover {
  color: var(--clr-primary);
}

/* ---------- 移动端 ---------- */
@media (max-width: 768px) {
  :root {
    --space-page-x: 16px;
    --gap-section: 44px;
  }

  .header-inner {
    height: 56px;
    gap: 12px;
  }

  .logo {
    font-size: 17px;
    max-width: 56%;
  }

  .nav-main,
  .search-box input {
    display: none;
  }

  .menu-btn {
    display: flex;
    margin-left: auto;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--clr-text);
    cursor: pointer;
  }

  .container {
    padding-top: 16px;
  }

  .hub-hero {
    padding: 20px 0 18px;
  }

  .hub-stats {
    gap: 20px;
    flex-wrap: wrap;
  }

  .layout-main {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .side-col {
    position: static;
    top: auto;
  }

  .episode-item {
    gap: 12px;
    padding: 12px 10px;
    margin: 0 -10px;
  }

  .ep-no {
    flex: 0 0 28px;
    font-size: 16px;
    padding-top: 4px;
  }

  .ep-poster {
    flex: 0 0 88px;
  }

  .ep-name {
    font-size: 16px;
  }

  .about-block,
  .faq-block {
    margin-top: 36px;
    padding-top: 26px;
  }

  .site-footer {
    margin-top: 44px;
    padding: 32px 0 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}