/* ==========================================================================
   果剧场 · 短剧 H5
   ========================================================================== */

:root {
  --bg: #0a0a0d;
  --bg-soft: #101014;
  --panel: #17171f;
  --panel-2: #20202a;
  --text: #f3f3f6;
  --muted: #9b9ba8;
  --dim: #6b6b78;
  --brand: #ff4d2d;
  --brand-2: #ff8a3d;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .16);
  --tab-h: 54px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Noto Sans SC", "Microsoft YaHei", "Source Han Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body { overflow: hidden; }

button { font-family: inherit; color: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }
img, svg { display: block; }
[hidden] { display: none !important; }

#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.view {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.mono { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Tab bar
   -------------------------------------------------------------------------- */
.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  align-items: stretch;
  background: rgba(10, 10, 13, .94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform .22s ease, opacity .22s ease;
}

.tabbar.hidden { transform: translateY(110%); opacity: 0; pointer-events: none; }

.tabbar--over {
  background: linear-gradient(to top, rgba(0, 0, 0, .82), rgba(0, 0, 0, .12));
  border-top-color: transparent;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, .55);
  font-size: 10px;
  letter-spacing: .02em;
  padding: 0;
  transition: color .18s ease;
}

.tab-item .tab-ico { display: grid; place-items: center; height: 24px; }
.tab-item.active { color: #fff; }
.tab-item.active .tab-ico { color: var(--brand); filter: drop-shadow(0 0 8px rgba(255, 77, 45, .45)); }
.tab-item:active { opacity: .7; }

/* --------------------------------------------------------------------------
   Generic page (discover / search / profile / detail)
   -------------------------------------------------------------------------- */
.page {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 18px);
  background: radial-gradient(120% 50% at 50% 0%, #191922 0%, var(--bg) 58%);
  scrollbar-width: none;
}
.page::-webkit-scrollbar { display: none; }
.page--plain { padding-bottom: calc(var(--safe-b) + 24px); }

.page-head {
  position: sticky;
  top: 0;
  z-index: 12;
  padding: calc(var(--safe-t) + 14px) 16px 10px;
  background: linear-gradient(to bottom, rgba(10, 10, 13, .96) 55%, rgba(10, 10, 13, 0));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.page-title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.page-sub { margin: 3px 0 0; font-size: 12px; color: var(--muted); }

.section { margin-top: 22px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 16px 10px;
}
.section-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.section-head .more {
  border: 0; background: none; color: var(--muted); font-size: 12px; padding: 2px 0;
}
.section-head .more:active { color: var(--text); }

/* Back button */
.back-btn {
  position: absolute;
  top: calc(var(--safe-t) + 10px);
  left: 12px;
  z-index: 30;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(0, 0, 0, .38);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.back-btn:active { transform: scale(.94); }

/* --------------------------------------------------------------------------
   Feed (vertical short-drama player)
   -------------------------------------------------------------------------- */
.feed {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: auto;
  background: #000;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
}
.feed::-webkit-scrollbar { display: none; }

.feed-item {
  position: relative;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  background: #000;
  isolation: isolate;
  contain: layout paint;
}

.feed-bg {
  position: absolute;
  inset: -2%;
  background:
    radial-gradient(90% 60% at 18% 8%, rgba(255, 255, 255, .16), transparent 60%),
    linear-gradient(155deg, var(--c1) 0%, var(--c2) 100%);
  filter: saturate(1.05);
  transition: filter .4s ease;
}
.feed-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .035) 0 2px, transparent 2px 9px);
  mix-blend-mode: overlay;
}
.feed-bg::after {
  content: attr(data-title);
  position: absolute;
  left: 24px;
  top: 34%;
  font-size: clamp(26px, 9vw, 40px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: .02em;
  color: rgba(255, 255, 255, .9);
  text-shadow: 0 6px 30px rgba(0, 0, 0, .35);
  max-width: 62%;
  opacity: .92;
}

.feed-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  opacity: 0;
  transition: opacity .35s ease;
}
.feed-item.is-ready .feed-video { opacity: 1; }
.feed-item.is-ready .feed-bg::after { opacity: 0; }

.feed-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, .5) 0%, transparent 18%, transparent 56%, rgba(0, 0, 0, .28) 74%, rgba(0, 0, 0, .86) 100%);
}

.gesture-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  touch-action: pan-y;
}

/* Top bar over the video */
.feed-top {
  position: absolute;
  top: calc(var(--safe-t) + 10px);
  left: 12px;
  right: 12px;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}
.feed-top > * { pointer-events: auto; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(0, 0, 0, .34);
  color: #fff;
  font-size: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.pill:active { transform: scale(.97); }
.pill--brand {
  border-color: transparent;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(255, 77, 45, .35);
}
.pill--muted { color: rgba(255, 255, 255, .8); }

/* Right action rail */
.feed-rail {
  position: absolute;
  right: 8px;
  bottom: calc(var(--tab-h) + var(--safe-b) + 108px);
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.rail-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 0;
  background: none;
  color: #fff;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .6);
  min-width: 52px;
  padding: 0;
  transition: transform .12s ease;
}
.rail-btn:active { transform: scale(.9); }
.rail-btn .rail-ico {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.rail-btn.on .rail-ico {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 22px rgba(255, 77, 45, .5);
}
.rail-btn.liked .rail-ico { animation: pop .32s cubic-bezier(.22, 1.6, .36, 1); }
.rail-btn .rail-label { opacity: .92; }

/* Bottom info block */
.feed-info {
  position: absolute;
  left: 14px;
  right: 80px;
  bottom: calc(var(--tab-h) + var(--safe-b) + 26px);
  z-index: 9;
  pointer-events: none;
}
.feed-info > * { pointer-events: auto; }

.feed-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.01em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .5);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.feed-title .ep-badge {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .2);
  padding: 1px 7px;
  border-radius: 6px;
  backdrop-filter: blur(6px);
}
.feed-desc {
  margin: 0 0 9px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .76);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .6);
}
.feed-desc.open { -webkit-line-clamp: unset; }

.feed-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.tag {
  font-size: 11px;
  color: rgba(255, 255, 255, .72);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(0, 0, 0, .18);
}
.tag--hot { color: #ffd2c6; border-color: rgba(255, 120, 80, .4); background: rgba(255, 77, 45, .16); }

.feed-actions { display: flex; gap: 8px; align-items: center; }
.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(0, 0, 0, .28);
  color: #fff;
  font-size: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.chip-btn:active { transform: scale(.97); }
.chip-btn--solid {
  border-color: transparent;
  background: rgba(255, 255, 255, .92);
  color: #111;
  font-weight: 700;
}

/* Progress */
.feed-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--tab-h) + var(--safe-b));
  height: 26px;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 0 14px;
  touch-action: none;
}
.progress-track {
  position: relative;
  flex: 1;
  height: 3px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .24);
}
.progress-buffer {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, .26);
}
.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}
.progress-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 11px; height: 11px;
  margin-left: -5.5px;
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%) scale(.55);
  transition: transform .18s ease;
  box-shadow: 0 0 8px rgba(0, 0, 0, .5);
}
.feed-progress.dragging .progress-thumb,
.feed-item.is-active .progress-thumb { transform: translateY(-50%) scale(1); }

.seek-bubble {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%) scale(.9);
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .72);
  color: #fff;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}
.seek-bubble.show { opacity: 1; transform: translateX(-50%) scale(1); }

/* Tap feedback */
.play-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 74px; height: 74px;
  margin: -37px 0 0 -37px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .42);
  display: grid;
  place-items: center;
  color: #fff;
  opacity: 0;
  transform: scale(.7);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
  z-index: 5;
  backdrop-filter: blur(4px);
}
.play-hint.show { opacity: 1; transform: scale(1); }

.speed-hint {
  position: absolute;
  top: calc(var(--safe-t) + 58px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 8;
}
.speed-hint.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Double-tap heart */
.heart-burst {
  position: absolute;
  width: 110px; height: 110px;
  margin: -55px 0 0 -55px;
  display: grid;
  place-items: center;
  color: var(--brand);
  pointer-events: none;
  z-index: 7;
  opacity: 0;
}
.heart-burst.run { animation: heartBurst .8s ease forwards; }

/* Danmaku canvas */
.danmaku-layer {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--safe-t) + 8px);
  height: 44%;
  width: 100%;
  pointer-events: none;
  z-index: 4;
}

/* Feed top-right actions */
.feed-top-right { display: flex; gap: 8px; align-items: center; }

/* Loading / error */
.feed-item .loading-ring {
  position: absolute;
  left: 50%; top: 50%;
  width: 30px; height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .25);
  border-top-color: #fff;
  animation: spin .8s linear infinite;
  display: none;
  z-index: 6;
}
.feed-item.is-loading .loading-ring { display: block; }
.feed-item.is-error .feed-video { opacity: 0; }
.feed-item.is-error .feed-bg::after { content: attr(data-title); opacity: 1; }
.feed-item.is-error .video-error { display: flex; }
.video-error {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 24px;
  z-index: 4;
  color: rgba(255, 255, 255, .8);
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   Cards & grids
   -------------------------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 10px;
  padding: 0 14px;
}
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  color: var(--text);
  min-width: 0;
}
.card:active { transform: scale(.98); }

.card-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(155deg, var(--c1, #333), var(--c2, #555));
  display: flex;
  align-items: flex-end;
  padding: 10px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .35);
}
.card-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .72) 0%, rgba(0, 0, 0, .08) 46%, transparent 70%);
}
.card-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 7px);
  mix-blend-mode: overlay;
}
.card-cover .cover-title {
  position: relative;
  z-index: 2;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .45);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-cover .cover-badge {
  position: absolute;
  top: 7px; left: 7px;
  z-index: 2;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  color: #fff;
}
.card-cover .cover-count {
  position: absolute;
  right: 7px; bottom: 7px;
  z-index: 2;
  font-size: 10px;
  color: rgba(255, 255, 255, .85);
  background: rgba(0, 0, 0, .42);
  border-radius: 5px;
  padding: 1px 5px;
  backdrop-filter: blur(4px);
}
.card-title {
  margin: 7px 1px 2px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  margin: 0 1px;
  font-size: 11px;
  color: var(--dim);
  display: flex;
  gap: 6px;
  align-items: center;
}
.card-meta .dot { width: 2px; height: 2px; border-radius: 50%; background: var(--dim); }

/* Horizontal scroll rows */
.hscroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 14px 4px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { flex: 0 0 auto; width: 108px; scroll-snap-align: start; }

/* Ranking list */
.rank-list { display: flex; flex-direction: column; gap: 2px; padding: 0 14px; }
.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 8px;
  border-radius: 12px;
  border: 0;
  background: none;
  color: var(--text);
  text-align: left;
  width: 100%;
}
.rank-row:active { background: rgba(255, 255, 255, .05); }
.rank-num {
  width: 24px;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--dim);
  font-style: italic;
  flex: 0 0 auto;
}
.rank-row:nth-child(1) .rank-num { color: #ff7043; }
.rank-row:nth-child(2) .rank-num { color: #ffb74d; }
.rank-row:nth-child(3) .rank-num { color: #ffd54f; }
.rank-cover {
  width: 46px;
  height: 62px;
  border-radius: 8px;
  flex: 0 0 auto;
  background: linear-gradient(155deg, var(--c1), var(--c2));
  position: relative;
  overflow: hidden;
}
.rank-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .5), transparent 60%);
}
.rank-info { flex: 1; min-width: 0; }
.rank-info h4 {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-info p {
  margin: 0;
  font-size: 11.5px;
  color: var(--dim);
  display: flex;
  gap: 8px;
}
.rank-score {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-2);
  flex: 0 0 auto;
}

/* Chips */
.chip-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 14px 12px;
  scrollbar-width: none;
}
.chip-scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .045);
  color: var(--muted);
  font-size: 13px;
}
.chip.on {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  font-weight: 650;
  box-shadow: 0 4px 16px rgba(255, 77, 45, .28);
}
.chip:active { transform: scale(.97); }

/* Segmented tabs */
.seg {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
}
.seg button {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  padding: 6px 13px;
  border-radius: 999px;
}
.seg button.on { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 650; }

/* --------------------------------------------------------------------------
   Detail page
   -------------------------------------------------------------------------- */
.detail-hero {
  position: relative;
  height: 46vh;
  min-height: 300px;
  background: linear-gradient(155deg, var(--c1), var(--c2));
  overflow: hidden;
}
.detail-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(90% 70% at 20% 0%, rgba(255, 255, 255, .2), transparent 60%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 9px);
}
.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg) 2%, rgba(10, 10, 13, .55) 30%, transparent 62%),
              linear-gradient(to bottom, rgba(0, 0, 0, .35), transparent 26%);
}
.hero-title {
  position: absolute;
  left: 20px;
  right: 20px;
  top: 30%;
  z-index: 2;
  font-size: clamp(24px, 7.4vw, 32px);
  font-weight: 900;
  line-height: 1.2;
  text-shadow: 0 4px 26px rgba(0, 0, 0, .45);
}

.detail-body {
  position: relative;
  z-index: 3;
  margin-top: -34px;
  padding: 0 18px 30px;
}
.detail-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 850;
  letter-spacing: -.02em;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
.detail-meta .score { color: var(--brand-2); font-weight: 800; font-size: 15px; }
.detail-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.detail-tags .tag { color: var(--muted); }

.synopsis {
  margin: 0 0 8px;
  font-size: 13.5px;
  line-height: 1.65;
  color: rgba(255, 255, 255, .72);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.synopsis.open { -webkit-line-clamp: unset; }
.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--brand-2);
  font-size: 12.5px;
}

.detail-cta {
  display: flex;
  gap: 10px;
  margin: 16px 0 4px;
}
.btn-primary {
  flex: 1;
  height: 46px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 15px;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 10px 26px rgba(255, 77, 45, .32);
}
.btn-primary:active { transform: scale(.98); }
.btn-ghost {
  height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-ghost.on { color: var(--brand-2); border-color: rgba(255, 138, 61, .45); background: rgba(255, 77, 45, .12); }

.detail-stats {
  display: flex;
  gap: 18px;
  padding: 14px 0 4px;
  font-size: 12px;
  color: var(--muted);
}
.detail-stats b { display: block; color: var(--text); font-size: 15px; font-weight: 700; }

.actor-row { display: flex; gap: 16px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.actor-row::-webkit-scrollbar { display: none; }
.actor { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 62px; flex: 0 0 auto; }
.actor .avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 700;
  background: linear-gradient(140deg, var(--c1), var(--c2));
  border: 1px solid rgba(255, 255, 255, .12);
}
.actor .name { font-size: 11.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62px; }
.actor .role { font-size: 10px; color: var(--dim); }

.episode-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.ep-btn {
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  display: grid;
  place-items: center;
  position: relative;
}
.ep-btn.current {
  border-color: transparent;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  font-weight: 700;
  color: #fff;
}
.ep-btn.watched::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 4px; height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--brand-2);
}
.ep-btn.current.watched::after { background: #fff; }

.comment-preview { display: flex; flex-direction: column; gap: 12px; }
.cmt {
  display: flex;
  gap: 10px;
}
.cmt-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(140deg, var(--c1, #444), var(--c2, #666));
}
.cmt-body { flex: 1; min-width: 0; }
.cmt-name { font-size: 12px; color: var(--muted); margin-bottom: 2px; display: flex; gap: 6px; align-items: center; }
.cmt-name .hot { font-size: 9.5px; color: #ff9a76; border: 1px solid rgba(255, 154, 118, .35); border-radius: 4px; padding: 0 4px; }
.cmt-text { font-size: 13.5px; line-height: 1.5; color: rgba(255, 255, 255, .88); word-break: break-word; }
.cmt-foot { display: flex; gap: 14px; margin-top: 5px; font-size: 11px; color: var(--dim); }
.cmt-like { border: 0; background: none; color: var(--dim); font-size: 11px; padding: 0; display: inline-flex; align-items: center; gap: 3px; }
.cmt-like.on { color: var(--brand); }

/* --------------------------------------------------------------------------
   Search
   -------------------------------------------------------------------------- */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--line);
}
.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font-size: 14px;
}
.search-box input::placeholder { color: var(--dim); }
.search-clear {
  border: 0; background: rgba(255, 255, 255, .14); color: var(--muted);
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px;
}
.search-label { padding: 20px 16px 10px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.search-label button { border: 0; background: none; color: var(--dim); font-size: 12px; }
.word-cloud { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px; }
.word {
  border: 0;
  background: rgba(255, 255, 255, .055);
  color: rgba(255, 255, 255, .82);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.word:active { background: rgba(255, 255, 255, .12); }
.word .n { color: var(--brand-2); font-weight: 700; margin-right: 4px; font-style: italic; }

.result-row {
  display: flex;
  gap: 12px;
  padding: 10px 16px;
  border: 0;
  background: none;
  color: var(--text);
  text-align: left;
  width: 100%;
}
.result-row:active { background: rgba(255, 255, 255, .04); }
.result-cover {
  width: 64px;
  height: 86px;
  border-radius: 10px;
  flex: 0 0 auto;
  background: linear-gradient(155deg, var(--c1), var(--c2));
  position: relative;
  overflow: hidden;
}
.result-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .55), transparent 58%);
}
.result-cover span {
  position: absolute;
  left: 6px; bottom: 6px; right: 6px;
  z-index: 2;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.result-info { flex: 1; min-width: 0; padding-top: 2px; }
.result-info h4 { margin: 0 0 5px; font-size: 15px; font-weight: 650; }
.result-info p { margin: 0 0 6px; font-size: 12px; color: var(--dim); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.result-info .row { display: flex; gap: 8px; font-size: 11px; color: var(--muted); align-items: center; }

.empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--dim);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty .big { font-size: 34px; opacity: .5; }

/* --------------------------------------------------------------------------
   Profile
   -------------------------------------------------------------------------- */
.profile-head {
  padding: calc(var(--safe-t) + 30px) 18px 20px;
  background:
    radial-gradient(120% 100% at 10% 0%, rgba(255, 77, 45, .22), transparent 60%),
    radial-gradient(100% 90% at 90% 10%, rgba(255, 138, 61, .14), transparent 55%);
}
.user-row { display: flex; align-items: center; gap: 14px; }
.user-avatar {
  width: 62px; height: 62px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(140deg, #ff6a3d, #ff2d55);
  box-shadow: 0 8px 24px rgba(255, 77, 45, .3);
}
.user-name { margin: 0 0 3px; font-size: 19px; font-weight: 750; }
.user-sub { margin: 0; font-size: 12px; color: var(--muted); }
.user-badge {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 6px;
  font-size: 11px;
  color: #ffc7b8;
  background: rgba(255, 77, 45, .14);
  border: 1px solid rgba(255, 77, 45, .3);
  padding: 2px 8px;
  border-radius: 999px;
}

.stat-row {
  display: flex;
  margin: 20px 18px 0;
  padding: 14px 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
}
.stat {
  flex: 1;
  text-align: center;
  border: 0;
  background: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat + .stat { border-left: 1px solid var(--line); }
.stat b { font-size: 19px; font-weight: 800; }
.stat span { font-size: 11.5px; color: var(--muted); }

.menu-list {
  margin: 18px 14px 0;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, .045);
  border: 1px solid var(--line);
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 14px;
  text-align: left;
}
.menu-item + .menu-item { border-top: 1px solid var(--line); }
.menu-item:active { background: rgba(255, 255, 255, .05); }
.menu-item .m-ico { color: var(--muted); display: grid; place-items: center; }
.menu-item .m-label { flex: 1; }
.menu-item .m-value { color: var(--dim); font-size: 12.5px; }
.menu-item .chev { color: var(--dim); }

.switch {
  position: relative;
  width: 44px; height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  border: 0;
  flex: 0 0 auto;
  transition: background .2s ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s cubic-bezier(.22, 1, .36, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}
.switch.on { background: linear-gradient(120deg, var(--brand), var(--brand-2)); }
.switch.on::after { transform: translateX(18px); }

/* History list */
.hist-row {
  display: flex;
  gap: 12px;
  padding: 10px 16px;
  align-items: center;
  border: 0;
  background: none;
  color: var(--text);
  width: 100%;
  text-align: left;
}
.hist-row:active { background: rgba(255, 255, 255, .04); }
.hist-cover {
  width: 62px; height: 84px;
  border-radius: 10px;
  flex: 0 0 auto;
  background: linear-gradient(155deg, var(--c1), var(--c2));
}
.hist-info { flex: 1; min-width: 0; }
.hist-info h4 { margin: 0 0 4px; font-size: 14px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-info p { margin: 0 0 8px; font-size: 11.5px; color: var(--dim); }
.mini-progress { height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.mini-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.hist-del {
  border: 0; background: none; color: var(--dim); padding: 10px; font-size: 12px;
}

/* --------------------------------------------------------------------------
   Bottom sheet
   -------------------------------------------------------------------------- */
.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, .55);
  display: flex;
  align-items: flex-end;
  animation: fadeIn .18s ease;
  backdrop-filter: blur(2px);
}
.sheet {
  width: 100%;
  max-height: 80vh;
  max-height: 80dvh;
  background: #15151c;
  border-radius: 20px 20px 0 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
  display: flex;
  flex-direction: column;
  animation: sheetUp .26s cubic-bezier(.22, 1, .36, 1);
  padding-bottom: var(--safe-b);
  overflow: hidden;
}
.sheet-grip {
  width: 36px; height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .18);
  margin: 9px auto 0;
  flex: 0 0 auto;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px 8px;
  flex: 0 0 auto;
}
.sheet-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.sheet-head .sub { color: var(--dim); font-size: 12px; margin-left: 6px; font-weight: 400; }
.sheet-close {
  border: 0; background: none; color: var(--muted); width: 30px; height: 30px;
  display: grid; place-items: center; border-radius: 50%;
}
.sheet-close:active { background: rgba(255, 255, 255, .08); }
.sheet-body {
  padding: 4px 18px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}

/* Episode picker */
.ep-pick-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; padding-bottom: 10px; }
.ep-pick {
  height: 46px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  position: relative;
}
.ep-pick small { font-size: 9px; color: var(--dim); }
.ep-pick.current {
  border-color: transparent;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  font-weight: 700;
  color: #fff;
}
.ep-pick.current small { color: rgba(255, 255, 255, .8); }
.ep-pick .seen { position: absolute; top: 5px; right: 6px; width: 4px; height: 4px; border-radius: 50%; background: var(--brand-2); }
.ep-pick.current .seen { background: #fff; }

/* Settings rows in sheet */
.opt-list { display: flex; flex-direction: column; }
.opt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.opt-row:last-child { border-bottom: 0; }
.opt-row .opt-sub { font-size: 11.5px; color: var(--dim); margin-top: 2px; }
.opt-row .check { color: var(--brand-2); }
.opt-row button.opt-hit {
  border: 0; background: none; color: var(--text); font-size: 13px; display: flex; align-items: center; gap: 6px;
}
.speed-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding-top: 4px; }
.speed-btn {
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font-size: 13px;
}
.speed-btn.on { border-color: transparent; background: linear-gradient(120deg, var(--brand), var(--brand-2)); font-weight: 700; }

/* Comments sheet */
.cmt-list { display: flex; flex-direction: column; gap: 16px; padding-bottom: 10px; }
.cmt-compose {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: #15151c;
}
.cmt-compose input {
  flex: 1;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  padding: 0 14px;
  font-size: 13.5px;
  outline: 0;
}
.cmt-compose input:focus { border-color: rgba(255, 120, 80, .5); }
.cmt-send {
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}
.cmt-send:disabled { opacity: .4; }

/* Toast */
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + var(--safe-b) + 40px);
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: 86vw;
}
.toast {
  background: rgba(28, 28, 36, .96);
  color: #fff;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  animation: toastIn .22s ease;
  text-align: center;
}
.toast.out { animation: toastOut .22s ease forwards; }

/* Loading page */
.page-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--dim);
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   Small additions
   -------------------------------------------------------------------------- */
.sheet-footer {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  background: #15151c;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, .07);
  color: var(--text);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.icon-btn:active { background: rgba(255, 255, 255, .14); }

.opt-sub { font-size: 11.5px; color: var(--dim); margin-top: 2px; font-weight: 400; }

.menu-item .m-label { display: flex; flex-direction: column; gap: 0; }
.menu-item .chev { display: grid; place-items: center; }
.menu-item .m-ico { flex: 0 0 auto; }

.card, .result-row, .rank-row, .stat, .hist-row { font: inherit; }
.feed-title { cursor: pointer; }

.search-box input::-webkit-search-cancel-button,
.search-box input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

.ep-pick .seen { pointer-events: none; }

.page-head .link-btn { padding: 4px 2px; }

/* 详情页在没有 tabbar 时留出底部空间 */
.page--plain { padding-bottom: calc(var(--safe-b) + 30px); }

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px); } }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes heartBurst {
  0% { opacity: 0; transform: scale(.4) rotate(-12deg); }
  25% { opacity: 1; transform: scale(1.15) rotate(4deg); }
  60% { opacity: 1; transform: scale(1) rotate(0); }
  100% { opacity: 0; transform: scale(1.35) translateY(-26px); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Desktop preview: center a phone-sized canvas */
@media (min-width: 720px) and (min-height: 640px) {
  body { background: #050507; display: grid; place-items: center; }
  #app {
    position: relative;
    inset: auto;
    width: 414px;
    height: 896px;
    max-height: 96vh;
    border-radius: 30px;
    box-shadow: 0 40px 90px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .08);
    overflow: hidden;
  }
  .toast-wrap { position: absolute; bottom: 120px; }
  .sheet-mask { position: absolute; }
}
