/* ══════════════════════════════════════════════════════════════
   黄果播放器 · iOS 优先的暗色影院 UI
   ══════════════════════════════════════════════════════════════ */

:root {
  --bg: #08080c;
  --surface: #101017;
  --surface-2: #17171f;
  --line: rgba(255, 255, 255, 0.075);
  --text: #f4f4f8;
  --dim: #8b8b9c;
  --dim-2: #5d5d6e;
  --accent: #ff4f6e;
  --accent-2: #ff9a3c;
  --radius: 16px;
  --tabbar-h: 58px;
  --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%;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  touch-action: manipulation;
}

body { overflow: hidden; }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; }
.hidden { display: none !important; }

#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

/* ═════════ windows / views ═════════ */

.view {
  position: absolute;
  inset: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 18px);
  display: none;
}
.view.is-active { display: block; }

.page-head {
  padding: calc(var(--safe-t) + 18px) 18px 10px;
}
.page-head h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ═════════ 首页头 ═════════ */

.hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-t) + 14px) 18px 8px;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px rgba(255, 79, 110, 0.7);
}
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: 0.02em; }
.brand-sub {
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--dim-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 5px;
  transform: translateY(1px);
}

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: var(--text); stroke-width: 1.9; stroke-linecap: round; }

/* ═════════ 横向滑动 ═════════ */

.hscroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 18px 6px;
  scrollbar-width: none;
}
.hscroll::-webkit-scrollbar { display: none; }

.banner {
  position: relative;
  flex: 0 0 84%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  scroll-snap-align: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
.banner img { width: 100%; height: 100%; object-fit: cover; }
.banner-fade {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(4, 4, 8, 0.94) 6%, rgba(4, 4, 8, 0.25) 52%, transparent 80%);
}
.banner-meta {
  position: absolute;
  left: 14px; right: 14px; bottom: 11px;
}
.banner-meta b {
  display: block;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}
.banner-badge {
  display: inline-block;
  margin-bottom: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2.5px 7px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

/* ═════════ 区块 ═════════ */

.block { margin-top: 22px; }
.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 18px 10px;
}
.block-head h2 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 680;
  letter-spacing: -0.01em;
}
.link-btn { font-size: 12.5px; color: var(--dim); }

/* ═════════ 卡片 ═════════ */

.cards .card { flex: 0 0 112px; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px 11px;
  padding: 0 18px;
}

.card {
  position: relative;
  border-radius: 13px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  -webkit-user-select: none;
  user-select: none;
}
.card:active { transform: scale(0.975); }
.card { transition: transform 0.14s ease; }

.card .thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--surface-2);
}
.card .thumb.poster {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 10px;
  position: relative;
  overflow: hidden;
}
.card .thumb.poster .ptext {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  color: rgba(255, 255, 255, 0.94);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  z-index: 1;
}
.card .thumb.poster .pglow {
  position: absolute;
  width: 120px; height: 120px;
  border-radius: 50%;
  filter: blur(34px);
  opacity: 0.55;
  bottom: -30px; right: -30px;
}

.card .badge-ep {
  position: absolute;
  right: 6px; bottom: 6px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.9);
}
.card .badge-prog {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.5);
}
.card .badge-prog i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.card .c-title {
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1.32;
  padding: 7px 8px 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.92);
}

/* ═════════ 标签 ═════════ */

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 18px 12px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--dim);
  white-space: nowrap;
}
.chip.is-active {
  background: linear-gradient(135deg, rgba(255, 79, 110, 0.9), rgba(255, 138, 61, 0.9));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

/* ═════════ 搜索 ═════════ */

.searchbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: calc(var(--safe-t) + 12px) 18px 6px;
  padding: 0 13px;
  height: 44px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.sb-icon { width: 17px; height: 17px; fill: none; stroke: var(--dim); stroke-width: 2; flex: none; }
.searchbar input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font-size: 15px;
  -webkit-appearance: none;
  appearance: none;
}
.searchbar input::-webkit-search-cancel-button { display: none; }
.q-clear { font-size: 20px; color: var(--dim-2); padding: 0 2px; line-height: 1; }

.empty-state {
  padding: 42px 18px;
  text-align: center;
  color: var(--dim-2);
  font-size: 13.5px;
}

/* ═════════ 我的 ═════════ */

.stat-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 4px 18px 0;
  padding: 16px 0;
  border-radius: 18px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
}
.stat { text-align: center; }
.stat b { display: block; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.stat span { font-size: 11.5px; color: var(--dim); }

.rowlist { padding: 0 18px; display: flex; flex-direction: column; gap: 9px; }
.rowitem {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.rowitem img, .rowitem .ph {
  width: 44px; height: 58px;
  border-radius: 8px;
  object-fit: cover;
  flex: none;
  background: var(--surface-2);
}
.rowitem .rt { flex: 1; min-width: 0; }
.rowitem .rt b {
  display: block;
  font-size: 13.5px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rowitem .rt small { font-size: 11.5px; color: var(--dim); }
.rowitem .rx { color: var(--dim-2); font-size: 19px; padding: 0 6px; }

.setting-list { padding: 0 18px; display: flex; flex-direction: column; gap: 9px; }
.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.setting b { display: block; font-size: 13.5px; font-weight: 550; }
.setting small { font-size: 11.5px; color: var(--dim); line-height: 1.4; }
.setting select {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 9px;
  font-size: 13px;
  -webkit-appearance: none;
  appearance: none;
}
.switch {
  -webkit-appearance: none;
  appearance: none;
  width: 46px; height: 28px;
  border-radius: 999px;
  background: #2a2a36;
  position: relative;
  transition: background 0.2s;
  flex: none;
}
.switch:checked { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.switch:checked::after { transform: translateX(18px); }

.foot-note {
  margin: 26px 18px calc(10px);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--dim-2);
  text-align: center;
}

/* ═════════ 底部导航 ═════════ */

#tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(10, 10, 15, 0.82);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--dim-2);
  font-size: 10.5px;
}
.tab svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.tab.is-active { color: var(--accent); }
.tab.is-active svg { stroke: var(--accent); }

/* ═════════ 详情页 ═════════ */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: calc(24px + var(--safe-b));
}
.sheet.open { transform: translateY(0); }

.sheet-back {
  position: fixed;
  top: calc(var(--safe-t) + 10px);
  left: 14px;
  z-index: 3;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(12, 12, 18, 0.62);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.sheet-back svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }

.d-hero {
  position: relative;
  height: 46vh;
  min-height: 300px;
  overflow: hidden;
}
.d-hero > img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(1.05);
}
.d-hero-fade {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--bg) 2%, rgba(8, 8, 12, 0.55) 34%, rgba(8, 8, 12, 0.15) 62%, rgba(8, 8, 12, 0.55) 100%);
}
.d-hero-meta {
  position: absolute;
  left: 18px; right: 18px; bottom: 14px;
}
.d-hero-meta h1 {
  margin: 0 0 7px;
  font-size: 22px;
  font-weight: 720;
  line-height: 1.24;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
}
.d-sub { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--dim); }
.d-sub .score { color: var(--accent-2); font-weight: 700; }

.d-body { padding: 4px 18px 0; }
.d-actions { display: flex; gap: 10px; margin-top: 6px; }
.btn-primary {
  flex: 1;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 15.5px;
  font-weight: 650;
  box-shadow: 0 8px 24px rgba(255, 79, 110, 0.28);
}
.btn-primary svg { width: 19px; height: 19px; fill: currentColor; }
.btn-ghost {
  width: 100px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--dim);
  font-size: 14px;
}
.btn-ghost svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.btn-ghost.on { color: var(--accent); border-color: rgba(255, 79, 110, 0.4); }
.btn-ghost.on svg { fill: currentColor; stroke: none; }

.d-desc {
  margin: 16px 0 4px;
  font-size: 13.5px;
  line-height: 1.62;
  color: #b6b6c4;
}

.d-eplist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
  gap: 9px;
  margin-top: 18px;
}
.d-eplist button {
  height: 42px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--dim);
  font-size: 13.5px;
  font-weight: 550;
}
.d-eplist button.on {
  background: rgba(255, 79, 110, 0.14);
  border-color: rgba(255, 79, 110, 0.5);
  color: var(--accent);
}

/* ══════════════════════════════════════════════════════════════
   播放器舞台
   全屏与小窗是同一个容器，只改几何 → 视频永不重建，切小窗不卡不断
   ══════════════════════════════════════════════════════════════ */

.stage {
  position: fixed;
  z-index: 70;
  inset: 0;
  background: #000;
  transition: left 0.28s cubic-bezier(0.32, 0.72, 0, 1),
              top 0.28s cubic-bezier(0.32, 0.72, 0, 1),
              width 0.28s cubic-bezier(0.32, 0.72, 0, 1),
              height 0.28s cubic-bezier(0.32, 0.72, 0, 1),
              border-radius 0.28s cubic-bezier(0.32, 0.72, 0, 1),
              box-shadow 0.28s;
  overflow: hidden;
  touch-action: manipulation;
}
.stage-inner { position: absolute; inset: 0; }

#video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

.stage-scrim {
  position: absolute;
  left: 0; right: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.stage-scrim.top {
  top: 0; height: 140px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent);
}
.stage-scrim.bottom {
  bottom: 0; height: 190px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.86), transparent);
}

.stage.ui-hidden .stage-top,
.stage.ui-hidden .stage-bottom,
.stage.ui-hidden .stage-scrim,
.stage.ui-hidden .center-play { opacity: 0; pointer-events: none; }

.stage-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(var(--safe-t) + 10px) 12px 10px;
  transition: opacity 0.25s;
}
.stage-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(20, 20, 26, 0.5);
  backdrop-filter: blur(12px);
  flex: none;
}
.stage-btn svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stage-title { flex: 1; min-width: 0; }
.stage-title b {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}
.stage-title small { font-size: 11px; color: rgba(255, 255, 255, 0.6); }

.center-play {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 66px; height: 66px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(16, 16, 22, 0.42);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: opacity 0.22s, transform 0.22s;
}
.center-play svg { width: 26px; height: 26px; fill: #fff; }
.center-play .ic-pause { display: none; }
.stage.is-playing .center-play { opacity: 0; pointer-events: none; transform: translate(-50%, -50%) scale(0.86); }
.stage.is-playing .center-play .ic-play { display: none; }
.stage.is-playing .center-play .ic-pause { display: block; }
.stage:not(.is-playing) #btn-play .ic-play { display: block; }
.stage.is-playing #btn-play .ic-play { display: none; }
.stage.is-playing #btn-play .ic-pause { display: block; }
#btn-play .ic-pause { display: none; }

.spinner {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.spinner.show { opacity: 1; }
.spinner span {
  display: block;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.18);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.stage-bottom {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0 14px calc(10px + var(--safe-b));
  transition: opacity 0.25s;
}
.seek-row { display: flex; align-items: center; gap: 9px; }
.seek-row .t {
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.72);
  min-width: 34px;
  text-align: center;
}
.seek {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 22px;
  background: transparent;
  touch-action: none;
}
.seek::-webkit-slider-runnable-track {
  height: 3.5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.22);
}
.seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #fff;
  margin-top: -4.75px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}
.seek::-moz-range-track { height: 3.5px; border-radius: 3px; background: rgba(255, 255, 255, 0.22); }
.seek::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: #fff; }
.seek { background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--p, 0%), transparent var(--p, 0%)) no-repeat; background-size: 100% 3.5px; background-position: 0 center; }

.ctrl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  margin-top: 2px;
}
.ctrl {
  width: 42px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.9);
}
.ctrl svg { width: 21px; height: 21px; fill: currentColor; }
.ctrl svg[viewBox] path[stroke], .ctrl#btn-prev svg, .ctrl#btn-next svg, .ctrl#btn-eps svg, .ctrl#btn-pip svg, .ctrl#btn-mini svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ctrl#btn-play svg { fill: rgba(255, 255, 255, 0.96); }
.ctrl.text { font-size: 12px; font-weight: 600; letter-spacing: 0.01em; width: auto; padding: 0 6px; font-variant-numeric: tabular-nums; }
.ctrl:active { background: rgba(255, 255, 255, 0.08); }

/* ─────── 选集面板 ─────── */

.ep-panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  max-height: 58%;
  display: flex;
  flex-direction: column;
  background: rgba(12, 12, 18, 0.95);
  backdrop-filter: blur(26px);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
  animation: panel-up 0.26s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes panel-up { from { transform: translateY(100%); } }
.ep-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px 8px;
}
.ep-panel-head b { font-size: 15px; font-weight: 650; }
.ep-panel-head button { font-size: 22px; color: var(--dim); line-height: 1; }
.ep-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 9px;
  padding: 6px 16px 18px;
  overflow-y: auto;
}
.ep-panel-grid button {
  height: 40px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--dim);
  font-size: 13px;
}
.ep-panel-grid button.on {
  background: rgba(255, 79, 110, 0.16);
  border-color: rgba(255, 79, 110, 0.55);
  color: var(--accent);
  font-weight: 650;
}

/* ══════════════════════════════════════════════════════════════
   小窗（应用内悬浮）
   ══════════════════════════════════════════════════════════════ */

.stage.mini {
  inset: auto;
  left: auto;
  top: auto;
  right: 12px;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px);
  width: min(52vw, 320px);
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(255, 255, 255, 0.09);
  background: #000;
  touch-action: none;
  cursor: grab;
}
.stage.mini.dragging { transition: none; cursor: grabbing; }
.stage.mini .stage-top,
.stage.mini .stage-bottom,
.stage.mini .stage-scrim,
.stage.mini .center-play,
.stage.mini .ep-panel { display: none; }
.stage.mini .mini-bar { display: flex; }

.mini-bar {
  display: none;
  position: absolute;
  left: 0; right: 0; bottom: 0;
  align-items: center;
  gap: 4px;
  padding: 6px 7px 6px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.1));
}
.mini-title {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.86);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-btn {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  flex: none;
}
.mini-btn svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.mini-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2.5px;
  background: rgba(255, 255, 255, 0.16);
  display: none;
}
.stage.mini .mini-progress { display: block; }
.mini-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* ═════════ Toast ═════════ */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 28px);
  transform: translateX(-50%) translateY(8px);
  z-index: 90;
  max-width: 82vw;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(24, 24, 32, 0.94);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
  opacity: 0;
  transition: opacity 0.22s, transform 0.22s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ═════════ 骨架屏 ═════════ */

.sk {
  border-radius: 13px;
  background: linear-gradient(100deg, var(--surface-2) 30%, #20202b 50%, var(--surface-2) 70%);
  background-size: 220% 100%;
  animation: sk 1.3s ease-in-out infinite;
}
@keyframes sk { from { background-position: 120% 0; } to { background-position: -80% 0; } }
.sk-card { aspect-ratio: 3 / 4; }

.sentinel { height: 1px; }
.load-more {
  text-align: center;
  padding: 18px;
  font-size: 12.5px;
  color: var(--dim-2);
}

@media (min-width: 620px) {
  .grid { grid-template-columns: repeat(5, 1fr); }
  .banner { flex-basis: 46%; }
  .cards .card { flex-basis: 140px; }
}

/* ═════════ 刚更新 / 资源同步 ═════════ */

.upd-count {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 9px;
  font-size: 10.5px;
  line-height: 16px;
  font-weight: 700;
  text-align: center;
  vertical-align: 1px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.upd-tag {
  position: absolute;
  left: 6px;
  top: 6px;
  padding: 1px 6px;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .3px;
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.upd-tag.is-new { background: rgba(255, 62, 92, .86); }
.upd-tag.is-more { background: rgba(255, 152, 56, .86); }

.sync-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  padding: 4px 14px;
}
.sync-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.sync-line:last-child { border-bottom: 0; }
.sync-line span { color: var(--dim); }
.sync-line b { font-weight: 600; font-variant-numeric: tabular-nums; }
.sync-line b.bad { color: #ff6b81; }

.tip-small {
  margin: 10px 2px 0;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--dim);
}

/* 从主屏快捷方式进来时，短暂高亮目标区块 */
.block.flash { animation: blkflash 1.3s ease; }
@keyframes blkflash {
  0% { box-shadow: inset 0 0 0 1px rgba(255,79,110,0); }
  30% { box-shadow: inset 0 0 0 1px rgba(255,79,110,.55); }
  100% { box-shadow: inset 0 0 0 1px rgba(255,79,110,0); }
}

/* 离线 / 连不上本机的提示条 */
.offline-bar {
  position: fixed;
  left: 50%;
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 14px);
  max-width: calc(100vw - 36px);
  padding: 9px 15px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
  color: #ffd9df;
  background: rgba(120, 22, 40, .92);
  border: 1px solid rgba(255, 79, 110, .38);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s;
  z-index: 60;
}
.offline-bar.show { opacity: 1; transform: translate(-50%, 0); }
