* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0b0e14; --bg2: #111722; --card: #151c29; --card2: #1b2434;
  --line: #232d40; --txt: #e8edf6; --sub: #8b96ab; --accent: #4f8cff;
  --accent2: #7c5cff; --gold: #ffb84d; --ok: #34c77b; --warn: #ff6b5e;
  --radius: 14px;
}
html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei UI", "PingFang SC", "Segoe UI", sans-serif;
  background: radial-gradient(1200px 800px at 80% -10%, #16233b 0%, var(--bg) 55%);
  color: var(--txt); overflow: hidden; user-select: none;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2c3a52; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- é¡¶æ � ---------- */
header {
  display: flex; align-items: center; gap: 18px; padding: 14px 22px;
  border-bottom: 1px solid var(--line); background: rgba(11,14,20,.85);
  backdrop-filter: blur(10px); position: relative; z-index: 30;
}
.logo { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 700; letter-spacing: 1px; }
.logo .badge {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-size: 18px;
  box-shadow: 0 4px 14px rgba(79,140,255,.35);
}
nav { display: flex; gap: 4px; }
nav .tab {
  padding: 8px 18px; border-radius: 10px; cursor: pointer; color: var(--sub);
  font-size: 15px; transition: .2s; border: 1px solid transparent;
}
nav .tab:hover { color: var(--txt); background: var(--card); }
nav .tab.active { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 4px 14px rgba(79,140,255,.3); }
header .spacer { flex: 1; }
.searchbox { display: flex; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; }
.searchbox input { background: none; border: none; outline: none; color: var(--txt); padding: 8px 6px; width: 220px; font-size: 14px; }
.searchbox .icon { cursor: pointer; color: var(--sub); font-size: 18px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }

/* ---------- ä¸»åŒº ---------- */
main { height: calc(100vh - 62px); position: relative; }
.view { position: absolute; inset: 0; display: none; padding: 18px 22px; overflow: hidden; }
.view.active { display: flex; }

/* ---------- ç‚¹æ’­ ---------- */
.vod-layout { display: flex; gap: 16px; height: 100%; }
.vod-left { width: 200px; flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
.panel .phead { padding: 12px 16px; font-size: 14px; font-weight: 600; color: var(--sub); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.source-list { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.source-item {
  padding: 10px 14px; border-radius: 10px; cursor: pointer; font-size: 14px; color: var(--sub);
  border: 1px solid transparent; transition: .15s; display: flex; align-items: center; gap: 8px;
}
.source-item:hover { background: var(--card2); color: var(--txt); }
.source-item.active { background: linear-gradient(135deg, rgba(79,140,255,.18), rgba(124,92,255,.12)); border-color: rgba(79,140,255,.5); color: #fff; }
.source-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 0; }
.source-item.active .dot { opacity: 1; }

.vod-main { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.class-bar { display: flex; gap: 6px; overflow-x: auto; padding: 2px; }
.class-chip {
  padding: 7px 16px; border-radius: 20px; cursor: pointer; font-size: 13px; white-space: nowrap;
  background: var(--card); color: var(--sub); border: 1px solid var(--line); transition: .15s;
}
.class-chip:hover { color: var(--txt); }
.class-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.grid-wrap { flex: 1; overflow-y: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; padding: 6px 2px 20px; }
.pcard { cursor: pointer; transition: .2s; border-radius: 12px; overflow: hidden; background: var(--card); border: 1px solid var(--line); }
.pcard:hover { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(0,0,0,.45); border-color: var(--accent); }
.pcard .poster { position: relative; aspect-ratio: 2/3; background: var(--card2); overflow: hidden; }
.pcard .poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard .poster .fallback { width: 100%; height: 100%; display: grid; place-items: center; color: var(--sub); font-size: 34px; background: linear-gradient(160deg, #1c2940, #121a2c); }
.pcard .remarks { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.72); color: var(--gold); font-size: 11px; padding: 2px 7px; border-radius: 6px; }
.pcard .pname { padding: 9px 11px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .pmeta { padding: 0 11px 9px; font-size: 11px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loading, .empty, .err { padding: 60px 20px; text-align: center; color: var(--sub); font-size: 14px; }
.err { color: var(--warn); }
.pager { display: flex; justify-content: center; gap: 10px; padding: 12px 0 20px; align-items: center; color: var(--sub); font-size: 13px; }
.pager button {
  padding: 7px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--card);
  color: var(--txt); cursor: pointer; transition: .15s;
}
.pager button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pager button:disabled { opacity: .35; cursor: default; }

/* ---------- ç›´æ’­ ---------- */
.live-layout { display: flex; gap: 16px; height: 100%; }
.live-left { width: 230px; flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; }
.live-src-bar { display: flex; gap: 6px; padding: 10px; overflow-x: auto; }
.live-src { padding: 6px 12px; border-radius: 8px; font-size: 12px; background: var(--card2); cursor: pointer; white-space: nowrap; color: var(--sub); border: 1px solid transparent; }
.live-src.active { background: rgba(79,140,255,.2); color: #fff; border-color: var(--accent); }
.group-tree { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.gnode {
  padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--sub);
  display: flex; justify-content: space-between; align-items: center; transition: .12s;
}
.gnode:hover { background: var(--card2); color: var(--txt); }
.gnode.active { background: rgba(79,140,255,.16); color: #fff; }
.gnode .cnt { font-size: 11px; color: var(--sub); background: var(--card2); padding: 1px 7px; border-radius: 8px; }
.live-main { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }
.live-main .panel { width: 100% !important; flex-shrink: 0; }
.ch-list { width: 100%; flex-shrink: 0; overflow-y: auto; display: flex; flex-direction: row; flex-wrap: wrap; gap: 4px; padding: 6px; max-height: 212px; }
.chn {
  padding: 8px 12px; border-radius: 9px; cursor: pointer; font-size: 13px; color: var(--sub);
  display: flex; align-items: center; gap: 10px; transition: .12s;
}
.chn:hover { background: var(--card2); color: var(--txt); }
.chn.active { background: linear-gradient(135deg, rgba(79,140,255,.25), rgba(124,92,255,.12)); color: #fff; }
.chn .logo img { width: 30px; height: 30px; border-radius: 6px; object-fit: contain; background: #000; }
.chn .logo .no { width: 30px; height: 30px; border-radius: 6px; background: var(--card2); display: grid; place-items: center; font-size: 12px; color: var(--sub); }
.live-player { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; }
.live-stage {
  flex: 1; min-height: 0; background: #000; border-radius: var(--radius); border: 1px solid var(--line);
  display: grid; place-items: center; overflow: hidden; position: relative;
}
.live-stage video { width: 100%; height: 100%; object-fit: contain; }
.live-stage .hint { color: var(--sub); font-size: 15px; }
#liveFrameWrap { width: 100%; height: 100%; }
#liveFrameWrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.live-info { padding: 12px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.live-info .now { color: #fff; font-weight: 600; }
.live-info .sub { color: var(--sub); font-size: 12px; }

/* ---------- è¯¦æƒ…é¡µ ---------- */
.detail-view { position: absolute; inset: 0; background: var(--bg); z-index: 20; display: none; flex-direction: column; padding: 18px 26px; overflow-y: auto; }
.detail-view.active { display: flex; }

/* ---------- é¦–é¡µï¼ˆæ�œç´¢+åŽ†å�²+æ”¶è—�ï¼Œæž�ç®€ï¼‰ ---------- */
.home-wrap { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; overflow-y: auto; padding: 20px 0; }
.home-hero { text-align: center; width: min(620px, 94%); }
.home-title { font-size: 42px; font-weight: 800; letter-spacing: 2px; margin-bottom: 22px; background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.home-search { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 34px; padding: 6px 8px 6px 22px; box-shadow: 0 10px 34px rgba(0,0,0,.35); transition: .2s; }
.home-search:focus-within { border-color: var(--accent); box-shadow: 0 10px 40px rgba(79,140,255,.25); }
.home-search input { flex: 1; background: none; border: none; outline: none; color: var(--txt); font-size: 17px; padding: 13px 6px; min-width: 0; }
.home-search .icon { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent2)); display: grid; place-items: center; color: #fff; cursor: pointer; font-size: 18px; flex-shrink: 0; box-shadow: 0 4px 14px rgba(79,140,255,.4); }
.home-search .icon:hover { filter: brightness(1.1); }
.home-tip { color: var(--sub); font-size: 13px; margin-top: 14px; }
.home-rails { width: min(1280px, 97%); }
.home-quick { text-align: center; }
.home-browse-btn { font-size: 14px; padding: 11px 26px; border-radius: 10px; }
.vod-browse { height: 100%; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.vod-browse.search-mode .vod-left { display: none; }
.vod-browse.search-mode .class-bar { display: none; }
.vod-browse.search-mode .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.rail-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.rail-card { width: auto; flex-shrink: 0; cursor: pointer; border-radius: 10px; overflow: hidden; background: var(--card); border: 1px solid var(--line); transition: .2s; }
.browse-head { display: flex; align-items: center; gap: 12px; }
.browse-head .back-btn { margin-bottom: 0; }
.browse-title { color: var(--sub); font-size: 14px; }

.detail-top { display: flex; gap: 26px; }
.detail-poster { width: 200px; flex-shrink: 0; }
.detail-poster img { width: 100%; border-radius: 14px; box-shadow: 0 12px 34px rgba(0,0,0,.5); }
.detail-info { flex: 1; min-width: 0; }
.detail-info h2 { font-size: 26px; margin-bottom: 10px; }
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.dtag { font-size: 12px; padding: 4px 10px; border-radius: 6px; background: var(--card); color: var(--sub); border: 1px solid var(--line); }
.detail-desc { color: var(--sub); font-size: 14px; line-height: 1.8; margin-top: 14px; max-height: 130px; overflow-y: auto; }
.line-bar { display: flex; align-items: center; gap: 12px; margin: 20px 0 10px; flex-wrap: wrap; }
.line-bar .lb { font-size: 13px; color: var(--sub); }
select {
  background: var(--card); color: var(--txt); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 12px; font-size: 13px; outline: none; cursor: pointer;
}
select option:disabled { color: #778; }
select option.opt-dead { color: #f66; }
.search-skip-tip { display: block; padding: 8px 12px; border-radius: 8px; background: rgba(255,107,94,.08); border: 1px dashed rgba(255,107,94,.4); color: var(--sub); font-size: 12px; margin-bottom: 10px; }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
.ep { padding: 8px 4px; text-align: center; border-radius: 8px; background: var(--card); border: 1px solid var(--line); font-size: 12px; color: var(--sub); cursor: pointer; transition: .12s; }
.ep:hover { border-color: var(--accent); color: #fff; }
.ep.playing { background: var(--accent); color: #fff; }
.back-btn { margin-bottom: 14px; align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border-radius: 9px; background: var(--card); border: 1px solid var(--line); color: var(--sub); cursor: pointer; font-size: 13px; transition: .15s; }
.back-btn:hover { color: #fff; border-color: var(--accent); }

/* ---------- è®¾ç½® ---------- */
.settings-layout { display: flex; flex-direction: column; gap: 18px; height: 100%; overflow-y: auto; padding-bottom: 30px; }
.set-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.set-panel h3 { font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.set-panel h3 .ic { color: var(--accent); }
.srow { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.srow label { width: 120px; color: var(--sub); font-size: 13px; flex-shrink: 0; }
.srow input[type=text], .srow input[type=number] { flex: 1; background: var(--bg2); border: 1px solid var(--line); color: var(--txt); border-radius: 8px; padding: 9px 12px; font-size: 13px; outline: none; }
.srow input:focus { border-color: var(--accent); }
table.src-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.src-tbl th { color: var(--sub); text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); font-weight: 600; }
.src-tbl td { padding: 7px 10px; border-bottom: 1px solid #1a2334; }
.src-tbl td input { width: 100%; background: var(--bg2); border: 1px solid transparent; color: var(--txt); border-radius: 6px; padding: 6px 8px; font-size: 12px; outline: none; }
.src-tbl td input:focus { border-color: var(--accent); }
.mini-btn {
  padding: 6px 12px; border-radius: 7px; border: 1px solid var(--line); background: var(--card2);
  color: var(--txt); font-size: 12px; cursor: pointer; transition: .15s; white-space: nowrap;
}
.mini-btn:hover { border-color: var(--accent); color: var(--accent); }
.mini-btn.danger:hover { border-color: var(--warn); color: var(--warn); }
.mini-btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); border: none; color: #fff; }
.mini-btn.primary:hover { filter: brightness(1.1); color: #fff; }
.switch { position: relative; width: 44px; height: 24px; background: var(--line); border-radius: 12px; cursor: pointer; transition: .2s; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: .2s; }
.switch.on { background: var(--accent); }
.switch.on::after { left: 23px; }
.cache-line { display: flex; align-items: center; gap: 16px; }
.cache-line .size { font-size: 22px; font-weight: 700; color: var(--gold); }
.src-tbl td.ok { color: #4caf50; font-weight: 600; }
.src-tbl td.bad { color: #f44336; font-weight: 600; }
.mini-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- æ’­æ”¾å™¨æµ®å±‚ ---------- */
#playerOverlay {
  position: relative; width: 100%; aspect-ratio: 16/9; background: #000; z-index: 10;
  display: none; flex-direction: column; border-radius: var(--radius); border: 1px solid var(--line);
  margin-bottom: 16px; overflow: hidden; flex-shrink: 0;
}
#playerOverlay.active { display: flex; }
#playerOverlay.fullscreen { position: fixed; inset: 0; width: 100vw; height: 100vh; aspect-ratio: auto; z-index: 100; margin: 0; border: none; border-radius: 0; }
#playerVideoWrap { position: absolute; inset: 0; }
#playerVideoWrap video, #playerOverlay video { width: 100%; height: 100%; object-fit: contain; }
#danmakuCanvas { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.player-top {
  position: absolute; top: 0; left: 0; right: 0; padding: 14px 20px; display: flex; align-items: center; gap: 12px;
  background: linear-gradient(#000c, transparent); z-index: 5;
}
.player-top .ptitle { color: #fff; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-top .pclose { margin-left: auto; cursor: pointer; color: #fff; font-size: 20px; padding: 4px 10px; border-radius: 8px; }
.player-top .pclose:hover { background: rgba(255,255,255,.15); }
.player-ctrl {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 16px 20px 14px; z-index: 5;
  background: linear-gradient(transparent, #000d);
}
.progress { position: relative; height: 16px; cursor: pointer; }
.progress .track { position: absolute; top: 7px; left: 0; right: 0; height: 3px; background: #333; border-radius: 2px; }
.progress .fill { position: absolute; top: 7px; left: 0; height: 3px; background: var(--accent); border-radius: 2px; width: 0; }
.progress .buff { position: absolute; top: 7px; left: 0; height: 3px; background: #555; border-radius: 2px; width: 0; }
.ctrl-row { display: flex; align-items: center; gap: 16px; margin-top: 10px; color: #fff; }
.ctrl-row .btn { cursor: pointer; font-size: 18px; padding: 4px; transition: .15s; }
.ctrl-row .btn:hover { color: var(--accent); }
.ctrl-row .btn.active { color: var(--accent); }
.ctrl-row .time { font-size: 12px; color: #bbb; font-variant-numeric: tabular-nums; }
.ctrl-row .spacer { flex: 1; }
.line-switch { display: flex; gap: 6px; overflow-x: auto; max-width: 45vw; }
.line-chip { padding: 5px 12px; border-radius: 6px; font-size: 12px; background: rgba(255,255,255,.12); color: #ddd; cursor: pointer; white-space: nowrap; }
.line-chip.active { background: var(--accent); color: #fff; }
.ep-float { display: flex; gap: 6px; overflow-x: auto; max-width: 30vw; }
.ep-chip { padding: 5px 10px; border-radius: 6px; font-size: 12px; background: rgba(255,255,255,.12); color: #ddd; cursor: pointer; white-space: nowrap; }
.ep-chip.active { background: var(--accent); color: #fff; }
/* ================= v2.0 æ–°å¢žï¼šç»§ç»­è§‚çœ‹ / ç‚¹æ’­æ”¶è—� / è§’æ ‡ / ç”»ä¸­ç”» ================= */
.rail { margin-bottom: 18px; }
.rail-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.rail-title { font-size: 15px; font-weight: 700; color: var(--accent); }
.rail-sub { font-size: 11px; color: var(--sub); }
.rail-body { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.rail-card { width: 120px; flex-shrink: 0; cursor: pointer; border-radius: 10px; overflow: hidden; background: var(--card); border: 1px solid var(--line); transition: .2s; }
.rail-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.rail-card .poster { position: relative; aspect-ratio: 2/3; background: var(--card2); overflow: hidden; }
.rail-card .poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rail-card .poster .fallback { width: 100%; height: 100%; display: grid; place-items: center; color: var(--sub); font-size: 30px; background: linear-gradient(160deg, #1c2940, #121a2c); }
.rail-card .pname { padding: 8px 9px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-card .pmeta { padding: 0 9px 9px; font-size: 11px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.favbadge { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,.72); color: #ff5a5f; font-size: 13px; padding: 2px 7px; border-radius: 6px; line-height: 1; }
.histbadge { position: absolute; bottom: 6px; left: 6px; right: 6px; background: rgba(0,0,0,.72); color: var(--gold); font-size: 11px; padding: 3px 7px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dname-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dname-row h2 { margin: 0; font-size: 22px; }
.dname-row .mini-btn { font-size: 13px; }
.resume-bar { display: flex; align-items: center; gap: 10px; margin: 10px 0; padding: 10px 14px; border: 1px dashed var(--accent); border-radius: 10px; background: rgba(94,154,255,.08); }
.resume-bar .mini-btn { font-size: 13px; }
.resume-bar span { font-size: 12px; color: var(--sub); }
.msg-toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%); background: rgba(20,28,44,.95);
  border: 1px solid var(--accent); color: #fff; padding: 10px 22px; border-radius: 10px; font-size: 13px;
  z-index: 200; display: none; box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.msg-toast.show { display: block; animation: fadein .25s; }
@keyframes fadein { from { opacity: 0; transform: translate(-50%, -8px);} to { opacity: 1; transform: translate(-50%, 0);} }
.spin { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: rot 0.8s linear infinite; margin: 0 auto 12px; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ================= v2.1 ÐÂÔö£º´°¿Ú»¯²¥·Å / ÃÔÄã²¥·ÅÆ÷ / ¶àÔ´¿É²¥ / Ö±²¥ËÑË÷ ================= */
#playerVideoWrap { position: absolute; inset: 0; }
#playerVideoWrap video, #playerOverlay video { width: 100%; height: 100%; object-fit: contain; }
#miniPlayer {
  position: fixed; right: 16px; bottom: 16px; width: 360px; z-index: 90; display: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
}
#miniPlayer .mini-top { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 12px; color: var(--sub); }
#miniPlayer .mini-top .mt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--txt); }
#miniPlayer .mini-top span { cursor: pointer; font-size: 15px; padding: 2px 8px; border-radius: 6px; }
#miniPlayer .mini-top span:hover { background: rgba(255,255,255,.1); }
#miniVideoWrap { position: relative; aspect-ratio: 16/9; background: #000; }
#miniVideoWrap video { width: 100%; height: 100%; object-fit: contain; }
.mini-search { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.mini-search input { flex: 1; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; color: var(--txt); padding: 8px 12px; font-size: 13px; outline: none; }
.mini-search input:focus { border-color: var(--accent); }
.multi-sites { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 16px; background: var(--card); border-radius: 10px; margin-bottom: 12px; }
.multi-sites .ms-label { font-size: 12px; color: var(--sub); white-space: nowrap; }
.site-chip { padding: 5px 12px; border-radius: 8px; font-size: 12px; background: var(--bg2); border: 1px solid var(--line); color: var(--txt); cursor: pointer; }
.site-chip:hover { border-color: var(--accent); }
.site-chip.active { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; border-color: transparent; }
.search-tip { padding: 12px 4px; color: var(--sub); font-size: 12px; line-height: 1.7; }
.live-src-head { display: flex; align-items: center; gap: 10px; padding: 10px; }
.live-src-head .mini-btn { flex-shrink: 0; }

/* ================= Mobile responsive: keep UI operable while playing, no forced fullscreen ================= */
@media (max-width: 640px) {
  html, body { overflow: hidden; }
  header { padding: 10px 12px; gap: 8px; flex-wrap: wrap; }
  header .logo { font-size: 17px; }
  header .logo .badge { width: 28px; height: 28px; font-size: 15px; }
  header .spacer { display: none; }
  nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  nav .tab { padding: 6px 14px; font-size: 13px; }
  .searchbox { flex: 1; min-width: 0; }
  .searchbox input { width: 100%; min-width: 0; font-size: 13px; }
  main { height: calc(100dvh - 104px); }
  .view { padding: 10px; overflow-y: auto; }
  .vod-layout { flex-direction: column; gap: 10px; height: auto; min-height: 100%; }
  .vod-left { width: 100%; flex-shrink: 0; }
  .vod-left .panel { max-height: 130px; }
  .source-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 6px; }
  .source-item { white-space: nowrap; flex-shrink: 0; padding: 8px 12px; font-size: 13px; }
  .vod-main { min-height: 0; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
  .pcard .pname { font-size: 12px; }
  .live-layout { flex-direction: column; gap: 10px; height: auto; min-height: 100%; }
  .live-left { width: 100%; flex-shrink: 0; }
  .live-left .panel { max-height: 120px; }
  .group-tree { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 6px; gap: 4px; }
  .gnode { white-space: nowrap; flex-shrink: 0; padding: 6px 10px; font-size: 12px; }
  .live-main { flex-direction: column; gap: 10px; }
  .live-main .panel { width: 100% !important; flex-shrink: 0; }
  .ch-list { width: 100%; max-height: 190px; overflow-y: auto; }
  .chn { padding: 8px 10px; font-size: 13px; }
  .chn .logo img, .chn .logo .no { width: 26px; height: 26px; }
  .live-player { width: 100%; }
  .live-stage { height: 38vh; min-height: 200px; }
  .live-info { padding: 10px 12px; gap: 8px; flex-wrap: wrap; }
  .live-info .spacer { display: none; }
  #liveFullBtn { margin-left: auto; padding: 8px 14px; font-size: 13px; }
  .detail-view { padding: 12px 14px; }
  .detail-top { flex-direction: column; gap: 14px; }
  .detail-poster { width: 120px; }
  .detail-info h2 { font-size: 20px; }
  .line-bar { margin: 14px 0 8px; }
  select { max-width: 100%; }
  .player-top { padding: 10px 14px; }
  .player-top .ptitle { font-size: 13px; }
  .player-top .pclose { font-size: 18px; padding: 6px 12px; }
  .player-ctrl { padding: 10px 14px 12px; }
  .ctrl-row { gap: 12px; margin-top: 8px; }
  .ctrl-row .btn { font-size: 20px; padding: 8px 6px; }
  .line-switch, .ep-float { max-width: 78vw; }
  .settings-layout { padding: 0 0 24px; }
  .set-panel { padding: 12px 14px; }
  .srow { flex-wrap: wrap; gap: 8px; }
  .srow label { width: 100%; }
  .src-tbl { font-size: 12px; }
  .src-tbl th, .src-tbl td { padding: 6px 6px; }
  .src-tbl td .mini-btn { padding: 5px 8px; font-size: 11px; }
  #miniPlayer { right: 8px; bottom: 8px; width: 46vw; min-width: 170px; }
  .rail-body { display: flex; overflow-x: auto; gap: 12px; padding-bottom: 6px; }
  .rail-card { width: 96px; flex-shrink: 0; }
  .resume-bar { flex-wrap: wrap; }
  .home-title { font-size: 28px; margin-bottom: 16px; }
  .home-search { border-radius: 26px; padding: 4px 6px 4px 16px; }
  .home-search input { font-size: 15px; padding: 11px 4px; }
  .home-search .icon { width: 38px; height: 38px; font-size: 15px; }
  .home-wrap { gap: 18px; justify-content: flex-start; padding-top: 24px; }
  #playerOverlay { aspect-ratio: 16/10; margin-bottom: 12px; }
}
/* ================= TV/Desktop large screen: wider channel list, bigger font ================= */
@media (min-width: 641px) {
  .ch-list { width: 380px; }
  .chn { padding: 10px 14px; font-size: 14px; }
  .gnode { padding: 9px 14px; font-size: 14px; }
  .live-src { padding: 7px 14px; font-size: 13px; }
}

/* extra: detail scroll + mini head */
.detail-view { overflow-y: auto; }
#miniPlayer .mini-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 12px; color: var(--sub); }
#miniPlayer .mini-head .mini-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--txt); }
#miniPlayer .mini-head .pclose { cursor: pointer; font-size: 15px; padding: 2px 8px; border-radius: 6px; }
#miniPlayer .mini-head .pclose:hover { background: rgba(255,255,255,.1); }

/* æ’­æ”¾å™¨æ‰‹åŠ¨æ�¢æº�è�œå�• */
#siteSwitchMenu { position: absolute; right: 10px; top: 46px; z-index: 30; width: min(280px, 90%); background: var(--card, #1e1e2e); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.45); max-height: 60%; overflow-y: auto; }
#siteSwitchMenu .ssw-title { font-size: 12px; color: var(--sub, #aaa); margin-bottom: 8px; }
#siteSwitchMenu .ssw-item { padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--txt, #eee); cursor: pointer; margin-bottom: 4px; background: rgba(255,255,255,.05); }
#siteSwitchMenu .ssw-item:hover { background: rgba(255,255,255,.12); }
#siteSwitchMenu .ssw-item.active { background: var(--accent, #3b82f6); color: #fff; }
