﻿/* 电影天堂 · 网页版
 * 视觉对齐 IPA 内嵌 H5：深灰底 #252525、选中色 #EEDE4D、
 * 金色评分、橙色主按钮，手机端 3 列海报 + 底部标签栏。 */

:root {
  --bg: #252525;
  --bg-deep: #1d1d1d;
  --panel: #2f2f2f;
  --panel-2: #3a3a3a;
  --ink: #ffffff;
  --ink-soft: #d9d9d9;
  --muted: #8c8c8c;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .18);
  --gold: #EEDE4D;
  --gold-soft: rgba(238, 222, 77, .15);
  --orange: linear-gradient(270deg, #ef8a56, #ff4d00);
  --teal: #44d7b6;
  --radius: 10px;
  --shadow: 0 18px 48px rgba(0, 0, 0, .55);
  --tabbar-h: 60px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}

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

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

button { cursor: pointer; }

img { display: block; }

/* ---------- 顶部栏 ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: env(safe-area-inset-top);
  background: rgba(30, 30, 30, .94);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 9px 14px 10px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .02em;
}

.logo-img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(238, 222, 77, .22);
}

.nav { display: none; }

.bar-search {
  order: 3;
  flex: 1 0 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 4px 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #333;
  transition: border-color .15s, background .15s;
}

.bar-search:focus-within {
  border-color: rgba(238, 222, 77, .6);
  background: #3a3a3a;
}

.search-ico {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #8c8c8c;
  stroke-width: 2;
  stroke-linecap: round;
}

.bar-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  outline: none;
  font-size: 13.5px;
  color: var(--ink);
}

.bar-search input::placeholder { color: #7e7e7e; }

.bar-search input::-webkit-search-cancel-button { display: none; }

.search-btn {
  flex: none;
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--gold);
  color: #1d1d1d;
  font-size: 12.5px;
  font-weight: 600;
  transition: filter .15s;
}

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

/* ---------- 页面 ---------- */
.page {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 14px calc(var(--tabbar-h) + 26px + env(safe-area-inset-bottom));
}

/* ---------- 首页轮播 ---------- */
.banner {
  position: relative;
  height: 182px;
  margin-top: 2px;
  border-radius: 12px;
  overflow: hidden;
  background: #2a2a2a;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .3);
}

.banner-track {
  display: flex;
  height: 100%;
  transition: transform .55s cubic-bezier(.4, 0, .2, 1);
  will-change: transform;
}

.banner-slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: #2a2a2a;
  text-align: left;
}

.banner-bg {
  position: absolute;
  inset: -12%;
  width: 124%;
  height: 124%;
  object-fit: cover;
  filter: blur(16px) brightness(.62) saturate(1.1);
}

.banner-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(16, 16, 16, .94) 0%, rgba(16, 16, 16, .74) 46%, rgba(16, 16, 16, .22) 100%),
    linear-gradient(0deg, rgba(16, 16, 16, .88), transparent 60%);
}

.banner-copy {
  position: absolute;
  left: 14px;
  right: 96px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.banner-tag {
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--gold);
  color: #1d1d1d;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
}

.banner-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .65);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.banner-sub {
  font-size: 11.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .7);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.banner-cta {
  margin-top: 2px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(255, 77, 0, .32);
}

.banner-poster {
  position: absolute;
  right: 12px;
  bottom: 14px;
  width: 72px;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .55);
  border: 1px solid rgba(255, 255, 255, .14);
}

.banner-dots {
  position: absolute;
  right: 12px;
  top: 10px;
  z-index: 3;
  display: flex;
  gap: 5px;
}

.banner-dots button {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, .38);
  transition: width .2s, background .2s;
}

.banner-dots button[aria-current="true"] {
  width: 16px;
  background: var(--gold);
}

/* ---------- 分类入口 ---------- */
.cats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 6px;
  margin: 16px 0 0;
}

.cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ink-soft);
  transition: color .15s;
}

.cat:hover { color: var(--gold); }

.cat-ico {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
  transition: background .15s, transform .15s;
}

.cat:hover .cat-ico { background: #3a3a3a; transform: translateY(-1px); }

.cat:active .cat-ico { transform: scale(.95); }

.cat-ico svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- 热门搜索 ---------- */
.hot-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  overflow: hidden;
}

.hot-label {
  flex: none;
  padding: 0 6px;
  border: 1px solid rgba(238, 222, 77, .38);
  border-radius: 4px;
  color: var(--gold);
  font-size: 10.5px;
  line-height: 18px;
}

.chips {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 1px;
}

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

.chips button {
  flex: none;
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #2d2d2d;
  color: var(--ink-soft);
  font-size: 12px;
  white-space: nowrap;
  transition: border-color .15s, color .15s;
}

.chips button:hover { border-color: rgba(238, 222, 77, .45); color: var(--gold); }

/* ---------- 首页分区 ---------- */
.home-sections {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 20px;
}

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 2px 10px;
}

.sec-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .01em;
}

.sec-title::before {
  content: "";
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: var(--gold);
}

.sec-more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 11.5px;
  transition: color .15s;
}

.sec-more:hover { color: var(--gold); }

.sec-more svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-sections .sec-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 8px;
}

/* 手机端每个分区只露出 3 行 */
.home-sections .sec-grid .card:nth-child(n+10) { display: none; }

.home-error {
  padding: 40px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.home-error button {
  margin-top: 12px;
  padding: 7px 18px;
  border: 1px solid rgba(238, 222, 77, .45);
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 12.5px;
}

/* ---------- 结果区 ---------- */
.results-block { padding-top: 4px; }

.results-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.filters {
  display: flex;
  gap: 6px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.type-filter {
  padding-right: 8px;
  border-right: 1px solid var(--line);
}

.filters button {
  flex: none;
  padding: 4px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  transition: color .15s, background .15s, border-color .15s;
}

.filters button:hover { color: var(--ink); }

.filters button[aria-pressed="true"] {
  border-color: rgba(238, 222, 77, .55);
  background: var(--gold-soft);
  color: var(--gold);
}

.count {
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

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

.card {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  animation: rise .26s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

.card-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 7px;
  overflow: hidden;
  background: var(--panel);
}

.card-poster img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.card-poster img[data-failed="1"] { opacity: 0; }

.card:hover .card-poster img { transform: scale(1.045); }

.card-poster .fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 25px;
  font-weight: 600;
  color: rgba(255, 255, 255, .18);
  background: linear-gradient(160deg, #363636, #2a2a2a);
}

.card-poster .badge {
  position: absolute;
  z-index: 2;
  top: 5px;
  right: 5px;
  padding: 1px 5px;
  border-radius: 3px;
  background-image: linear-gradient(270deg, #fde39e, #fff3d4);
  color: #421901;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.5;
}

.card-title {
  margin: 7px 1px 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: #f2f2f2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  margin: 2px 1px 0;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 骨架屏 */
.skeleton .card-poster,
.skeleton .sk-line {
  background: linear-gradient(100deg, #303030 30%, #3d3d3d 50%, #303030 70%);
  background-size: 220% 100%;
  animation: shimmer 1.2s linear infinite;
}

.sk-line {
  height: 10px;
  margin: 9px 1px 0;
  border-radius: 4px;
}

.sk-line.short { width: 55%; }

@keyframes shimmer {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

.empty {
  padding: 56px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

.more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}

.more {
  padding: 9px 26px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #2f2f2f;
  color: var(--ink-soft);
  font-size: 13px;
  transition: border-color .15s, color .15s;
}

.more:hover { border-color: rgba(238, 222, 77, .55); color: var(--gold); }

.more:disabled { opacity: .55; cursor: default; }

/* ---------- 详情 / 播放弹层 ---------- */
.sheet {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--bg);
  color: var(--ink);
  box-shadow: var(--shadow);
  overflow: auto;
  overscroll-behavior: contain;
}

.sheet::backdrop {
  background: rgba(8, 8, 8, .72);
  backdrop-filter: blur(2px);
}

.sheet-close {
  position: absolute;
  top: calc(8px + env(safe-area-inset-top));
  right: 10px;
  z-index: 8;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  background: rgba(20, 20, 20, .62);
  backdrop-filter: blur(6px);
  color: #e8e8e8;
  transition: background .15s;
}

.sheet-close:hover { background: rgba(50, 50, 50, .85); }

.sheet-close svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.stage {
  display: flex;
  flex-direction: column;
  background: #000;
}

/* ---------- 播放器 ---------- */
.player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 46vh;
  overflow: hidden;
  background: #000;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.player video {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
}

.player-cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  background: radial-gradient(78% 78% at 50% 42%, rgba(0, 0, 0, .12), rgba(0, 0, 0, .68));
  cursor: pointer;
  transition: opacity .2s;
}

.player:not(.cover) .player-cover { opacity: 0; pointer-events: none; }

.player-cover-bg {
  position: absolute;
  inset: -28px;
  background-position: center;
  background-size: cover;
  filter: blur(24px) brightness(.55) saturate(1.15);
  pointer-events: none;
}

.player-cover-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(72% 72% at 50% 44%, rgba(0, 0, 0, .08), rgba(0, 0, 0, .6));
}

.player-cover > :not(.player-cover-bg) {
  position: relative;
  z-index: 1;
}

.player-start {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(238, 222, 77, .95);
  color: #1b1b1b;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .5);
  transition: transform .15s, background .15s;
}

.player-start svg { width: 26px; height: 26px; margin-left: 3px; fill: currentColor; }

.player-start:hover { transform: scale(1.06); background: #f6ea72; }

.player-cover-text {
  max-width: 86%;
  margin: 0;
  color: rgba(255, 255, 255, .8);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}

.player-ui {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .52), rgba(0, 0, 0, 0) 24%,
    rgba(0, 0, 0, 0) 58%, rgba(0, 0, 0, .82));
  transition: opacity .22s;
}

.player.idle .player-ui,
.player.cover .player-ui { opacity: 0; }

.player-head {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 10px 44px 0 12px;
  pointer-events: none;
}

.player-label {
  overflow: hidden;
  color: rgba(255, 255, 255, .88);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .7);
}

.player-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 7px;
}

.player-btn {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #fff;
  opacity: .92;
  transition: background .15s, opacity .15s;
}

.player-btn svg { width: 19px; height: 19px; fill: currentColor; }

.player-btn:hover { background: rgba(255, 255, 255, .14); opacity: 1; }

.player-rate b { font-size: 12px; font-weight: 600; letter-spacing: .02em; }

.player-time {
  flex: none;
  min-width: 36px;
  color: rgba(255, 255, 255, .8);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.player-seek {
  display: flex;
  flex: 1;
  align-items: center;
  height: 18px;
  cursor: pointer;
  touch-action: none;
}

.player-seek-rail {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .3);
  overflow: hidden;
  transition: height .12s;
}

.player-seek:hover .player-seek-rail { height: 6px; }

.player-seek-buf {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: rgba(255, 255, 255, .34);
}

.player-seek-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: var(--gold);
}

.player-seek-knob {
  position: absolute;
  top: 50%;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .35);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity .12s;
}

.player-seek:hover .player-seek-knob,
.player-seek:focus-visible .player-seek-knob { opacity: 1; }

.player-vol {
  flex: none;
  width: 62px;
  height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
}

.player-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .2);
  pointer-events: none;
}

.player-spin {
  width: 30px;
  height: 30px;
  border: 2.5px solid rgba(255, 255, 255, .22);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

.player:fullscreen {
  width: 100vw;
  height: 100vh;
  max-height: none;
  aspect-ratio: auto;
}

.player:fullscreen video { height: 100%; }

.player:fullscreen .player-head { padding-right: 16px; }

.stage-note {
  width: 100%;
  padding: 7px 14px;
  background: #000;
  color: rgba(255, 255, 255, .62);
  font-size: 11.5px;
}

.detail {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  padding: 14px;
}

.detail-cover {
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

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

.detail h2 {
  margin: 0 0 5px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.01em;
}

.detail .sub {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
}

.detail .sub span + span::before {
  content: "·";
  margin: 0 6px;
  color: var(--line-strong);
}

.detail .summary {
  margin: 0;
  color: #b9b9b9;
  font-size: 12.5px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sources { padding: 4px 14px calc(26px + env(safe-area-inset-bottom)); }

.sources h3 {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .05em;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 1px;
}

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

.tabs button {
  flex: none;
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #333;
  color: var(--ink-soft);
  font-size: 12.5px;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}

.tabs button:hover { background: #3d3d3d; }

.tabs button[aria-pressed="true"] {
  border-color: rgba(238, 222, 77, .65);
  background: var(--gold-soft);
  color: var(--gold);
}

.tabs .vip {
  margin-left: 3px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .16);
  color: inherit;
  font-size: 9px;
  font-style: normal;
  vertical-align: 1px;
}

.eps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-height: 232px;
  overflow: auto;
  padding: 1px;
}

.eps button {
  padding: 9px 5px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #333;
  color: var(--ink-soft);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .15s, border-color .15s, color .15s;
}

.eps button:hover { background: #3d3d3d; }

.eps button[aria-pressed="true"] {
  border-color: rgba(238, 222, 77, .65);
  background: var(--gold-soft);
  color: var(--gold);
}

/* ---------- 状态 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom));
  z-index: 60;
  max-width: 86vw;
  padding: 9px 15px;
  border-radius: 10px;
  background: rgba(18, 18, 18, .96);
  color: var(--ink);
  font-size: 12.5px;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.foot {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.dot::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--line-strong);
  vertical-align: 1px;
}

.dot.ok::before { background: #2ecc71; }
.dot.bad::before { background: #ff6b6b; }

/* ---------- 底部标签栏（手机） ---------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  display: flex;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(28, 28, 28, .97);
  backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid rgba(255, 255, 255, .06);
}

.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #6f6a86;
  font-size: 10.5px;
  transition: color .15s;
}

.tabbar svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tabbar a[aria-current="page"] { color: var(--gold); }

/* ---------- 平板（窗口较窄的电脑） ---------- */
@media (min-width: 640px) and (max-width: 999px) {
  .page { max-width: 960px; }

  .banner { height: 250px; }

  .banner-copy { right: 150px; }

  .banner-title { font-size: 24px; }

  .banner-poster { width: 104px; right: 20px; bottom: 20px; }

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

  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px 12px; }

  .home-sections .sec-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px 12px;
  }

  .home-sections .sec-grid .card:nth-child(n+16) { display: none; }

  .sheet {
    width: min(760px, calc(100vw - 40px));
    height: fit-content;
    max-height: 92vh;
    margin: auto;
    border-radius: 14px;
  }

  .stage { border-radius: 14px 14px 0 0; }

  .player { max-height: 48vh; }

  .detail { grid-template-columns: 112px 1fr; padding: 16px; }

  .sources { padding: 6px 16px 20px; }

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

  .toast { bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); }
}

/* ---------- 电脑端 ---------- */
@media (min-width: 1000px) {
  :root { --tabbar-h: 0px; }

  .bar {
    background: rgba(30, 30, 30, .9);
  }

  .bar-inner {
    max-width: 1320px;
    margin: 0 auto;
    height: 64px;
    padding: 0 14px;
    flex-wrap: nowrap;
    gap: 0;
  }

  .logo { gap: 9px; font-size: 18px; }

  .logo-img { width: 32px; height: 32px; border-radius: 9px; }

  .nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 22px;
    font-size: 13.5px;
    color: #b4b4b4;
  }

  .nav a {
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    transition: color .15s, background .15s;
  }

  .nav a:hover { color: #fff; background: rgba(255, 255, 255, .06); }

  .nav a[aria-current="page"] {
    color: var(--gold);
    background: var(--gold-soft);
  }

  .bar-search {
    order: 0;
    flex: 0 0 auto;
    width: 300px;
    height: 38px;
    margin-left: auto;
    background: #2e2e2e;
    border: 1px solid rgba(255, 255, 255, .07);
  }

  .page { padding: 20px 14px 56px; }

  .banner { height: 384px; border-radius: 16px; margin-top: 0; }

  .banner-copy { left: 34px; right: 220px; bottom: 32px; gap: 9px; }

  .banner-tag { font-size: 10.5px; padding: 2px 8px; }

  .banner-title { font-size: 34px; -webkit-line-clamp: 1; }

  .banner-sub { max-width: 92%; font-size: 13px; -webkit-line-clamp: 2; }

  .banner-cta { margin-top: 6px; padding: 10px 24px; font-size: 13.5px; }

  .banner-poster {
    right: 34px;
    bottom: 34px;
    width: 134px;
    border-radius: 10px;
  }

  .banner-dots { right: 34px; top: 20px; gap: 6px; }

  .banner-dots button { width: 7px; height: 7px; }

  .banner-dots button[aria-current="true"] { width: 20px; }

  .cats {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
  }

  .cat { font-size: 12.5px; gap: 8px; }

  .cat-ico {
    width: 58px;
    height: 58px;
    border-radius: 18px;
  }

  .cat-ico svg { width: 26px; height: 26px; }

  .hot-row { margin-top: 20px; flex-wrap: wrap; overflow: visible; }

  .chips { flex-wrap: wrap; overflow: visible; }

  .chips button { font-size: 12.5px; padding: 5px 13px; }

  .home-sections { gap: 34px; margin-top: 28px; }

  .sec-head { margin-bottom: 14px; }

  .sec-title { font-size: 20px; gap: 9px; }

  .sec-title::before { width: 4px; height: 18px; }

  .sec-more { font-size: 12.5px; }

  .sec-more svg { width: 13px; height: 13px; }

  .home-sections .sec-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 22px 16px;
  }

  .home-sections .sec-grid .card:nth-child(n+10) { display: block; }

  .results-head { margin-bottom: 16px; padding-bottom: 12px; }

  .filters button { font-size: 13px; padding: 5px 13px; }

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

  .card-title { font-size: 13.5px; }

  .card-meta { font-size: 11.5px; }

  .card-poster { border-radius: 8px; }

  .card-poster .badge { font-size: 10px; padding: 1px 6px; }

  .sheet {
    width: min(1160px, calc(100vw - 64px));
    max-width: 1160px;
    height: fit-content;
    max-height: 92vh;
    margin: auto;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 16px;
  }

  /* 有线路面板时，电脑端用「播放器 + 右侧剧集」两栏布局 */
  .sheet:has(.sources) #sheet-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 368px;
    grid-template-rows: auto auto;
  }

  .sheet:has(.sources) .stage { grid-column: 1; grid-row: 1; }

  .sheet:has(.sources) .stage .player { max-height: none; }

  .sheet:has(.sources) .detail {
    grid-column: 1;
    grid-row: 2;
    align-content: start;
  }

  .sheet:has(.sources) .sources {
    grid-column: 2;
    grid-row: 1 / span 2;
    max-height: 92vh;
    overflow: auto;
    padding: 58px 22px 22px;
    border-left: 1px solid var(--line);
    background: #232323;
  }

  .sheet:has(.sources) .tabs { margin-bottom: 14px; }

  .sheet:has(.sources) .eps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    max-height: 320px;
  }

  .sheet-close {
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
  }

  .stage { border-radius: 16px 16px 0 0; }

  .player { aspect-ratio: 16 / 9; max-height: 52vh; }

  .stage-note { font-size: 12px; padding: 8px 18px; }

  .detail {
    grid-template-columns: 132px 1fr;
    gap: 20px;
    padding: 20px 24px;
  }

  .detail h2 { font-size: 22px; }

  .detail .sub { font-size: 12.5px; }

  .detail .summary { font-size: 13px; -webkit-line-clamp: 3; }

  .sources { padding: 12px 24px 26px; }

  .tabs { flex-wrap: wrap; overflow: visible; }

  .tabs button { font-size: 13px; padding: 7px 15px; }

  .eps {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 9px;
    max-height: 250px;
  }

  .eps button { font-size: 12.5px; }

  .foot { display: flex; }

  .tabbar { display: none; }

  .toast { bottom: 28px; }
}

/* 手机窄屏：控制条只留必要的按钮 */
@media (max-width: 639px) {
  .player-vol,
  .player-vol-btn { display: none; }

  .player-start { width: 54px; height: 54px; }

  .player-start svg { width: 22px; height: 22px; }

  .player-btn { width: 28px; height: 28px; }

  .player-btn svg { width: 18px; height: 18px; }

  .player-time { min-width: 32px; font-size: 11px; }

  .player-foot { gap: 4px; padding: 0 6px 6px; }
}

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