/* ============================================================
   光影追踪 · CineTrack — 视觉样式
   深色影院风 / 玻璃拟态 / 渐变品牌色
   ============================================================ */

:root {
  --bg: #0a0c11;
  --bg-soft: #10131b;
  --card: rgba(255, 255, 255, 0.045);
  --card-solid: #141824;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef0f7;
  --muted: #8b93a7;
  --accent: #6366f1;
  --accent-2: #ec4899;
  --gold: #f5c518;
  --green: #34d399;
  --blue: #60a5fa;
  --grad: linear-gradient(120deg, #6366f1, #a855f7 55%, #ec4899);
  --focus: #c4b5fd;
  --radius: 14px;
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.55);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(99, 102, 241, 0.45); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
img { display: block; max-width: 100%; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* ---------- 背景氛围光 ---------- */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.32;
  pointer-events: none;
  z-index: 0;
}
.bg-glow-1 { width: 46vw; height: 46vw; background: #4338ca; top: -18vw; left: -12vw; }
.bg-glow-2 { width: 36vw; height: 36vw; background: #9d2367; bottom: -16vw; right: -10vw; opacity: 0.22; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 clamp(16px, 4vw, 44px);
  height: 64px;
  background: rgba(10, 12, 17, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--grad);
  display: grid; place-items: center;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.45);
}
.logo-mark svg { width: 15px; height: 15px; color: #fff; }
.logo-text {
  font-size: 18px; font-weight: 800; letter-spacing: 1px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.main-nav { display: flex; gap: 4px; }
.main-nav a {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
}
.main-nav a:hover { color: var(--text); }
.main-nav a.active { color: var(--text); background: rgba(255, 255, 255, 0.08); font-weight: 600; }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.header-search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  width: min(300px, 32vw);
  min-width: 0;
  transition: border-color 0.2s, background 0.2s;
}
.header-search:focus-within { border-color: var(--accent); background: rgba(255, 255, 255, 0.09); }
.header-search svg { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }
.header-search input {
  background: none; border: none; outline: none;
  color: var(--text); font-size: 14px; width: 100%; min-width: 0;
}
.header-search input::placeholder { color: var(--muted); }

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  display: grid; place-items: center;
  transition: color 0.2s, border-color 0.2s, transform 0.4s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); transform: rotate(45deg); }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------- 演示模式横幅 ---------- */
.demo-banner {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 9px 16px;
  font-size: 13px;
  color: #c7cbdd;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.16), rgba(236, 72, 153, 0.14));
  border-bottom: 1px solid var(--border);
}
.demo-banner b { color: #fff; font-weight: 600; }
.demo-banner .link-btn { font-size: 12.5px; padding: 3px 12px; }
.demo-banner .dismiss {
  background: none; border: none; color: var(--muted);
  font-size: 16px; line-height: 1; padding: 2px 6px;
}
.demo-banner .dismiss:hover { color: var(--text); }

/* ---------- 布局 ---------- */
.app { position: relative; z-index: 1; min-height: 60vh; }
.container { max-width: 1360px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 44px); }

.site-footer {
  position: relative; z-index: 1;
  text-align: center;
  padding: 34px 16px 26px;
  color: var(--muted);
  font-size: 12.5px;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}
.site-footer a { color: #a5b0ff; }
.site-footer a:hover { text-decoration: underline; }

/* ---------- Hero 轮播 ---------- */
.hero {
  position: relative;
  height: min(72vh, 640px);
  min-height: 440px;
  overflow: hidden;
}
.hero-slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 0.9s ease;
  pointer-events: none;
}
.hero-slide.active { opacity: 1; pointer-events: auto; }
.hero-backdrop {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center 22%;
  transform: scale(1.04);
}
.hero-mask {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 12, 17, 0.25) 0%, rgba(10, 12, 17, 0.05) 40%, var(--bg) 98%),
    linear-gradient(90deg, rgba(10, 12, 17, 0.88) 0%, rgba(10, 12, 17, 0.35) 55%, rgba(10, 12, 17, 0.05) 100%);
}
.hero-content {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 64px;
  max-width: 640px;
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; letter-spacing: 2.5px; font-weight: 700;
  color: #c9b8ff;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.hero-kicker::before { content: ""; width: 26px; height: 2px; background: var(--grad); border-radius: 2px; }
.hero-title {
  font-size: clamp(30px, 4.6vw, 56px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 1px;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.6);
  margin-bottom: 14px;
}
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; font-size: 13.5px; color: #cdd2e2; margin-bottom: 14px; }
.hero-overview {
  font-size: 14.5px;
  color: #b9bfd3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 24px;
  max-width: 560px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-dots {
  position: absolute;
  right: clamp(16px, 4vw, 44px);
  bottom: 34px;
  display: flex; gap: 8px;
  z-index: 3;
}
.hero-dots button {
  width: 26px; height: 4px;
  border: none; border-radius: 4px;
  background: rgba(255, 255, 255, 0.25);
  transition: background 0.3s, width 0.3s;
}
.hero-dots button.active { background: #fff; width: 40px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 11px 24px;
  font-size: 14px; font-weight: 600;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, border-color 0.2s, color 0.2s;
}
.btn:active { transform: scale(0.96); }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4); }
.btn-primary:hover { box-shadow: 0 10px 30px rgba(236, 72, 153, 0.5); transform: translateY(-1px); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.16); }
.link-btn {
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13px;
  transition: background 0.2s;
}
.link-btn:hover { background: rgba(255, 255, 255, 0.14); }

/* ---------- 评分徽章 / 标签 ---------- */
.rating-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(10, 12, 17, 0.72);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(245, 197, 24, 0.35);
  color: var(--gold);
  font-size: 12px; font-weight: 700;
  border-radius: 8px;
  padding: 3px 8px;
}
.rating-badge svg { width: 11px; height: 11px; fill: var(--gold); }

.chip {
  display: inline-block;
  font-size: 12px;
  color: #cfd4e6;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 12px;
}
.type-chip {
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  padding: 2px 9px; border-radius: 6px;
  background: rgba(99, 102, 241, 0.22);
  border: 1px solid rgba(99, 102, 241, 0.5);
  color: #b7bcff;
}
.type-chip.tv { background: rgba(236, 72, 153, 0.18); border-color: rgba(236, 72, 153, 0.5); color: #ffb3d9; }

.status-pill {
  font-size: 11px; font-weight: 700;
  padding: 2px 9px; border-radius: 999px;
}
.status-pill.want { background: rgba(96, 165, 250, 0.2); color: #93c5fd; border: 1px solid rgba(96, 165, 250, 0.45); }
.status-pill.watching { background: rgba(245, 197, 24, 0.16); color: var(--gold); border: 1px solid rgba(245, 197, 24, 0.45); }
.status-pill.watched { background: rgba(52, 211, 153, 0.16); color: var(--green); border: 1px solid rgba(52, 211, 153, 0.45); }

/* ---------- 片单横行 ---------- */
.section { margin-top: 44px; }
.section-head {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 18px;
}
.section-title {
  font-size: 21px; font-weight: 800; letter-spacing: 0.5px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::before {
  content: "";
  width: 4px; height: 20px;
  border-radius: 4px;
  background: var(--grad);
}
.section-sub { color: var(--muted); font-size: 13px; }

.row-wrap { position: relative; }
.row-scroll {
  display: flex; gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 6px 2px 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.18) transparent;
}
.row-scroll::-webkit-scrollbar { height: 6px; }
.row-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.16); border-radius: 6px; }
.row-scroll::-webkit-scrollbar-track { background: transparent; }
.row-scroll > * { scroll-snap-align: start; }

.row-nav {
  position: absolute; top: 34%;
  z-index: 5;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(12, 14, 20, 0.82);
  backdrop-filter: blur(8px);
  color: var(--text);
  display: grid; place-items: center;
  opacity: 0;
  transition: opacity 0.25s, background 0.2s;
}
.row-wrap:hover .row-nav { opacity: 1; }
.row-nav:hover { background: rgba(40, 44, 60, 0.95); }
.row-nav svg { width: 18px; height: 18px; }
.row-nav.prev { left: -14px; }
.row-nav.next { right: -14px; }
@media (hover: none) { .row-nav { display: none; } }

/* ---------- 海报卡片 ---------- */
.card { width: 168px; flex-shrink: 0; }
.card-poster {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card-solid);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.3, 1.2), box-shadow 0.28s, border-color 0.28s;
}
.card:hover .card-poster {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(139, 92, 246, 0.45), 0 12px 34px rgba(99, 102, 241, 0.22);
  border-color: transparent;
}
.card-poster img { width: 100%; height: 100%; object-fit: cover; }
.card-poster .rating-badge { position: absolute; left: 8px; top: 8px; }
.card-poster .status-pill { position: absolute; right: 8px; top: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.card-hover {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end;
  padding: 12px;
  background: linear-gradient(180deg, transparent 45%, rgba(5, 6, 10, 0.92));
  opacity: 0;
  transition: opacity 0.25s;
}
.card:hover .card-hover { opacity: 1; }
.card-hover span {
  font-size: 12px; color: #dfe3f0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { padding: 10px 4px 0; }
.card-title {
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-sub { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 8px; }

/* ---------- 生成海报（无图/演示模式） ---------- */
.art-poster {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 16px 14px;
  overflow: hidden;
}
.art-poster::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 78% 12%, rgba(255, 255, 255, 0.28), transparent 42%),
    radial-gradient(circle at 12% 88%, rgba(0, 0, 0, 0.4), transparent 55%);
}
.art-poster::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,0.03) 0 2px, transparent 2px 9px);
}
.art-title {
  position: relative; z-index: 1;
  font-weight: 900;
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.45);
}
.art-year {
  position: relative; z-index: 1;
  margin-top: 8px;
  font-size: 12px; letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.66);
}
.art-icon { position: relative; z-index: 1; font-size: 22px; margin-bottom: 10px; opacity: 0.85; }

/* ---------- 网格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px 16px;
}
.grid .card { width: auto; }

/* ---------- 详情页 ---------- */
.detail-hero {
  position: relative;
  min-height: 52vh;
  overflow: hidden;
}
.detail-backdrop {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center 20%;
}
.detail-mask {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 12, 17, 0.4) 0%, rgba(10, 12, 17, 0.25) 35%, var(--bg) 96%),
    linear-gradient(90deg, rgba(10, 12, 17, 0.7), rgba(10, 12, 17, 0.1) 60%);
}
.detail-body {
  --detail-overlap: 150px;
  position: relative;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 36px;
  row-gap: 0;
  margin-top: calc(-1 * var(--detail-overlap));
  padding-bottom: 10px;
}
.detail-poster {
  position: relative;
  grid-column: 1;
  grid-row: 1 / span 2;
  aspect-ratio: 2 / 3;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  align-self: start;
}
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }

.detail-info {
  grid-column: 2;
  grid-row: 1;
  padding-top: calc(var(--detail-overlap) + 8px);
  min-width: 0;
}
.detail-content {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
}
.detail-title { font-size: clamp(26px, 3.4vw, 42px); font-weight: 900; letter-spacing: 0.5px; line-height: 1.2; }
.detail-original { color: var(--muted); font-size: 14px; margin-top: 4px; }
.detail-meta {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px 12px;
  margin: 16px 0 18px;
  font-size: 13.5px; color: #c6cbde;
}
.detail-meta .dot { color: var(--muted); }
.detail-score { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.score-num {
  font-size: 34px; font-weight: 900;
  background: linear-gradient(120deg, var(--gold), #ff9d5c);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.score-sub { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.detail-overview { color: #c2c8da; font-size: 15px; max-width: 760px; }
.detail-overview .none { color: var(--muted); }

/* 追踪面板 */
.track-panel {
  margin-top: 26px;
  padding: 20px 22px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  max-width: 760px;
}
.track-panel h4 { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: 1.5px; margin-bottom: 12px; }
.track-status-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.track-btn {
  border-radius: 999px;
  padding: 9px 20px;
  font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  transition: all 0.2s;
}
.track-btn:hover { background: rgba(255, 255, 255, 0.13); }
.track-btn.on.want { background: rgba(96, 165, 250, 0.22); border-color: var(--blue); color: #bcd8ff; }
.track-btn.on.watching { background: rgba(245, 197, 24, 0.16); border-color: var(--gold); color: var(--gold); }
.track-btn.on.watched { background: rgba(52, 211, 153, 0.16); border-color: var(--green); color: var(--green); }
.track-remove {
  background: none; border: none;
  color: var(--muted); font-size: 12.5px;
  margin-left: auto;
  padding: 6px 4px;
}
.track-remove:hover { color: #ff8f8f; }

.my-rating { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.my-rating .label { font-size: 13px; color: var(--muted); }
.stars { display: inline-flex; gap: 3px; }
.stars button {
  background: none; border: none; padding: 1px;
  color: rgba(255, 255, 255, 0.22);
  transition: color 0.12s, transform 0.12s;
}
.stars button svg { width: 19px; height: 19px; fill: currentColor; }
.stars button.lit { color: var(--gold); }
.stars button:hover { transform: scale(1.18); }
.stars.readonly button { cursor: default; }
.stars.readonly button:hover { transform: none; }
.my-rating .val { font-size: 13px; color: var(--gold); font-weight: 700; min-width: 30px; }

/* 区块（演职员 / 季 / 推荐） */
.detail-section { margin-top: 46px; }
.cast-row { display: flex; gap: 16px; overflow-x: auto; padding: 4px 2px 14px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.18) transparent; }
.cast-card { width: 108px; flex-shrink: 0; text-align: center; color: var(--text); border-radius: 12px; }
.cast-link { transition: transform 0.2s, color 0.2s; }
.cast-link:hover { color: #c8ccff; transform: translateY(-3px); }
.cast-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.cast-link:hover .cast-avatar,
.cast-link:focus-visible .cast-avatar { border-color: var(--accent); box-shadow: 0 8px 24px rgba(99, 102, 241, 0.24); }
.cast-avatar {
  width: 84px; height: 84px;
  margin: 0 auto 8px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-strong);
  background: var(--card-solid);
  display: grid; place-items: center;
  font-size: 24px; font-weight: 800; color: #aab;
}
.cast-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cast-name { font-size: 13px; font-weight: 600; }
.cast-role { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 人物页 ---------- */
.person-page { padding-top: 42px; padding-bottom: 40px; }
.person-hero {
  display: grid;
  grid-template-columns: clamp(190px, 23vw, 270px) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 58px);
  align-items: start;
}
.person-profile {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(145deg, hsl(var(--person-hue), 58%, 42%), hsl(calc(var(--person-hue) + 42), 66%, 17%));
  box-shadow: var(--shadow-lg);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(54px, 9vw, 92px);
  font-weight: 900;
}
.person-profile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.person-info { min-width: 0; padding-top: 8px; }
.person-kicker { color: #aab2ff; font-size: 12px; font-weight: 800; letter-spacing: 2px; }
.person-name { margin-top: 8px; font-size: clamp(34px, 6vw, 58px); line-height: 1.08; letter-spacing: -1px; }
.person-facts { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 24px; }
.person-facts div { min-width: 150px; }
.person-facts dt { color: var(--muted); font-size: 11.5px; margin-bottom: 4px; }
.person-facts dd { font-size: 14px; font-weight: 650; }
.person-biography { margin-top: 28px; max-width: 860px; }
.person-biography h2 { font-size: 17px; margin-bottom: 10px; }
.person-biography p { color: #c8ccda; font-size: 14px; line-height: 1.9; white-space: pre-line; }
.person-demo-notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 30px;
  padding: 15px 18px;
  border: 1px solid rgba(245, 194, 66, 0.35);
  border-radius: 14px;
  background: rgba(245, 194, 66, 0.08);
  color: #dfd6b8;
  font-size: 13px;
  line-height: 1.6;
}
.person-demo-notice strong { flex-shrink: 0; color: var(--gold); }
.person-works { margin-top: 38px; }
.person-works-head > div { display: flex; align-items: baseline; gap: 10px; }
.person-tabs { margin-top: 16px; }
.person-credits-grid .card { width: 100%; }
.person-credit-card { min-width: 0; }
.person-credit-roles {
  margin: 7px 3px 0;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.person-empty { padding-block: 64px; }
.person-skeleton .person-profile { box-shadow: none; }

/* 剧集季/集进度 */
.season-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  margin-bottom: 12px;
  overflow: hidden;
}
.season-head {
  width: 100%;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: none; border: none; color: var(--text);
  text-align: left;
  transition: background 0.2s;
}
.season-head:hover { background: rgba(255, 255, 255, 0.05); }
.season-name { font-size: 14.5px; font-weight: 700; }
.season-progress-info { font-size: 12.5px; color: var(--muted); }
.season-head .chev { margin-left: auto; transition: transform 0.25s; color: var(--muted); }
.season-block.open .season-head .chev { transform: rotate(180deg); }
.progress-track {
  flex: 1; max-width: 220px; height: 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.progress-fill { height: 100%; border-radius: 5px; background: var(--grad); transition: width 0.35s ease; }
.season-body { display: none; padding: 6px 18px 16px; }
.season-block.open .season-body { display: block; }
.ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.ep-btn {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 13px; font-weight: 600;
  transition: all 0.15s;
}
.ep-btn:hover { border-color: var(--accent); color: var(--text); }
.ep-btn.watched {
  background: rgba(99, 102, 241, 0.28);
  border-color: var(--accent);
  color: #cdd1ff;
}
.ep-note { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ---------- 片库页 ---------- */
.page-head { padding: 40px 0 8px; }
.page-title { font-size: 30px; font-weight: 900; letter-spacing: 1px; }
.page-desc { color: var(--muted); font-size: 14px; margin-top: 6px; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 26px 0 8px;
}
.stat-tile {
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
}
.stat-num { font-size: 30px; font-weight: 900; }
.stat-num.c-want { color: var(--blue); }
.stat-num.c-watching { color: var(--gold); }
.stat-num.c-watched { color: var(--green); }
.stat-num.c-rate { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat-label { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.tabs { display: flex; gap: 8px; margin: 22px 0 24px; flex-wrap: wrap; }
.tab {
  border-radius: 999px;
  padding: 8px 20px;
  font-size: 13.5px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  transition: all 0.2s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--grad); border-color: transparent; color: #fff; font-weight: 700; }
.tab .count { opacity: 0.75; font-size: 12px; margin-left: 4px; }

.lib-card { position: relative; }
.lib-tools {
  position: absolute; right: 8px; bottom: 8px; z-index: 3;
  display: flex; gap: 6px;
  opacity: 1;
  transition: opacity 0.2s;
}
.lib-tool-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(10, 12, 17, 0.9);
  color: var(--muted);
  display: grid; place-items: center;
  transition: color 0.2s, border-color 0.2s;
}
@media (hover: hover) and (pointer: fine) {
  .lib-tools { opacity: 0; }
  .lib-card:hover .lib-tools,
  .lib-card:focus-within .lib-tools { opacity: 1; }
}
.lib-tool-btn:hover { color: #ff9c9c; border-color: #ff9c9c; }
.lib-tool-btn svg { width: 14px; height: 14px; }
.lib-extra { padding: 8px 4px 0; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lib-extra .mini-stars { color: var(--gold); letter-spacing: 1px; }
.lib-progress { width: 100%; margin-top: 6px; }

.library-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 16px;
  margin: -8px 0 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
}
.library-search {
  flex: 1 1 240px;
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.05);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.library-search:focus-within,
.library-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
}
.library-search svg { width: 17px; height: 17px; color: var(--muted); flex-shrink: 0; }
.library-search input {
  width: 100%; min-width: 0;
  border: 0; outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
}
.library-field { display: grid; gap: 5px; flex: 0 0 auto; }
.library-field > span { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.library-field select {
  height: 42px;
  min-width: 112px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  outline: 0;
  background: #1b1f2b;
  color: var(--text);
  font-size: 13px;
}
.library-actions { display: flex; gap: 8px; margin-left: auto; }
.library-actions .btn { min-height: 42px; white-space: nowrap; }
.library-import-input { display: none; }
.library-result-summary { min-height: 20px; margin: 0 2px 12px; color: var(--muted); font-size: 12.5px; }
.ep-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.ep-actions .ep-note { margin: 0; }

.empty-state {
  text-align: center;
  padding: 90px 20px;
  color: var(--muted);
}
.empty-state .big { font-size: 46px; margin-bottom: 14px; }
.empty-state p { font-size: 15px; margin-bottom: 20px; }

/* ---------- 搜索页 ---------- */
.search-bar-wrap { padding: 40px 0 6px; }
.search-big {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 14px 24px;
  max-width: 640px;
}
.search-big:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18); }
.search-big svg { width: 19px; height: 19px; color: var(--muted); flex-shrink: 0; }
.search-big input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 16px; }
.search-hint { color: var(--muted); font-size: 13.5px; margin: 14px 2px 0; }

/* ---------- 弹窗 / Toast ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 6, 10, 0.66);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  border-radius: 20px;
  background: #141824;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  padding: 28px 30px;
  animation: popIn 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.modal h3 { font-size: 19px; font-weight: 800; margin-bottom: 6px; }
.modal .sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; line-height: 1.7; }
.modal .sub a { color: #a5b0ff; }
.modal .sub a:hover { text-decoration: underline; }
.modal input[type="text"], .modal input[type="password"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.modal input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18); }
body.modal-open { overflow: hidden; }
.field-label {
  display: block;
  margin: 0 0 7px 2px;
  color: #cfd4e6;
  font-size: 13px;
  font-weight: 600;
}
.key-input-row { display: flex; align-items: stretch; gap: 8px; }
.key-input-row input { min-width: 0; }
.key-input-row .key-visibility {
  flex-shrink: 0;
  min-width: 62px;
  padding-inline: 14px;
}
.modal-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; flex-wrap: wrap; }
.key-status { font-size: 12.5px; margin-top: 12px; min-height: 18px; }
.key-status.ok { color: var(--green); }
.key-status.err { color: #ff9c9c; }

#toastRoot {
  position: fixed;
  left: 50%; bottom: 34px;
  transform: translateX(-50%);
  z-index: 200;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  pointer-events: none;
}
.toast {
  background: rgba(18, 21, 30, 0.94);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 13.5px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.3);
  display: flex; align-items: center; gap: 8px;
}
.toast.success { border-color: rgba(52, 211, 153, 0.5); }
.toast.error { border-color: rgba(255, 120, 120, 0.5); }

/* ---------- 骨架屏 ---------- */
.skel {
  border-radius: var(--radius);
  background: linear-gradient(100deg, rgba(255,255,255,0.05) 40%, rgba(255,255,255,0.11) 50%, rgba(255,255,255,0.05) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}
.skel-poster { aspect-ratio: 2/3; }
.row-scroll .skel-poster { width: 168px; flex-shrink: 0; }
.skel-line { height: 14px; border-radius: 7px; margin-top: 10px; }
.skel-line.w60 { width: 60%; }
.skel-hero { height: min(72vh, 640px); min-height: 440px; border-radius: 0; }

/* ---------- 动画 ---------- */
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(16px) scale(0.97); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(18px); } }
.rise { animation: riseIn 0.5s ease both; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .site-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "logo nav settings"
      "search search search";
    gap: 10px 14px;
    height: auto;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .logo { grid-area: logo; }
  .main-nav { grid-area: nav; min-width: 0; }
  .header-right { display: contents; }
  .header-search { grid-area: search; width: 100%; }
  .header-right .icon-btn { grid-area: settings; justify-self: end; }

  .detail-hero {
    min-height: 0;
    height: clamp(220px, 32vh, 280px);
    height: clamp(220px, 32svh, 280px);
  }
  .detail-body {
    --detail-overlap: 76px;
    grid-template-columns: clamp(112px, 30vw, 150px) minmax(0, 1fr);
    column-gap: clamp(16px, 4vw, 24px);
    row-gap: 20px;
  }
  .detail-poster { width: auto; }
  .detail-info { padding-top: calc(var(--detail-overlap) + 4px); }
  .detail-content { grid-column: 1 / -1; grid-row: 2; }
  .detail-title { font-size: clamp(24px, 6vw, 34px); }
  .detail-meta { margin: 12px 0 14px; gap: 7px 10px; }
  .detail-score { margin-bottom: 0; }

  .person-page { padding-top: 30px; }
  .person-hero { grid-template-columns: clamp(150px, 30vw, 210px) minmax(0, 1fr); gap: 26px; }
  .person-name { font-size: clamp(30px, 6vw, 44px); }
  .person-biography { grid-column: 1 / -1; }

  .card { width: 138px; }
  .hero-content { padding-bottom: 46px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .library-toolbar { flex-wrap: wrap; }
  .library-search { flex-basis: 100%; }
  .library-actions { margin-left: 0; }
}
@media (max-width: 520px) {
  .site-header { gap: 9px 10px; }
  .main-nav { justify-self: end; }
  .main-nav a { padding: 6px 9px; font-size: 13px; }
  .logo-text { font-size: 16px; }

  .demo-banner {
    align-items: flex-start;
    justify-content: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 11px 54px 11px 16px;
    line-height: 1.55;
    text-align: left;
  }
  .demo-banner .dismiss {
    position: absolute;
    top: 3px;
    right: 7px;
    width: 40px; height: 40px;
    display: grid; place-items: center;
    padding: 0;
  }

  .detail-hero {
    height: clamp(190px, 29vh, 230px);
    height: clamp(190px, 29svh, 230px);
  }
  .detail-body {
    --detail-overlap: 58px;
    grid-template-columns: clamp(108px, 34vw, 132px) minmax(0, 1fr);
    column-gap: 16px;
  }
  .detail-info { padding-top: calc(var(--detail-overlap) + 2px); }
  .detail-title { font-size: clamp(22px, 6.5vw, 29px); }
  .detail-original { font-size: 12.5px; }
  .detail-meta .chip { display: none; }
  .detail-score { gap: 9px; }
  .score-num { font-size: 29px; }

  .person-page { padding-top: 22px; }
  .person-hero { grid-template-columns: 112px minmax(0, 1fr); gap: 18px; }
  .person-profile { border-radius: 16px; }
  .person-info { padding-top: 2px; }
  .person-kicker { font-size: 10.5px; letter-spacing: 1.4px; }
  .person-name { font-size: clamp(25px, 8vw, 34px); }
  .person-facts { display: grid; gap: 8px; margin-top: 15px; }
  .person-facts div { min-width: 0; }
  .person-biography { grid-column: 1 / -1; margin-top: 2px; }
  .person-biography p { font-size: 13.5px; line-height: 1.8; }
  .person-demo-notice { flex-direction: column; gap: 4px; margin-top: 22px; }
  .person-credits-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }

  .card { width: 122px; }
  .track-panel { padding: 16px; }
  .modal { padding: 22px; }
  .key-input-row { align-items: stretch; }
  .key-input-row .key-visibility { min-width: 58px; padding-inline: 10px; }
  .library-toolbar { padding: 12px; gap: 10px; align-items: stretch; }
  .library-search { min-width: 0; flex-basis: 100%; }
  .library-field { flex: 1 1 calc(50% - 5px); }
  .library-field select { width: 100%; min-width: 0; }
  .library-actions { width: 100%; }
  .library-actions .btn { flex: 1; padding-inline: 10px; }
  .ep-actions { flex-wrap: wrap; }
}
@media (max-width: 350px) {
  .site-header { grid-template-columns: auto minmax(0, 1fr) auto; }
  .logo-text { display: none; }
  .main-nav a { padding-inline: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .skel { animation: none; }
  .card:hover .card-poster,
  .cast-link:hover,
  .btn-primary:hover,
  .btn:active,
  .icon-btn:hover,
  .stars button:hover {
    transform: none;
  }
}
