:root {
  color-scheme: dark;
  --bg: #08080b;
  --panel: #15151b;
  --panel-2: #1f1f27;
  --soft: #292933;
  --line: rgba(255, 255, 255, .08);
  --muted: #9698a4;
  --text: #f6f7fb;
  --red: #ff2738;
  --red-2: #b51222;
}

* {
  -webkit-tap-highlight-color: transparent;
}

html {
  min-height: 100%;
  background: #000;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 20% 0, rgba(255, 39, 56, .18), transparent 30rem),
    linear-gradient(180deg, #101015 0, var(--bg) 34rem, #09090d 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 450px;
  min-height: 100vh;
  margin: 0 auto;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 18rem),
    var(--bg);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .04), 0 24px 80px rgba(0, 0, 0, .45);
}

.safe-page {
  padding: 16px 16px 96px;
}

.safe-top {
  padding-top: max(16px, env(safe-area-inset-top));
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 13px;
}

.section-title {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
}

.section-more {
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--red), #7c0714);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 14px 32px rgba(255, 39, 56, .26);
}

.glass-input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .07);
  color: #fff;
  outline: 0;
  padding: 0 14px;
}

.glass-input::placeholder {
  color: rgba(255, 255, 255, .42);
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .07);
  color: #fff;
}

.hero-wrap {
  position: relative;
  min-height: 502px;
  padding: max(16px, env(safe-area-inset-top)) 16px 18px;
  overflow: hidden;
}

.hero-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  gap: 16px;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.hero-track::-webkit-scrollbar {
  display: none;
}

.hero-slide {
  position: relative;
  min-height: 486px;
  overflow: hidden;
  border-radius: 0 0 28px 28px;
  scroll-snap-align: start;
  background: #15151b;
}

.hero-slide::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, rgba(5, 5, 8, .08), rgba(5, 5, 8, .18) 38%, rgba(5, 5, 8, .88) 82%, var(--bg) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, .55), transparent 58%);
  z-index: 1;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.06) contrast(1.03);
}

.hero-content {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 26px;
  z-index: 2;
}

.hero-title {
  max-width: 78%;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.12;
  text-shadow: 0 6px 24px rgba(0, 0, 0, .55);
}

.hero-meta {
  margin-top: 6px;
  color: rgba(255, 255, 255, .78);
  font-size: 12px;
}

.primary-btn,
.ghost-btn,
.danger-outline-btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 13px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.primary-btn {
  background: linear-gradient(135deg, var(--red), #d31527);
  color: #fff;
  box-shadow: 0 16px 38px rgba(255, 39, 56, .28);
}

.ghost-btn {
  border: 1px solid rgba(255, 255, 255, .23);
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.danger-outline-btn {
  border: 1px solid rgba(255, 39, 56, .58);
  color: var(--red);
}

.play-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .15);
}

.slider-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 14px;
}

.slider-dots span {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .28);
}

.slider-dots span.active {
  width: 18px;
  background: var(--red);
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 6px;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip,
.filter-chip {
  display: inline-flex;
  min-width: max-content;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  color: rgba(255, 255, 255, .78);
  padding: 0 13px;
  font-size: 12px;
  font-weight: 700;
}

.chip.active,
.filter-chip.active,
.chip:hover,
.filter-chip:hover {
  border-color: rgba(255, 39, 56, .9);
  background: var(--red);
  color: #fff;
}

.poster-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 32%;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 0 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.poster-rail::-webkit-scrollbar {
  display: none;
}

.poster-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 10px;
}

.waterfall {
  column-count: 2;
  column-gap: 12px;
}

.waterfall .vod-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 14px;
  break-inside: avoid;
}

.vod-card {
  position: relative;
  display: block;
  min-width: 0;
  overflow: hidden;
}

.vod-poster {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  object-fit: cover;
  background: #20202a;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .32);
}

.vod-score,
.vod-note {
  position: absolute;
  z-index: 2;
  top: 6px;
  border-radius: 7px;
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.vod-score {
  left: 6px;
  background: var(--red);
  color: #fff;
}

.vod-note {
  right: 6px;
  max-width: calc(100% - 44px);
  overflow: hidden;
  background: rgba(0, 0, 0, .58);
  color: rgba(255, 255, 255, .86);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vod-title {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vod-meta {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-tabbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  display: grid;
  width: min(100%, 450px);
  grid-template-columns: repeat(5, 1fr);
  margin: 0 auto;
  padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(13, 13, 17, .88);
  backdrop-filter: blur(20px);
}

.tabbar-item {
  display: grid;
  place-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, .58);
  font-size: 10px;
  font-weight: 700;
}

.tabbar-item.active {
  color: var(--red);
}

.tabbar-icon {
  position: relative;
  display: block;
  width: 22px;
  height: 22px;
}

.tabbar-icon::before,
.tabbar-icon::after {
  position: absolute;
  content: "";
  box-sizing: border-box;
}

.icon-home::before {
  inset: 5px 3px 3px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 3px;
}

.icon-home::after {
  top: 2px;
  left: 5px;
  width: 12px;
  height: 12px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(45deg);
}

.icon-compass::before {
  inset: 3px;
  border: 2px solid currentColor;
  border-radius: 99px;
}

.icon-compass::after {
  top: 7px;
  left: 9px;
  width: 5px;
  height: 9px;
  border-radius: 5px 5px 1px 1px;
  background: currentColor;
  transform: rotate(35deg);
}

.icon-bookmark::before {
  inset: 3px 6px;
  border: 2px solid currentColor;
  border-radius: 3px 3px 1px 1px;
}

.icon-bookmark::after {
  left: 8px;
  bottom: 3px;
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.icon-download::before {
  left: 5px;
  right: 5px;
  bottom: 3px;
  height: 6px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 4px 4px;
}

.icon-download::after {
  top: 3px;
  left: 10px;
  width: 2px;
  height: 12px;
  background: currentColor;
  box-shadow: -4px 7px 0 -1px currentColor, 4px 7px 0 -1px currentColor;
}

.icon-user::before {
  top: 3px;
  left: 7px;
  width: 8px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 99px;
}

.icon-user::after {
  left: 4px;
  right: 4px;
  bottom: 3px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 9px 9px 4px 4px;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(16px, env(safe-area-inset-top)) 16px 10px;
}

.page-title {
  font-size: 21px;
  font-weight: 900;
}

.back-btn,
.share-btn {
  position: relative;
}

.back-btn::before,
.share-btn::before,
.share-btn::after {
  position: absolute;
  content: "";
  box-sizing: border-box;
}

.back-btn::before {
  top: 13px;
  left: 15px;
  width: 10px;
  height: 10px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(45deg);
}

.share-btn::before {
  top: 12px;
  left: 10px;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 5px;
}

.share-btn::after {
  top: 8px;
  left: 11px;
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(-45deg);
}

.media-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .045);
}

.media-row + .media-row {
  margin-top: 10px;
}

.media-row-poster {
  width: 58px;
  flex: 0 0 58px;
}

.media-row-poster img {
  display: block;
  width: 58px;
  aspect-ratio: 2 / 3;
  border-radius: 9px;
  object-fit: cover;
}

.media-row-title {
  display: block;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-row-meta,
.media-row-desc {
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.round-play {
  position: relative;
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 99px;
}

.round-play::before {
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid #fff;
  content: "";
}

.detail-hero {
  position: relative;
  min-height: 430px;
  padding: max(14px, env(safe-area-inset-top)) 16px 22px;
  overflow: hidden;
}

.detail-hero::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .1), var(--bg) 92%),
    linear-gradient(90deg, rgba(0, 0, 0, .8), rgba(0, 0, 0, .18));
  content: "";
  z-index: 1;
}

.detail-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .72;
  filter: blur(1px) saturate(1.08);
  transform: scale(1.02);
}

.detail-content {
  position: relative;
  z-index: 2;
}

.rating-stars {
  color: var(--red);
  font-size: 13px;
  letter-spacing: 1px;
}

.panel-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .035));
}

.episode-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.episode-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.episode-link {
  display: grid;
  min-height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .82);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  padding: 0 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.episode-list .episode-link {
  min-height: 44px;
  place-items: center start;
  padding: 0 12px;
  overflow: hidden;
  line-height: 1.35;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.episode-link.active,
.episode-link:hover {
  border-color: rgba(255, 39, 56, .8);
  background: rgba(255, 39, 56, .16);
  color: var(--red);
}

.player-shell {
  position: relative;
  width: 100%;
  background: #000;
}

.player-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}

.player-box .MacPlayer,
.player-box iframe,
.player-box video,
.player-box embed,
.player-box object {
  width: 100% !important;
  height: 100% !important;
}

.control-pill {
  display: inline-flex;
  min-width: 54px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .82);
  font-size: 11px;
  font-weight: 800;
}

[data-tab-group].active {
  color: var(--red) !important;
}

.profile-card {
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 39, 56, .9), rgba(124, 7, 20, .88));
  box-shadow: 0 18px 40px rgba(255, 39, 56, .18);
}

.menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
  color: rgba(255, 255, 255, .88);
  font-size: 14px;
  font-weight: 700;
}

.menu-link:last-child {
  border-bottom: 0;
}

.menu-link::after {
  width: 8px;
  height: 8px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  content: "";
  opacity: .55;
  transform: rotate(45deg);
}

.setting-row {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.setting-row:last-child {
  border-bottom: 0;
}

.switch {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .16);
}

.switch::before {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  content: "";
  transition: transform .2s ease;
}

.switch.active,
.switch.is-on {
  background: var(--red);
}

.switch.active::before,
.switch.is-on::before {
  transform: translateX(18px);
}

.bottom-sheet {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 80;
  width: min(100%, 450px);
  max-height: 78vh;
  overflow-y: auto;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  background: rgba(20, 20, 25, .96);
  box-shadow: 0 -24px 60px rgba(0, 0, 0, .44);
  transform: translateY(105%);
  transition: transform .24s ease;
  backdrop-filter: blur(20px);
}

.bottom-sheet.open {
  transform: translateY(0);
}

.sheet-lock {
  overflow: hidden;
}

.page-pill,
.page-count {
  display: inline-flex;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .85);
  font-size: 12px;
  font-weight: 800;
}

.page-pill.disabled {
  pointer-events: none;
  opacity: .42;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 240px;
  color: var(--muted);
  text-align: center;
}

.empty-state p {
  margin: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}

.empty-state span {
  font-size: 12px;
}

.empty-icon {
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 39, 56, .35), rgba(255, 255, 255, .04));
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 120;
  max-width: min(330px, calc(100vw - 48px));
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: rgba(18, 18, 23, .94);
  color: #fff;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .42);
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity .2s ease, transform .2s ease;
  backdrop-filter: blur(16px);
}

.app-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.record-check {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
}

.record-check input {
  width: 14px;
  height: 14px;
  accent-color: var(--red);
}

.avatar-edit {
  position: relative;
  display: block;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
}

.avatar-edit img {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  object-fit: cover;
}

.avatar-edit span {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.avatar-edit input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.line-clamp-2 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

@media (max-width: 374px) {
  .poster-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .poster-rail {
    grid-auto-columns: 38%;
  }

  .episode-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
