:root {
  --ink: #171815;
  --muted: #6f7168;
  --paper: #f3f0e8;
  --card: #fbfaf6;
  --line: #d8d4c9;
  --accent: #d95332;
  --green: #334d3d;
  --shadow: 0 18px 60px rgba(32, 35, 29, .11);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}
button, input, select { font: inherit; }
button, select { cursor: pointer; }

.hero {
  position: relative;
  min-height: 510px;
  overflow: hidden;
  color: #f8f5ed;
  background: var(--green);
}
.hero::after {
  content: "MEDIA";
  position: absolute;
  right: -22px;
  bottom: -72px;
  color: rgba(255,255,255,.035);
  font: 800 clamp(120px, 22vw, 330px)/1 sans-serif;
  letter-spacing: -.08em;
  pointer-events: none;
}
.hero__glow {
  position: absolute;
  width: 460px;
  height: 460px;
  right: 11%;
  top: -210px;
  border-radius: 50%;
  background: #bd593d;
  filter: blur(120px);
  opacity: .46;
}
.nav, .hero__content, .stats, main, footer { width: min(1240px, calc(100% - 40px)); margin-inline: auto; }
.nav { display: flex; align-items: center; justify-content: space-between; padding-top: 25px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 650; letter-spacing: .05em; }
.brand__mark { display: grid; place-items: center; width: 33px; height: 33px; border: 1px solid #d9b6a8; border-radius: 50%; color: #ffd6c7; font-family: serif; }
.nav__hint { color: #b9c1b9; font-size: 13px; }
.hero__content { position: relative; z-index: 1; padding-top: 78px; }
.eyebrow { color: #e99678; font-size: 12px; font-weight: 750; letter-spacing: .24em; }
h1 { margin: 18px 0; max-width: 780px; font: 500 clamp(46px, 6vw, 82px)/1.08 Georgia, "Noto Serif SC", serif; letter-spacing: -.055em; }
h1 em { color: #f4a184; font-weight: inherit; }
.hero__copy { max-width: 590px; color: #c8cec7; font-size: 16px; line-height: 1.8; }
.stats { position: absolute; z-index: 2; left: 50%; bottom: 31px; transform: translateX(-50%); display: flex; gap: 45px; }
.stat strong { display: block; font: 500 27px/1.2 Georgia, serif; }
.stat span { color: #aeb8af; font-size: 12px; }

main { padding-block: 42px 70px; }
.toolbar { display: grid; grid-template-columns: minmax(280px, 1fr) auto; gap: 16px; align-items: center; }
.search { height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border: 1px solid var(--line); background: var(--card); }
.search span { font-size: 25px; transform: rotate(-15deg); }
.search input { width: 100%; border: 0; outline: 0; background: transparent; }
kbd { padding: 2px 7px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; background: #ebe8df; }
.filters { display: flex; gap: 9px; }
select { height: 52px; min-width: 145px; padding: 0 35px 0 14px; color: var(--ink); border: 1px solid var(--line); background: var(--card); }
.results-head { display: flex; justify-content: space-between; margin: 34px 0 18px; color: var(--muted); font-size: 14px; }
#result-count { color: var(--ink); font-size: 20px; font-weight: 700; }
.text-button { border: 0; color: var(--accent); background: transparent; }

.catalog { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); background: var(--card); transition: transform .2s, box-shadow .2s, border-color .2s; }
.card:hover { z-index: 2; transform: translateY(-4px); border-color: #b8b1a4; box-shadow: var(--shadow); }
.card__body { min-height: 210px; display: flex; flex-direction: column; padding: 18px; }
.poster { position: relative; aspect-ratio: 2/3; overflow: hidden; background: #d9ddd4; }
.poster img { width: 100%; height: 100%; display: block; object-fit: cover; }
.poster > span { display: none; }
.poster--missing { display: grid; place-items: center; color: rgba(255,255,255,.75); background: linear-gradient(145deg, #6c8272, #263b30); }
.poster--missing::before { content: attr(data-type); position: absolute; top: 16px; left: 16px; color: rgba(255,255,255,.55); font-size: 10px; letter-spacing: .2em; }
.poster--missing::after { content: "光雅媒体馆"; position: absolute; bottom: 15px; color: rgba(255,255,255,.38); font: 10px Georgia, serif; letter-spacing: .15em; }
.poster--missing > span { display: block; font: 500 58px/1 Georgia, "Noto Serif SC", serif; }
.card__top { display: flex; justify-content: space-between; align-items: center; }
.badge { padding: 4px 8px; color: var(--green); border-radius: 2px; background: #e4e9e1; font-size: 11px; font-weight: 700; }
.year { color: var(--accent); font: 600 14px Georgia, serif; }
.card h2 { position: relative; margin: 18px 0 7px; font: 600 19px/1.35 Georgia, "Noto Serif SC", serif; }
.category { margin: 0; color: var(--muted); font-size: 12px; }
.card__meta { display: flex; flex-wrap: wrap; gap: 6px 13px; margin-top: auto; padding-top: 28px; color: var(--muted); font-size: 12px; }
.card__meta span::before { content: "·"; margin-right: 5px; color: var(--accent); }
.card button { position: absolute; inset: 0; width: 100%; border: 0; background: transparent; font-size: 0; }
.empty { grid-column: 1/-1; padding: 80px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); }

.pagination { display: flex; justify-content: center; align-items: center; gap: 7px; margin-top: 35px; }
.pagination button { min-width: 39px; height: 39px; border: 1px solid var(--line); background: var(--card); }
.pagination button.active { color: white; border-color: var(--green); background: var(--green); }
.pagination button:disabled { opacity: .4; cursor: default; }

dialog { width: min(920px, calc(100% - 24px)); max-height: 88vh; padding: 0; color: var(--ink); border: 0; background: var(--card); box-shadow: 0 30px 100px rgba(0,0,0,.4); }
dialog::backdrop { background: rgba(14,20,16,.72); backdrop-filter: blur(5px); }
.detail__header { position: sticky; z-index: 3; top: 0; min-height: 205px; padding: 28px 60px 25px 30px; overflow: hidden; color: white; background: var(--green); }
.detail__header--image::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(28,47,36,.98) 20%, rgba(28,47,36,.7)), var(--backdrop) center/cover; }
.detail__identity { position: relative; display: flex; align-items: center; gap: 24px; }
.detail__poster { width: 112px; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.25); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.detail__header h2 { margin: 6px 0; font: 500 31px/1.3 Georgia, "Noto Serif SC", serif; }
.detail__header p { margin: 0; color: #c3cbc4; font-size: 13px; }
.detail__close { position: absolute; right: 20px; top: 20px; width: 36px; height: 36px; color: white; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; background: transparent; }
.detail__summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.detail__summary div { padding: 18px 22px; background: #f0ede5; }
.detail__summary strong { display: block; margin-top: 4px; }
.detail__summary span { color: var(--muted); font-size: 11px; }
.whole-series { padding: 20px 30px 0; }
.seasons { padding: 20px 30px 35px; }
.season { margin-top: 12px; border: 1px solid var(--line); }
.season summary { display: flex; justify-content: space-between; padding: 15px 17px; cursor: pointer; font-weight: 700; background: #efede5; }
.season summary span { color: var(--muted); font-size: 12px; font-weight: 400; }
.file { display: grid; grid-template-columns: 75px minmax(0,1fr) auto; gap: 12px; padding: 13px 16px; align-items: start; border-top: 1px solid #e5e1d8; }
.file__number { color: var(--accent); font-size: 12px; font-weight: 750; }
.file__name { overflow-wrap: anywhere; font-size: 13px; line-height: 1.5; }
.file__tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.file__tags span { padding: 2px 5px; color: var(--muted); background: #ece9e0; font-size: 10px; }
.file__size { color: var(--muted); font-size: 12px; white-space: nowrap; }
.file__path { grid-column: 2/-1; margin: -5px 0 0; color: #92938c; font-size: 10px; overflow-wrap: anywhere; }
.rapid-link { grid-column: 2/-1; margin-top: -3px; }
.rapid-link summary {
  width: max-content;
  padding: 5px 9px;
  color: var(--accent);
  border: 1px solid #dfc9bf;
  border-radius: 3px;
  background: #fff8f4;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}
.rapid-link summary::-webkit-details-marker { display: none; }
.rapid-link summary::before { content: "＋"; margin-right: 4px; }
.rapid-link[open] summary::before { content: "－"; }
.rapid-link--whole { margin: 0; }
.rapid-link--whole summary {
  width: 100%;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  color: #fff;
  border-color: var(--green);
  background: var(--green);
  font-size: 13px;
}
.rapid-link--whole summary::before { margin-right: 8px; }
.rapid-link--whole summary span { margin-left: auto; color: #bdc9c0; font-size: 11px; font-weight: 400; }
.rapid-link--whole pre { max-height: 420px; }
.rapid-link__body { position: relative; margin-top: 8px; }
.rapid-link__body button {
  position: absolute;
  z-index: 1;
  right: 8px;
  top: 8px;
  padding: 5px 9px;
  color: #fff;
  border: 0;
  border-radius: 3px;
  background: var(--green);
  font-size: 11px;
}
.rapid-link pre {
  max-height: 230px;
  margin: 0;
  padding: 16px 90px 16px 16px;
  overflow: auto;
  color: #d9e2da;
  border-radius: 4px;
  background: #202921;
  font: 11px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

footer { padding: 22px 0 35px; color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; text-align: center; }
@media (max-width: 1100px) { .catalog { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 880px) { .catalog { grid-template-columns: repeat(3, 1fr); } .toolbar { grid-template-columns: 1fr; } }
@media (max-width: 650px) { .hero { min-height: 580px; } .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; } .catalog { grid-template-columns: repeat(2, 1fr); } .filters { display: grid; grid-template-columns: 1fr 1fr; } select { width: 100%; min-width: 0; } #sort { grid-column: 1/-1; } .detail__summary { grid-template-columns: 1fr 1fr; } }
@media (max-width: 470px) { .nav, .hero__content, .stats, main, footer { width: min(100% - 24px, 1240px); } .card__body { min-height: 185px; padding: 14px; } .card h2 { font-size: 16px; } .detail__poster { width: 82px; } .detail__identity { gap: 14px; } .detail__header h2 { font-size: 23px; } .file { grid-template-columns: 55px minmax(0,1fr); } .file__size { grid-column: 2; } .file__path, .rapid-link { grid-column: 1/-1; } }
