:root {
  color-scheme: light;
  --bg: #fff;
  --txt: #202124;
  --sub: #85878c;
  --line: #ededee;
  --surface: #f5f5f6;
  --red: #d93645;
  --red-soft: #fceef0;
  --viewport-height: 100vh;
  --inset-top: env(safe-area-inset-top, 0px);
  --inset-bottom: env(safe-area-inset-bottom, 0px);
  --inset-left: env(safe-area-inset-left, 0px);
  --inset-right: env(safe-area-inset-right, 0px);
  --safe-top: clamp(0px, var(--inset-top), min(64px, calc(var(--viewport-height) * .1)));
  --safe-bottom: clamp(0px, var(--inset-bottom), min(48px, calc(var(--viewport-height) * .1)));
  --safe-left: clamp(0px, var(--inset-left), min(64px, 10vw));
  --safe-right: clamp(0px, var(--inset-right), min(64px, 10vw));
  --tabbar-height: 59px;
}
@supports (height: 100dvh) {
  :root { --viewport-height: 100dvh; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body { background: #f5f5f6; color: var(--txt); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input { font: inherit; appearance: none; -webkit-appearance: none; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; opacity: .4; }
button, a, input { touch-action: manipulation; }
button:active, a:active { opacity: .7; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
[hidden] { display: none !important; }
.app { max-width: 600px; margin: auto; min-height: var(--viewport-height); padding: 0 var(--safe-right) 0 var(--safe-left); background: var(--bg); }
#view { padding-bottom: calc(var(--tabbar-height) + var(--safe-bottom)); }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
#topnav { display: none; }
#tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 600px; height: calc(var(--tabbar-height) + var(--safe-bottom)); z-index: 60; display: flex; background: #fff; border-top: 1px solid var(--line); padding: 4px var(--safe-right) var(--safe-bottom) var(--safe-left); }
.tab { flex: 1; border: 0; background: none; text-decoration: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; color: var(--sub); font-size: 11px; }
.tab .ic { display: flex; }
.tab.on { color: var(--txt); font-weight: 600; }
.tab.on .ic { color: var(--red); }
.tab:focus-visible { background: var(--surface); }
.topbar, .searchbar { border-bottom: 1px solid var(--line); }
.topbar { display: flex; align-items: center; gap: 12px; padding: calc(12px + var(--safe-top)) 16px 12px; min-height: 56px; background: #fff; }
.topbar .ttl { font-size: 18px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back { flex-shrink: 0; border: 0; padding: 8px; margin-left: -8px; background: none; display: flex; }
.home-header { padding-bottom: 4px; }
.home-brand { font-size: 22px; font-weight: 650; letter-spacing: -.5px; white-space: nowrap; }
.searchpill { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--sub); background: var(--surface); border-radius: 6px; height: 40px; padding: 0 12px; flex: 1; min-width: 0; font-size: 13px; }
.searchpill .icon { width: 18px; height: 18px; }
.searchpill span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips { display: flex; gap: 24px; overflow-x: auto; scrollbar-width: none; padding: 0 16px; border-bottom: 1px solid var(--line); }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 15px 0 11px; font-size: 15px; color: #75777c; }
.chip.on { color: var(--txt); font-weight: 600; border-bottom-color: var(--red); }
.seclabel { display: flex; align-items: baseline; gap: 12px; padding: 20px 16px 12px; }
.seclabel b { font-size: 16px; font-weight: 600; }
.seclabel span { margin-left: auto; color: var(--sub); font-size: 12px; }
.grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px 10px; padding: 16px; }
.card { display: block; text-decoration: none; color: inherit; min-width: 0; }
.card .cover { display: block; width: 100%; aspect-ratio: 2/3; object-fit: cover; background: var(--surface); border-radius: 4px; }
.card .t { margin-top: 7px; font-size: 13px; font-weight: 500; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { display: flex; gap: 6px; justify-content: space-between; margin-top: 3px; color: var(--sub); font-size: 10px; min-height: 15px; }
.badge span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge .cnt { flex-shrink: 0; }
.loading, .empty, .errbox { padding: 40px 20px; text-align: center; color: var(--sub); font-size: 13px; line-height: 1.8; }
.empty p { margin: 8px 0 20px; }
.errbox { color: #a33b44; }
.errbox .btn { margin-top: 16px; }
.loader { width: 20px; height: 20px; margin: 0 auto 10px; border: 2px solid var(--line); border-top-color: var(--sub); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 5px; background: var(--red); color: #fff; padding: 11px 18px; min-height: 42px; font-size: 14px; font-weight: 500; }
.btn.gray { background: var(--surface); color: var(--txt); }
.btn.sm { padding: 9px 16px; }
.dwrap { padding: 16px; }
.dleft, .dright { min-width: 0; }
.dright { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 4px; }
.dhead { display: flex; gap: 18px; }
.dhead img { width: 112px; aspect-ratio: 2/3; object-fit: cover; border-radius: 4px; background: var(--surface); align-self: flex-start; }
.dinfo { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dinfo h1 { font-size: 20px; line-height: 1.4; margin: 1px 0 12px; font-weight: 600; }
.dmeta { display: flex; gap: 6px 8px; flex-wrap: wrap; }
.dmeta .tg { font-size: 11px; color: #72747a; }
.dmeta .tg + .tg::before { content: '·'; margin-right: 8px; color: #b8b8bc; }
.dact { margin-top: auto; padding-top: 16px; }
.dact .btn { width: 100%; }
.dintro { margin-top: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line); color: #72747a; font-size: 13px; line-height: 1.85; }
.dintro::before { content: '剧情简介'; display: block; font-size: 15px; font-weight: 600; color: var(--txt); margin-bottom: 8px; }
.more { border: 0; background: none; padding: 4px; color: var(--txt); font-size: 12px; }
.more:empty { display: none; }
.dright .seclabel { padding-left: 0; padding-right: 0; }
.eps { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; }
.ep { min-width: 0; min-height: 44px; padding: 10px 2px; border: 1px solid transparent; border-radius: 4px; background: var(--surface); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep.done { color: var(--red); }
.ep.busy { color: var(--red); background: var(--red-soft); border-color: #f1ccd1; }
.searchbar { display: flex; align-items: center; gap: 8px; padding: calc(12px + var(--safe-top)) 16px 12px; background: #fff; position: sticky; top: 0; z-index: 40; }
.search-field { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; height: 42px; background: var(--surface); border-radius: 6px; padding: 0 10px; color: var(--sub); }
.search-field .icon { width: 19px; height: 19px; }
.search-field input { min-width: 0; width: 100%; border: 0; outline: none; background: none; color: var(--txt); padding: 10px 0; }
.search-field:focus-within { outline: 1px solid #bfc0c4; }
.search-field input::placeholder { color: #96989d; }
.search-clear { border: 0; background: none; display: flex; padding: 8px 0 8px 4px; }
.searchbar .go { border: 0; background: none; padding: 10px 0 10px 8px; font-weight: 500; }
.stabs { display: flex; padding: 0 16px; gap: 28px; border-bottom: 1px solid var(--line); }
.stab { border: 0; border-bottom: 2px solid transparent; background: none; padding: 10px 0; color: var(--sub); font-size: 15px; }
.stab.on { color: var(--txt); font-weight: 600; border-bottom-color: var(--red); }
.hotline { padding: 16px 16px 0; color: var(--sub); font-size: 12px; }
.search-cover { display: block; position: relative; width: 100%; height: 0; padding-top: 150%; }
.card .search-cover .cover { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.search-suggestions { padding: 22px 16px; }
.search-suggestions h2 { font-size: 15px; margin: 0 0 16px; font-weight: 600; }
.suggestions { display: flex; gap: 10px; flex-wrap: wrap; }
.suggestions button { border: 0; border-radius: 4px; background: var(--surface); padding: 9px 18px; font-size: 13px; }
.mine-summary { padding: 16px 16px 24px; border-bottom: 8px solid var(--surface); display: flex; align-items: center; gap: 14px; }
.avatar { width: 48px; height: 48px; border-radius: 6px; display: grid; place-items: center; background: var(--surface); color: #777980; }
.avatar .icon { width: 26px; height: 26px; }
.mine-summary h1 { font-size: 17px; margin: 0 0 4px; font-weight: 600; }
.mine-summary p { margin: 0; color: var(--sub); font-size: 12px; }
.sec-h { padding: 20px 16px 4px; display: flex; align-items: baseline; justify-content: space-between; }
.sec-h h2 { margin: 0; font-size: 16px; font-weight: 600; }
.sec-h span { font-size: 12px; color: var(--sub); }
#histbox { padding: 0 16px; }
.histcard { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 16px 0; }
.hist-link { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; text-decoration: none; color: inherit; }
.histcard img { width: 56px; aspect-ratio: 2/3; object-fit: cover; border-radius: 4px; background: var(--surface); }
.histcard .hi { min-width: 0; flex: 1; }
.histcard .ht { font-size: 14px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.histcard .hs { font-size: 11px; color: var(--sub); margin-top: 7px; }
.histcard .continue { color: var(--red); font-size: 12px; margin-top: 6px; }
.histcard .del { border: 0; background: none; padding: 12px 4px 12px 12px; color: #a0a1a6; display: flex; }
.histcard .del .icon { width: 18px; height: 18px; pointer-events: none; }
#toast { position: fixed; top: 45%; left: 50%; transform: translate(-50%,-50%); background: #27282c; color: #fff; padding: 11px 18px; border-radius: 5px; font-size: 13px; z-index: 200; display: none; max-width: 85%; }
.is-player { background: #000; overflow: hidden; color-scheme: dark; }
.is-player .app { max-width: none; padding: 0; background: #000; }
.is-player #topnav, .is-player #tabbar { display: none !important; }
.is-player #view { padding: 0 !important; }
.pwrap { position: fixed; inset: 0 0 auto; width: 100%; height: var(--viewport-height); background: #000; color: #fff; z-index: 99; overflow: hidden; }
.pleft { position: relative; width: 100%; height: 100%; background: #000; overflow: hidden; }
.phead { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; touch-action: pan-x; }
.phead video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }

/* 顶部栏：返回 + 标题 + 全屏 */
.ptopbar { position: absolute; top: var(--safe-top); left: 0; right: 0; height: 48px; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 0 max(16px, var(--safe-right)) 0 max(16px, var(--safe-left)); pointer-events: none; }
.ptopbar > * { pointer-events: auto; }
.pback-hg { width: 36px; height: 36px; display: grid; place-items: center; background: rgba(0,0,0,0.3); backdrop-filter: blur(4px); border: 0; color: #fff; border-radius: 50%; }
.ptop-title { font-size: 15px; font-weight: 500; text-shadow: 0 1px 3px rgba(0,0,0,0.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.ptop-actions { display: flex; align-items: center; gap: 8px; }
.ptop-btn { width: 36px; height: 36px; display: grid; place-items: center; background: rgba(0,0,0,0.3); backdrop-filter: blur(4px); border: 0; color: #fff; border-radius: 50%; }

/* 播放状态提示条 */
.pstatebar { position: absolute; top: calc(52px + var(--safe-top)); left: max(16px, var(--safe-left)); right: max(6px, var(--safe-right)); z-index: 10; display: flex; align-items: center; gap: 8px; pointer-events: none; }
#pst { min-width: 0; flex: 0 1 auto; }
#pst:not(:empty) { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); padding: 5px 12px; border-radius: 14px; font-size: 12px; color: #ff861b; font-weight: 500; }

/* 中间大播放暂停反馈图标 (暂停时居中微透显示) */
.play-center-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 64px; height: 64px; background: rgba(0,0,0,0.45); backdrop-filter: blur(4px); border-radius: 50%; display: grid; place-items: center; z-index: 8; pointer-events: auto; cursor: pointer; transition: opacity .2s, transform .2s; }
.play-center-btn svg { width: 32px; height: 32px; fill: #fff; margin-left: 4px; }
.play-center-btn.playing { opacity: 0; pointer-events: none; transform: translate(-50%, -50%) scale(0.8); }

/* 底部信息层与控制栏 */
.pbottom-info { position: absolute; left: 0; right: 0; bottom: 0; z-index: 12; padding: 30px max(16px, var(--safe-right)) max(14px, var(--safe-bottom)) max(16px, var(--safe-left)); background: #101010; pointer-events: none; }
.pbottom-info > * { pointer-events: auto; }
.pbottom-text { margin-bottom: 8px; min-width: 0; }
.pbottom-title { font-size: 16px; font-weight: 600; line-height: 1.4; text-shadow: 0 1px 3px rgba(0,0,0,0.8); display: flex; align-items: center; gap: 8px; }
.pbottom-title > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbottom-badge { flex-shrink: 0; white-space: nowrap; font-size: 11px; font-weight: normal; background: #ff861b; color: #fff; padding: 1px 6px; border-radius: 4px; }
.pbottom-desc { font-size: 13px; color: rgba(255,255,255,0.85); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }

/* 播放器进度条 (红果特色：沉浸滑轨) */
.seek { height: 18px; display: flex; align-items: center; cursor: pointer; touch-action: none; margin-bottom: 6px; }
.seek-track { position: relative; width: 100%; height: 3px; background: rgba(255,255,255,0.25); border-radius: 2px; }
.seek-track i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; }
.seek-track #pbuffer { background: rgba(255,255,255,0.4); }
.seek-track #pprogress { background: #ff861b; }
.seek-track b { position: absolute; top: 50%; left: 0; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 4px rgba(0,0,0,0.5); transform: translate(-50%, -50%); transition: transform .1s; }
.seek:hover .seek-track b, .seek:active .seek-track b { transform: translate(-50%, -50%) scale(1.6); }

/* 底部工具条：时间、倍速、选集胶囊 */
.pfooter-bar { display: flex; flex-wrap: nowrap; gap: 8px; align-items: center; justify-content: space-between; min-width: 0; font-size: 12px; color: rgba(255,255,255,0.9); }
.pfooter-left { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.ptime-text { font-variant-numeric: tabular-nums; font-size: 11px; opacity: 0.85; white-space: nowrap; }
.prate-wrap { position: relative; flex-shrink: 0; }
.prate-menu { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); z-index: 20; display: flex; flex-direction: column; gap: 4px; width: 88px; max-height: max(0px, calc(var(--viewport-height) - var(--safe-top) - var(--safe-bottom) - 100px)); overflow-y: auto; overscroll-behavior: contain; padding: 6px; border: 1px solid rgba(255,255,255,0.15); border-radius: 10px; background: rgba(28,28,30,0.96); box-shadow: 0 4px 20px rgba(0,0,0,0.4); }
.prate-option { flex-shrink: 0; border: 0; border-radius: 6px; background: transparent; color: #fff; min-height: 32px; padding: 6px 10px; font-size: 12px; white-space: nowrap; }
.prate-option:hover, .prate-option[aria-pressed="true"] { background: #ff861b; color: #fff; }
.prate-btn, .pquality-btn { border: 0; background: rgba(255,255,255,0.12); color: #fff; padding: 2px 8px; border-radius: 10px; font-size: 11px; cursor: pointer; }
.pquality-wrap { position: relative; flex-shrink: 0; }
.pquality-menu { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); z-index: 20; display: flex; flex-direction: column; gap: 4px; width: 88px; max-height: calc(var(--viewport-height) - var(--safe-top) - var(--safe-bottom) - 100px); overflow-y: auto; padding: 6px; border: 1px solid rgba(255,255,255,0.15); border-radius: 10px; background: rgba(28,28,30,0.96); }
.pquality-option { border: 0; border-radius: 6px; background: transparent; color: #fff; min-height: 32px; padding: 6px 10px; font-size: 12px; white-space: nowrap; }
.pquality-option:hover, .pquality-option[aria-pressed="true"] { background: #ff861b; color: #fff; }
.pmute-btn { border: 0; background: transparent; color: #fff; font-size: 11px; padding: 2px 4px; cursor: pointer; opacity: 0.85; }
.pplay-btn { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; padding: 6px; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; opacity: 0.85; }
.pplay-btn svg { width: 20px; height: 20px; fill: currentColor; }
.pplay-btn:hover { opacity: 1; background: rgba(255,255,255,0.12); }
.pplay-btn:focus-visible { outline: 2px solid #ff861b; outline-offset: 2px; }
.pep-capsule { display: inline-flex; flex: 0 0 auto; flex-shrink: 0; width: max-content; max-width: 100%; white-space: nowrap; word-break: keep-all; overflow: hidden; align-items: center; gap: 6px; background: rgba(255,255,255,0.18); backdrop-filter: blur(6px); border: 0; color: #fff; font-size: 12px; padding: 5px 14px; border-radius: 16px; font-weight: 500; cursor: pointer; }
.pep-capsule span { display: block; white-space: nowrap; word-break: keep-all; }
.pep-capsule svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 2; fill: none; }

/* 准备/重试面板提示 */
#pact:empty { display: none; }
.player-actions { flex: 0 0 auto; margin-left: auto; display: flex; align-items: center; pointer-events: none; }
.player-actions > * { pointer-events: auto; }
#pact .player-action-icon { display: grid; place-items: center; width: 40px; height: 40px; padding: 9px; background: transparent; color: rgba(255,255,255,.88); border: 0; border-radius: 50%; }
.player-action-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 2px #0008); }

/* 选集底部弹窗 (高保真还原红果样式) */
.sheet-mask { position: absolute; inset: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); border: 0; z-index: 100; backdrop-filter: blur(2px); }
.pright { display: none; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 600px; min-width: 0; height: 65%; max-height: calc(100% - var(--safe-top)); overflow-y: auto; background: #1c1c1e; color: #fff; color-scheme: dark; border-radius: 16px 16px 0 0; padding: 12px max(16px, var(--safe-right)) max(16px, var(--safe-bottom)) max(16px, var(--safe-left)); z-index: 101; overscroll-behavior: contain; touch-action: pan-y; }
.pright.open { display: flex; flex-direction: column; }
.sheet-handle { width: 36px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.25); margin: 0 auto 12px; flex-shrink: 0; }
.sheet-header-hg { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-shrink: 0; }
.sheet-title-area { display: flex; min-width: 0; align-items: baseline; gap: 8px; }
.sheet-title-area h3 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; font-size: 16px; font-weight: 600; color: #fff; }
.sheet-title-area span { flex-shrink: 0; white-space: nowrap; font-size: 12px; color: rgba(255,255,255,0.5); }
.sheet-close-hg { flex-shrink: 0; }
.sheet-close-hg { width: 32px; height: 32px; display: grid; place-items: center; background: none; border: 0; color: rgba(255,255,255,0.6); border-radius: 50%; padding: 0; cursor: pointer; }

/* 选集范围Tabs */
.episode-ranges-hg { display: flex; gap: 10px; overflow-x: auto; margin-bottom: 12px; scrollbar-width: none; flex-shrink: 0; padding-bottom: 2px; }
.episode-ranges-hg::-webkit-scrollbar { display: none; }
.episode-ranges-hg button { border: 0; background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); padding: 5px 12px; border-radius: 12px; font-size: 12px; flex-shrink: 0; cursor: pointer; }
.episode-ranges-hg button.on { background: #ff861b; color: #fff; font-weight: 500; }

/* 选集九宫格网格 */
#peps { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); align-content: start; min-height: 0; gap: 10px; overflow-y: auto; flex: 1; }
#peps .ep { background: rgba(255,255,255,0.08); color: #fff; border: 1px solid transparent; border-radius: 8px; height: 46px; font-size: 15px; font-weight: 500; display: grid; place-items: center; cursor: pointer; transition: all .15s; }
#peps .ep:active { transform: scale(0.95); }
#peps .ep.busy { background: #ff861b; color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(255,134,27,0.4); }
.pwrap:fullscreen, .pwrap.is-fullscreen { width: 100%; height: 100%; }
.pwrap:-webkit-full-screen { width: 100%; height: 100%; }
.pwrap.video-landscape .phead video, .pwrap.video-portrait .phead video { object-fit: contain; object-position: center; }
.pwrap.controls-hidden .ptopbar,
.pwrap.controls-hidden .pstatebar,
.pwrap.controls-hidden .player-actions,
.pwrap.controls-hidden .play-center-btn,
.pwrap.controls-hidden .pbottom-info { visibility: hidden; }
.pwrap.controls-hidden :is(.ptopbar, .pstatebar, .player-actions, .play-center-btn, .pbottom-info),
.pwrap.controls-hidden :is(.ptopbar, .pstatebar, .player-actions, .play-center-btn, .pbottom-info) * { pointer-events: none; }
.pwrap.controls-hidden .prate-menu:not([hidden]),
.pwrap.controls-hidden .prate-menu:not([hidden]) *,
.pwrap.controls-hidden .pquality-menu:not([hidden]),
.pwrap.controls-hidden .pquality-menu:not([hidden]) * { visibility: visible; pointer-events: auto; }
@media (max-height: 480px) {
  .pbottom-info { padding-top: 12px; padding-bottom: max(6px, var(--safe-bottom)); }
  .pbottom-desc { display: none; }
  .pbottom-text { margin-bottom: 4px; }
  .seek { margin-bottom: 2px; }
  .pright { height: 85%; }
  .sheet-handle { margin-bottom: 8px; }
}
@media (min-width: 760px) {
  .app { max-width: 1120px; }
  #topnav { display: flex; align-items: center; gap: 40px; padding: var(--safe-top) 32px 0; height: calc(64px + var(--safe-top)); background: #fff; border-bottom: 1px solid var(--line); }
  #topnav .brand { font-size: 20px; font-weight: 600; color: var(--txt); text-decoration: none; }
  #topnav .tabs { display: flex; gap: 32px; height: 100%; }
  #topnav .tab { font-size: 14px; min-width: 32px; border-bottom: 2px solid transparent; padding-top: 2px; }
  #topnav .tab.on { border-bottom-color: var(--red); }
  .tn-right { margin-left: auto; width: 240px; }
  #tabbar { display: none; }
  #view { padding-bottom: var(--safe-bottom); }
  .home-header { display: none; }
  .topbar { padding: 20px 32px 12px; }
  .chips { padding: 0 32px; gap: 30px; }
  .chip { padding-top: 20px; padding-bottom: 15px; }
  .grid { grid-template-columns: repeat(6,minmax(0,1fr)); gap: 28px 16px; padding: 24px 32px; }
  .card .t { font-size: 14px; }
  .badge { font-size: 11px; }
  .dwrap { display: grid; grid-template-columns: 360px minmax(0,1fr); gap: 40px; padding: 16px 32px; }
  .dright .seclabel { padding-top: 0; }
  .dright .eps { grid-template-columns: repeat(6,minmax(0,1fr)); }
  .searchbar { position: static; max-width: 700px; padding: 24px 32px 16px; }
  .stabs { padding: 0 32px; }
  .hotline { padding-left: 32px; }
  .search-suggestions { padding: 28px 32px; }
  .mine-summary { margin: 8px 32px 0; padding: 16px 0 24px; border-bottom: 1px solid var(--line); }
  .sec-h { padding: 24px 32px 4px; }
  #histbox { padding: 0 32px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 36px; }
  #histbox .empty { grid-column: 1/-1; }
}
@media (max-width: 360px) {
  .home-brand { font-size: 19px; }
  .home-header { gap: 10px; }
  .searchpill { font-size: 12px; padding: 0 8px; }
  .dhead { gap: 12px; }
  .dhead img { width: 92px; }
  .dinfo h1 { font-size: 18px; }
  .pfooter-left { gap: 6px; }
  .pep-capsule { gap: 4px; padding-left: 8px; padding-right: 8px; }
}
/* 小说与短剧共用导航，内容样式独立。 */
.mode-switch { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.mode-switch a { text-decoration: none; color: var(--sub); padding: 8px 0; }
.mode-switch a.on { color: var(--txt); box-shadow: inset 0 -2px var(--red); }
#topnav .mode-switch .brand:not(.on) { color: var(--sub); }
.novel-back { color: inherit; text-decoration: none; }
.novel-rank-heading { margin: 20px 16px 0; padding: 22px; background: #f5f1e8; border-left: 3px solid #a38856; }
.novel-rank-heading small { color: #806b47; letter-spacing: 2px; }
.novel-rank-heading h1 { font-size: 22px; margin: 8px 0; }
.novel-rank-heading p { margin: 0; font-size: 12px; color: #787064; }
.novel-list { display: grid; gap: 0 28px; padding: 0 16px; }
.novel-card { display: flex; align-items: center; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; min-width: 0; }
.novel-cover { display: flex; flex-direction: column; justify-content: space-between; flex-shrink: 0; width: 88px; height: 126px; padding: 12px 10px; background: #eee7d9; border: 1px solid #e0d6c2; border-left: 4px solid #bca77f; color: #554833; overflow: hidden; }
.novel-cover small { display: block; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.novel-cover strong { font-family: Georgia, 'Songti SC', SimSun, serif; font-size: 16px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.novel-info { display: flex; flex-direction: column; min-width: 0; gap: 8px; }
.novel-info > strong { font-size: 16px; overflow-wrap: anywhere; }
.novel-info > small { color: var(--sub); }
.novel-info > span { color: #777; font-size: 12px; line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.novel-list-footer { padding: 28px 16px; text-align: center; color: var(--sub); }
.novel-detail { padding: 20px 16px; }
.novel-book-head { display: flex; gap: 20px; align-items: flex-start; }
.novel-book-head > div { min-width: 0; }
.novel-book-head .novel-cover { width: 110px; height: 160px; }
.novel-book-head h1 { font-size: 22px; margin: 0 0 12px; overflow-wrap: anywhere; }
.novel-book-head p { color: var(--sub); }
.novel-detail h2 { font-size: 17px; margin: 26px 0 12px; }
.novel-detail a.btn, .novel-reader a.btn, .novel-history a.btn { text-decoration: none; }
.novel-intro { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.9; color: #72747a; }
.novel-directory-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.novel-directory-head label { white-space: nowrap; font-size: 12px; color: var(--sub); }
.novel-directory-head input { width: 58px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 4px; color: var(--txt); background: var(--bg); }
.novel-chapters { display: grid; grid-template-columns: minmax(0, 1fr); }
.novel-chapters a { text-decoration: none; color: inherit; padding: 14px 6px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.novel-chapters a.on { color: var(--red); background: var(--red-soft); }
.novel-pagination { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 24px 0; }
.novel-pagination .btn { padding: 10px 12px; }
.novel-history { padding: 0 16px; }
.novel-history .novel-cover { width: 56px; height: 82px; padding: 6px; }
.novel-history .novel-cover strong { font-size: 12px; -webkit-line-clamp: 2; }
.novel-history .novel-cover small { font-size: 8px; }
.novel-reader { max-width: 780px; margin: auto; padding: 12px 20px 24px; }
.novel-reading-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-bottom: 24px; }
.novel-reading-tools .btn { padding: 8px 12px; }
.novel-reader-book, .novel-reader-note { color: var(--sub); font-size: 12px; }
.novel-reader h1 { font-size: 24px; margin: 16px 0 28px; overflow-wrap: anywhere; }
.novel-content { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 2; font-family: Georgia, 'Songti SC', SimSun, serif; }
body.novel-dark { --bg: #202226; --txt: #d3d1cc; --sub: #a09e99; --line: #393b40; --surface: #303238; background: #181a1e; color-scheme: dark; }
.novel-dark #topnav, .novel-dark #tabbar, .novel-dark .topbar { background: var(--bg); }
@media (min-width: 760px) {
  .novel-rank-heading { margin: 24px 32px 0; }
  .novel-list, .novel-history { padding: 0 32px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
  .novel-history > .empty { grid-column: 1 / -1; }
  .novel-detail { padding: 24px 32px; }
  .novel-chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
  .novel-reader { padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
