/* ===========================================================
   全球电影抢先看 — index 视觉层
   仅做叠加增强，不改动 styles.css / overlays.css 的布局契约：
   网格列数、断点、[hidden]、aria 状态选择器一律保持原样。
   =========================================================== */

:root {
  --background: #0a0b0e;
  --surface: #16181d;
  --surface-2: #1d1f26;
  --line: #2b2e37;
  --white: #f6f4f0;
  --muted: #9a9da8;
  --accent: #ff5a3c;
  --accent-hot: #ff8a4c;
  --accent-soft: rgb(255 90 60 / 14%);
  --accent-line: rgb(255 90 60 / 34%);
  --ring: 0 0 0 2px #0a0b0e, 0 0 0 4px rgb(255 90 60 / 62%);
  --shadow-card: 0 18px 44px -22px rgb(0 0 0 / 88%);
  --header-height: 70px;
  --gutter: clamp(20px, 5vw, 80px);
  --radius-card: 14px;
}

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1200px 620px at 78% -8%, rgb(255 90 60 / 9%), transparent 62%),
    radial-gradient(900px 520px at 4% 0%, rgb(86 122 255 / 8%), transparent 60%),
    var(--background);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgb(255 90 60 / 32%); color: #fff; }

:is(button, select, input, a):focus-visible {
  outline: 2px solid rgb(255 138 76 / 78%);
  outline-offset: 2px;
}
html[dir="rtl"] :is(button, select, input, a):focus-visible { outline-offset: 2px; }

@supports selector(::-webkit-scrollbar) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: #0a0b0e; }
  ::-webkit-scrollbar-thumb { background: #2c3038; border: 2px solid #0a0b0e; border-radius: 9px; }
  ::-webkit-scrollbar-thumb:hover { background: #3c414b; }
}

/* ---------------- 头部 ---------------- */
.site-header {
  background: rgb(10 11 14 / 72%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid rgb(255 255 255 / 7%);
}
.site-header::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-line) 22%, transparent 62%);
  pointer-events: none;
}
.brand { transition: opacity .18s ease; }
.brand:hover { opacity: .86; }
.desktop-nav button { position: relative; letter-spacing: .01em; }
.desktop-nav button[aria-current]::after {
  background: linear-gradient(90deg, var(--accent), var(--accent-hot));
  box-shadow: 0 0 14px -2px rgb(255 90 60 / 72%);
}
.header-search,
.language-button {
  background: rgb(255 255 255 / 4%);
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 999px;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.header-search kbd {
  background: rgb(255 255 255 / 7%);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 6px;
}

/* ---------------- Hero ---------------- */
.hero { background: #0c0e12; }
.hero-art img { filter: saturate(108%) contrast(104%); }
.hero-shade {
  background:
    linear-gradient(var(--hero-shade-angle), rgb(10 11 14 / 96%) 6%, rgb(10 11 14 / 62%) 42%, rgb(10 11 14 / 10%) 74%, rgb(10 11 14 / 56%) 100%),
    linear-gradient(0deg, var(--background) 1%, transparent 26%);
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: .34rem .72rem .34rem .6rem;
  border: 1px solid rgb(255 90 60 / 34%);
  border-radius: 999px;
  background: var(--accent-soft);
  color: #ffc9bd;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: .72rem;
}
.hero-kicker::before { display: none; }
.hero h1 {
  text-shadow: 0 22px 60px rgb(0 0 0 / 62%);
  letter-spacing: -.022em;
}
.hero h1 span { color: #ffd9d0; }
.hero-original { color: #b9bcc6; letter-spacing: .04em; }
.hero-meta { color: #e6e7ea; }
.hero-description { color: #c5c8d0; max-width: 46ch; }
.hero-actions .button-primary {
  background: linear-gradient(100deg, var(--accent), var(--accent-hot));
  box-shadow: 0 14px 34px -16px rgb(255 90 60 / 86%);
}
.hero-actions .button-primary:hover {
  background: linear-gradient(100deg, #ff6b4f, #ffa163);
  transform: translateY(-1px);
}
.button { transition: transform .16s ease, background-color .16s ease, border-color .16s ease, color .16s ease; }
.hero-slides button { border-radius: 8px; }
.hero-slides button[aria-pressed="true"]::before { box-shadow: 0 0 12px 0 rgb(255 90 60 / 82%); }

/* ---------------- 区块标题 ---------------- */
.section-title h2 {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.section-title h2::before {
  content: "";
  inline-size: 3px;
  block-size: 1.05em;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), transparent);
  flex: none;
}

/* ---------------- 类型筛选 ---------------- */
.genres { gap: .45rem; }
.genres button {
  border-radius: 999px;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, transform .16s ease;
}
.genres button:hover { transform: translateY(-1px); }
.genres button[aria-pressed="true"] {
  background: linear-gradient(100deg, var(--accent), var(--accent-hot));
  border-color: transparent;
  color: #1a0a06;
  font-weight: 700;
  box-shadow: 0 10px 24px -14px rgb(255 90 60 / 90%);
}
.sort-control select {
  border-radius: 999px;
  background: rgb(255 255 255 / 4%);
  transition: border-color .16s ease;
}
.sort-control select:hover { border-color: #565a64; }

/* ---------------- 影片卡片 ---------------- */
.movie-card { transition: transform .22s ease; }
.movie-card:hover { transform: translateY(-4px); }
.movie-art {
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid rgb(255 255 255 / 8%);
}
.movie-art img { transition: transform .5s ease, filter .3s ease; }
.movie-card:hover .movie-art img { transform: scale(1.035); filter: saturate(110%) brightness(1.04); }
.movie-art::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 46%;
  background: linear-gradient(0deg, rgb(0 0 0 / 62%), transparent);
  pointer-events: none;
}
.movie-title { font-weight: 720; letter-spacing: -.005em; }
.movie-card:hover .movie-title { color: #fff; }
.movie-runtime {
  background: rgb(8 9 12 / 72%);
  border: 1px solid rgb(255 255 255 / 12%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-radius: 999px;
}
.card-save {
  background: rgb(8 9 12 / 62%);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 50%;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background-color .16s ease, color .16s ease, transform .16s ease;
}
.card-save:hover { transform: scale(1.06); }
.card-save[aria-pressed="true"] { color: #ffab9c; border-color: rgb(255 90 60 / 46%); }
.card-watch {
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 12%);
  background: rgb(255 255 255 / 4%);
  transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}
.card-watch:hover { border-color: transparent; }

/* 首屏卡片入场：只动位移，不动透明度，避免动画未启动时内容不可见 */
@media (prefers-reduced-motion: no-preference) {
  .movie-grid > .movie-card:nth-child(-n+12) {
    animation: cardIn .4s cubic-bezier(.22, .61, .36, 1) both;
  }
  .movie-grid > .movie-card:nth-child(1) { animation-delay: .02s; }
  .movie-grid > .movie-card:nth-child(2) { animation-delay: .05s; }
  .movie-grid > .movie-card:nth-child(3) { animation-delay: .08s; }
  .movie-grid > .movie-card:nth-child(4) { animation-delay: .11s; }
  .movie-grid > .movie-card:nth-child(5) { animation-delay: .14s; }
  .movie-grid > .movie-card:nth-child(6) { animation-delay: .17s; }
  .movie-grid > .movie-card:nth-child(7) { animation-delay: .2s; }
  .movie-grid > .movie-card:nth-child(8) { animation-delay: .23s; }
  .movie-grid > .movie-card:nth-child(9) { animation-delay: .26s; }
  .movie-grid > .movie-card:nth-child(10) { animation-delay: .29s; }
  .movie-grid > .movie-card:nth-child(11) { animation-delay: .32s; }
  .movie-grid > .movie-card:nth-child(12) { animation-delay: .35s; }
}
@keyframes cardIn {
  from { transform: translateY(14px); }
  to { transform: none; }
}

/* ---------------- 空态与状态 ---------------- */
.saved-empty {
  border: 1px dashed rgb(255 255 255 / 12%);
  border-radius: 20px;
  background: rgb(255 255 255 / 2%);
  padding: clamp(1.6rem, 5vw, 2.8rem);
}
.catalog-placeholder {
  border-radius: var(--radius-card);
  background: linear-gradient(100deg, #14161b 8%, #1c1f25 42%, #14161b 76%);
  background-size: 220% 100%;
  animation: shimmer 1.5s linear infinite;
}
@keyframes shimmer { to { background-position: -120% 0; } }
.catalog-status { font-size: .9rem; }

/* ---------------- 弹窗与移动导航 ---------------- */
.dialog::backdrop {
  background: rgb(5 6 9 / 74%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
}
.dialog[open] { border-radius: 20px; border-color: rgb(255 255 255 / 9%); }
.detail-actions {
  background: linear-gradient(0deg, #101216 62%, rgb(16 18 22 / 78%));
  border-top: 1px solid rgb(255 255 255 / 8%);
}
.login-sheet { border-radius: 22px 22px 0 0; }
.login-form input:focus { border-color: var(--accent-line); }
.language-option { border-radius: 12px; transition: background-color .16s ease, border-color .16s ease; }
.search-field { border-radius: 999px; }
.search-result { border-radius: 12px; }
.toast {
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 12%);
  background: rgb(14 15 19 / 92%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 44px -20px rgb(0 0 0 / 90%);
}

@media (max-width: 680px) {
  .mobile-nav {
    background: rgb(10 11 14 / 88%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
    border-top: 1px solid rgb(255 255 255 / 8%);
  }
  .movie-card:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .catalog-placeholder { animation: none; }
  .movie-card,
  .movie-art img,
  .button,
  .genres button { transition: none; }
}
