:root {
  --bg: #111018;
  --surface: #1a1822;
  --raised: #24222e;
  --header: #14121bf3;
  --line: #eee4ff17;
  --ink: #fbf7ff;
  --muted: #b6aebf;
  --green: #ffab8c;
  --green-ink: #29151c;
  --cinema-rose: #f275a0;
  --cinema-accent-wash: #ffad9018;
  --cinema-radius: 18px;
  --cinema-rail: 178px;
  --rail: var(--cinema-rail);
}
:root[data-theme='light'] {
  --bg: #f8f5f8;
  --surface: #fff;
  --raised: #efebf2;
  --header: #fffafbfa;
  --line: #3323391c;
  --ink: #251c2d;
  --muted: #695f72;
  --green: #953550;
  --green-ink: #fff;
  --cinema-rose: #a73660;
  --cinema-accent-wash: #aa386114;
}

.kubo-icon {
  display: block;
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.sidebar { padding: 21px 13px; background: var(--header); }
.sidebar .kubo-brand { margin: 0 9px 24px; }
.side-group { gap: 4px; padding-bottom: 15px; margin-bottom: 15px; }
.side-group:last-child { border-bottom: 0; }
.side-group a, .side-group button {
  min-height: 43px;
  padding: 8px 10px;
  gap: 10px;
  font-size: 14px;
  border: 1px solid transparent;
  border-radius: 10px;
}
.side-group a[aria-current='page'] {
  background: var(--cinema-accent-wash);
  border-color: color-mix(in srgb, var(--green), transparent 79%);
  color: var(--green);
  font-weight: 700;
}
.side-group .kubo-icon { width: 19px; height: 19px; }
.side-group [data-kubo-text] { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.side-heading { margin: 0 0 4px 11px; font-size: 12px; color: var(--muted); }

.topbar { gap: 21px; padding-inline: 27px; }
.top-links { align-items: stretch; align-self: stretch; gap: 19px; }
.top-links a { position: relative; display: grid; place-items: center; font-size: 14px; }
.top-links a[aria-current='page'] { color: var(--green); }
.top-links a[aria-current='page']::after {
  content: '';
  position: absolute;
  height: 2px;
  left: 18%;
  right: 18%;
  bottom: 0;
  border-radius: 2px 2px 0 0;
  background: var(--green);
}
.topbar-discover {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  max-width: 600px;
  margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--raised);
}
.topbar-discover:focus-within { border-color: var(--green); }
.filter-link {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  border-right: 1px solid var(--line);
  padding: 0 11px;
  color: var(--muted);
  font-size: 13px;
}
.filter-link .kubo-icon { width: 17px; height: 17px; }
.filter-link:hover { color: var(--green); }
.topbar .search { flex: 1; min-width: 0; height: 40px; margin: 0; border: 0; border-radius: 0 13px 13px 0; background: none; }
.topbar .search input { padding-inline: 12px 3px; }
.topbar .search button { padding-inline: 12px; font-size: 13px; }
.topbar .search button .kubo-icon { width: 18px; height: 18px; }
.utilities { align-items: center; flex: 0 0 auto; gap: 12px; }
.utility { min-height: 43px; min-width: 41px; padding: 3px 4px; border-radius: 9px; }
.utility:hover { background: var(--cinema-accent-wash); }
.theme-icon { display: grid; place-items: center; }
.theme-icon-sun, :root[data-theme='dark'] .theme-icon-moon { display: none; }
:root[data-theme='dark'] .theme-icon-sun { display: grid; }
.locale-fab {
  position: fixed;
  z-index: 45;
  inset-inline-end: calc(20px + env(safe-area-inset-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}
.locale-fab-trigger {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  list-style: none;
  border: 1px solid #ffd2c388;
  border-radius: 50%;
  background: linear-gradient(138deg, #ffd2ac, #ff9b97 64%, #f281ab);
  color: #402031;
  box-shadow: 0 6px 18px #1a10283d, inset 0 1px 1px #ffffff73;
  cursor: pointer;
}
.locale-fab-trigger::-webkit-details-marker { display: none; }
.locale-fab-trigger .kubo-icon { width: 23px; height: 23px; }
.locale-fab-trigger:hover, .locale-fab[open] .locale-fab-trigger { filter: brightness(1.08); }
.locale-fab-trigger:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
.locale-fab-panel {
  position: absolute;
  inset-inline-end: 0;
  bottom: calc(100% + 10px);
  width: min(210px, calc(100vw - 44px - env(safe-area-inset-right, 0px)));
  max-height: max(90px, calc(100dvh - 146px - env(safe-area-inset-bottom, 0px)));
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.locale-fab-panel h2 { margin: 3px 9px 5px; color: var(--muted); font-size: 12px; font-weight: 650; }
.locale-fab-panel button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 6px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  text-align: start;
}
.locale-fab-panel button:hover, .locale-fab-panel button[aria-pressed='true'] { background: var(--cinema-accent-wash); }
.locale-fab-panel button[aria-pressed='true'] { color: var(--green); font-weight: 700; }
.locale-fab-panel button[aria-pressed='true']::after {
  content: '';
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.locale-fab-panel button:focus-visible { outline-offset: -2px; }
.utilities .account-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  border: 1px solid color-mix(in srgb, var(--green), transparent 78%);
  border-radius: 10px;
  background: var(--cinema-accent-wash);
  color: var(--green);
  font-weight: 700;
}
.account-login .kubo-icon { width: 16px; height: 16px; }

.home-feature {
  position: relative;
  isolation: isolate;
  margin: 15px 25px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--cinema-radius);
  background: var(--surface);
}
.home-feature:not(:has(.hero-pick)) { display: none; }
.home-feature .hero { min-height: clamp(414px, 32vw, 580px); margin: 0; }
.home-feature .hero-art { object-position: 65% 37%; }
.home-feature .hero::after, :root[data-theme='light'] .home-feature .hero::after {
  background: linear-gradient(0deg, #120f1ae0 1%, #120f1a00 53%), linear-gradient(90deg, #120f1af7, #120f1a97 36%, #120f1a00 78%);
}
.feature-inner { width: 100%; padding-inline: 34px; }
.home-feature .hero-copy { width: min(620px, 66%); padding: 48px 0 54px; }
.home-feature .hero-label {
  padding: 5px 10px 5px 8px;
  gap: 6px;
  border: 1px solid #ffdcce42;
  border-radius: 999px;
  background: #241b31ac;
  color: #ffe3d7;
  font-size: 12px;
  letter-spacing: 0;
}
.home-feature .hero-label::before { display: none; }
.hero-label .kubo-icon { width: 15px; height: 15px; color: #ffab8c; }
.home-feature .hero h1 {
  margin: 14px 0 13px;
  color: #fff;
  font-family: 'Cinema Title', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  font-size: clamp(44px, 4.35vw, 72px);
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
  text-shadow: 0 3px 22px #090611bb;
}
.home-feature .hero-tagline {
  display: -webkit-box;
  margin: 0 0 13px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #faf6fb;
  font-family: 'PingFang SC', 'Microsoft YaHei UI', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui, sans-serif;
  font-size: clamp(15px, 1.32vw, 19px);
  font-weight: 650;
  line-height: 1.55;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 6px #120f1aee;
}
:lang(zh-Hant) .home-feature .hero-tagline {
  font-family: 'PingFang TC', 'Microsoft JhengHei UI', 'Microsoft JhengHei', 'Noto Sans CJK TC', system-ui, sans-serif;
}
.home-feature .hero-tagline:empty { display: none; }
.home-feature .hero-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 19px; color: #f4ebf4; }
.hero-meta span { padding: 2px 7px; border: 1px solid #fcf5ff44; border-radius: 5px; background: #20172991; font-size: 11px; }
.hero-meta span:empty { display: none; }
.home-feature .button-row { gap: 9px; }
.home-feature .hero .primary, .home-feature .hero .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 9px; font-size: 14px; }
.home-feature .hero .primary { background: linear-gradient(112deg, #ffc098, #ff9d9e); color: #261429; }
.home-feature .hero .primary:hover { background: #ffd3b3; }
.home-feature .hero .secondary { border-color: #ffeaff53; background: #211929b9; color: #fff7ff; }
.home-feature .hero .secondary:hover { background: #36273de8; }
.home-feature .button-row .kubo-icon { width: 16px; height: 16px; }
.home-feature .hero .primary .kubo-icon, .poster-play .kubo-icon { fill: currentColor; stroke-width: 1.1; }
.watchlist-icon-saved, [data-save-id][aria-pressed='true'] .watchlist-icon-add { display: none; }
[data-save-id][aria-pressed='true'] .watchlist-icon-saved { display: block; color: #ffab8c; }

.feature-strip {
  position: relative;
  z-index: 1;
  padding: 14px 21px 17px;
  border-top: 1px solid var(--line);
  background: linear-gradient(115deg, var(--cinema-accent-wash), transparent 34%), var(--surface);
}
.feature-strip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.feature-strip-head h2 { margin: 0; color: var(--ink); font-size: 15px; font-weight: 700; }
.feature-controls { display: flex; gap: 6px; }
.feature-controls button, .dialog-head [data-dialog-close] {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
  color: var(--ink);
}
.feature-controls button:hover, .dialog-head [data-dialog-close]:hover { border-color: var(--green); color: var(--green); }
.feature-controls .kubo-icon { width: 17px; height: 17px; }
.feature-strip:has(.hero-pick:only-child) .feature-controls { display: none; }
.home-feature .hero-thumbs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 50px) / 6);
  grid-template-columns: none;
  margin: 0;
  padding: 3px 2px 4px;
  gap: 10px;
  overflow: auto hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  scroll-snap-type: x proximity;
}
.home-feature .hero-pick { scroll-snap-align: start; border-radius: 10px; }
.home-feature .hero-pick img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 9px;
  object-position: 72% center;
  background: var(--raised);
  border: 1px solid var(--line);
}
.home-feature .hero-pick span { padding-inline: 2px; margin: 4px 0 0; font-size: 13px; }
.home-feature .hero-pick:hover { color: var(--ink); }
.home-feature .hero-pick[aria-pressed='true'] img { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.home-feature .hero-pick[aria-pressed='true'] span { color: var(--green); }

.home-shelf { margin-top: 27px; }
.section-head h2, .section-head .more { display: inline-flex; align-items: center; gap: 8px; }
.section-head h2 .kubo-icon { width: 21px; height: 21px; color: var(--cinema-rose); }
.section-head .more .kubo-icon { width: 15px; height: 15px; }
.card-action { display: block; min-width: 0; border-radius: 11px; }
.card-action:hover h3, .card-action:focus-visible h3 { color: var(--green); }
.card-action .poster-link { border: 1px solid var(--line); border-radius: 11px; }
.poster-note, .poster-score { display: flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 5px; background: #1a1222db; }
.poster-note { display: block; right: auto; max-width: calc(100% - 51px); }
.poster-score .kubo-icon { width: 11px; height: 11px; fill: currentColor; }
.poster-play {
  position: absolute;
  z-index: 2;
  inset: 50% auto auto 50%;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #fffcf571;
  border-radius: 50%;
  background: #1a1222ca;
  color: #fff3ed;
  opacity: 0;
  transform: translate(-50%, -44%);
  transition: opacity .18s, transform .18s;
}
.card-action:hover .poster-play, .card-action:focus-visible .poster-play { opacity: 1; transform: translate(-50%, -50%); }
.footer.content { margin-left: var(--rail); padding-inline: 32px; }

@media (max-width: 1200px) {
  :root { --rail: 154px; }
  .topbar { gap: 16px; padding-inline: 20px; }
  .utilities { gap: 8px; }
  .home-feature { margin-inline: 19px; }
}
@media (max-width: 900px) {
  :root { --rail: 0px; }
  .top-links { display: none; }
  .home-feature { margin-inline: 13px; }
  .home-feature .hero-thumbs { grid-auto-columns: calc((100% - 40px) / 5); }
  .footer.content { padding-inline: 22px; }
}
@media (max-width: 600px) {
  .topbar { gap: 8px; padding-inline: 11px; }
  .topbar-discover { border-radius: 999px; }
  .topbar .search { height: 34px; }
  .filter-link, .utilities .account-login, .utilities .history-control { display: none; }
  .topbar .search input { padding-left: 9px; font-size: 12px; }
  .topbar .search button { padding-inline: 6px; }
  .utilities { gap: 3px; }
  .utility { min-width: 31px; min-height: 36px; padding-inline: 2px; }
  .utility .kubo-icon { width: 17px; height: 17px; }
  .locale-fab { inset-inline-end: calc(14px + env(safe-area-inset-right, 0px)); bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .locale-fab-trigger { width: 44px; height: 44px; }
  .mobile-channels { align-items: stretch; gap: 7px; padding: 0 10px; }
  .mobile-channels a { display: flex; gap: 4px; align-items: center; padding-inline: 7px; font-size: 13px; }
  .mobile-channels .kubo-icon { width: 15px; height: 15px; }
  .mobile-channels a[aria-current='page'] { color: var(--green); box-shadow: inset 0 -2px currentColor; font-weight: 700; }
  .mobile-bottom a, .mobile-bottom button { display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 36px; }
  .mobile-bottom .kubo-icon { width: 20px; height: 20px; }
  .mobile-bottom a[aria-current='page'] { color: var(--green); font-weight: 700; }
  .home-feature { margin: 0 0 13px; border: 0; border-radius: 0; }
  .home-feature .hero { min-height: 330px; }
  .home-feature .hero-art { object-position: 69% 34%; }
  .home-feature .hero::after, :root[data-theme='light'] .home-feature .hero::after { background: linear-gradient(0deg, #130f1dec 1%, #180f239d 39%, #130f1a11 79%); }
  .feature-inner { padding-inline: 15px; }
  .home-feature .hero-copy { width: 100%; padding: 75px 0 19px; }
  .home-feature .hero h1 { margin: 9px 0 8px; font-size: clamp(31px, 9.6vw, 46px); }
  .home-feature .hero-tagline { margin-bottom: 9px; font-size: 14px; }
  .home-feature .hero-meta { margin-bottom: 10px; }
  .home-feature .hero .primary, .home-feature .hero .secondary { min-height: 36px; padding-inline: 10px; font-size: 12px; }
  .feature-strip { padding: 7px 14px 10px; }
  .feature-strip-head { margin-bottom: 5px; }
  .feature-strip-head h2 { font-size: 13px; }
  .feature-controls button { width: 36px; height: 34px; }
  .home-feature .hero-thumbs { grid-auto-columns: calc((100% - 22px) / 3.2); gap: 7px; scrollbar-width: none; }
  .home-feature .hero-pick img { border-radius: 6px; }
  .home-feature .hero-pick span { font-size: 12px; }
  .home-shelf { margin-top: 18px; }
  .section-head h2 { font-size: 19px; }
  .section-head h2 .kubo-icon { width: 18px; height: 18px; }
  .card-action .poster-link { border-radius: 8px; }
  .poster-note, .poster-score { padding: 2px 4px; }
  .poster-note { max-width: calc(100% - 38px); }
  .footer.content { padding-inline: 16px; padding-bottom: calc(69px + env(safe-area-inset-bottom)); }
}

.detail-banner {
  background: radial-gradient(ellipse at 76% 3%, var(--cinema-accent-wash), transparent 60%), var(--surface);
}
.detail-poster { border: 1px solid var(--line); box-shadow: var(--shadow); }
.detail .button-row > a, .detail .button-row > button, .player-info .secondary { display: inline-flex; align-items: center; gap: 7px; }
.detail .button-row .kubo-icon, .player-info .secondary .kubo-icon { width: 17px; height: 17px; }
.detail .button-row .primary .kubo-icon { fill: currentColor; }
.player-side, .filters { border-radius: 13px; }


@media (max-width: 350px) {
  .topbar {
    display: grid;
    grid-template-columns: 1fr max-content;
    grid-template-rows: 50px 35px;
    gap: 0 8px;
    height: 92px;
    padding: 0 11px 7px;
  }
  .topbar .logo { grid-row: 1; grid-column: 1; justify-self: start; }
  .topbar-discover { grid-row: 2; grid-column: 1 / -1; width: 100%; }
  .topbar > .utilities { grid-row: 1; grid-column: 2; }
  .mobile-channels { top: 92px; }
  .main { padding-top: 136px; }
}
