:root {
  color-scheme: dark;
  --background: #101114;
  --surface: #1a1c21;
  --line: #33363d;
  --white: #f7f6f4;
  --muted: #a7a9b2;
  --accent: #ff6249;
  --header-height: 70px;
  --gutter: clamp(20px, 5vw, 80px);
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--background);
  color: var(--white);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button, select, input, a { touch-action: manipulation; }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
button { border: 0; background: none; }
svg { width: 1.25em; height: 1.25em; flex: none; }
[hidden] { display: none !important; }

.icon-sprite, .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  z-index: 30;
  inset-block-start: .5rem;
  inset-inline-start: .5rem;
  translate: 0 -180%;
  padding: .75rem;
  color: var(--white);
  background: var(--surface);
  border-radius: .5rem;
}
.skip-link:focus { translate: none; }
.shell {
  --shell-inset: max(var(--gutter), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  width: min(1280px, calc(100% - var(--shell-inset) * 2));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 5;
  top: 0;
  background: rgb(16 17 20 / 95%);
  border-bottom: 1px solid rgb(255 255 255 / 8%);
  backdrop-filter: blur(16px);
}
.header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  min-height: var(--header-height);
}

/* Keep the globe at the top right in every language. */
html[dir="rtl"] .header-inner { direction: ltr; }
html[dir="rtl"] :is(.brand > span, .desktop-nav) { direction: rtl; }
.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  max-inline-size: 100%;
  padding: 0;
  min-height: 44px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: .015em;
  white-space: nowrap;
}
.brand > svg { color: var(--accent); width: 31px; height: 31px; }
.brand > span {
  display: flex;
  flex-wrap: wrap;
  column-gap: .18em;
  min-inline-size: 0;
  line-height: 1.18;
  text-align: start;
  white-space: normal;
  overflow-wrap: anywhere;
}
.brand-accent { color: var(--accent); }
.desktop-nav { display: flex; align-items: stretch; align-self: stretch; gap: clamp(.7rem, 3vw, 2.7rem); }
.desktop-nav button {
  position: relative;
  padding: 0 .25rem;
  min-width: 3rem;
  font-size: .9375rem;
  color: var(--muted);
  font-weight: 650;
}
.desktop-nav button:is(:hover, [aria-current]) { color: var(--white); }
.desktop-nav button[aria-current]::after {
  position: absolute;
  content: "";
  inset: auto 20% 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
}
.header-search, .language-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0 .7rem;
  color: var(--muted);
  font-size: .875rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: .65rem;
}
.header-search:hover, .language-button:hover { color: var(--white); border-color: #585960; }
.header-search > span { white-space: nowrap; }
.language-button { color: #ffd4ca; }
.language-button svg { width: 20px; height: 20px; color: var(--accent); }
.language-current {
  max-inline-size: 6ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .75rem;
  font-weight: 700;
}
.language-current:empty { display: none; }
kbd {
  padding: .12rem .38rem;
  margin-inline-start: .8rem;
  color: var(--muted);
  background: #26282f;
  border-radius: .25rem;
  font-size: .8125rem;
}

.hero { --hero-shade-angle: 90deg; position: relative; isolation: isolate; background: #151b16; overflow: hidden; touch-action: pan-y pinch-zoom; }
html[dir="rtl"] .hero { --hero-shade-angle: 270deg; }
.hero-art, .hero-shade { position: absolute; z-index: -1; inset: 0; }
.hero-art img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  object-position: 67% 48%;
}
.hero-shade {
  background:
    linear-gradient(0deg, var(--background), rgb(16 17 20 / 24%) 34%, transparent 62%),
    linear-gradient(var(--hero-shade-angle), rgb(10 12 13 / 96%) 2%, rgb(10 12 13 / 80%) 28%, rgb(10 12 13 / 25%) 59%, transparent 80%);
}
.hero-inner {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(438px, 34vw, 515px);
  padding-block: 2rem 3.8rem;
}
.hero-content { width: min(510px, 58%); }
.hero-kicker {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: .9rem;
  font-size: .875rem;
  font-weight: 750;
  letter-spacing: .14em;
  color: #ff9989;
}
.hero-kicker::before { content: ""; width: 19px; height: 2px; background: var(--accent); border-radius: 8px; }
.hero h1 {
  margin: 0;
  color: #fffefa;
  font-size: clamp(2.9rem, 4.2vw, 4.15rem);
  line-height: 1.07;
  letter-spacing: -.037em;
  font-weight: 850;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.hero h1 span { display: block; margin-block-start: .12em; font-size: .76em; letter-spacing: .01em; }
.hero-original {
  margin: .72rem 0 .92rem;
  color: #d3d4d5;
  min-height: 1.2em;
  font-size: .875rem;
  font-weight: 630;
  letter-spacing: .075em;
  overflow-wrap: anywhere;
}
.hero-meta { display: flex; flex-wrap: wrap; gap: .25rem .65rem; margin: 0; color: #e1e2e4; font-size: .9rem; font-weight: 630; }
.hero-description {
  display: -webkit-box;
  margin: .72rem 0 0;
  color: #bec1c6;
  font-size: .94rem;
  max-width: 27rem;
  line-height: 1.7;
  text-wrap: pretty;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.4rem; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .4rem;
  min-height: 46px;
  padding-inline: .92rem;
  border: 1px solid transparent;
  border-radius: .56rem;
  font-size: .9375rem;
  font-weight: 750;
  white-space: nowrap;
}
.button-primary { background: var(--accent); color: #180b07; }
.button-primary:hover { background: #ff816b; }
.button-secondary { border-color: rgb(255 255 255 / 26%); background: rgb(18 19 22 / 65%); }
.button-secondary:hover { border-color: rgb(255 255 255 / 55%); }
.button-secondary[aria-pressed="true"] { color: #ff9785; }
.hero-save-icon { inline-size: 46px; padding-inline: 0; }
.hero-actions .button { max-inline-size: 100%; white-space: normal; text-wrap: balance; }
.hero-slides {
  position: absolute;
  inset-inline-end: 0;
  bottom: 1.7rem;
  display: flex;
  gap: .28rem;
}
.hero-slides button {
  display: grid;
  place-items: center;
  width: 31px;
  min-height: 32px;
  padding: 0;
}
.hero-slides button::before {
  content: "";
  width: 22px;
  height: 3px;
  border-radius: 9px;
  background: rgb(255 255 255 / 38%);
  transition: width .18s, background .18s;
}
.hero-slides button:hover::before { background: #e7e4de; }
.hero-slides button[aria-pressed="true"]::before { width: 30px; background: var(--accent); }

.collection {
  padding-top: 1rem;
  padding-bottom: clamp(4rem, 8vw, 7rem);
  scroll-margin-top: calc(var(--header-height) + .45rem);
}
.favorites { padding-top: clamp(2rem, 6vw, 4rem); min-height: 70vh; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1.05rem; }
.section-title { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: .75rem; }
.section-title h2 { margin: 0; font-size: clamp(1.55rem, 2.6vw, 2rem); font-weight: 820; letter-spacing: -.015em; overflow-wrap: anywhere; }
.result-count { margin: 0; font-size: .875rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sort-control { position: relative; display: inline-flex; flex: none; }
.sort-control select {
  -webkit-appearance: none;
  appearance: none;
  width: 9.4rem;
  min-height: 40px;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: .55rem;
  padding-block: .4rem;
  padding-inline: .7rem 1.6rem;
  font-size: .875rem;
  color: #dadbe0;
  background: var(--surface);
  text-overflow: ellipsis;
}
.sort-control svg { pointer-events: none; position: absolute; top: 50%; inset-inline-end: .52rem; translate: 0 -50%; color: var(--muted); }
.genres {
  display: flex;
  gap: .5rem;
  margin: -.3rem -.25rem .8rem;
  padding: .3rem .25rem .38rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.genres::-webkit-scrollbar { display: none; }
.genres button {
  flex: none;
  min-width: 58px;
  min-height: 38px;
  padding: .38rem .88rem;
  border: 1px solid #303239;
  border-radius: .52rem;
  background: #191a1f;
  color: #c6c8ce;
  font-size: .875rem;
  font-weight: 650;
  transition: background .16s, border-color .16s, color .16s;
}
.genres button:hover { color: var(--white); border-color: #62646d; }
.genres button[aria-pressed="true"] { color: #180b07; background: var(--accent); border-color: var(--accent); }
.movie-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.55rem clamp(12px, 1.45vw, 21px); }
.catalog-status { margin-block: .75rem; color: var(--muted); }
[data-app-failed] :is(button, select):disabled { opacity: .55; cursor: default; }
.catalog-placeholder {
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: .8rem;
  background: #202227;
}
@supports not (aspect-ratio: 2 / 3) {
  .catalog-placeholder { padding-top: 150%; }
}
.movie-card { display: flex; flex-direction: column; min-width: 0; }
.poster-wrap { position: relative; }
.movie-open {
  display: block;
  width: 100%;
  padding: 0;
  border-radius: .8rem;
  text-align: start;
}
.movie-art {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  isolation: isolate;
  background: var(--surface);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: .8rem;
  transition: border-color .2s;
}
.movie-art picture,
.movie-art img {
  display: block;
  width: 100%;
  height: 100%;
}
.movie-art picture { position: relative; }
.movie-art img {
  object-fit: cover;
  transition: scale .25s ease;
}

picture[data-image-state="loading"], picture[data-image-state="failed"] {
  isolation: isolate;
  background: linear-gradient(155deg, #252a34, #191c24 65%);
}

picture[data-image-state="loading"]::before,
picture[data-image-state="failed"]::before {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  z-index: -1;
  width: min(28%, 36px);
  aspect-ratio: 5 / 4;
  margin: 0;
  color: #747c8d;
  transform: translate(-50%, -50%);
  border: 1px solid currentColor;
  border-radius: 4px;
  background: linear-gradient(140deg, transparent 45%, currentColor 46% 50%, transparent 51%) no-repeat 50% 70% / 58% 50%;
  pointer-events: none;
  content: "";
}

html[dir="rtl"] picture[data-image-state]::before { transform: translate(50%, -50%); }
.hero-art[data-image-state]::before { inset-inline-start: 78%; }
picture[data-image-state="failed"] > img { visibility: hidden; }
@supports not (aspect-ratio: 2 / 3) {
  .movie-art::before { content: ""; display: block; padding-top: 150%; }
  .movie-art picture { position: absolute; top: 0; left: 0; }
}
.movie-runtime {
  position: absolute;
  inset-block-start: .32rem;
  inset-inline-start: .32rem;
  display: flex;
  align-items: center;
  gap: .25rem;
  max-inline-size: calc(100% - 56px);
  min-block-size: 26px;
  padding: .3rem .38rem;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: .42rem;
  color: #fffefa;
  background: rgb(10 12 16 / 88%);
  font-size: .75rem;
  font-weight: 720;
  line-height: 1.16;
  font-variant-numeric: tabular-nums;
}
.movie-runtime svg { inline-size: 13px; block-size: 13px; }
.movie-runtime span { overflow-wrap: anywhere; text-wrap: balance; }
.movie-title {
  display: block;
  margin: .48rem .13rem 0;
  color: var(--white);
  font-size: .9375rem;
  font-weight: 720;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.card-save {
  position: absolute;
  inset-block-start: .32rem;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 50%;
  background: rgb(10 12 16 / 77%);
}
.card-save { inset-inline-end: .32rem; }
.card-save:hover { background: #21232a; }
.card-save[aria-pressed="true"] { color: #ff927f; }
.movie-footer {
  display: flex;
  flex-direction: column;
  justify-content: end;
  gap: .4rem;
  margin: auto .13rem 0;
  padding-block-start: .3rem;
}
.movie-meta {
  display: grid;
  gap: .15rem;
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: .8125rem;
  line-height: 1.3;
}
.movie-meta time { font-variant-numeric: tabular-nums; }
.movie-region { overflow-wrap: anywhere; }
.card-watch {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .35rem;
  width: 100%;
  min-height: 44px;
  padding: .4rem .35rem;
  border: 1px solid rgb(255 139 116 / 30%);
  border-radius: .56rem;
  color: #ffd7cd;
  background: #271d1e;
  font-size: .875rem;
  font-weight: 720;
  line-height: 1.2;
}
.card-watch > span { min-width: 0; overflow-wrap: anywhere; text-wrap: balance; }
.card-watch:hover { color: #180b07; background: var(--accent); }

.saved-empty {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 340px;
  padding: 1rem;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: #15171b;
}
.saved-empty > svg { width: 37px; height: 37px; color: #fb8c78; }
.saved-empty h3 { margin: .7rem 0 .15rem; font-size: 1.25rem; }
.saved-empty p { margin: .25rem 0 1.1rem; color: var(--muted); }
.mobile-nav { display: none; }
.toast {
  position: fixed;
  z-index: 8;
  inset-block-end: 1.2rem;
  inset-inline-end: 1.2rem;
  max-width: calc(100% - 2.4rem);
  padding: .7rem 1rem;
  border: 1px solid #494b55;
  border-radius: .65rem;
  background: #24262d;
  color: var(--white);
  font-size: .875rem;
  box-shadow: 0 10px 36px #0006;
}

@media (hover: hover) {
  .movie-open:hover .movie-art { border-color: #f88471; }
  .movie-open:hover .movie-art img { scale: 1.035; }
}
@media (max-width: 1080px) {
  .movie-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 875px) {
  .movie-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .header-search > span, .header-search kbd, .language-current { display: none; }
  .header-search, .language-button { padding-inline: 0; }
}
@media (max-width: 680px) {
  :root { --gutter: 18px; --header-height: 60px; }
  main { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  .site-header {
    padding-block-start: env(safe-area-inset-top, 0px);
    background: #101114;
    backdrop-filter: none;
  }
  .header-inner { grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
  .desktop-nav, .header-search kbd { display: none; }
  .brand { gap: .45rem; font-size: 1.0625rem; }
  .brand > svg { width: 27px; height: 27px; }
  .header-actions { gap: .375rem; }
  .header-search { color: var(--white); }
  .header-search svg { width: 19px; height: 19px; }
  .hero-art { bottom: 1rem; }
  .hero-art img { object-position: 80% 38%; }
  .hero-shade {
    background:
      linear-gradient(0deg, var(--background) 0%, rgb(16 17 20 / 92%) 20%, rgb(16 17 20 / 50%) 49%, transparent 80%),
      linear-gradient(var(--hero-shade-angle), #0a0c0d4d, transparent 74%);
  }
  .hero-inner {
    align-items: end;
    min-height: 340px;
    min-height: clamp(318px, 43svh, 360px);
    padding-block: .88rem 3.45rem;
  }
  .hero-content { width: 100%; }
  .hero-kicker { margin-bottom: .58rem; font-size: .8125rem; }
  .hero h1 { font-size: clamp(2.15rem, 7.2vw, 3.6rem); line-height: 1.13; }
  .hero h1 span { display: inline; margin-inline-start: .22em; font-size: .72em; }
  .hero-original { margin-block: .45rem .65rem; font-size: .8125rem; }
  .hero-meta { font-size: .875rem; }
  .hero-description { display: none; }
  .hero-actions { gap: .48rem; margin-top: .75rem; }
  .hero-slides { inset-inline: 0 auto; bottom: .3rem; margin-inline-start: -8px; }
  .hero-slides button { width: 44px; min-height: 44px; }
  .collection {
    padding-top: .85rem;
    padding-bottom: 2.5rem;
    scroll-margin-top: calc(var(--header-height) + env(safe-area-inset-top, 0px) + .45rem);
  }
  .favorites { padding-top: 1.6rem; }
  .section-heading { margin-bottom: .8rem; }
  .section-title { column-gap: .5rem; }
  .sort-control select { width: clamp(8.75rem, 38vw, 10rem); font-size: .8125rem; padding-inline-start: .55rem; }
  .genres { margin: -.15rem calc(-1 * var(--gutter)) .65rem; padding: .3rem var(--gutter) .45rem; }
  .genres button { min-height: 44px; }
  .movie-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem .75rem; }
  .mobile-nav {
    position: fixed;
    z-index: 6;
    bottom: 0;
    inset-inline: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: 61px;
    padding: .13rem .5rem env(safe-area-inset-bottom);
    border-top: 1px solid rgb(255 255 255 / 10%);
    background: #101114;
  }
  .mobile-nav button {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: .18rem;
    min-width: 0;
    min-height: 56px;
    padding: 0 .15rem;
    color: var(--muted);
    font-size: .8125rem;
    font-weight: 650;
    overflow-wrap: anywhere;
  }
  .mobile-nav button[aria-current] { color: #ff8873; }
  .mobile-nav svg { width: 21px; height: 21px; }
  .toast { bottom: calc(68px + env(safe-area-inset-bottom)); }
}
@media (max-width: 470px) {
  .movie-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero h1 span { display: block; margin-inline-start: 0; }
}
@media (max-width: 354px) {
  .hero-actions .button:not(.hero-save-icon) { padding-inline: .7rem; }
  .collection .section-heading { flex-wrap: wrap; }
  .sort-control select { width: 9.5rem; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .hero-inner {
    min-height: clamp(230px, calc(100svh - var(--header-height)), 320px);
    padding-block: .9rem 3.15rem;
  }
  .hero h1 { font-size: clamp(1.75rem, 4.7vw, 2.5rem); }
  .hero-kicker { margin-block-end: .42rem; }
  .hero-original { margin-block: .32rem .42rem; }
  .hero-description { display: none; }
  .hero-actions { margin-block-start: .65rem; }
  .hero-slides { bottom: .3rem; }
  .hero-slides button { width: 44px; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; }
}
