/* ==========================================================================
   蓝鹭漫剧 · H5 设计系统
   base.css —— 设计令牌 / 基础布局 / 通用组件 / 首页
   ========================================================================== */

/* ---------------------------------------------------------------- Tokens */
:root {
  --bg: #05080f;
  --bg-soft: #080d18;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --surface-3: rgba(255, 255, 255, 0.11);
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);

  --text: #f2f6ff;
  --text-2: #9aa8c2;
  --text-3: #7a88a3;

  --brand: #7dc8ff;
  --brand-2: #9d8bff;
  --brand-3: #4aa8ff;
  --gold: #e9c27c;
  --gold-deep: #b28a3f;
  --rose: #ff7096;
  --mint: #4fe0c0;
  --grad-brand: linear-gradient(135deg, #8fd4ff 0%, #8e7bff 100%);
  --grad-gold: linear-gradient(135deg, #f6dcab 0%, #d9a64f 100%);
  --grad-card: linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 100%);

  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius: 16px;
  --radius-sm: 11px;
  --radius-pill: 999px;

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --font-en: "SF Pro Display", "Helvetica Neue", "Segoe UI", Arial, sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --tabbar-h: 62px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --app-max: 520px;
}

/* ---------------------------------------------------------------- Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.overlay-lock {
  overflow: hidden;
}

h1, h2, h3, h4, p, figure {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}

input,
textarea {
  font: inherit;
  color: inherit;
}

::selection {
  background: rgba(141, 196, 255, 0.25);
}

/* ---------------------------------------------------------------- Ambient */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(120% 60% at 50% -8%, rgba(44, 82, 150, 0.28) 0%, transparent 60%),
    radial-gradient(90% 55% at 100% 32%, rgba(88, 62, 160, 0.16) 0%, transparent 62%),
    radial-gradient(80% 50% at 0% 78%, rgba(30, 94, 138, 0.14) 0%, transparent 60%),
    var(--bg);
}

.ambient__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
}

.ambient__glow--a {
  top: -160px;
  left: -80px;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(66, 132, 232, 0.55), transparent 70%);
}

.ambient__glow--b {
  top: 180px;
  right: -140px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(133, 92, 238, 0.4), transparent 70%);
}

.ambient__grain {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ---------------------------------------------------------------- App frame */
.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--app-max);
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 26px);
}

.app.has-tabbar:not(.tabbar-hidden) {
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 30px);
}

@media (min-width: 760px) {
  body {
    background:
      radial-gradient(70% 50% at 50% 0%, rgba(55, 98, 178, 0.24), transparent 65%),
      #04070d;
  }
  .app {
    min-height: 100vh;
    background: linear-gradient(180deg, rgba(7, 11, 19, 0.72), rgba(5, 8, 15, 0.92));
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 40px 140px rgba(0, 0, 0, 0.7);
  }
}

/* ---------------------------------------------------------------- Common */
.page {
  animation: page-in 0.34s var(--ease) both;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none !important;
}

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

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

.mark,
mark {
  color: var(--brand);
  background: rgba(125, 200, 255, 0.14);
  border-radius: 4px;
  padding: 0 2px;
}

/* ---------------------------------------------------------------- Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 58px;
  padding: calc(var(--safe-top) + 6px) 18px 6px;
  background: linear-gradient(180deg, rgba(5, 8, 15, 0.94) 0%, rgba(5, 8, 15, 0.66) 62%, transparent 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.topbar--solid {
  background: rgba(5, 8, 15, 0.9);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 44px;
}

.brand__logo {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 4px 12px rgba(112, 176, 255, 0.4));
}

.brand__name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.brand__en {
  font-family: var(--font-en);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-top: 1px;
  white-space: nowrap;
}

.brand__tag {
  margin-left: 2px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--brand);
  border: 1px solid rgba(125, 200, 255, 0.35);
  background: rgba(125, 200, 255, 0.08);
  white-space: nowrap;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}

.icon-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.1);
}

.icon-btn--plain {
  background: none;
  border-color: transparent;
}

.icon-btn__badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 2px rgba(5, 8, 15, 0.9);
}

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  transition: transform 0.18s var(--ease), filter 0.2s var(--ease), background 0.2s var(--ease);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.96);
}

.btn--primary {
  background: var(--grad-brand);
  color: #05101f;
  box-shadow: 0 10px 28px rgba(96, 160, 255, 0.32);
}

.btn--primary:hover {
  filter: brightness(1.06);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--text);
  backdrop-filter: blur(10px);
}

.btn--gold {
  background: var(--grad-gold);
  color: #211405;
  box-shadow: 0 10px 26px rgba(217, 166, 79, 0.28);
}

.btn--outline {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}

.btn--block {
  width: 100%;
}

.btn--sm {
  height: 32px;
  padding: 0 13px;
  font-size: 12px;
}

.btn--lg {
  height: 48px;
  font-size: 15px;
  padding: 0 26px;
}

/* ---------------------------------------------------------------- Tags & chips */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.tag--brand {
  color: var(--brand);
  background: rgba(125, 200, 255, 0.1);
  border-color: rgba(125, 200, 255, 0.22);
}

.tag--gold {
  color: var(--gold);
  background: rgba(233, 194, 124, 0.1);
  border-color: rgba(233, 194, 124, 0.24);
}

.tag--rose {
  color: var(--rose);
  background: rgba(255, 112, 150, 0.1);
  border-color: rgba(255, 112, 150, 0.22);
}

.tag--solid {
  color: #06111f;
  background: var(--grad-brand);
  border-color: transparent;
  font-weight: 700;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 13px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  white-space: nowrap;
  transition: all 0.2s var(--ease);
}

.chip:active {
  transform: scale(0.95);
}

.chip.is-active {
  color: #06111f;
  font-weight: 700;
  background: var(--grad-brand);
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(96, 160, 255, 0.28);
}

.chip--sm {
  height: 26px;
  padding: 0 10px;
  font-size: 11px;
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 18px;
  margin: 0 -18px;
  scroll-snap-type: x proximity;
  scroll-padding-left: 18px;
}

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

.chip-row > * {
  scroll-snap-align: start;
  flex: 0 0 auto;
}

/* ---------------------------------------------------------------- Section */
.section {
  padding: 26px 18px 0;
}

.section--tight {
  padding-top: 20px;
}

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section__titles {
  min-width: 0;
}

.section__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.section__title::before {
  content: "";
  width: 3px;
  height: 17px;
  border-radius: 3px;
  background: var(--grad-brand);
  box-shadow: 0 0 12px rgba(125, 200, 255, 0.6);
}

.section__sub {
  margin-top: 5px;
  padding-left: 11px;
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--text-3);
  text-transform: uppercase;
}

.section__more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--text-3);
  padding: 12px 2px;
  margin: -12px 0;
  transition: color 0.2s var(--ease);
}

.section__more:active {
  color: var(--brand);
}

/* ---------------------------------------------------------------- Hero */
.hero {
  position: relative;
  margin: 2px 14px 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  touch-action: pan-y;
  isolation: isolate;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.hero__track {
  display: flex;
  will-change: transform;
  transition: transform 0.55s var(--ease);
}

.hero__slide {
  position: relative;
  flex: 0 0 100%;
  height: clamp(400px, 60vh, 520px);
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
}

.hero__slide.is-active .hero__bg {
  animation: hero-zoom 8s linear both;
}

@keyframes hero-zoom {
  from { transform: scale(1.03); }
  to { transform: scale(1.11); }
}

.hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 7, 13, 0.02) 0%, rgba(4, 7, 13, 0.12) 38%, rgba(4, 7, 13, 0.72) 72%, rgba(4, 7, 13, 0.94) 100%),
    linear-gradient(90deg, rgba(4, 7, 13, 0.55) 0%, transparent 55%);
}

.hero__grain {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

.hero__content {
  position: absolute;
  inset: auto 0 0;
  padding: 0 22px 44px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--gold);
}

.hero__eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.hero__eyebrow em {
  font-style: normal;
  color: var(--text-3);
  letter-spacing: 0.1em;
}

.hero__title {
  font-family: var(--font-serif);
  font-size: clamp(30px, 8.6vw, 38px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: 0.02em;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.hero__en {
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(242, 246, 255, 0.5);
  margin-top: -5px;
}

.hero__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-2);
}

.hero__meta i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-3);
}

.hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hero__tags .tag {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(242, 246, 255, 0.82);
  backdrop-filter: blur(8px);
}

.hero__cta {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.hero__cta .btn {
  height: 42px;
  padding: 0 22px;
  font-size: 13px;
}

.hero__ui {
  position: absolute;
  right: 18px;
  top: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.hero__count {
  font-family: var(--font-en);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.65);
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  background: rgba(4, 7, 13, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.hero__dots {
  position: absolute;
  left: 22px;
  bottom: 10px;
  display: flex;
  gap: 0;
  z-index: 2;
}

.hero__dot {
  position: relative;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
}

.hero__dot::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.4);
  transition: all 0.35s var(--ease);
}

.hero__dot.is-active::before {
  width: 18px;
  background: var(--grad-brand);
  box-shadow: 0 0 10px rgba(125, 200, 255, 0.55);
}

/* ---------------------------------------------------------------- Category tiles */
.cats {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 18px 18px 6px;
  margin: 0;
  scroll-snap-type: x proximity;
  scroll-padding-left: 18px;
}

.cats::-webkit-scrollbar {
  display: none;
}

.cat {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  scroll-snap-align: start;
}

.cat__disc {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(155deg, var(--cat, #7dc8ff) 0%, #0a1020 78%);
  background:
    radial-gradient(120% 120% at 30% 20%, color-mix(in srgb, var(--cat, #7dc8ff) 62%, #ffffff 6%) 0%, color-mix(in srgb, var(--cat, #7dc8ff) 26%, #0a1020 74%) 62%),
    #0c1322;
  border: 1px solid color-mix(in srgb, var(--cat, #7dc8ff) 42%, transparent);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--cat, #7dc8ff) 18%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.2s var(--ease);
}

.cat__disc::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  pointer-events: none;
}

.cat:active .cat__disc {
  transform: scale(0.93);
}

.cat__label {
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- Poster card */
.pcard {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0b1120;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.32), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  isolation: isolate;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.pcard:active {
  transform: scale(0.97);
}

.pcard__art {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(150deg, #111a2e, #080d17);
}

.pcard__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.pcard:hover .pcard__img {
  transform: scale(1.05);
}

.pcard__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 8, 15, 0.06) 0%, transparent 34%, rgba(5, 8, 15, 0.58) 76%, rgba(5, 8, 15, 0.9) 100%);
}

.pcard__top {
  position: absolute;
  inset: 8px 8px auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.pcard__badge {
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.7;
  white-space: nowrap;
}

.pcard__badge--gold {
  color: #241705;
  background: var(--grad-gold);
  box-shadow: 0 3px 10px rgba(217, 166, 79, 0.35);
}

.pcard__badge--blue {
  color: #06111f;
  background: var(--grad-brand);
  box-shadow: 0 3px 10px rgba(96, 160, 255, 0.3);
}

.pcard__badge--glass {
  color: var(--text);
  background: rgba(5, 8, 15, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
}

.pcard__eps {
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(5, 8, 15, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
  white-space: nowrap;
}

.pcard__info {
  position: absolute;
  inset: auto 9px 9px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pcard__title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
}

.pcard__meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: rgba(242, 246, 255, 0.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pcard__meta i {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

.pcard--lg .pcard__title {
  font-size: 17px;
}

.pcard--lg .pcard__info {
  inset: auto 12px 12px;
}

.pcard--lg .pcard__meta {
  font-size: 10.5px;
}

/* rank badge on poster */
.pcard__rank {
  position: absolute;
  left: 8px;
  bottom: 8px;
}

/* ---------------------------------------------------------------- Rails */
.rail {
  display: flex;
  gap: 11px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 18px 6px;
  margin: 0 -18px;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 18px;
}

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

.rail > * {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.rail__item {
  width: 146px;
}

.rail__item--lg {
  width: 172px;
}

/* ---------------------------------------------------------------- Poster grid */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* ---------------------------------------------------------------- Wide feature card */
.feature {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 13px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(125, 200, 255, 0.14) 0%, transparent 52%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform 0.22s var(--ease);
}

.feature:active {
  transform: scale(0.985);
}

.feature__art {
  flex: 0 0 104px;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.feature__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  padding-right: 4px;
}

.feature__eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.feature__title {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: 0.02em;
}

.feature__desc {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-2);
}

.feature__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 1px;
  font-size: 10px;
  color: var(--text-3);
}

/* ---------------------------------------------------------------- Media row (榜单/搜索/历史 共用) */
.mrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.mrow:active {
  transform: scale(0.985);
  background: rgba(255, 255, 255, 0.06);
}

.mrow__thumb {
  position: relative;
  flex: 0 0 62px;
  height: 82px;
  border-radius: 10px;
  overflow: hidden;
  background: #0b1120;
}

.mrow__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mrow__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mrow__title {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mrow__sub {
  font-size: 10.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mrow__tags {
  display: flex;
  gap: 5px;
  overflow: hidden;
}

.mrow__tags .tag {
  font-size: 9px;
  padding: 1px 6px;
}

.mrow__tail {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
}

.mrow__play {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #06111f;
  background: var(--grad-brand);
  box-shadow: 0 6px 16px rgba(96, 160, 255, 0.32);
}

/* ---------------------------------------------------------------- Footer */
.footer {
  padding: 44px 26px 30px;
  text-align: center;
  color: var(--text-3);
}

.footer__logo {
  width: 38px;
  height: 38px;
  margin: 0 auto 10px;
  opacity: 0.9;
}

.footer__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.footer__name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: rgba(242, 246, 255, 0.78);
}

.footer__tag {
  font-family: var(--font-en);
  font-size: 8px;
  letter-spacing: 0.26em;
  color: var(--text-3);
  text-transform: uppercase;
}

.footer__stats {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin: 18px 0;
}

.footer__stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer__stat b {
  font-family: var(--font-en);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(242, 246, 255, 0.85);
}

.footer__stat span {
  font-size: 9.5px;
  color: var(--text-3);
}

.footer__notice {
  font-size: 10.5px;
  line-height: 1.8;
  color: var(--text-3);
  max-width: 340px;
  margin: 0 auto;
}

.footer__copy {
  margin-top: 16px;
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.06em;
}

/* ---------------------------------------------------------------- Tabbar */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  width: 100%;
  max-width: var(--app-max);
  display: flex;
  align-items: stretch;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding: 6px 10px calc(6px + var(--safe-bottom));
  background: rgba(6, 10, 18, 0.82);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  transition: transform 0.3s var(--ease), opacity 0.25s var(--ease);
}

.tabbar.is-hidden {
  transform: translate(-50%, 110%);
  opacity: 0;
  pointer-events: none;
}

.tab {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 14px;
  color: var(--text-3);
  transition: color 0.22s var(--ease);
}

.tab__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 24px;
  position: relative;
  z-index: 1;
}

.tab__label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: color 0.22s var(--ease);
}

.tab::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 46px;
  height: 28px;
  transform: translateX(-50%) scale(0.8);
  border-radius: var(--radius-pill);
  background: radial-gradient(60% 100% at 50% 50%, rgba(125, 200, 255, 0.22), rgba(125, 200, 255, 0.05) 70%, transparent);
  opacity: 0;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.tab.is-active {
  color: var(--brand);
}

.tab.is-active::before {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.tab.is-active .tab__label {
  font-weight: 700;
}

.tab__dot {
  position: absolute;
  bottom: 3px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--brand);
  opacity: 0;
  transform: scale(0.4);
  transition: all 0.25s var(--ease);
}

.tab.is-active .tab__dot {
  opacity: 1;
  transform: scale(1);
  box-shadow: 0 0 10px rgba(125, 200, 255, 0.8);
}

/* ---------------------------------------------------------------- Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 26px);
  z-index: 200;
  transform: translate(-50%, 12px);
  max-width: 76vw;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text);
  background: rgba(18, 26, 42, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.26s var(--ease), transform 0.26s var(--ease);
  text-align: center;
}

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

.toast--center {
  bottom: 50%;
  transform: translate(-50%, 50%) scale(0.96);
}

.toast--center.is-show {
  transform: translate(-50%, 50%) scale(1);
}

/* ---------------------------------------------------------------- Sheet */
.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(2, 5, 10, 0.62);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.28s var(--ease);
}

.sheet-mask.is-show {
  opacity: 1;
}

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 160;
  width: 100%;
  max-width: var(--app-max);
  max-height: 82vh;
  transform: translate(-50%, 100%);
  border-radius: 24px 24px 0 0;
  background: linear-gradient(180deg, #0d1524 0%, #080d17 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 0;
  box-shadow: 0 -30px 80px rgba(0, 0, 0, 0.6);
  transition: transform 0.34s var(--ease);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sheet.is-show {
  transform: translate(-50%, 0);
}

.sheet__grab {
  width: 38px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.16);
  margin: 10px auto 0;
  flex: 0 0 auto;
}

.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px 10px;
  flex: 0 0 auto;
}

.sheet__title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.sheet__close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-2);
}

.sheet__body {
  padding: 4px 20px calc(24px + var(--safe-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ---------------------------------------------------------------- Empty state */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 56px 24px;
  text-align: center;
  color: var(--text-3);
}

.empty__icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 4px;
  border-radius: 22px;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
}

.empty__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

.empty__desc {
  font-size: 11.5px;
  line-height: 1.7;
}

/* ---------------------------------------------------------------- Loader */
.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------------------------------------------------------------- Home helpers */
.home-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 0;
  color: var(--text-3);
  font-size: 10.5px;
}

.home-stats b {
  color: var(--text-2);
  font-weight: 600;
}

.home-stats__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-3);
}

.home-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 18px 0;
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--text-2);
  background: linear-gradient(90deg, rgba(125, 200, 255, 0.09), rgba(157, 139, 255, 0.05));
  border: 1px solid rgba(125, 200, 255, 0.14);
}

.home-tip svg {
  flex: 0 0 auto;
  color: var(--brand);
}

.home-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  margin-top: 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  transition: background 0.2s var(--ease);
}

.home-more:active {
  background: rgba(255, 255, 255, 0.09);
}

@media (max-width: 360px) {
  .hero__slide {
    height: clamp(360px, 56vh, 460px);
  }
  .hero__content {
    padding: 0 16px 18px;
  }
  .section {
    padding-left: 14px;
    padding-right: 14px;
  }
  .poster-grid {
    gap: 8px;
  }
  .rail,
  .chip-row {
    margin-left: -14px;
    margin-right: -14px;
    padding-left: 14px;
    padding-right: 14px;
    scroll-padding-left: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------- Brand titles */
.brand__titles {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1;
}

.brand__titles .brand__name {
  line-height: 1.15;
}

.brand__titles .brand__en {
  margin-top: 2px;
}

.icon {
  display: inline-block;
  vertical-align: middle;
  flex: 0 0 auto;
}

/* ---------------------------------------------------------------- Rank list */
.rank-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mrow__rank {
  flex: 0 0 26px;
  font-family: var(--font-en);
  font-size: 17px;
  font-style: italic;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-3);
  text-align: center;
}

.mrow__rank--top {
  font-size: 20px;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(233, 194, 124, 0.4);
}

/* ---------------------------------------------------------------- Resource sheet */
.res-sheet {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.res-sheet__drama {
  display: flex;
  gap: 13px;
  align-items: center;
}

.res-sheet__cover {
  width: 66px;
  height: 88px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
}

.res-sheet__info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.res-sheet__title {
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-serif);
}

.res-sheet__sub {
  font-family: var(--font-en);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--text-3);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.res-sheet__chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.res-sheet__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-2);
  letter-spacing: 0.04em;
}

.res-sheet__link {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.14);
}

.res-sheet__url {
  font-family: var(--font-en);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--brand);
  word-break: break-all;
}

.res-sheet__pwd {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-2);
}

.res-sheet__pwd b {
  font-family: var(--font-en);
  font-size: 17px;
  letter-spacing: 0.18em;
  color: var(--gold);
  padding: 2px 10px;
  border-radius: 8px;
  background: rgba(233, 194, 124, 0.1);
  border: 1px solid rgba(233, 194, 124, 0.25);
}

.res-sheet__actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.res-sheet__notice {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-size: 10px;
  line-height: 1.7;
  color: var(--text-3);
  margin: 0;
}

.res-sheet__notice svg {
  margin-top: 2px;
  flex: 0 0 auto;
}

/* ---------------------------------------------------------------- 404 */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 110px 30px 48px;
  text-align: center;
}

.error-page__code {
  font-family: var(--font-en);
  font-size: 76px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 12px 34px rgba(96, 160, 255, 0.35));
}

.error-page__title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.error-page__desc {
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-3);
  max-width: 300px;
}

.error-page__actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
