:root {
  --bg: #070709;
  --bg-elev: #101016;
  --bg-card: #12121a;
  --bg-card-hover: #1a1a26;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(240, 215, 140, 0.28);
  --text: #ece8df;
  --text-dim: #9a958a;
  --text-mute: #6d695f;
  --gold: #e6c76a;
  --gold-soft: #f0d78c;
  --gold-deep: #c9a227;
  --accent: #7aa2ff;
  --danger: #ff7b7b;
  --radius: 16px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  --font: "Outfit", "Noto Sans SC", system-ui, sans-serif;
  --font-cn: "Noto Sans SC", "Outfit", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: var(--font-cn);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold-soft); text-decoration: none; }
a:hover { text-decoration: underline; }

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(201, 162, 39, 0.16), transparent 60%),
    radial-gradient(700px 420px at 90% 8%, rgba(122, 162, 255, 0.1), transparent 55%),
    radial-gradient(600px 400px at 50% 110%, rgba(201, 162, 39, 0.06), transparent 50%),
    linear-gradient(180deg, #0b0b10 0%, #070709 40%, #050506 100%);
}

.site-header {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-family: var(--font);
  font-weight: 700;
  font-size: 22px;
  color: #0a0a0c;
  background: linear-gradient(135deg, var(--gold-deep), var(--gold-soft));
  box-shadow: 0 0 0 1px rgba(240, 215, 140, 0.35), 0 8px 24px rgba(201, 162, 39, 0.25);
}
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand-text strong {
  font-family: var(--font);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}
.brand-text span { font-size: 0.78rem; color: var(--text-dim); }

.header-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--gold-soft);
}
.pill.muted { color: var(--text-dim); }

.hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 24px 8px;
}
.hero h1 {
  margin: 0 0 8px;
  font-family: var(--font);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.2vw, 2.35rem);
  letter-spacing: -0.02em;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { margin: 0; color: var(--text-dim); max-width: 52ch; }

.toolbar {
  max-width: 1280px;
  margin: 20px auto 0;
  padding: 0 24px 8px;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(7, 7, 9, 0.72);
  border-bottom: 1px solid transparent;
}
.toolbar.is-stuck { border-bottom-color: var(--line); padding-top: 12px; padding-bottom: 12px; }

.search-wrap {
  position: relative;
  margin-bottom: 12px;
}
.search-ico {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-mute);
}
#search {
  width: 100%;
  padding: 14px 16px 14px 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(18, 18, 26, 0.9);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
#search:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.12);
}
#search::placeholder { color: var(--text-mute); }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}
.filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--text-mute);
  min-width: 120px;
  flex: 1;
}
.filters select {
  appearance: none;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-elev) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%239a958a' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--text);
  font: inherit;
  outline: none;
}
.filters select:focus { border-color: var(--line-strong); }

.btn {
  border: 1px solid var(--line-strong);
  background: linear-gradient(135deg, rgba(201,162,39,0.18), rgba(240,215,140,0.08));
  color: var(--gold-soft);
  padding: 10px 16px;
  border-radius: 10px;
  font: inherit;
  cursor: pointer;
  transition: transform .15s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--gold); }
.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text-dim);
  height: 40px;
  align-self: end;
}
.btn.ghost:hover { color: var(--text); border-color: var(--text-mute); }

main { max-width: 1280px; margin: 0 auto; padding: 16px 24px 48px; }

.status-bar {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 14px;
  min-height: 1.2em;
}

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

.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), border-color .25s, box-shadow .25s, background .25s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow), 0 0 0 1px rgba(240, 215, 140, 0.08);
}
.card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.cover {
  position: relative;
  aspect-ratio: 3 / 4;
  max-height: 280px;
  background: #0e0e14;
  overflow: hidden;
}
.cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .45s ease;
}
.card:hover .cover img { transform: scale(1.06); }
.cover::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(transparent, rgba(7,7,9,0.92));
  pointer-events: none;
}
.score-badge {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 2;
  padding: 5px 9px;
  border-radius: 999px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.85rem;
  color: #0a0a0c;
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}
.year-badge {
  position: absolute;
  left: 10px; top: 10px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.72rem;
  color: var(--text);
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(6px);
}

.card-body {
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-titles { display: flex; flex-direction: column; gap: 3px; }
.card-title-line {
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title-line.zh {
  font-size: 0.98rem;
  font-weight: 600;
  -webkit-line-clamp: 2;
}
.card-title-line.ja,
.card-title-line.en {
  font-size: 0.74rem;
  color: var(--text-dim);
  font-weight: 400;
  -webkit-line-clamp: 1;
}
.card-title-line .lang {
  display: inline-block;
  min-width: 1.1em;
  margin-right: 4px;
  font-size: 0.65rem;
  color: var(--text-mute);
  font-weight: 500;
}
.modal-titles { margin-bottom: 12px; }
.modal-titles h2 { margin: 0 0 6px; font-size: 1.35rem; }
.modal-titles .ja,
.modal-titles .en {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 2px 0;
}
.modal-titles .lang {
  display: inline-block;
  min-width: 1.6em;
  margin-right: 6px;
  font-size: 0.72rem;
  color: var(--text-mute);
}

.card-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-sub {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-mute);
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text-dim);
  white-space: nowrap;
}
.chip.gold {
  border-color: rgba(240, 215, 140, 0.25);
  color: var(--gold-soft);
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
}
.tag {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(122, 162, 255, 0.1);
  color: #b7c8f5;
  border: 1px solid rgba(122, 162, 255, 0.15);
}
.platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.platform {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(201, 162, 39, 0.1);
  color: var(--gold-soft);
  border: 1px solid rgba(201, 162, 39, 0.18);
}
.platform.pending {
  color: var(--text-mute);
  background: rgba(255,255,255,0.03);
  border-color: var(--line);
}

.empty {
  text-align: center;
  padding: 64px 16px;
  color: var(--text-dim);
}
.hidden { display: none !important; }

.site-footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 24px 48px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  color: var(--text-mute);
  font-size: 0.82rem;
}
.footer-note { max-width: 48ch; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
}
.modal-card {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  background: #12121a;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.modal-close {
  position: sticky;
  top: 10px;
  float: right;
  margin: 10px 10px 0 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.45);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.modal-body { padding: 8px 22px 28px; clear: both; }
.modal-layout {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
}
@media (max-width: 560px) {
  .modal-layout { grid-template-columns: 1fr; }
  .modal-layout img { max-width: 180px; margin: 0 auto; }
}
.modal-layout img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.modal-body h2 { margin: 0 0 4px; font-size: 1.35rem; }
.modal-body .ja { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 12px; }
.modal-body .synopsis {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 14px 0;
}
.modal-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.modal-links a {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  text-decoration: none;
  color: var(--text);
  font-size: 0.85rem;
}
.modal-links a:hover { border-color: var(--gold); color: var(--gold-soft); }

.skeleton {
  background: linear-gradient(90deg, #12121a 25%, #1a1a24 50%, #12121a 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: var(--radius);
  aspect-ratio: 3/4;
  border: 1px solid var(--line);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (max-width: 640px) {
  .filters label { min-width: calc(50% - 8px); }
  .site-header { padding-top: 18px; }
}


/* 有中配 badge — vivid cyan/magenta so it stands out from gold score & blue tags */
.dub-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.dub-badge.has-dub {
  color: #0a0a0c;
  background: linear-gradient(135deg, #2ee6a6 0%, #3ec6ff 55%, #b388ff 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 0 1px rgba(46, 230, 166, 0.25), 0 6px 16px rgba(62, 198, 255, 0.28);
  animation: dub-pulse 2.8s ease-in-out infinite;
}
@keyframes dub-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}
.card .dub-badge.has-dub {
  margin-left: 2px;
}
.modal-body .dub-badge.has-dub {
  font-size: 0.8rem;
  padding: 4px 12px;
}


/* 中配平台标注（卡片 / 详情） */
.dub-platforms {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #b8f0e0;
  background: rgba(46, 230, 166, 0.1);
  border: 1px solid rgba(46, 230, 166, 0.28);
  white-space: normal;
  line-height: 1.35;
}
.dub-platforms.pending {
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}
.card .dub-platforms {
  width: 100%;
  margin-top: 2px;
  border-radius: 10px;
  justify-content: flex-start;
}
.modal-body .dub-platforms {
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 999px;
  width: auto;
}
