/* =====================================================================
   当季新番 — 与放映页（home-deck / video-deck）同一套暗色影院风格
   颜色与字体变量来自 home-deck.css 的 .home-deck
   ===================================================================== */

.anime-deck {
  --ok: #4ade80;
  --err: #ff6b6b;
}

.anime-page {
  position: relative;
  z-index: 3;
  flex: 0 0 auto; /* nav.css 里 body 是 100% 高的 flex 列，防止 main 被压缩 */
  min-height: 100vh;
  color: var(--ink);
}

.anime-wrap { padding: 0 6vw; }
.anime-muted { color: var(--dim); font-size: 13px; }

/* ---------- Hero ---------- */
.anime-hero { padding: 20vh 6vw 9vh; }
.anime-hero .chapter-head { margin-bottom: 7vh; }
.anime-hero__row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto auto;
  align-items: end;
  gap: 32px;
}
.anime-hero__sub {
  max-width: 520px;
  margin: 0;
  color: var(--dim);
  font-size: 15px;
  line-height: 1.9;
}
.anime-hero__sub b { color: var(--ink); }

.anime-ticket {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .03);
}
.anime-ticket div {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 22px;
}
.anime-ticket div + div { border-left: 1px dashed var(--line); }
.anime-ticket span { font-size: 9px; color: var(--cyan); }
.anime-ticket b {
  font-family: var(--mono);
  font-size: 30px;
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.anime-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.anime-deck button.feature-link { background: none; font-family: var(--mono); cursor: pointer; }
.feature-link.is-ghost { border-color: rgba(255, 255, 255, .14); color: var(--dim); }

/* ---------- 区块标题 ---------- */
.anime-page .chapter-kicker { margin-bottom: 10px; }
.anime-section-title {
  margin: 0 0 28px;
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 900;
  letter-spacing: -.02em;
}

/* ---------- 管理面板 ---------- */
.anime-admin {
  padding: 7vh 0 !important;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}
.anime-admin__grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.anime-admin__card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(5, 7, 10, .6);
}
.anime-admin__card h2 {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  color: var(--cyan);
}
.anime-copy { display: flex; gap: 8px; margin-top: 14px; }
.anime-copy input {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, .04);
  color: var(--ink);
  font: 12px/1.4 var(--mono);
}
.anime-copy button {
  padding: 0 18px;
  border: 1px solid var(--cyan);
  border-radius: 4px;
  background: var(--cyan);
  color: #000;
  font: 11px var(--mono);
  letter-spacing: .14em;
  cursor: pointer;
}
.anime-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 18px;
  margin: 0 0 18px;
  font-size: 13px;
}
.anime-dl dt { color: var(--dim); }
.anime-dl dd { margin: 0; word-break: break-all; }
.anime-admin__btns { display: flex; flex-wrap: wrap; gap: 8px; }

.anime-episodes, .anime-preview {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 300px;
  overflow: auto;
}
.anime-episodes li, .anime-preview li {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.anime-episodes li:last-child, .anime-preview li:last-child { border-bottom: 0; }
.anime-episodes li.anime-muted, .anime-preview li.anime-muted { display: block; }
.anime-ep {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gold);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.anime-preview__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); }
.anime-state { font-family: var(--mono); font-size: 11px; color: var(--dim); white-space: nowrap; }
.anime-state.is-ok { color: var(--ok); }
.anime-state.is-err { color: var(--err); }

/* ---------- 我在追 ---------- */
.anime-following { padding: 8vh 0 2vh !important; border-top: 1px solid var(--line); }
.anime-following__list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.anime-following__list::-webkit-scrollbar { display: none; }
.anime-follow {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 300px;
  padding: 8px 16px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .03);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .3s ease, transform .4s var(--ease-out);
}
.anime-follow:hover { border-color: var(--cyan); transform: translateY(-2px); }
.anime-follow img { width: 42px; height: 58px; object-fit: cover; border-radius: 4px; background: var(--bg-2); }
.anime-follow span { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.anime-follow strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anime-follow em {
  font-style: normal;
  font-size: 12px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 本季番组 ---------- */
.anime-list { padding: 8vh 0 10vh !important; border-top: 1px solid var(--line); }
.anime-toolbar {
  position: sticky;
  top: 44px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 -6vw 28px;
  padding: 12px 6vw;
  background: rgba(5, 7, 10, .88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.anime-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.anime-tabs::-webkit-scrollbar { display: none; }
.anime-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--dim);
  font-size: 13px;
  cursor: pointer;
  transition: color .25s ease, border-color .25s ease, background .25s ease;
}
.anime-tab span { font-family: var(--mono); font-size: 11px; opacity: .7; }
.anime-tab:hover { color: var(--ink); border-color: rgba(255, 255, 255, .32); }
.anime-tab.is-active { background: var(--cyan); border-color: var(--cyan); color: #000; }
.anime-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--dim);
  cursor: pointer;
}
.anime-toggle input { accent-color: var(--cyan); }

.anime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 36px 20px;
}
.anime-empty {
  grid-column: 1 / -1;
  padding: 80px 0;
  text-align: center;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .14em;
}
.anime-card { display: flex; flex-direction: column; min-width: 0; }
.anime-card.is-stale { opacity: .5; }
.anime-card__cover {
  position: relative;
  display: block;
  aspect-ratio: 5 / 7;
  padding: 0;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .8);
  cursor: pointer;
  transition: transform .5s var(--ease-out), box-shadow .5s ease;
}
.anime-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s var(--ease-out);
}
.anime-card__cover:hover {
  transform: translateY(-8px);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .9), 0 0 0 1px rgba(41, 195, 255, .6), 0 0 40px -6px rgba(41, 195, 255, .45);
}
.anime-card__cover:hover img { transform: scale(1.06); }
.anime-card.is-subscribed .anime-card__cover { box-shadow: 0 0 0 1px var(--gold), 0 0 32px -8px rgba(245, 196, 76, .55); }
.anime-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  max-width: calc(100% - 20px);
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(5, 7, 10, .72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--gold);
  font: 11px var(--mono);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.anime-card__body { padding-top: 12px; }
.anime-card__body h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 800;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}
.anime-card__body p { margin: 6px 0 12px; font-size: 12px; color: var(--dim); }

/* 感兴趣按钮：feature-link 同款，从左侧扫入填色 */
.anime-like {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: color .35s ease, border-color .35s ease;
}
.anime-like::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--cyan);
  transform: translateX(-101%);
  transition: transform .5s var(--ease-out);
}
.anime-like:hover { color: #000; border-color: var(--cyan); }
.anime-like:hover::before { transform: none; }
.anime-like svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.anime-like.is-on { border-color: var(--gold); color: var(--gold); }
.anime-like.is-on svg { fill: currentColor; }
.anime-like.is-on::before { background: var(--gold); }
.anime-like.is-on:hover { color: #000; }

.anime-source {
  margin: 56px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--dim);
  text-align: center;
}
.anime-source a { color: var(--cyan); }

/* ---------- 弹窗（同放映页 movie-modal 的玻璃面板） ---------- */
.anime-modal-open { overflow: hidden; }
.anime-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0);
  transition: background .2s;
}
.anime-modal.is-open { background: rgba(0, 0, 0, .66); }
.anime-modal[hidden] { display: none; }
.anime-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(640px, 100%);
  max-height: calc(100vh - 32px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 13, 18, .96);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: var(--ink);
  box-shadow: 0 40px 120px rgba(0, 0, 0, .7);
  opacity: 0;
  transform: translateY(14px) scale(.98);
  transition: opacity .2s, transform .35s var(--ease-out);
}
.anime-modal.is-open .anime-dialog { opacity: 1; transform: none; }
.anime-dialog--small { width: min(400px, 100%); padding: 30px; gap: 12px; }
.anime-dialog--small h3 { margin: 0; font-size: 22px; }
.anime-dialog--small p { margin: 0; }
.anime-dialog--small input,
.anime-dialog__auth input,
.anime-filters input {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, .05);
  color: var(--ink);
  font-size: 14px;
}
.anime-dialog input:focus { outline: none; border-color: var(--cyan); }
.anime-dialog__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--dim);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.anime-dialog__close:hover { background: rgba(255, 255, 255, .08); color: var(--ink); }
.anime-dialog__head {
  display: flex;
  gap: 18px;
  padding: 26px 26px 18px;
  border-bottom: 1px solid var(--line);
}
.anime-dialog__head img {
  flex: 0 0 auto;
  width: 76px;
  height: 106px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg-2);
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .8);
}
.anime-dialog__head .anime-kicker,
.anime-dialog__head #dialogWeekday {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--cyan);
}
.anime-dialog__head h3 { margin: 0 36px 10px 0; font-size: 22px; font-weight: 900; line-height: 1.3; }
.anime-dialog__head a { font-size: 13px; color: var(--dim); text-decoration: none; }
.anime-dialog__head a:hover { color: var(--cyan); }
.anime-lifecycle { margin: 8px 0 0; font-size: 12px; color: var(--gold); }
.anime-lifecycle:empty { display: none; }
.anime-dialog__body { padding: 6px 26px 8px; overflow-y: auto; }
.anime-dialog__body h4 {
  margin: 18px 0 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  color: var(--dim);
}
.anime-dialog__body h4 span { color: var(--gold); }
.anime-groups { display: flex; flex-direction: column; gap: 6px; }
.anime-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.anime-group:hover { border-color: rgba(255, 255, 255, .3); }
.anime-group:has(input:checked) { border-color: var(--cyan); background: rgba(41, 195, 255, .08); }
.anime-group.is-raw .anime-group__name { color: var(--dim); }
.anime-group input { margin: 0; accent-color: var(--cyan); }
.anime-group__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anime-group__date { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.anime-chip {
  padding: 2px 8px;
  border: 1px solid rgba(245, 196, 76, .5);
  border-radius: 3px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
}
.anime-chip--on { border-color: var(--cyan); color: var(--cyan); }
.anime-filters { margin-top: 16px; font-size: 13px; }
.anime-filters summary { cursor: pointer; color: var(--dim); }
.anime-filters label { display: block; margin-top: 10px; color: var(--dim); }
.anime-preview { max-height: 220px; }
.anime-dialog__auth { padding: 8px 26px 0; font-size: 13px; color: var(--dim); }
.anime-dialog__error { min-height: 18px; padding: 6px 26px 0; color: var(--err); font-size: 13px; }
.anime-dialog--small .anime-dialog__error { padding: 0; }
.anime-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 26px 24px;
}
.anime-dialog--small .anime-dialog__actions { padding: 0; }
.anime-btn {
  position: relative;
  padding: 12px 20px;
  border: 1px solid var(--cyan);
  border-radius: 0;
  background: var(--cyan);
  color: #000;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  cursor: pointer;
  transition: opacity .2s, background .3s, color .3s, border-color .3s;
}
.anime-btn:hover { opacity: .88; }
.anime-btn:disabled { opacity: .35; cursor: not-allowed; }
.anime-btn--ghost { background: transparent; color: var(--ink); border-color: rgba(255, 255, 255, .28); }
.anime-btn--ghost:hover { border-color: var(--cyan); color: var(--cyan); opacity: 1; }
#dialogUnsubscribe { margin-right: auto; }

/* ---------- Toast ---------- */
.anime-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 1600;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(10, 13, 18, .94);
  color: var(--ink);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .2s, transform .3s var(--ease-out);
}
.anime-toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 移动端 ---------- */
@media (max-width: 860px) {
  .anime-hero { padding: 16vh 22px 7vh; }
  .anime-hero__row { grid-template-columns: 1fr; gap: 22px; }
  .anime-ticket { align-self: start; width: fit-content; }
  .anime-wrap { padding: 0 22px; }
  .anime-admin__grid { grid-template-columns: 1fr; }
  .anime-toolbar { flex-direction: column; align-items: stretch; gap: 10px; margin: 0 -22px 24px; padding: 12px 22px; }
  .anime-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 12px; }
  .anime-dialog__head { padding: 22px 16px 14px; }
  .anime-dialog__body, .anime-dialog__auth, .anime-dialog__error { padding-left: 16px; padding-right: 16px; }
  .anime-dialog__actions { padding: 12px 16px 20px; }
  .anime-episodes li, .anime-preview li { grid-template-columns: 64px 1fr; }
  .anime-episodes li > :last-child, .anime-preview li > :last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .anime-page .chapter-title .ch { transition: none; opacity: 1; transform: none; }
  .deck-grain { animation: none; }
}
