/*
 * LibreTV 手机网页版：视觉与电视版 Apple TV 风格一致（深色底、跟随内容的模糊背景、大圆角卡片、胶囊按钮），
 * 排版手机优先：手机上底部图标导航（像 iPhone 上的 Apple TV App），电脑宽屏才用电视版的顶部标签栏。
 */
:root {
  --bg: #0e1116;
  --surface: #1a1f27;
  --surface-high: #262d38;
  --accent: #4fd1c5;
  --text: #edeff3;
  --muted: #9aa7b8;
  --error: #ff8a80;
  --glass: rgba(255, 255, 255, 0.09);
  --glass-strong: rgba(255, 255, 255, 0.16);
  --chip-selected: rgba(255, 255, 255, 0.28);
  --radius: 12px;
  --side: 16px;
  --poster-w: 108px;
  --bottombar-h: 58px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
@media (min-width: 900px) {
  :root { --side: 40px; --poster-w: 150px; }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
/* 去掉手机上点按的延迟和双击放大 */
a, button, .chip, .pill, .item, .ep { touch-action: manipulation; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- 模糊背景 ---------- */
#backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--bg); }
#backdrop .layer {
  position: absolute; inset: -40px; background-size: cover; background-position: center;
  filter: blur(36px) saturate(1.2); opacity: 0; transition: opacity .6s ease; transform: scale(1.1);
}
#backdrop .layer.on { opacity: .45; }
#backdrop::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(14, 17, 22, .55) 0%, rgba(14, 17, 22, .82) 45%, var(--bg) 100%);
}

/* ---------- 导航：电脑顶部标签栏，手机底部图标栏 ---------- */
#tabbar {
  position: sticky; top: 0; z-index: 20; height: calc(60px + var(--safe-top)); padding-top: var(--safe-top);
  background: linear-gradient(180deg, rgba(0, 0, 0, .9), rgba(0, 0, 0, .55) 70%, rgba(0, 0, 0, 0));
  display: flex; align-items: center;
}
#tabs { display: flex; gap: 4px; padding: 0 var(--side); margin: 0 auto; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
#tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; flex: none; padding: 8px 16px; color: rgba(237, 239, 243, .62); font-size: 18px; border-radius: 999px; transition: color .2s, background .2s; }
.tab.on { color: #fff; font-weight: 700; }
.tab.on::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 22px; height: 3px; margin-left: -11px; border-radius: 2px; background: #fff; }

#bottombar { display: none; }
.btab { display: grid; justify-items: center; align-content: center; gap: 2px; font-size: 11px; color: rgba(237, 239, 243, .5); }
.btab svg { width: 25px; height: 25px; }
.btab.on { color: #fff; font-weight: 600; }

@media (max-width: 899px) {
  #tabbar { display: none; }
  #bottombar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--bottombar-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
    background: rgba(14, 17, 22, .86); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border-top: 1px solid rgba(255, 255, 255, .08);
  }
  body.subpage #bottombar { display: none; }
}

.back {
  position: fixed; z-index: 30; top: calc(10px + var(--safe-top)); left: 10px;
  width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: grid; place-items: center; font-size: 26px; line-height: 1; cursor: pointer;
}

main { padding: 8px 0 48px; min-height: 60vh; }
@media (max-width: 899px) {
  main { padding: calc(8px + var(--safe-top)) 0 calc(var(--bottombar-h) + var(--safe-bottom) + 24px); }
}
/* 详情、播放等二级页面和电视版一样全屏：不显示导航，只留左上角返回 */
body.subpage #tabbar { display: none; }
body.subpage main { padding-top: calc(62px + var(--safe-top)); padding-bottom: calc(32px + var(--safe-bottom)); }
body.subpage main:has(.player) { padding-top: var(--safe-top); }

.page { padding: 0 var(--side); }
.page-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; margin: 8px 0 14px; }
.page-title h1 { margin: 0; font-size: 28px; line-height: 1.2; letter-spacing: .5px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
@media (min-width: 900px) { .phone-only { display: none !important; } }

/* ---------- 胶囊按钮与标签 ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 20px; border: 0; border-radius: 999px;
  background: var(--glass-strong); color: #fff; font-weight: 600; cursor: pointer; white-space: nowrap; transition: transform .12s, background .2s, color .2s;
}
.pill.primary { background: #fff; color: #000; }
.pill.small { min-height: 34px; padding: 0 14px; font-size: 14px; }
.pill[disabled] { opacity: .45; pointer-events: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px;
  background: var(--glass); color: rgba(237, 239, 243, .88); cursor: pointer; white-space: nowrap; font-size: 14px; transition: background .2s, color .2s, transform .12s;
}
.chip.on { background: var(--chip-selected); color: #fff; font-weight: 700; }
.chips { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 0; overscroll-behavior-x: contain; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.filter-row { display: flex; align-items: center; gap: 10px; margin: 2px 0; }
.filter-row > .label { flex: none; color: var(--muted); font-size: 13px; width: 30px; }
.filter-row > .chips { flex: 1; min-width: 0; }
/* 横向滚动的标签行在手机上贴着右边缘滚动，看得出还能往右滑 */
@media (max-width: 899px) {
  .page > .chips, .page .filter-row > .chips, .bleed { margin-right: calc(var(--side) * -1); padding-right: var(--side); }
}

/* ---------- 海报卡片 ---------- */
.poster { display: block; width: var(--poster-w); flex: none; cursor: pointer; }
.grid .poster { width: auto; min-width: 0; }
.poster-img { position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden; background: var(--surface-high); transition: transform .2s ease, box-shadow .2s ease; }
.poster-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.poster-alt { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; text-align: center; color: var(--muted); font-size: 13px; }
.badge { position: absolute; top: 6px; right: 6px; padding: 0 6px; border-radius: 5px; background: rgba(0, 0, 0, .78); color: var(--accent); font-size: 12px; line-height: 20px; font-weight: 600; }
.poster-title { margin-top: 7px; font-size: 14px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poster-sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more-card .poster-img { display: grid; place-items: center; background: var(--glass); }
.more-card .poster-img span { display: grid; justify-items: center; gap: 4px; font-weight: 600; font-size: 14px; }
.more-card .poster-img b { font-size: 34px; line-height: 1; }

/* ---------- 横版「继续观看」卡片 ---------- */
.wide { position: relative; display: block; flex: none; width: 236px; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--surface-high); transition: transform .2s, box-shadow .2s; }
.grid-wide .wide { width: auto; }
.wide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wide .shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, .9)); }
.wide .info { position: absolute; left: 12px; right: 12px; bottom: 10px; }
.wide .info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wide .info span { font-size: 12px; color: rgba(255, 255, 255, .8); }
.progress { height: 3px; margin-top: 6px; border-radius: 2px; background: rgba(255, 255, 255, .33); overflow: hidden; }
.progress i { display: block; height: 100%; background: #fff; }
.wide .del { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .6); cursor: pointer; }

/* ---------- 行与网格 ---------- */
.section { margin: 18px 0 6px; }
.section > h2 { margin: 0 var(--side) 8px; font-size: 19px; font-weight: 700; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 var(--side) 8px; }
.section-head h2 { margin: 0; font-size: 19px; font-weight: 700; }
.section-head a { color: var(--muted); font-size: 14px; flex: none; }
.row { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--side); padding: 4px var(--side) 10px; scrollbar-width: none; overscroll-behavior-x: contain; }
.row::-webkit-scrollbar { display: none; }
.row > * { scroll-snap-align: start; }
.row.skeleton > div { width: var(--poster-w); aspect-ratio: 2 / 3; border-radius: var(--radius); background: var(--glass); flex: none; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.row-error { margin: 0 var(--side); display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 10px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 18px 14px; } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 22px 18px; } }
.grid-wide { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.sentinel { height: 1px; }
.status { color: var(--muted); font-size: 13px; margin: 8px 0; }
.empty { padding: 40px 0; text-align: center; color: var(--muted); }
.error-box { padding: 24px 0; display: grid; justify-items: start; gap: 12px; color: var(--muted); }

/* ---------- 首页焦点推荐 ---------- */
.hero { position: relative; margin: 0 0 4px; }
.hero-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.hero-track::-webkit-scrollbar { display: none; }
.slide { flex: none; width: 100%; scroll-snap-align: start; padding: 6px var(--side) 14px; }
.hero-card { position: relative; isolation: isolate; overflow: hidden; border-radius: 20px; display: flex; gap: 16px; align-items: flex-end; padding: 18px; min-height: 236px; background: var(--surface); }
.hero-bg { position: absolute; inset: -30px; z-index: -1; background-size: cover; background-position: center; filter: blur(26px) brightness(.55) saturate(1.3); transform: scale(1.1); }
.hero-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, .55)); }
.hero-card .thumb { flex: none; width: 108px; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden; background: var(--surface-high); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.hero-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-card .meta { min-width: 0; display: grid; gap: 6px; }
.hero-card h2 { margin: 0; font-size: 23px; line-height: 1.2; font-weight: 800; text-wrap: balance; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-card .sub { color: rgba(255, 255, 255, .8); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-card .actions { display: flex; gap: 8px; margin: 4px 0 0; flex-wrap: wrap; }
.hero-card .pill { min-height: 38px; padding: 0 16px; }
.dots { display: flex; gap: 6px; width: max-content; margin: -4px auto 4px; padding: 5px 8px; border-radius: 999px; background: rgba(0, 0, 0, .3); }
.dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .45); transition: width .25s, background .25s; }
.dots i.on { width: 16px; background: #fff; }
/* 电脑宽屏：和电视版一样整幅铺开，不要卡片底 */
@media (min-width: 900px) {
  .slide { padding: 20px var(--side) 26px; }
  .hero-card { background: transparent; overflow: visible; min-height: 360px; padding: 0; gap: 30px; align-items: center; }
  .hero-bg, .hero-card::after { display: none; }
  .hero-card .thumb { width: 190px; }
  .hero-card h2 { font-size: 46px; }
  .hero-card .sub { font-size: 17px; }
  .hero-card .pill { min-height: 44px; padding: 0 22px; }
}

/* 首页快捷入口（手机） */
.shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 6px 0 4px; }
.shortcut { display: grid; justify-items: center; gap: 6px; padding: 12px 4px; border-radius: 14px; background: var(--glass); font-size: 13px; transition: transform .12s, background .2s; }
.shortcut svg { width: 24px; height: 24px; color: var(--accent); }

/* ---------- 列表行（排行榜单、设置、直播频道、我的） ---------- */
.list { display: grid; gap: 8px; }
.item { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 12px 16px; border-radius: var(--radius); background: var(--glass); cursor: pointer; border: 0; width: 100%; text-align: left; transition: background .2s, color .2s, transform .12s; }
.item.on { background: var(--chip-selected); font-weight: 700; }
.item .grow { flex: 1; min-width: 0; }
.item .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.item .end { flex: none; font-weight: 600; }
.item .chev { flex: none; color: var(--muted); font-size: 20px; line-height: 1; }
.item > svg { flex: none; width: 22px; height: 22px; color: var(--accent); }
.ok { color: var(--accent); }
.bad { color: var(--error); }

/* 左右两栏（排行榜单、直播分组）只在电脑宽屏；手机上分组是一排可横滑的标签 */
.split { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.split > * { min-width: 0; }
@media (min-width: 900px) {
  .split { grid-template-columns: 210px minmax(0, 1fr); align-items: start; }
  .split .side { position: sticky; top: 70px; }
}
@media (max-width: 899px) {
  .split .side { margin-right: calc(var(--side) * -1); }
  .split .side .list { display: flex; overflow-x: auto; scrollbar-width: none; padding-right: var(--side); }
  .split .side .list::-webkit-scrollbar { display: none; }
  .split .side .item { flex: none; width: auto; min-height: 36px; white-space: nowrap; padding: 0 16px; border-radius: 999px; font-size: 14px; }
}
.channels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .channels { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); } }

/* ---------- 搜索框 ---------- */
.searchbar { display: flex; gap: 10px; }
.searchbar input {
  flex: 1; min-width: 0; height: 46px; padding: 0 20px; border-radius: 999px; border: 2px solid transparent; outline: none;
  background: rgba(255, 255, 255, .12); color: var(--text); font-size: 16px; -webkit-appearance: none; appearance: none;
}
.searchbar input:focus { background: #fff; color: #000; border-color: #fff; }
.searchbar .pill { min-height: 46px; }

/* ---------- 详情 ---------- */
.detail-head { display: flex; gap: 16px; align-items: flex-start; margin: 4px 0 12px; }
.detail-head .cover { flex: none; width: 112px; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden; background: var(--surface-high); position: relative; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.detail-head .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-head h1 { margin: 0 0 6px; font-size: 22px; line-height: 1.25; }
.detail-head .meta { color: rgba(255, 255, 255, .8); font-size: 13px; }
.detail-head .people { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.desc { color: rgba(255, 255, 255, .86); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.desc.open { -webkit-line-clamp: unset; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.actions > .pill.primary { flex: 1 1 auto; }
@media (min-width: 900px) { .actions > .pill.primary { flex: none; } }
.block { margin: 16px 0; }
.block > h3 { margin: 0 0 8px; font-size: 15px; color: var(--muted); font-weight: 600; }
.episodes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .episodes { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); } }
.ep { display: grid; place-items: center; height: 42px; border: 0; border-radius: 10px; background: var(--glass); color: var(--text); cursor: pointer; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; transition: background .2s, color .2s, transform .12s; }
.ep.watched { color: var(--accent); }
.ep.on { background: var(--chip-selected); font-weight: 700; color: #fff; }
@media (min-width: 900px) { .detail-head .cover { width: 200px; } .detail-head h1 { font-size: 40px; } .detail-head .meta { font-size: 15px; } }

/* ---------- 播放（B 站式控制条、手势、横屏全屏） ---------- */
.player { position: sticky; top: var(--safe-top); z-index: 25; background: #000; margin: 0 calc(var(--side) * -1); }
/* 添加到主屏幕后状态栏是透明的：视频吸顶时状态栏后面补黑 */
.player::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: var(--safe-top); background: #000; }
.stage { position: relative; background: #000; overflow: hidden; }
.player video { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: 70vh; background: #000; }
.player .overlay { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; pointer-events: none; color: #fff; text-align: center; padding: 20px; }
.player .overlay .box { pointer-events: auto; background: rgba(0, 0, 0, .78); padding: 14px 18px; border-radius: 14px; display: grid; gap: 10px; justify-items: center; max-width: 92%; font-size: 14px; }
@media (min-width: 900px) { .player { margin: 0; border-radius: 14px; overflow: hidden; position: relative; } }
main:has(.player) ~ .back { display: none; }
.panel-tabs { margin-top: 10px; }
.osd { position: absolute; left: 12px; bottom: 56px; z-index: 1; padding: 8px 14px; border-radius: 12px; background: rgba(0, 0, 0, .72); pointer-events: none; transition: opacity .4s; }
.osd.hide { opacity: 0; }
.osd b { color: var(--accent); margin-right: 10px; font-size: 20px; }
.osd .big { font-size: 18px; font-weight: 700; }

.pc { position: absolute; inset: 0; z-index: 2; color: #fff; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pc-gesture { position: absolute; inset: 0; touch-action: pan-y; }
.player.is-fs .pc-gesture { touch-action: none; }
.pc button { border: 0; background: none; color: #fff; padding: 6px; display: grid; place-items: center; cursor: pointer; flex: none; }
.pc button svg { width: 24px; height: 24px; }
.pc-top, .pc-bottom { position: absolute; left: 0; right: 0; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 6px 8px; transition: opacity .25s; }
.pc-top { top: 0; background: linear-gradient(rgba(0, 0, 0, .7), rgba(0, 0, 0, 0)); padding-bottom: 18px; }
.pc-bottom { bottom: 0; background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .78)); padding-top: 22px; }
.player:not(.chrome-on) .pc-top, .player:not(.chrome-on) .pc-bottom { opacity: 0; pointer-events: none; }
.pc-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; font-weight: 600; }
.pc-time { flex: none; font-size: 12px; font-variant-numeric: tabular-nums; min-width: 40px; text-align: center; }
.pc-fill { flex: 1; }
.pc-text { font-size: 14px; font-weight: 600; padding: 6px 8px !important; }
.pc-live { flex: none; font-size: 12px; line-height: 20px; padding: 0 8px; border-radius: 4px; background: #e5484d; font-weight: 700; }
.pc-bar { position: relative; flex: 1; min-width: 60px; height: 28px; cursor: pointer; touch-action: none; }
.pc-bar::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; background: rgba(255, 255, 255, .3); }
.pc-buf, .pc-played { position: absolute; left: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; width: 0; }
.pc-buf { background: rgba(255, 255, 255, .5); }
.pc-played { background: var(--accent); }
.pc-thumb { position: absolute; top: 50%; left: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(79, 209, 197, .35); }
.pc-center { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; pointer-events: none; }
.pc .pc-big { pointer-events: auto; width: 64px; height: 64px; border-radius: 50%; background: rgba(0, 0, 0, .45); }
.pc .pc-big svg { width: 30px; height: 30px; }
.player.playing .pc-big { display: none; }
.pc-spinner { display: none; width: 42px; height: 42px; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.player.loading .pc-spinner { display: block; }
.player.loading .pc-big { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.pc-hint { position: absolute; top: 24%; left: 50%; z-index: 3; transform: translateX(-50%); padding: 8px 16px; border-radius: 10px; background: rgba(0, 0, 0, .7); font-size: 15px; font-weight: 600; white-space: nowrap; display: none; pointer-events: none; }
.pc-hint.on { display: block; }
.pc-menu { position: absolute; top: 0; right: 0; bottom: 0; z-index: 5; width: min(46%, 380px); padding: 16px; overflow-y: auto; background: rgba(10, 12, 16, .94); display: none; overscroll-behavior: contain; }
.pc-menu.on { display: block; }
.pc-menu h4 { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.pc-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.pc-opts.wide { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.pc .pc-opt { display: block; height: 40px; border-radius: 10px; background: rgba(255, 255, 255, .1); font-size: 14px; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.pc .pc-opt.on { background: rgba(79, 209, 197, .22); color: var(--accent); font-weight: 700; }
.player:not(.is-fs) .pc-fs-only { display: none; }
.pc button[hidden] { display: none; }
@media (max-width: 420px) { .player:not(.is-fs) .pc-speed { display: none; } }

/* 全屏：真全屏或铺满可视区域；竖着拿手机又锁不了横屏时，把画面转 90° 铺满（和 B 站手机网页一样） */
.player.is-fs { position: fixed; inset: 0; z-index: 100; margin: 0; border-radius: 0; background: #000; }
.player.is-fs .stage { position: absolute; inset: 0; }
.player.is-fs video { width: 100%; height: 100%; max-height: none; aspect-ratio: auto; }
.player.is-fs.fs-rotate .stage { inset: auto; top: 0; left: 0; width: 100vh; height: 100vw; width: 100dvh; height: 100dvw; transform-origin: top left; transform: rotate(90deg) translateY(-100%); }
.player.is-fs .pc-top { padding: max(10px, env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) 24px max(14px, env(safe-area-inset-left, 0px)); }
.player.is-fs .pc-bottom { padding: 28px max(14px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px)); gap: 10px; }
.player.is-fs .pc-title { font-size: 17px; }
.player.is-fs .osd { bottom: 76px; left: 24px; }
body.no-scroll { overflow: hidden; }
body.no-scroll .back { display: none; }

/* ---------- 提示与输入 ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); transform: translateX(-50%) translateY(20px);
  padding: 10px 18px; border-radius: 999px; background: rgba(40, 44, 52, .96); color: #fff; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 50; max-width: 90vw; text-align: center;
}
@media (max-width: 899px) { body:not(.subpage) #toast { bottom: calc(var(--bottombar-h) + 20px + var(--safe-bottom)); } }
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.input { height: 44px; padding: 0 16px; border-radius: 999px; border: 0; outline: none; background: rgba(255, 255, 255, .12); color: var(--text); font-size: 16px; flex: 1; min-width: 0; }
.input:focus { background: #fff; color: #000; }
.inline { display: flex; gap: 10px; align-items: center; }
@media (max-width: 559px) { .inline { flex-wrap: wrap; } .inline .input { flex-basis: 100%; } }

/* ---------- 交互反馈：触屏用按下效果，只有鼠标才有悬停高亮（触屏上悬停会卡住） ---------- */
.pill:active, .chip:active, .item:active, .ep:active, .shortcut:active { transform: scale(.96); }
.poster:active .poster-img, .wide:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) {
  .tab:hover { color: var(--text); background: var(--glass); }
  .pill:hover { background: #fff; color: #000; }
  .chip:hover { background: #fff; color: #000; }
  .poster:hover .poster-img { transform: scale(1.05); box-shadow: 0 0 0 3px rgba(255, 255, 255, .9); }
  .more-card:hover .poster-img { background: #fff; color: #000; }
  .wide:hover { transform: scale(1.04); box-shadow: 0 0 0 3px rgba(255, 255, 255, .9); }
  .item:hover { background: #fff; color: #000; }
  .item:hover .muted, .item:hover .sub, .item:hover .chev { color: #333; }
  .ep:hover { background: #fff; color: #000; }
  .shortcut:hover { background: var(--glass-strong); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
