:root {
  --bg: #0b0b0e;
  --bg-2: #131318;
  --card: #17171d;
  --card-2: #1f1f27;
  --line: rgba(255, 255, 255, .08);
  --text: #f6f6f8;
  --text-2: #a7a7b3;
  --text-3: #6f6f7b;
  --red: #ff2d55;
  --red-2: #ff5f3d;
  --brand: linear-gradient(135deg, #ff2d55 0%, #ff6a3d 100%);
  --gold: #ffcd4d;
  --radius: 14px;
  --nav-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
input { font: inherit; }
.hide { display: none !important; }
.ellipsis { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 顶部 ---------- */
.app { min-height: 100%; padding-bottom: calc(var(--nav-h) + var(--safe-b)); }
.app.no-nav { padding-bottom: 0; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-t)) 14px 10px;
  background: linear-gradient(180deg, rgba(11, 11, 14, .96) 60%, rgba(11, 11, 14, .6));
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 8px; flex: none; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--brand);
  display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff;
  box-shadow: 0 6px 16px rgba(255, 45, 85, .35);
}
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: .5px; }
.brand-name em { font-style: normal; background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }

.searchbar {
  flex: 1; display: flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px; border-radius: 17px;
  background: rgba(255, 255, 255, .07); color: var(--text-2); font-size: 13px;
  min-width: 0;
}
.searchbar:active { background: rgba(255, 255, 255, .12); }
.searchbar svg { flex: none; }

.icon-btn { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--text); }
.icon-btn:active { background: rgba(255, 255, 255, .1); }

/* ---------- 首页 ---------- */
.page { padding-bottom: 16px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 14px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 6px 13px; border-radius: 999px; font-size: 13px;
  background: rgba(255, 255, 255, .07); color: var(--text-2);
}
.chip.on { background: var(--brand); color: #fff; font-weight: 600; }

.banner { padding: 0 14px; }
.banner-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px;
  border-radius: 16px; scrollbar-width: none;
}
.banner-track::-webkit-scrollbar { display: none; }
.banner-item {
  position: relative; flex: 0 0 100%; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden;
  scroll-snap-align: center; background: var(--card-2);
}
.banner-item img { height: 100%; width: auto; max-width: 62%; object-fit: contain; object-position: center; flex: none; }
.banner-item { display: flex; align-items: center; background: #101016; }
.banner-item::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, #14141c 0%, rgba(20, 20, 28, .92) 46%, rgba(20, 20, 28, .55) 100%);
}
.banner-item img { position: relative; z-index: 1; }
.banner-item .mask {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, .75) 0%, rgba(0, 0, 0, .15) 55%, transparent 100%), linear-gradient(0deg, rgba(0, 0, 0, .6), transparent 50%);
}
.banner-info { position: absolute; z-index: 2; right: 14px; left: auto; width: 52%; bottom: 30%; }
.banner-info h3 { margin: 0 0 6px; font-size: 18px; line-height: 1.25; text-shadow: 0 2px 10px rgba(0, 0, 0, .6); }
.banner-info p { margin: 0; font-size: 11.5px; color: rgba(255, 255, 255, .78); }
.banner-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.banner-tags span { font-size: 11px; padding: 2px 7px; border-radius: 4px; background: rgba(255, 255, 255, .18); }
.banner-dots { display: flex; justify-content: center; gap: 5px; padding: 9px 0 2px; }
.banner-dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, .22); transition: .25s; }
.banner-dots i.on { width: 14px; border-radius: 3px; background: var(--red); }

.section { margin-top: 18px; }
.section-head { display: flex; align-items: center; justify-content: space-between; padding: 0 14px 10px; }
.section-title { display: flex; align-items: center; gap: 7px; font-size: 16.5px; font-weight: 800; }
.section-title::before { content: ''; width: 4px; height: 16px; border-radius: 2px; background: var(--brand); }
.section-more { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 2px; }

.row-scroll { display: flex; gap: 10px; overflow-x: auto; padding: 0 14px 4px; scroll-snap-type: x proximity; scrollbar-width: none; }
.row-scroll::-webkit-scrollbar { display: none; }
.row-scroll .card { flex: 0 0 29vw; max-width: 132px; min-width: 104px; scroll-snap-align: start; }

.card { display: block; }
.card .poster {
  position: relative; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: var(--card-2);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.card .poster img { width: 100%; height: 100%; object-fit: cover; }
.card .poster .badge {
  position: absolute; right: 0; bottom: 0; left: 0; padding: 14px 7px 5px;
  background: linear-gradient(0deg, rgba(0, 0, 0, .85), transparent);
  font-size: 10.5px; color: rgba(255, 255, 255, .9); display: flex; justify-content: space-between; gap: 4px;
}
.card .poster .rank {
  position: absolute; left: 0; top: 0; min-width: 22px; height: 20px; padding: 0 6px;
  border-radius: 0 0 10px 0; background: var(--brand); font-size: 11.5px; font-weight: 800;
  display: grid; place-items: center;
}
.card .poster .rank.top { background: linear-gradient(135deg, #ffb400, #ff5f3d); }
.card .poster .heat {
  position: absolute; right: 6px; top: 6px; font-size: 10px; padding: 2px 6px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); backdrop-filter: blur(4px); color: #ffd9a0;
}
.card .name { margin-top: 7px; font-size: 13px; line-height: 1.35; color: var(--text); }
.card .sub { margin-top: 2px; font-size: 11px; color: var(--text-3); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 10px; padding: 4px 14px 8px; }
.grid .card .name { font-size: 12.5px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(4, 1fr); } .row-scroll .card { flex-basis: 128px; } }
@media (min-width: 820px) { .grid { grid-template-columns: repeat(6, 1fr); } .row-scroll .card { flex-basis: 150px; max-width: 150px; } }

.rank-row { display: flex; gap: 10px; overflow-x: auto; padding: 0 14px 4px; scrollbar-width: none; }
.rank-row::-webkit-scrollbar { display: none; }
.rank-row .rank-card {
  flex: 0 0 74%; max-width: 330px; display: flex; gap: 10px; padding: 8px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line);
}
.rank-row .rank-card .poster { width: 62px; flex: none; aspect-ratio: 3/4; border-radius: 8px; overflow: hidden; }
.rank-row .rank-card .poster img { width: 100%; height: 100%; object-fit: cover; }
.rank-row .rank-card .meta { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.rank-row .rank-card .meta b { font-size: 13.5px; }
.rank-row .rank-card .meta span { font-size: 11px; color: var(--text-3); }
.rank-row .rank-card .no { font-size: 20px; font-weight: 900; font-style: italic; color: var(--red); width: 22px; text-align: center; align-self: center; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(15, 15, 20, .96); backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-3); font-size: 10.5px;
}
.tabbar a.on { color: var(--text); }
.tabbar a.on svg { color: var(--red); }
.tabbar a.on .dot { opacity: 1; }
.tabbar .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--red); opacity: 0; }

/* ---------- 沉浸式推荐（上下滑） ---------- */
.feed { position: fixed; inset: 0; overflow-y: scroll; scroll-snap-type: y mandatory; background: #000; scrollbar-width: none; }
.feed::-webkit-scrollbar { display: none; }
.feed-item { position: relative; height: 100vh; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; background: #000; }
.feed-item .cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(18px) brightness(.45); transform: scale(1.15); }
.feed-item video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: transparent; }
.feed-item .shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0, 0, 0, .88) 0%, rgba(0, 0, 0, .25) 28%, transparent 55%); pointer-events: none; }
.feed-item .rail {
  position: absolute; right: 10px; bottom: 132px; display: flex; flex-direction: column; gap: 18px; align-items: center;
}
.feed-item .rail button { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10.5px; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.feed-item .rail svg { filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .6)); }
.feed-item .rail .on { color: var(--red); }
.feed-item .meta { position: absolute; left: 14px; right: 74px; bottom: calc(30px + var(--safe-b)); }
.feed-item .meta h2 { margin: 0 0 6px; font-size: 18px; line-height: 1.3; text-shadow: 0 2px 10px rgba(0, 0, 0, .7); }
.feed-item .meta .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.feed-item .meta .tags span { font-size: 11px; padding: 2px 7px; border-radius: 4px; background: rgba(255, 255, 255, .16); }
.feed-item .meta p { margin: 0; font-size: 12px; color: rgba(255, 255, 255, .72); }
.feed-item .ep-chip {
  position: absolute; left: 56px; right: 12px; top: calc(12px + var(--safe-t)); display: flex; align-items: center; gap: 8px;
}
.feed-item .ep-chip b:first-child { max-width: 58%; }
.feed-item .ep-chip b { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, .45); backdrop-filter: blur(8px); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.feed-tip {
  position: absolute; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%);
  font-size: 11.5px; color: rgba(255, 255, 255, .6); display: flex; flex-direction: column; align-items: center; gap: 2px;
  animation: bob 1.8s ease-in-out infinite; pointer-events: none;
}
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); opacity: .55; } 50% { transform: translate(-50%, -6px); opacity: 1; } }
.feed-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: 12.5px; gap: 8px; }
.spinner { width: 22px; height: 22px; border: 2px solid rgba(255, 255, 255, .18); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.feed-pause { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: .2s; }
.feed-pause svg { width: 54px; height: 54px; }
.feed-item.paused .feed-pause { opacity: 1; }
.feed-item .codec-tip { position: absolute; left: 14px; right: 74px; top: 42%; font-size: 12px; color: rgba(255,255,255,.72); text-align: center; line-height: 1.7; display: none; }
.feed-item.no-video .codec-tip { display: block; }
.feed-item.no-video .cover { filter: blur(10px) brightness(.5); }

/* ---------- 分类 / 榜单 ---------- */
.seg { display: flex; gap: 4px; padding: 0 14px 12px; }
.seg button { flex: 1; height: 34px; border-radius: 9px; font-size: 13px; color: var(--text-2); background: rgba(255, 255, 255, .06); }
.seg button.on { background: rgba(255, 45, 85, .16); color: #ff8095; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(255, 45, 85, .4); }

/* ---------- 详情 ---------- */
.hero { position: relative; }
.hero-bg { position: absolute; left: 0; top: 0; right: 0; height: 260px; overflow: hidden; pointer-events: none; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; filter: blur(20px) brightness(.5); transform: scale(1.2); }
.hero-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 11, 14, .5), var(--bg) 92%); }
.hero-main { position: relative; z-index: 2; display: flex; gap: 14px; padding: calc(14px + var(--safe-t)) 14px 0; }
.hero-cover { width: 112px; flex: none; aspect-ratio: 3/4; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 28px rgba(0, 0, 0, .5); }
.hero-cover img { width: 100%; height: 100%; object-fit: cover; }
.hero-info { min-width: 0; padding-top: 2px; }
.hero > div:not(.hero-bg):not(.hero-main) { position: relative; z-index: 2; }
.hero-info h1 { margin: 0 0 8px; font-size: 19px; line-height: 1.3; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11.5px; color: var(--text-2); margin-bottom: 8px; }
.hero-meta span { padding: 2px 7px; border-radius: 4px; background: rgba(255, 255, 255, .08); }
.hero-meta .score { color: var(--gold); font-weight: 700; background: rgba(255, 205, 77, .14); }
.hero-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.hero-tags i { font-style: normal; font-size: 11px; color: #ff96a8; padding: 2px 7px; border-radius: 4px; background: rgba(255, 45, 85, .12); }
.hero-actions { position: relative; z-index: 2; display: flex; gap: 10px; padding: 16px 14px 6px; }
.btn-play {
  flex: 1; height: 42px; border-radius: 21px; background: var(--brand); color: #fff; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center; gap: 7px; box-shadow: 0 8px 22px rgba(255, 45, 85, .32);
}
.btn-ghost {
  height: 42px; padding: 0 18px; border-radius: 21px; background: rgba(255, 255, 255, .08); color: var(--text);
  display: flex; align-items: center; gap: 6px; font-size: 13.5px;
}
.synopsis { position: relative; z-index: 2; padding: 12px 14px 0; font-size: 13px; color: var(--text-2); line-height: 1.65; }
.cast { display: flex; gap: 14px; overflow-x: auto; padding: 4px 14px 0; scrollbar-width: none; }
.cast::-webkit-scrollbar { display: none; }
.cast .person { flex: none; width: 58px; text-align: center; }
.cast .person img, .cast .person .ph { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; margin: 0 auto 5px; background: var(--card-2); }
.cast .person b { display: block; font-size: 11.5px; font-weight: 500; }
.cast .person span { font-size: 10.5px; color: var(--text-3); }
.ep-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; padding: 0 14px; }
.ep-grid button {
  height: 38px; border-radius: 8px; background: var(--card-2); font-size: 13px; color: var(--text-2);
  display: grid; place-items: center; position: relative;
}
.ep-grid button.on { background: var(--brand); color: #fff; font-weight: 700; }
.ep-grid button .lock { position: absolute; right: 3px; top: 2px; font-size: 8px; color: rgba(255, 255, 255, .5); }
.review { display: flex; gap: 9px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.review img { width: 30px; height: 30px; border-radius: 50%; flex: none; background: var(--card-2); }
.review .rv-name { font-size: 12px; color: var(--text-2); margin-bottom: 2px; }
.review .rv-text { font-size: 12.5px; color: rgba(255, 255, 255, .8); }

/* ---------- 播放器 ---------- */
  position: fixed; inset: 0; z-index: 100; background: #000; overflow: hidden;
  display: flex; flex-direction: column; touch-action: pan-y;
}
  position: absolute; top: 0; left: 0; right: 0; z-index: 6; padding: calc(10px + var(--safe-t)) 10px 26px;
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .72), transparent);
  transition: opacity .22s;
}
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; padding: 30px 12px calc(10px + var(--safe-b));
  background: linear-gradient(0deg, rgba(0, 0, 0, .82), transparent);
  transition: opacity .22s;
}
.p-side {
  position: absolute; right: 12px; bottom: 150px; z-index: 6; display: flex; flex-direction: column; gap: 16px; align-items: center;
  transition: opacity .22s;
}
.p-side button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; color: #fff; text-shadow: 0 1px 4px #000; }
.p-side .active { color: var(--red); }

.progress-wrap { display: flex; align-items: center; gap: 10px; }
.time { font-size: 11.5px; color: rgba(255, 255, 255, .8); flex: none; font-variant-numeric: tabular-nums; }
.progress {
  position: relative; flex: 1; height: 22px; display: flex; align-items: center; cursor: pointer;
}
.progress .track { position: relative; width: 100%; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .25); }
.progress .buffer { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255, 255, 255, .35); border-radius: 2px; width: 0; }
.progress .played { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand); border-radius: 2px; width: 0; }
.progress .knob {
  position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; background: #fff;
  transform: translate(-50%, -50%); box-shadow: 0 0 6px rgba(0, 0, 0, .6); left: 0;
}
.controls-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; padding: 0 2px; }
.controls-row .spacer { flex: 1; }
.ctrl { display: flex; align-items: center; gap: 5px; font-size: 12px; color: rgba(255, 255, 255, .88); padding: 4px 6px; border-radius: 6px; }
.ctrl:active { background: rgba(255, 255, 255, .12); }
.ctrl.solid { background: rgba(255, 255, 255, .14); padding: 5px 11px; border-radius: 999px; }

.center-play {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 5;
}
.center-play svg { width: 62px; height: 62px; filter: drop-shadow(0 2px 12px rgba(0, 0, 0, .6)); }
.center-play.hide { display: none; }

.danmaku-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 4; }
.danmaku-layer .dm {
  position: absolute; white-space: nowrap; font-size: 15px; font-weight: 600; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9), 0 0 2px #000;
  will-change: transform;
}
.danmaku-layer .dm.self { color: #ffd54f; }

.sheet-mask { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, .55); opacity: 0; transition: .2s; pointer-events: none; visibility: hidden; }
.sheet-mask.on { opacity: 1; pointer-events: auto; visibility: visible; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 201; max-height: 72vh; overflow-y: auto;
  background: #17171d; border-radius: 16px 16px 0 0; padding: 14px 0 calc(14px + var(--safe-b));
  transform: translateY(100%); transition: transform .24s ease; visibility: hidden;
}
.sheet.on { transform: translateY(0); visibility: visible; }
.sheet h4 { margin: 0 16px 12px; font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
.sheet h4 span { font-size: 12px; color: var(--text-3); font-weight: 400; }
.sheet .opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; padding: 0 16px; }
.sheet .opts button { height: 40px; border-radius: 9px; background: var(--card-2); font-size: 13px; color: var(--text-2); }
.sheet .opts button.on { background: rgba(255, 45, 85, .16); color: #ff8095; box-shadow: inset 0 0 0 1px rgba(255, 45, 85, .5); }

/* ---------- 我的 ---------- */
.mine-head { display: flex; align-items: center; gap: 14px; padding: 18px 16px 16px; }
.avatar { width: 58px; height: 58px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; font-size: 22px; font-weight: 800; }
.mine-head .who b { font-size: 17px; }
.mine-head .who p { margin: 3px 0 0; font-size: 12px; color: var(--text-3); }
.mine-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 14px; }
.mine-cell { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 13px 8px; text-align: center; }
.mine-cell b { display: block; font-size: 17px; }
.mine-cell span { font-size: 11.5px; color: var(--text-3); }
.list-item { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); align-items: center; }
.list-item img { width: 56px; height: 74px; border-radius: 8px; object-fit: cover; background: var(--card-2); }
.list-item .li-meta { min-width: 0; flex: 1; }
.list-item .li-meta b { display: block; font-size: 13.5px; margin-bottom: 3px; }
.list-item .li-meta span { font-size: 11.5px; color: var(--text-3); }
.empty { padding: 60px 20px; text-align: center; color: var(--text-3); font-size: 13px; }
.empty svg { margin-bottom: 12px; opacity: .5; }

/* ---------- 搜索 ---------- */
.search-layer { position: fixed; inset: 0; z-index: 120; background: var(--bg); display: flex; flex-direction: column; }
.search-head { display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 14px 10px; }
.search-input { flex: 1; height: 36px; border-radius: 18px; background: rgba(255, 255, 255, .08); border: 0; padding: 0 14px; color: var(--text); outline: none; font-size: 14px; }
.search-body { flex: 1; overflow-y: auto; }
.warm-list { display: flex; flex-wrap: wrap; gap: 9px; padding: 6px 14px 20px; }
.warm-list button { padding: 7px 13px; border-radius: 999px; background: rgba(255, 255, 255, .07); font-size: 12.5px; color: var(--text-2); }
.warm-list button:first-child { color: #ff8095; background: rgba(255, 45, 85, .12); }

/* ---------- 页脚信息 ---------- */
.site-footer { margin: 26px 14px 8px; padding: 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.site-footer .ft-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.site-footer .ft-brand .logo-mark { width: 26px; height: 26px; font-size: 13px; border-radius: 8px; }
.site-footer h5 { margin: 0; font-size: 14px; }
.site-footer p { margin: 0 0 7px; font-size: 11.5px; line-height: 1.7; color: var(--text-3); }
.site-footer .ft-line { display: flex; gap: 8px; align-items: flex-start; font-size: 11.5px; color: var(--text-2); margin-bottom: 6px; line-height: 1.6; }
.site-footer .ft-line > span:first-child { flex: none; white-space: nowrap; color: var(--text-3); }
.site-footer .ft-line b { color: var(--text); font-weight: 600; }
.site-footer .ft-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.site-footer .ft-tags span { font-size: 10.5px; color: var(--text-3); padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, .05); }
.site-footer .ft-bottom { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 10.5px; color: #55555f; line-height: 1.7; }

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 10px); z-index: 300;
  background: rgba(0, 0, 0, .82); color: #fff; font-size: 12.5px; padding: 8px 16px; border-radius: 999px;
  opacity: 0; transition: .22s; pointer-events: none; backdrop-filter: blur(6px);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.skeleton { background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.11), rgba(255,255,255,.05)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }

@media (min-width: 900px) {
  .app { max-width: 1180px; margin: 0 auto; }
  .tabbar { max-width: 1180px; margin: 0 auto; left: 50%; transform: translateX(-50%); border-radius: 0; }
  .feed-item video { object-fit: contain; }
  .feed-item .meta { right: auto; width: 60%; }
}


/* ---------- 启动页 / 公告条 ---------- */
.splash {
  position: fixed; inset: 0; z-index: 500; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(120% 90% at 50% 0%, #2a0f18 0%, #0b0b0e 60%);
  padding: 32px 24px calc(32px + var(--safe-b)); text-align: center;
  animation: fade .3s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.splash .sp-logo {
  width: 86px; height: 86px; border-radius: 26px; background: var(--brand); display: grid; place-items: center;
  font-size: 40px; font-weight: 900; color: #fff; box-shadow: 0 18px 50px rgba(255, 45, 85, .45); margin-bottom: 22px;
}
.splash h1 { margin: 0 0 8px; font-size: 30px; letter-spacing: 2px; }
.splash h1 em { font-style: normal; background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.splash .sp-sub { font-size: 12.5px; color: var(--text-3); letter-spacing: 1px; margin-bottom: 26px; }
.splash .sp-card {
  width: 100%; max-width: 420px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px 18px; text-align: left; margin-bottom: 26px;
}
.splash .sp-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; margin-bottom: 11px; color: var(--text-2); }
.splash .sp-row:last-child { margin-bottom: 0; }
.splash .sp-row b { color: var(--text); font-weight: 700; }
.splash .sp-row .k { color: var(--text-3); font-size: 12px; width: 66px; flex: none; }
.splash .sp-row .v { font-size: 14px; }
.splash .sp-tags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 26px; }
.splash .sp-tags span { font-size: 11.5px; color: #ffa1b1; background: rgba(255, 45, 85, .12); padding: 4px 10px; border-radius: 999px; }
.splash .sp-enter {
  width: 100%; max-width: 420px; height: 48px; border-radius: 24px; background: var(--brand); color: #fff;
  font-size: 16px; font-weight: 800; letter-spacing: 1px; box-shadow: 0 12px 30px rgba(255, 45, 85, .4);
}
.splash .sp-foot { margin-top: 18px; font-size: 11px; color: #4b4b57; line-height: 1.7; max-width: 420px; }

.notice-bar {
  display: flex; align-items: center; gap: 8px; margin: 0 14px 10px; padding: 8px 12px;
  border-radius: 10px; background: linear-gradient(90deg, rgba(255, 45, 85, .16), rgba(255, 106, 61, .08));
  border: 1px solid rgba(255, 45, 85, .22); font-size: 11.5px; color: #ffb0bd; overflow: hidden;
}
.notice-bar b { color: #fff; font-weight: 700; }
.notice-bar .nb-scroll { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


.ft-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.ft-btn {
  flex: 1 1 auto; min-width: 44%; text-align: center; font-size: 12px; padding: 9px 10px; border-radius: 9px;
  background: rgba(255, 255, 255, .07); color: var(--text-2); border: 1px solid var(--line);
}
.ft-btn.primary { background: var(--brand); color: #fff; border: 0; font-weight: 700; flex-basis: 100%; }
.about-text { padding: 0 14px; }
.about-text p { margin: 0 0 10px; font-size: 12.5px; line-height: 1.8; color: var(--text-2); }
.about-text b { color: var(--text); }
.mine-links { padding: 12px 14px 0; display: flex; flex-direction: column; gap: 8px; }
.mine-link {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 13px 14px; border-radius: 11px; background: var(--card); border: 1px solid var(--line);
  font-size: 13.5px; color: var(--text);
}
.mine-link b { font-size: 12px; color: var(--text-3); font-weight: 400; }

/* ================= 页脚 v2（简洁） ================= */
.site-footer {
  margin: 22px 12px 10px; padding: 14px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line);
}
.site-footer .ft-head { display: flex; align-items: center; gap: 9px; }
.site-footer .ft-logo {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #ff2d55, #ff6a3d); color: #fff; font-size: 15px; font-weight: 800;
}
.site-footer .ft-nm b { display: block; font-size: 14.5px; color: var(--text); }
.site-footer .ft-nm small { font-size: 11px; color: var(--text-3); }
.site-footer .ft-dl {
  display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 11px 13px; border-radius: 11px;
  background: linear-gradient(90deg, rgba(255,45,85,.16), rgba(255,106,61,.08));
  border: 1px solid rgba(255,45,85,.26);
}
.site-footer .ft-dl-ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 13px; flex: none; }
.site-footer .ft-dl-tx { flex: 1; min-width: 0; }
.site-footer .ft-dl-tx b { display: block; font-size: 13.5px; color: #fff; }
.site-footer .ft-dl-tx small { font-size: 11px; color: #ffb0bd; }
.site-footer .ft-dl-go { color: #ff8095; font-size: 17px; }
.site-footer .ft-rows { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.site-footer .ft-row { display: flex; gap: 10px; font-size: 12px; color: var(--text-2); }
.site-footer .ft-row span { flex: none; width: 56px; color: var(--text-3); }
.site-footer .ft-row b { color: var(--text); font-weight: 600; }
.site-footer .ft-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.site-footer .ft-nav a { font-size: 12px; color: var(--text-2); }
.site-footer .ft-nav i { width: 1px; height: 10px; background: var(--line); }
.site-footer .ft-legal { margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); }
.site-footer .ft-legal p { margin: 0 0 4px; font-size: 10.5px; line-height: 1.7; color: #5a5a66; }

  position: absolute; left: 12px; right: 12px; bottom: calc(150px + var(--safe-b)); z-index: 9; max-width: 420px;
  padding: 13px 14px; border-radius: 13px; background: rgba(20,20,24,.94); border: 1px solid rgba(255,255,255,.14);
  color: #f2f2f6; font-size: 12.5px; line-height: 1.65; box-shadow: 0 8px 30px rgba(0,0,0,.55);
}

/* ================================================================
   推荐流 v2
   ================================================================ */
.feed-splash { height: 100vh; height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #8b8b97; font-size: 12.5px; }
.feed-top {
  position: fixed; left: 0; right: 0; top: 0; z-index: 60; display: flex; align-items: center; gap: 10px;
  padding: calc(8px + var(--safe-t)) 12px 26px;
  background: linear-gradient(180deg, rgba(0,0,0,.66), transparent); pointer-events: none;
}
.feed-top > * { pointer-events: auto; }
.feed-ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.34); }
.feed-ico svg { width: 20px; height: 20px; }
.feed-tabs { flex: 1; min-width: 0; text-align: center; color: #fff; }
.feed-tabs b { display: block; font-size: 15px; }
.feed-tabs span { font-size: 11px; color: rgba(255,255,255,.62); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-item .fi-bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(24px) brightness(.36); transform: scale(1.18); }
.feed-item .fi-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: transparent; z-index: 2; }
.feed-item .fi-loading { position: absolute; inset: 0; display: none; place-items: center; z-index: 4; }
.feed-item .fi-loading.on { display: grid; }
.feed-item .fi-pause { position: absolute; inset: 0; display: none; place-items: center; z-index: 4; }
.feed-item .fi-pause svg { width: 56px; height: 56px; opacity: .9; }
.feed-item.paused .fi-pause { display: grid; }
.feed-item .fi-codec { display: none; position: absolute; left: 14px; right: 76px; top: 50%; transform: translateY(-50%); z-index: 6;
  padding: 12px 14px; border-radius: 12px; background: rgba(0,0,0,.76); border: 1px solid rgba(255,255,255,.14);
  color: #fff; font-size: 12px; line-height: 1.7; }
.feed-item .fi-codec b { color: #ff8095; }
.feed-item.no-video .fi-codec { display: block; }
.feed-item .fi-rail { position: absolute; right: 8px; bottom: 152px; z-index: 6; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.feed-item .fi-rail button { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #fff; font-size: 10.5px;
  text-shadow: 0 1px 5px rgba(0,0,0,.7); width: 52px; }
.feed-item .fi-rail button svg { width: 27px; height: 27px; filter: drop-shadow(0 1px 4px rgba(0,0,0,.6)); }
.feed-item .fi-rail button.on { color: #ff4d6a; }
.feed-item .fi-rail button.land { color: #fff; }
.feed-item .fi-foot { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; padding: 34px 74px calc(18px + var(--safe-b)) 14px;
  background: linear-gradient(0deg, rgba(0,0,0,.86) 20%, rgba(0,0,0,.35) 65%, transparent); color: #fff; }
.feed-item .fi-title { display: flex; align-items: center; gap: 8px; }
.feed-item .fi-title b { font-size: 16px; max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-item .fi-ep { flex: none; font-size: 11px; padding: 4px 9px; border-radius: 999px; background: rgba(255,45,85,.85); color: #fff; }
.feed-item .fi-tags { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.feed-item .fi-tags span { font-size: 10.5px; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.14); color: rgba(255,255,255,.86); }
.feed-item .fi-desc { margin: 8px 0 0; font-size: 12px; line-height: 1.6; color: rgba(255,255,255,.72); display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed-item .fi-hint { margin-top: 8px; font-size: 10.5px; color: rgba(255,255,255,.42); }

/* ================================================================
   顶栏 / 搜索 / 剧场分类
   ================================================================ */
.topbar { padding-right: 12px; }
.topbar .searchbar { min-width: 0; flex: 1; }
.topbar .searchbar .sb-tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .top-search { display: none; flex: none; }
@media (max-width: 400px) {
  .topbar .brand-name { display: none; }
  .topbar .searchbar { display: none; }
  .topbar .top-search { display: grid; }
}

.search-head { display: flex; align-items: center; gap: 8px; padding: calc(10px + var(--safe-t)) 12px 10px; }
.search-field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px;
  border-radius: 19px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.06); }
.search-field .sf-ico { display: flex; flex: none; color: var(--text-3); }
.search-field .sf-ico svg { width: 16px; height: 16px; }
.sf-input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--text);
  font-size: 14px; line-height: 1.4; padding: 0; }
.sf-input::placeholder { color: var(--text-3); font-size: 13px; }
.sf-clear { flex: none; width: 22px; height: 22px; border-radius: 50%; display: none; place-items: center;
  background: rgba(255,255,255,.14); color: var(--text-2); }
.sf-clear svg { width: 12px; height: 12px; }
.sf-clear.show { display: grid; }
.sf-go { flex: none; font-size: 13px; color: #fff; font-weight: 600; padding: 8px 14px; border-radius: 999px;
  background: linear-gradient(135deg,#ff2d55,#ff6a3d); }
.search-block { padding: 4px 0 14px; }
.search-block .block-title { font-size: 13px; font-weight: 700; color: var(--text); padding: 0 14px 8px; }
.search-head-line { display: flex; align-items: baseline; gap: 8px; padding: 6px 14px 10px; }
.search-head-line b { font-size: 14px; color: var(--text); }
.search-head-line span { font-size: 11.5px; color: var(--text-3); }
.search-more { text-align: center; padding: 14px; }
.search-more .dim { font-size: 11.5px; color: var(--text-3); }

.genre-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 14px 10px; scrollbar-width: none; }
.genre-row::-webkit-scrollbar { display: none; }
.genre-row button { flex: none; padding: 6px 13px; border-radius: 999px; font-size: 12.5px; color: var(--text-2); background: rgba(255,255,255,.06); }
.genre-row button.on { background: rgba(255,45,85,.16); color: #ff8095; font-weight: 700; }

/* ---- 公告跑马灯 ---- */
.notice-bar { display: flex; align-items: center; gap: 10px; overflow: hidden; }
.notice-bar .nb-wrap { flex: 1; min-width: 0; overflow: hidden; position: relative; }
.notice-bar .nb-scroll {
  display: inline-block; white-space: nowrap; padding-left: 100%;
  animation: nb-run 22s linear infinite;
}
@keyframes nb-run { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.notice-bar:hover .nb-scroll { animation-play-state: paused; }

/* ---- 封面兜底 ---- */
img.bad { opacity: 0; }
.poster { background: linear-gradient(135deg, #23232b, #15151a); }
.poster::after {
  content: '冰'; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 20px; color: rgba(255,255,255,.12); pointer-events: none; z-index: 0;
}
.poster { position: relative; }
.poster img { position: relative; z-index: 1; }

/* ---- 推荐流：画面不透顶，完整显示 ---- */
.feed-item .fi-poster { position: absolute; inset: 0; z-index: 1; display: none; place-items: center; }
.feed-item .fi-poster img { width: 100%; height: 100%; object-fit: contain; }
.feed-item.no-video .fi-poster { display: grid; }
.feed-item.no-video .fi-bg { filter: blur(30px) brightness(.5); }
.feed-item .fi-pause-ico { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0,0,0,.42); border: 1px solid rgba(255,255,255,.18); }
.feed-item .fi-pause-ico svg { width: 40px; height: 40px; }

/* ---- 清屏（沉浸） ---- */
  position: absolute; right: 14px; bottom: calc(16px + var(--safe-b)); z-index: 30;
  padding: 8px 14px; border-radius: 999px; font-size: 12px; color: #fff;
  background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(6px);
}

/* ---- 推荐流：UI 短暂显示后淡出，点击画面可切换播放/暂停 ---- */
.feed-item .fi-rail, .feed-item .fi-foot, .feed-top { transition: opacity .25s; }
.feed-item.ui-hide .fi-rail, .feed-item.ui-hide .fi-foot { opacity: 0; pointer-events: none; }
.feed-item .fi-pause { pointer-events: none; }

/* ================ 横屏（手机横过来）适配：首页 / 详情 / 剧场 / 推荐 ================ */
@media (orientation: landscape) and (max-height: 560px) {
  .topbar { padding-top: calc(6px + var(--safe-t)); padding-bottom: 6px; }
  .banner { height: auto; }
  .banner-item { height: 210px; }
  .banner-info h3 { font-size: 17px; }
  .banner-info p { -webkit-line-clamp: 1; font-size: 11.5px; }
  .banner-track { height: 210px; }
  .hero { padding-bottom: 10px; }
  .hero-cover { width: 96px; height: 134px; }
  .grid { grid-template-columns: repeat(5, 1fr); gap: 10px; }
  .chips { padding-top: 6px; padding-bottom: 6px; }
  .section { margin-top: 12px; }
  .site-footer { margin-top: 14px; }
  /* 推荐流 */
  .feed-item .fi-rail { bottom: 96px; gap: 10px; }
  .feed-item .fi-rail button { width: 46px; font-size: 10px; }
  .feed-item .fi-rail button svg { width: 22px; height: 22px; }
  .feed-item .fi-foot { padding: 20px 70px calc(10px + var(--safe-b)) 14px; }
  .feed-item .fi-title b { font-size: 14.5px; }
  .feed-item .fi-desc { -webkit-line-clamp: 1; }
  .feed-item .fi-hint { display: none; }
  .feed-top { padding-bottom: 14px; }
}


/* ================ 卡片上的「横屏」直达按钮 ================ */
a.card { position: relative; }
.card-land {
  position: absolute; right: 5px; top: 5px; z-index: 5;
  padding: 3px 8px; border-radius: 999px; font-size: 10px; line-height: 1.5;
  color: #fff; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(4px);
}
.card-land:active { background: var(--brand); border-color: transparent; }

.btn-land { display: flex; align-items: center; gap: 5px; }
.btn-land svg { width: 18px; height: 18px; }

/* 详情页按钮变三列（竖屏 / 横屏 / 收藏） */
.hero-actions { display: flex; gap: 8px; align-items: center; }
.hero-actions .btn-play { flex: 1 1 auto; }
.hero-actions .btn-ghost { flex: none; white-space: nowrap; }


/* 首页顶部「下载 App」条 */
.dl-strip {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 12px 2px; padding: 10px 12px; border-radius: 13px;
  background: linear-gradient(120deg, rgba(255,67,97,.22), rgba(255,67,97,.06));
  border: 1px solid rgba(255,77,106,.32); color: #fff; text-decoration: none;
}
.dl-strip .dl-ico {
  width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: var(--brand, #e6002f); font-size: 16px; font-weight: 800;
}
.dl-strip .dl-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.dl-strip .dl-tx b { font-size: 13.5px; }
.dl-strip .dl-tx small { font-size: 11px; color: rgba(255,255,255,.56); margin-top: 2px; }
.dl-strip .dl-go { font-size: 12px; color: #ff8095; font-weight: 700; white-space: nowrap; }

/* ================= v1.7.2 细节修复 ================= */

/* 详情页三个按钮：继续看第 X 集 不再溢出（可收缩 + 省略号） */
.hero-actions { align-items: stretch; }
.hero-actions .btn-play {
  flex: 1 1 auto; min-width: 0; padding: 0 14px; gap: 6px;
  font-size: 14.5px; white-space: nowrap; overflow: hidden;
}
.hero-actions .btn-play svg { flex: none; width: 20px; height: 20px; }
.hero-actions .btn-ghost { flex: 0 0 auto; padding: 0 13px; font-size: 13px; gap: 5px; }
.hero-actions .btn-ghost svg { width: 17px; height: 17px; flex: none; }
.hero-actions .btn-ghost span { white-space: nowrap; }
@media (max-width: 360px) {
  .hero-actions .btn-play { font-size: 13.5px; }
  .hero-actions .btn-ghost { padding: 0 10px; font-size: 12px; }
}

/* 选集标题行：横屏播放按钮不再把「共 X 集」挤出去 */
.section-head #ep-land { padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, .08); font-size: 12px; }
