:root {
  --bg: #f6efe4;
  --paper: #fffaf4;
  --ink: #1d1a17;
  --muted: #70655b;
  --line: #decdb8;
  --orange: #e88d3c;
  --plum: #5b3758;
  --max: 1240px;
}

* {
  box-sizing: border-box;
}

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

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

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

.topbar {
  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, 250, 244, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

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

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

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

.nav a,
p,
small,
.copy,
.footer p,
.footer a,
.chapter-copy small,
.strip-card small,
.timeline-copy small,
.info-list p {
  color: var(--muted);
}

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

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

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

.intro {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 20px;
  align-items: end;
  padding: 30px 0 18px;
}

.tag,
.section-head span,
.timeline-copy small {
  color: var(--plum);
  font-weight: 800;
}

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

h1 {
  font-size: clamp(40px, 5.6vw, 68px);
}

h2 {
  font-size: 30px;
}

.timeline-shell,
.archive-col,
.library-intro,
.detail-timeline,
.watch-box,
.footer,
.chapter-card,
.timeline-item {
  border: 1px solid var(--line);
  background: var(--paper);
}

.timeline-shell {
  position: relative;
  padding: 24px 24px 24px 90px;
  margin-bottom: 34px;
}

.timeline-line {
  position: absolute;
  left: 42px;
  top: 24px;
  bottom: 24px;
  width: 2px;
  background: linear-gradient(180deg, var(--orange), var(--plum));
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px;
}

.time-badge {
  position: absolute;
  left: -72px;
  top: 26px;
  width: 54px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--plum);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.timeline-cover {
  overflow: hidden;
  background: #ece3d7;
}

.timeline-cover img,
.chapter-cover img,
.strip-card img,
.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.meta-row strong,
.meta-row span,
.tag-list a,
.chip {
  border: 1px solid var(--line);
  padding: 8px 12px;
  background: #fff;
}

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

.section {
  margin: 40px 0;
}

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

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

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

.chapter-card {
  padding: 12px;
}

.chapter-cover {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
}

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

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

.chapter-cover span {
  top: 10px;
  left: 10px;
  color: #fff;
  background: rgba(91,55,88,.88);
  padding: 4px 8px;
  font-size: 12px;
}

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

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

.chapter-card:hover .chapter-cover {
  transform: translateY(-6px);
}

.chapter-cover,
.strip-card,
.timeline-item {
  transition: transform .22s ease, box-shadow .22s ease;
}

.chapter-card:hover .chapter-cover,
.strip-card:hover,
.timeline-item:hover {
  box-shadow: 0 18px 32px rgba(0,0,0,.12);
}

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

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

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

.chapter-copy em,
.rank-item em {
  color: var(--orange);
  font-style: normal;
}

.showcase-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 220px);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.strip-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.strip-card img {
  aspect-ratio: 2 / 3;
}

.strip-card span {
  display: grid;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.archive-col,
.library-intro,
.detail-timeline,
.watch-box {
  padding: 20px;
}

.compact {
  margin-bottom: 12px;
}

.tag-list {
  margin-top: 10px;
}

.tag-list a {
  color: var(--plum);
}

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

.chip {
  cursor: pointer;
}

.chip.active {
  background: var(--plum);
  color: #fff;
  border-color: var(--plum);
}

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

.toolbar select {
  width: 160px;
}

.detail-timeline {
  position: relative;
  overflow: hidden;
  margin: 28px 0;
}

.detail-track {
  position: absolute;
  left: 40px;
  top: 20px;
  bottom: 20px;
  width: 2px;
  background: linear-gradient(180deg, var(--orange), var(--plum));
}

.detail-block {
  position: relative;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  padding-left: 70px;
}

.detail-poster {
  overflow: hidden;
  background: #ece3d7;
}

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

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

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

.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: 56px auto 24px;
}

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

@media (max-width: 1100px) {
  .topbar,
  .intro,
  .two-col,
  .detail-block,
  .footer {
    grid-template-columns: 1fr;
  }

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

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

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

  .timeline-shell {
    padding-left: 64px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .chapter-grid,
  .library-grid,
  .two-col {
    grid-template-columns: repeat(2, 1fr);
  }

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