/* 企鹅影视 PC Web — iq.com 风格深色主题 (v2.0.0)
 * Design tokens extracted from the iq.com reference: near-black canvas, full-bleed
 * hero with left text stack + round green play button, icon+label topbar items,
 * gold VIP button, outlined APP button, green corner badges on 2:3 cards. */
:root {
  --bg: #0b0b0f;
  --bg-raised: #1a1c22;
  --bg-card: #1f2126;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, .58);
  --faint: rgba(255, 255, 255, .38);
  --line: rgba(255, 255, 255, .09);
  --green: #00c04a;
  --green-deep: #00a63e;
  --ink: #04140a;
  --gold: #e8ab4f;
  --gold-hi: #f7d38f;
  --page: 1440px;
  --radius: 6px;
  --touch: 44px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 24px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
[hidden] { display: none !important; }
.download-hash { overflow-wrap: anywhere; font-size: 12px; color: var(--muted); }
.info-body { line-height: 1.9; white-space: pre-line; }
.modal-actions { flex-wrap: wrap; }
#retryPlayback { margin: var(--space-md) 0; }
img { display: block; }
mark { background: rgba(0, 192, 74, .35); color: #d8ffe6; padding: 0 1px; border-radius: 3px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2c2e35; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- top bar (transparent over hero, solid after scroll) ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, rgba(5, 6, 8, .72), rgba(5, 6, 8, 0));
  transition: background .25s ease;
}
.topbar.solid {
  background: rgba(11, 11, 15, .96);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06);
}

.topbar-inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 32px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 26px;
}

.brand { display: flex; align-items: center; gap: 11px; flex: none; }
/* 品牌图标：形状来自 Android 端 ic_launcher，配色对齐本站深色主题 */
.brand-mark { width: 40px; height: 40px; display: block; }
.brand-wing { fill: var(--green); }
.brand-body { fill: #ffffff; }
.brand-eye { fill: var(--bg); }
.brand-name {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: .5px;
  white-space: nowrap;
  color: var(--text);          /* 与 APP 一致：前段暖白 */
}
.brand-name-accent { color: var(--green); }   /* 后段主绿 */

.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }

.nav-link {
  flex: none;
  padding: 8px 13px;
  font-size: 15px;
  color: rgba(255, 255, 255, .82);
  border-radius: 6px;
  transition: color .2s, background .2s;
  white-space: nowrap;
}
.nav-link:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav-link.active { color: #fff; font-weight: 700; background: rgba(255, 255, 255, .12); }

.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }

/* search */
.search-box { position: relative; display: flex; align-items: center; margin-right: 6px; }

#searchInput {
  width: 210px;
  height: 38px;
  padding: 0 40px 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
  font-size: 13px;
  color: #fff;
  outline: none;
  transition: width .25s, background .2s, border-color .2s;
}
#searchInput::placeholder { color: rgba(255, 255, 255, .42); }
#searchInput:focus { width: 270px; background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .25); }
#searchInput::-webkit-search-cancel-button { display: none; }

.search-btn {
  position: absolute;
  right: 6px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, .6);
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-btn:hover { color: #fff; }

.search-clear {
  position: absolute;
  right: 36px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  color: #fff;
  font-size: 14px;
  line-height: 1;
}

.suggest {
  position: absolute;
  top: 44px;
  left: 0;
  right: 0;
  background: #21232a;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .55);
  padding: 6px;
  max-height: 380px;
  overflow-y: auto;
}
.suggest-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, .85);
}
.suggest-item svg { flex: none; color: rgba(255, 255, 255, .4); }
.suggest-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-item:hover { background: rgba(255, 255, 255, .08); color: var(--green); }
.suggest-item:hover svg { color: var(--green); }

/* icon + label items (iq.com style) */
.tb-icon-item { position: relative; flex: none; }
.tb-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 8px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, .85);
}
a.tb-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 8px;
  color: rgba(255, 255, 255, .85);
}
.tb-icon-item svg { display: block; }
.tb-label { font-size: 11px; line-height: 1; color: rgba(255, 255, 255, .78); white-space: nowrap; }
.tb-icon-item:hover .tb-label, .tb-icon-item:hover svg, .tb-icon-item:hover { color: #fff; }

.lang-picker, .me-picker { position: relative; }

.lang-menu, .me-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 150px;
  background: #21232a;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .55);
  padding: 6px;
  z-index: 120;
}
.lang-item, .me-menu a {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: 0;
  border-radius: 6px;
  background: none;
  font-size: 13px;
  color: rgba(255, 255, 255, .85);
}
.lang-item:hover, .me-menu a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.lang-item.active { color: var(--green); font-weight: 700; }
.lang-item.active::after { content: "✓"; float: right; }
.me-menu a { white-space: nowrap; }

/* APP / VIP buttons */
.btn-app {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border: 1.5px solid rgba(255, 255, 255, .85);
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  transition: background .2s;
}
.btn-app:hover { background: rgba(255, 255, 255, .12); }

.btn-vip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold));
  color: #3a2708;
  font-size: 13px;
  font-weight: 800;
  transition: filter .2s;
}
.btn-vip:hover { filter: brightness(1.08); }

/* ---------------- hero (full-bleed, iq.com style) ---------------- */

.page { min-height: calc(100vh - 68px - 260px); }

.hero {
  position: relative;
  width: 100%;
  height: clamp(560px, 86vh, 820px);
  margin-top: -68px; /* sit under the transparent topbar */
  overflow: hidden;
  background: #000;
}

.hero-track { position: absolute; inset: 0; }

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .7s ease;
  pointer-events: none;
}
.hero-slide.active { opacity: 1; pointer-events: auto; }

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  /* 低清源（<480px）做轻模糊兜底，避免放大后像素感 */
  filter: blur(16px) brightness(.82) saturate(1.1);
  transform: scale(1.14);
}
/* 高清源：海报主体直接清晰铺满全宽（大图观感），只轻微压暗保证文字可读 */
.hero-bg.hq {
  filter: brightness(.88) saturate(1.05);
  transform: none;
}

.hero-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 5, 8, .86) 0%, rgba(4, 5, 8, .42) 32%, rgba(4, 5, 8, .06) 60%, rgba(4, 5, 8, .26) 100%),
    linear-gradient(0deg, var(--bg) 1%, rgba(11, 11, 15, .3) 14%, transparent 40%);
}

.hero-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 48px 72px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 48px;
}

.hero-text { max-width: 720px; min-width: 0; flex: 1; }

/* 右侧大海报：固定在原生分辨率下尽量放大（clamp 自适应视口） */
.hero-side { flex: none; width: clamp(300px, 26vw, 400px); margin-bottom: 4px; }
.hero-side-poster {
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  box-shadow: 0 26px 64px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .12);
}

.hero-rank-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }

.hero-rank {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--green);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}
.hero-rank.dim { background: rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .85); }
.hero-updated { font-size: 12px; color: rgba(255, 255, 255, .5); }

.hero-title {
  margin: 0 0 16px;
  font-size: clamp(34px, 4.4vw, 62px);
  line-height: 1.12;
  font-weight: 800;
  text-shadow: 0 2px 24px rgba(0, 0, 0, .6);
  max-width: 760px;
}

.hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 15px;
  color: rgba(255, 255, 255, .85);
}
.hero-meta .sep { width: 1px; height: 12px; background: rgba(255, 255, 255, .3); }
.hero-score { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: #fff; }
.hero-score svg { color: var(--green); }

.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.hero-syn {
  margin: 14px 0 26px;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, .6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 620px;
}

.hero-actions { display: flex; align-items: center; gap: 16px; }

.hero-play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 10px 30px rgba(0, 192, 74, .4);
  transition: transform .2s, box-shadow .2s;
}
.hero-play:hover { transform: scale(1.07); box-shadow: 0 14px 36px rgba(0, 192, 74, .55); }
.hero-play svg { margin-left: 4px; }

.hero-alt {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  transition: background .2s, transform .2s;
}
.hero-alt:hover { background: rgba(255, 255, 255, .3); transform: scale(1.06); }

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 72px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .65);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .2s;
  z-index: 5;
}
.hero-arrow:hover { color: #fff; }
.hero-arrow.left { left: 6px; }
.hero-arrow.right { right: 6px; }

.hero-dots {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}
.hero-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .32);
  transition: width .25s, background .25s;
}
.hero-dot.active { width: 22px; background: var(--green); }

/* ---------------- rows ---------------- */

.row-sec { max-width: var(--page); margin: 40px auto 0; padding: 0 32px; }
#rank-row { margin-top: 28px; }

.row-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.row-title { margin: 0; font-size: 22px; font-weight: 800; display: flex; align-items: baseline; gap: 10px; }
.row-sub { font-size: 12px; font-weight: 800; letter-spacing: 2px; color: var(--gold); }

.row-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: rgba(255, 255, 255, .5);
  transition: color .2s;
}
.row-more:hover { color: #fff; }

.row-scroller-wrap { position: relative; }

.row-scroller {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.row-scroller::-webkit-scrollbar { display: none; }

.row-arrow {
  position: absolute;
  top: 38%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s, background .2s;
  z-index: 6;
}
.row-arrow.left { left: -12px; }
.row-arrow.right { right: -12px; }
.row-scroller-wrap:hover .row-arrow { opacity: 1; }
.row-arrow:hover { background: rgba(255, 255, 255, .3); }

/* ---------------- cards ---------------- */

.card-wrap { position: relative; flex: none; width: 176px; scroll-snap-align: start; }

.card { display: block; }

.poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
  transition: transform .3s ease, box-shadow .3s ease;
}
.card:hover .poster {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .55), 0 0 0 2px rgba(255, 255, 255, .85) inset;
}

.poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.card:hover .poster-img { transform: scale(1.06); }

.poster-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  text-align: center;
  color: rgba(255, 255, 255, .92);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  word-break: break-all;
}

.poster-shade {
  position: absolute;
  inset: 58% 0 0;
  background: linear-gradient(0deg, rgba(4, 5, 8, .72), transparent);
  pointer-events: none;
}

.poster-badges {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  pointer-events: none;
}

.tag-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
}
.score-badge { background: var(--green); color: var(--ink); }
.new-badge { background: #fff; color: #0b0b0f; letter-spacing: 1px; }

.eps-overlay {
  position: absolute;
  left: 10px;
  bottom: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
  pointer-events: none;
}

.rank-overlay {
  position: absolute;
  left: 10px;
  bottom: 26px;
  font-size: 40px;
  font-weight: 900;
  font-style: italic;
  line-height: 1;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .85);
  pointer-events: none;
}
.rank-overlay.top3 { color: var(--gold-hi); }

.poster-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.8);
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: rgba(8, 10, 14, .62);
  border: 2px solid rgba(255, 255, 255, .9);
  opacity: 0;
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.poster-play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  border: 9px solid transparent;
  border-left: 14px solid #fff;
  border-right: 0;
}
.card:hover .poster-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.card-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: rgba(8, 10, 14, .66);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  opacity: 0;
  transition: opacity .2s, background .2s;
}
.card-wrap:hover .card-remove { opacity: 1; }
.card-remove:hover { background: var(--green-deep); }

.card-title {
  margin: 10px 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-meta {
  margin: 0;
  font-size: 12px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------- channel / filters ---------------- */

.channel-head {
  max-width: var(--page);
  margin: 40px auto 0;
  padding: 0 32px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.page-title { margin: 0; font-size: 26px; font-weight: 800; }
.channel-count { font-size: 14px; color: var(--muted); }
.channel-head .btn { margin-left: auto; }

.filters {
  max-width: var(--page);
  margin: 20px auto 28px;
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-group { display: flex; align-items: flex-start; gap: 14px; }
.filter-label { flex: none; padding-top: 8px; font-size: 13px; color: var(--faint); width: 42px; }

.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  padding: 7px 16px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, .1);
  font-size: 13px;
  color: rgba(255, 255, 255, .82);
  transition: background .2s, color .2s;
}
.chip:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.chip.on { background: #fff; color: #0b0b0f; font-weight: 700; }

.chip-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .88);
  font-size: 12px;
}

.grid {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 26px 16px;
}

.grid .card-wrap { width: auto; }

.grid-sentinel { height: 8px; }

.grid-empty {
  max-width: var(--page);
  margin: 0 auto;
  padding: 70px 32px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.grid-empty.show { display: block; }

/* ---------------- detail ---------------- */

.detail-hero {
  position: relative;
  margin-top: -68px;
  background: #000;
  overflow: hidden;
}

.detail-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(46px) brightness(.42) saturate(1.15);
  transform: scale(1.2);
}

.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--bg) 2%, transparent 55%);
}

.detail-hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--page);
  margin: 0 auto;
  padding: 150px 32px 48px;
  display: flex;
  gap: 40px;
  color: #fff;
}

.detail-poster { flex: none; width: 300px; }
.detail-poster .poster {
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .65);
}

.detail-info { display: flex; flex-direction: column; gap: 15px; max-width: 720px; min-width: 0; }

.detail-title { margin: 4px 0 0; font-size: 34px; font-weight: 800; line-height: 1.25; }

.detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, .8);
}
.detail-meta .dot { opacity: .5; }

.detail-score {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
}
.detail-score svg { color: var(--green); }

.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.detail-syn {
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 1.85;
  color: rgba(255, 255, 255, .68);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.detail-syn.open { -webkit-line-clamp: unset; }

.syn-toggle {
  align-self: flex-start;
  border: 0;
  background: none;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
}
.syn-toggle:hover { color: #fff; }

.detail-actions { display: flex; gap: 12px; margin-top: 4px; }

.detail-sub { margin: 2px 0 0; font-size: 12px; color: rgba(255, 255, 255, .42); }

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 26px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 700;
  transition: background .2s, transform .2s, box-shadow .2s, border-color .2s, color .2s;
  white-space: nowrap;
}
.btn.small { padding: 6px 14px; font-size: 13px; }

.btn-primary { background: var(--green); color: var(--ink); }
.btn-primary:hover { background: var(--green-deep); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0, 192, 74, .35); }

.btn-ghost { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .28); color: #fff; }
.btn-ghost:hover { border-color: rgba(255, 255, 255, .6); background: rgba(255, 255, 255, .2); }

.btn-fav-on { background: rgba(0, 192, 74, .16); border-color: var(--green); color: var(--green); }
.btn-fav-on:hover { background: rgba(0, 192, 74, .28); }

/* ---------------- play page ---------------- */

.play-wrap {
  max-width: var(--page);
  margin: 24px auto 0;
  padding: 0 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}

.play-main { min-width: 0; }

.player-shell { background: #101116; border-radius: 10px; overflow: hidden; }

.player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
  background: #17181e;
}
.player-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 标题右侧：清晰度选择 + 源徽章 */
.player-actions { flex: none; display: flex; align-items: center; gap: 10px; }
.quality-wrap { position: relative; }
.quality-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 4px;
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .9);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.quality-btn:hover { border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .12); }
.quality-btn .quality-label { color: rgba(255, 255, 255, .55); font-weight: 500; }
.quality-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 132px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  background: #1c1e26;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
}
.quality-item {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: rgba(255, 255, 255, .82);
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.quality-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.quality-item.on { color: var(--green); font-weight: 700; }
.quality-item.on::after { content: " ✓"; }

.demo-badge {
  flex: none;
  padding: 4px 12px;
  border: 1px solid rgba(232, 171, 79, .55);
  border-radius: 4px;
  background: rgba(232, 171, 79, .14);
  color: var(--gold-hi);
  font-size: 12px;
  font-weight: 700;
}

.live-badge {
  flex: none;
  padding: 4px 12px;
  border: 1px solid rgba(0, 192, 74, .55);
  border-radius: 4px;
  background: rgba(0, 192, 74, .14);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

/* episode selector under the player */
.ep-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: #17181e;
  border-top: 1px solid rgba(255, 255, 255, .06);
}
.ep-label { flex: none; font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, .85); }
.ep-scroll { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.ep-nav {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 6px;
  background: rgba(255, 255, 255, .05);
  color: rgba(255, 255, 255, .8);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}
.ep-nav:hover:not(:disabled) { border-color: rgba(255, 255, 255, .5); color: #fff; background: rgba(255, 255, 255, .1); }
.ep-nav:disabled { opacity: .28; cursor: default; }
.ep-chips {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .3) transparent;
}
.ep-chips::-webkit-scrollbar { height: 6px; }
.ep-chips::-webkit-scrollbar-track { background: transparent; }
.ep-chips::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .3); border-radius: 3px; }
.ep-chips::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .5); }
.ep-chip {
  flex: none;
  padding: 5px 14px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, .75);
  font-size: 12px;
  transition: border-color .2s, color .2s, background .2s;
}
.ep-chip:hover { border-color: rgba(255, 255, 255, .5); color: #fff; }
.ep-chip.on { background: var(--green); border-color: var(--green); color: var(--ink); font-weight: 700; }

.player-frame { aspect-ratio: 16 / 9; background: #000; }
.player-frame video { width: 100%; height: 100%; display: block; }

.player-note {
  margin: 0;
  padding: 10px 18px;
  background: #17181e;
  border-top: 1px solid rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .45);
  font-size: 12px;
  line-height: 1.6;
}
.player-note.warn { color: var(--gold-hi); }

.play-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-top: 18px;
}
.play-info-main { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.play-score {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
}
.play-score svg { color: var(--green); }
.play-syn {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.play-info .detail-tags .chip-tag { background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .75); }

.play-side { position: sticky; top: 92px; }
.side-title { margin: 0 0 12px; font-size: 18px; font-weight: 800; }

.side-list { display: flex; flex-direction: column; gap: 6px; max-height: 76vh; overflow-y: auto; padding-right: 4px; }

.side-item {
  display: flex;
  gap: 12px;
  padding: 8px;
  border-radius: 8px;
  transition: background .2s;
}
.side-item:hover { background: rgba(255, 255, 255, .07); }

.side-poster { flex: none; width: 92px; border-radius: 6px; }

.side-text { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.side-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.side-item:hover .side-name { color: var(--green); }
.side-meta { margin: 0; font-size: 12px; color: var(--faint); }

/* ---------------- history (gallery grid, same rhythm as favorites/channel) ---------------- */

/* 历史卡片 = 普通海报卡 + 海报底部进度条 + 右上角进度百分比 */
.hist-card .hist-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: rgba(0, 0, 0, .58);
  z-index: 2;
}
.hist-card .hist-bar .fill { height: 100%; background: var(--green); }

.hist-card .hist-pct {
  position: absolute;
  top: 8px; right: 8px;
  z-index: 2;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .66);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.card-meta.hist-when { color: var(--green); }

/* ---------------- toast / notfound ---------------- */

.toast {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translate(-50%, 10px);
  background: rgba(38, 40, 46, .96);
  border: 1px solid rgba(255, 255, 255, .12);
  color: #fff;
  padding: 11px 22px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  z-index: 300;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.notfound { text-align: center; padding: 150px 32px; }
.nf-404 {
  margin: 0;
  font-size: 84px;
  font-weight: 800;
  color: rgba(255, 255, 255, .16);
}
.nf-msg { color: var(--muted); margin: 10px 0 28px; }

/* ---------------- footer ---------------- */

.footer { margin-top: 72px; background: #101116; border-top: 1px solid var(--line); }

.footer-inner { max-width: var(--page); margin: 0 auto; padding: 44px 32px 28px; }

.footer-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

.footer-col h3 { margin: 0 0 14px; font-size: 14px; font-weight: 700; }
.footer-col a { display: block; padding: 5px 0; font-size: 13px; color: rgba(255, 255, 255, .48); transition: color .2s; }
.footer-col a:hover { color: var(--green); }

.footer-base { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); }
.footer-note { margin: 0 0 8px; font-size: 12px; color: rgba(255, 255, 255, .4); line-height: 1.7; max-width: 760px; }
.footer-copy { margin: 0; font-size: 12px; color: rgba(255, 255, 255, .3); }

/* ---------------- responsive ---------------- */

@media (max-width: 1280px) {
  .topbar-inner { gap: 14px; padding: 0 24px; }
  #searchInput { width: 170px; }
  #searchInput:focus { width: 220px; }
  .hero-content { padding: 0 32px 64px; }
}

@media (max-width: 1080px) {
  .topbar-inner { height: auto; min-height: 68px; flex-wrap: wrap; padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
  .main-nav { display: flex; order: 3; flex-basis: 100%; }
  .btn-app { display: none; }
  .tb-label { display: none; }
  .hero-side { display: none; }
  .play-wrap { grid-template-columns: 1fr; }
  .play-side { position: static; }
  .side-list { flex-direction: row; flex-wrap: wrap; max-height: none; }
  .side-item { width: calc(50% - 4px); }
  .detail-hero-inner { flex-direction: column; align-items: center; text-align: center; }
  .detail-info { align-items: center; }
  .detail-actions, .detail-meta, .detail-tags { justify-content: center; }
  .syn-toggle { align-self: center; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
  .hero { height: 62vh; min-height: 480px; }
}

@media (max-width: 720px) {
  .topbar-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); }
  .brand { min-width: 0; gap: 6px; grid-column: 1; grid-row: 1; }
  .brand-name { font-size: 16px; white-space: normal; line-height: 1.15; }
  .brand-mark { width: 30px; height: 30px; flex-shrink: 0; }
  .topbar-actions { display: contents; }
  .topbar-actions > a.tb-icon-item, .btn-vip { display: none; }
  .btn-member { grid-column: 2; grid-row: 1; max-width: 96px; padding: 0 var(--space-sm); }
  #memberBtnLabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lang-picker { grid-column: 3; grid-row: 1; }
  .me-picker { grid-column: 4; grid-row: 1; }
  .search-box { grid-column: 1 / -1; grid-row: 2; min-width: 0; margin: 0; }
  #searchInput, #searchInput:focus { width: 100%; height: var(--touch); }
  .suggest { width: 100%; }
  .main-nav { grid-column: 1 / -1; grid-row: 3; max-width: 100%; }
  .nav-link { min-height: var(--touch); display: flex; align-items: center; }
  .topbar-actions .tb-icon-btn, .btn-member { min-height: var(--touch); }
  .player-bar { flex-wrap: wrap; gap: var(--space-md); }
  .player-title { width: 100%; }
  .hero { height: 72vh; }
  .hero-title { font-size: 30px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
}

/* hero with a real landscape backdrop: near-original colors, text-side veil only */
.hero-slide.wide .hero-bg {
  filter: brightness(.94) saturate(1.06);
  transform: none;
  object-position: center;
}
.hero-slide.wide .hero-veil {
  background:
    linear-gradient(90deg, rgba(4, 5, 8, .58) 0%, rgba(4, 5, 8, .28) 30%, rgba(4, 5, 8, .04) 58%, rgba(4, 5, 8, .22) 100%),
    linear-gradient(0deg, var(--bg) 1%, rgba(11, 11, 15, .25) 11%, transparent 28%);
}

/* ---------------- 会员中心 / Telegram 登录 ---------------- */

.btn-member {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s;
}
.btn-member:hover { background: rgba(255, 255, 255, .08); }
.btn-member.on { border-color: var(--green); color: var(--green); }

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, .68);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal {
  position: relative;
  width: min(470px, 100%);
  background: var(--bg-raised);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  padding: 26px 26px 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, .6);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { color: #fff; }
.modal-title { margin: 0 0 14px; font-size: 19px; font-weight: 800; }
.modal-steps {
  margin: 0 0 18px;
  padding-left: 20px;
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
  line-height: 1.95;
}
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.modal-status { margin: 16px 0 0; font-size: 13px; color: var(--green); min-height: 18px; }

.member-box {
  max-width: 640px;
  margin: 26px auto 0;
  padding: 22px 24px;
  border-radius: 12px;
  background: var(--bg-raised);
  border: 1px solid rgba(255, 255, 255, .08);
}
.member-note { margin: 0 0 16px; color: rgba(255, 255, 255, .7); font-size: 14px; }
.member-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  font-size: 14px;
}
.member-row:last-child { border-bottom: 0; }
.member-row .mk { color: rgba(255, 255, 255, .55); }
.member-row .mv { font-weight: 600; }
.member-row .mv.yes { color: var(--green); }
.member-row .mv.no { color: #ff7a7a; }
