:root {
  --bg: #f2f4f7;
  --paper: #ffffff;
  --ink: #1d2630;
  --muted: #6f7c88;
  --line: #d9e1ea;
  --blue: #2f70ff;
  --red: #d24444;
  --max: 1280px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #f8fafc, var(--bg));
  line-height: 1.6;
}

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

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

.header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr minmax(220px, 320px);
  gap: 18px;
  align-items: center;
  padding: 14px max(20px, calc((100vw - var(--max)) / 2));
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 900;
}

.brand span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), var(--red));
  color: #fff;
}

.nav {
  display: flex;
  gap: 18px;
}

.nav a,
p,
small,
.footer p,
.footer a,
.copy,
.copy small,
.card .copy small,
.flow-item small {
  color: var(--muted);
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--blue);
}

.search input,
select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  outline: none;
}

.portal,
.library-main,
.detail-main,
.footer {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.portal {
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  gap: 18px;
  padding: 28px 0;
}

.panel,
.hero-card,
.flow-block,
.support-cards article,
.intro-panel,
.detail-panel,
.watch-panel,
.footer {
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 10px 24px rgba(30, 40, 60, .05);
}

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

.panel,
.support-cards article,
.intro-panel,
.detail-panel,
.watch-panel {
  padding: 18px;
}

.label {
  color: var(--red);
  font-weight: 800;
}

.quick-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.quick-grid a,
.chip,
.tag-row a {
  border: 1px solid var(--line);
  padding: 10px 12px;
  background: #fff;
}

.quick-grid a:hover,
.chip.active {
  color: var(--blue);
  border-color: rgba(47,112,255,.22);
}

.main-flow {
  display: grid;
  gap: 18px;
}

.hero-card {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  padding: 18px;
}

.hero-cover {
  overflow: hidden;
  background: #eef1f5;
}

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

h1,
h2 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  font-size: clamp(38px, 5.4vw, 62px);
}

h2 {
  font-size: 30px;
}

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

.meta-row strong,
.meta-row span,
.tag-row a,
.chip {
  background: #fff;
}

.meta-row strong {
  color: var(--blue);
}

.flow-block {
  padding: 18px;
}

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

.section-head a {
  color: var(--blue);
}

.flow-list,
.rank-list {
  display: grid;
}

.flow-item,
.rank-item {
  display: grid;
  gap: 12px;
  align-items: center;
  transition: transform .2s ease, background .2s ease;
}

.flow-item {
  grid-template-columns: 92px 1fr auto;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.flow-item img {
  width: 92px;
  aspect-ratio: 2 / 3;
}

.flow-item span {
  display: grid;
}

.flow-item em,
.rank-item em,
.card .copy em {
  color: var(--red);
  font-style: normal;
}

.flow-item:hover,
.rank-item:hover {
  transform: translateX(6px);
}

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

.library-grid {
  grid-template-columns: repeat(6, 1fr);
}

.card {
  min-width: 0;
}

.cover {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #eef1f5;
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}

.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.78));
}

.cover span,
.cover b,
.cover i {
  position: absolute;
  z-index: 1;
}

.cover span {
  top: 10px;
  left: 10px;
  color: var(--blue);
  background: rgba(255,255,255,.92);
  padding: 4px 8px;
  font-size: 12px;
}

.cover b {
  top: 10px;
  right: 10px;
  color: #fff;
}

.cover i {
  left: 12px;
  bottom: 10px;
  color: #fff;
  font-style: normal;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .22s ease, transform .22s ease;
}

.card:hover .cover {
  transform: translateY(-7px);
  border-color: rgba(47,112,255,.24);
  box-shadow: 0 18px 30px rgba(30,40,60,.12);
}

.card:hover .cover i {
  opacity: 1;
  transform: translateY(0);
}

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

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

.mini-posters {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.mini-poster {
  display: grid;
  gap: 8px;
}

.mini-poster img {
  aspect-ratio: 2 / 3;
}

.rank-item {
  grid-template-columns: 36px 1fr auto;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.rank-item b {
  color: var(--blue);
}

.support-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 40px 0 0;
}

.library-main,
.detail-main {
  padding: 28px 0;
}

.filters {
  margin: 20px 0 16px;
}

.chip {
  cursor: pointer;
}

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

.toolbar select {
  width: 160px;
}

.detail-panel {
  margin-bottom: 18px;
}

.detail-cover {
  overflow: hidden;
  background: #eef1f5;
}

.detail-panel {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
}

.watch-panel {
  margin-bottom: 34px;
}

.screen {
  display: grid;
  place-items: center;
  min-height: 360px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #f7fbff, #eef4fb);
}

.screen span {
  color: var(--blue);
}

.screen strong {
  font-size: 42px;
}

.episode-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.episode-list button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 10px 14px;
}

.footer {
  display: grid;
  grid-template-columns: 1.1fr .85fr 1fr;
  gap: 24px;
  padding: 28px;
  margin: 0 auto 24px;
}

.copy {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

@media (max-width: 1180px) {
  .header,
  .portal,
  .hero-card,
  .detail-panel,
  .footer {
    grid-template-columns: 1fr;
  }

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

  .support-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .portal,
  .library-main,
  .detail-main,
  .footer {
    width: min(100% - 24px, var(--max));
  }

  .nav {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .card-grid,
  .library-grid,
  .support-cards,
  .mini-posters {
    grid-template-columns: repeat(2, 1fr);
  }

  .flow-item {
    grid-template-columns: 74px 1fr;
  }

  .flow-item em {
    grid-column: 2;
  }

  .section-head,
  .toolbar {
    flex-direction: column;
    align-items: start;
  }
}
