:root {
  --bg: #edf1f6;
  --surface: #f8fafc;
  --paper: #ffffff;
  --ink: #1d2a38;
  --muted: #677586;
  --line: #d9e0e8;
  --navy: #24415f;
  --blue: #43698d;
  --slate: #7e90a3;
  --gold: #bf9a61;
  --shadow: 0 20px 44px rgba(29, 42, 56, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(36, 65, 95, 0.08), rgba(36, 65, 95, 0) 220px),
    var(--bg);
  color: var(--ink);
  font: 16px/1.6 "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

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

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(248, 250, 252, 0.95);
  border-bottom: 1px solid rgba(36, 65, 95, 0.1);
  backdrop-filter: blur(14px);
}

.topbar-inner,
.shell,
.footer {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar-inner {
  display: grid;
  grid-template-columns: auto 1fr minmax(220px, 320px);
  align-items: center;
  gap: 24px;
  min-height: 82px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #fff;
  font-weight: 800;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 1.1rem;
}

.brand-copy small,
.nav a,
.search input::placeholder,
.section-head span,
.side-head span,
.card-copy small,
.card-copy em,
.archive-sub,
.footer p,
.footer a,
.guide-grid p,
.detail-sub,
.detail-copy p,
.side-panel p,
.summary-box p,
.note-row p {
  color: var(--muted);
}

.nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
}

.nav a {
  position: relative;
  padding: 6px 0;
  font-weight: 600;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--navy), var(--gold));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.nav a:hover::after,
.nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.search input {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(36, 65, 95, 0.12);
  border-radius: 999px;
  background: var(--paper);
  padding: 0 18px;
  color: var(--ink);
}

.shell {
  padding: 28px 0 56px;
}

.hero-board,
.entry-row,
.panel,
.reading-layout,
.triple-layout,
.guide-grid,
.library-banner,
.filter-panel,
.library-layout,
.detail-stage,
.detail-panels {
  margin-bottom: 24px;
}

.hero-board,
.reading-layout,
.triple-layout,
.library-layout,
.detail-panels {
  display: grid;
  gap: 20px;
}

.hero-board {
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.9fr);
}

.hero-main,
.hero-side,
.panel,
.library-banner,
.filter-panel,
.side-panel,
.archive-item,
.detail-stage,
.footer > div,
.guide-grid article {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(36, 65, 95, 0.08);
  box-shadow: var(--shadow);
}

.hero-main {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(250px, 0.9fr);
  overflow: hidden;
  border-radius: 28px;
}

.hero-copy {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 34px;
}

.hero-copy span,
.section-head span,
.side-head span,
.library-banner span,
.detail-state,
.note-row .label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.hero-copy h1,
.section-head h1,
.section-head h2,
.library-banner h1,
.detail-main h1 {
  margin: 0;
  line-height: 1.14;
}

.hero-copy h1 {
  font-size: clamp(2rem, 3vw, 3rem);
}

.hero-copy p,
.section-head p,
.library-banner p,
.archive-desc,
.detail-desc {
  margin: 0;
  color: #415364;
}

.hero-poster {
  background: #d6dde6;
}

.hero-poster img,
.detail-poster img {
  height: 100%;
  object-fit: cover;
}

.hero-meta,
.archive-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-meta b,
.archive-meta span,
.archive-row .year,
.note-row .label {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(36, 65, 95, 0.08);
  color: var(--navy);
  font-size: 0.94rem;
}

.hero-copy a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 130px;
  height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #fff;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.hero-copy a:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(36, 65, 95, 0.16);
}

.hero-side,
.panel {
  border-radius: 24px;
  padding: 24px;
}

.side-head,
.section-head {
  display: grid;
  gap: 6px;
}

.section-head {
  margin-bottom: 18px;
}

.section-head.compact {
  margin-bottom: 16px;
}

.rank-row,
.archive-row {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(36, 65, 95, 0.08);
  transition: transform 180ms ease, color 180ms ease;
}

.rank-row {
  grid-template-columns: 34px 62px minmax(0, 1fr) 44px;
}

.archive-row {
  grid-template-columns: 34px 72px minmax(0, 1fr) 44px;
}

.rank-row:last-child,
.archive-row:last-child {
  border-bottom: 0;
}

.rank-row:hover,
.archive-row:hover {
  transform: translateX(4px);
  color: var(--navy);
}

.rank-row b,
.archive-row b,
.archive-order {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(36, 65, 95, 0.08);
  font-size: 0.9rem;
  font-weight: 700;
}

.rank-row img {
  width: 62px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 12px;
}

.rank-row span {
  display: grid;
}

.rank-row em,
.archive-row em {
  justify-self: end;
  font-style: normal;
  font-weight: 700;
  color: var(--blue);
}

.entry-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.entry-row a {
  display: grid;
  place-items: center;
  min-height: 54px;
  padding: 0 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(36, 65, 95, 0.95), rgba(67, 105, 141, 0.95));
  color: #fff;
  font-weight: 700;
  text-align: center;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.entry-row a:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(36, 65, 95, 0.18);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

.card {
  display: grid;
  gap: 10px;
}

.card-cover {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  aspect-ratio: 2 / 3;
  background: #d6dde6;
  border: 1px solid rgba(36, 65, 95, 0.08);
}

.card-cover img {
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.card:hover img {
  transform: scale(1.04);
}

.kind-tag,
.score-tag {
  position: absolute;
  top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 30px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
  z-index: 1;
}

.kind-tag {
  left: 12px;
  padding: 0 12px;
  background: rgba(29, 42, 56, 0.72);
}

.score-tag {
  right: 12px;
  padding: 0 10px;
  background: rgba(191, 154, 97, 0.92);
}

.card-hover,
.archive-hover {
  position: absolute;
  inset: auto 0 0 0;
  display: grid;
  gap: 4px;
  padding: 18px 16px 14px;
  color: #fff;
  background: linear-gradient(180deg, rgba(29, 42, 56, 0), rgba(29, 42, 56, 0.86));
  transform: translateY(100%);
  transition: transform 220ms ease;
}

.card:hover .card-hover,
.archive-cover:hover .archive-hover {
  transform: translateY(0);
}

.card-copy {
  display: grid;
  gap: 2px;
}

.card-copy a {
  font-weight: 700;
}

.card-copy em {
  font-style: normal;
}

.reading-layout,
.detail-panels {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rank-list,
.archive-column-list,
.archive-list {
  display: grid;
}

.note-list {
  display: grid;
  gap: 14px;
}

.note-row {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(36, 65, 95, 0.05);
  transition: transform 180ms ease, background 180ms ease;
}

.note-row:hover {
  transform: translateY(-2px);
  background: rgba(36, 65, 95, 0.08);
}

.note-row strong {
  font-size: 1.05rem;
}

.note-row p {
  margin: 0;
}

.triple-layout {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.archive-panel {
  min-height: 100%;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.guide-grid article {
  border-radius: 24px;
  padding: 24px;
}

.library-banner {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  border-radius: 28px;
  padding: 28px;
}

.summary-box {
  display: grid;
  gap: 8px;
  min-width: 220px;
  padding: 20px;
  border-radius: 22px;
  background: rgba(36, 65, 95, 0.06);
}

.summary-box strong {
  font-size: 1.4rem;
}

.filter-panel {
  display: grid;
  gap: 16px;
  border-radius: 24px;
  padding: 20px;
}

.filter-row,
.select-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.filter {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(36, 65, 95, 0.12);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.filter:hover,
.filter.active {
  transform: translateY(-1px);
  border-color: rgba(36, 65, 95, 0.28);
  background: rgba(36, 65, 95, 0.08);
}

.select-row label {
  display: grid;
  gap: 6px;
}

.select-row span {
  font-size: 0.9rem;
  color: var(--muted);
}

.select-row select {
  min-width: 150px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(36, 65, 95, 0.12);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
}

.library-layout {
  grid-template-columns: minmax(230px, 270px) minmax(0, 1fr);
}

.side-panel {
  position: sticky;
  top: 102px;
  align-self: start;
  display: grid;
  gap: 10px;
  border-radius: 24px;
  padding: 22px;
}

.side-panel a {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(36, 65, 95, 0.06);
  font-weight: 600;
}

.archive-list {
  gap: 16px;
}

.archive-item {
  display: grid;
  grid-template-columns: 54px 132px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  border-radius: 24px;
  padding: 16px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.archive-item:hover {
  transform: translateY(-2px);
  border-color: rgba(36, 65, 95, 0.18);
  box-shadow: 0 18px 36px rgba(29, 42, 56, 0.1);
}

.archive-cover {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  aspect-ratio: 2 / 3;
  background: #d6dde6;
}

.archive-cover img {
  height: 100%;
  object-fit: cover;
}

.archive-hover {
  inset: 0;
  place-items: center;
  background: linear-gradient(180deg, rgba(29, 42, 56, 0.08), rgba(29, 42, 56, 0.78));
}

.archive-main {
  display: grid;
  gap: 12px;
}

.archive-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.archive-title {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 1.35rem;
  font-weight: 800;
}

.archive-score {
  display: grid;
  justify-items: center;
  align-content: center;
  width: 88px;
  min-width: 88px;
  aspect-ratio: 1;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(36, 65, 95, 0.08), rgba(191, 154, 97, 0.12));
}

.archive-score strong {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--navy);
}

.archive-bottom {
  display: grid;
  gap: 10px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-row a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(36, 65, 95, 0.08);
  color: var(--navy);
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 180ms ease;
}

.tag-row a:hover {
  background: rgba(36, 65, 95, 0.12);
}

.archive-credits {
  display: grid;
  gap: 4px;
  color: var(--muted);
}

.detail-stage {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 24px;
  border-radius: 28px;
  padding: 24px;
}

.detail-poster {
  overflow: hidden;
  border-radius: 24px;
  background: #d6dde6;
}

.detail-main {
  display: grid;
  align-content: start;
  gap: 16px;
}

.detail-state {
  color: var(--navy);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.detail-grid div {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(36, 65, 95, 0.06);
}

.detail-grid dt {
  margin-bottom: 6px;
  color: var(--muted);
}

.detail-grid dd {
  margin: 0;
  font-weight: 700;
}

.episode-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.episode-grid button {
  min-height: 46px;
  border: 1px solid rgba(36, 65, 95, 0.12);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, color 180ms ease;
}

.episode-grid button:hover {
  transform: translateY(-1px);
  border-color: rgba(36, 65, 95, 0.3);
  color: var(--navy);
}

.detail-copy {
  display: grid;
  gap: 12px;
}

.footer {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 20px;
  padding: 0 0 42px;
}

.footer > div {
  display: grid;
  gap: 8px;
  padding: 24px;
  border-radius: 24px;
}

.copy {
  grid-column: 1 / -1;
  margin: 0;
  text-align: center;
}

@media (max-width: 1100px) {
  .topbar-inner,
  .hero-board,
  .reading-layout,
  .triple-layout,
  .library-layout,
  .detail-stage,
  .detail-panels,
  .footer {
    grid-template-columns: 1fr;
  }

  .topbar-inner {
    padding: 14px 0;
  }

  .nav {
    justify-content: flex-start;
  }

  .side-panel {
    position: static;
  }

  .card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .topbar-inner,
  .hero-main,
  .guide-grid,
  .detail-panels,
  .detail-grid,
  .footer {
    grid-template-columns: 1fr;
  }

  .entry-row,
  .card-grid,
  .episode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .archive-item,
  .archive-head,
  .library-banner {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: start;
  }

  .archive-cover {
    width: min(180px, 100%);
  }

  .panel,
  .hero-copy,
  .hero-side,
  .library-banner,
  .side-panel,
  .detail-stage {
    padding: 20px;
  }

  .shell,
  .topbar-inner,
  .footer {
    width: min(100% - 20px, 1280px);
  }
}


/* stable responsive guards */
html, body { max-width: 100%; overflow-x: hidden; }
*, *::before, *::after { box-sizing: border-box; }
img, video, canvas, svg { max-width: 100%; }
h1, h2, h3, h4, p, a, span, strong, small, b, em, li { min-width: 0; overflow-wrap: anywhere; }
main, header, footer, section, article, aside, nav, div { min-width: 0; }
.poster-grid, .feature-grid, .movie-grid, .library-grid, .library-list, .related-grid, .content-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
