/* 点歌机 · 手机端样式 */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #14161c; --card: #1e222b; --line: #2c3340;
  --fg: #eef1f6; --mut: #8b93a5;
  --acc: #ff5a6e; --acc2: #4ea1ff; --ok: #2ecc71; --warn: #f5a623;
}
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--fg);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  padding-bottom: calc(118px + env(safe-area-inset-bottom));
  padding-top: calc(52px + env(safe-area-inset-top));
}
.hidden { display: none !important; }
.muted { color: var(--mut); font-size: 12px; }
.hint { color: var(--mut); font-size: 12px; padding: 10px 14px 2px; }
.hint2 { padding: 4px 14px 10px; }

/* 顶栏 */
header { position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  background: rgba(20,22,28,.96); backdrop-filter: blur(6px);
  padding-top: env(safe-area-inset-top); border-bottom: 1px solid var(--line); }
.tabs { display: flex; }
.tab-btn { flex: 1; border: 0; background: none; color: var(--mut);
  font-size: 15px; padding: 14px 0 12px; border-bottom: 2px solid transparent; }
.tab-btn.on { color: var(--fg); border-bottom-color: var(--acc); font-weight: 600; }
.chip { display: inline-block; min-width: 18px; margin-left: 5px; padding: 1px 5px;
  border-radius: 9px; background: var(--acc); color: #fff; font-size: 11px; }

/* 主体 */
main { padding: 8px 10px 90px; }
.tab { display: none; }
.tab.on { display: block; }
h3 { font-size: 13px; color: var(--mut); margin: 18px 4px 6px; font-weight: 600; }

.searchbar input, #modalNum {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--fg); font-size: 15px; outline: none; }
.searchbar input:focus { border-color: var(--acc2); }

/* 列表行 */
.list { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; align-items: center; gap: 8px; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.row .main { flex: 1; min-width: 0; }
.row .t { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .t.tc-good { color: #2ecc71; font-weight: 600; }   /* 绿：卡拉OK 已做好（可逐字跟唱） */
.row .t.tc-mid { color: #f5a623; }                       /* 黄：有画面但无逐字歌词 */
.row .s { font-size: 12px; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .ic { font-size: 16px; }
.kind-v .ic { color: var(--acc2); } .kind-a .ic { color: var(--ok); }
.btn { border: 0; border-radius: 8px; padding: 7px 12px; font-size: 14px;
  background: #343c4c; color: var(--fg); }
.btn.primary { background: var(--acc); color: #fff; font-weight: 600; }
.btn.ok { background: var(--ok); color: #07240f; font-weight: 600; }
.btn.danger { background: #7a2430; color: #ffd7db; }
.btn:active { filter: brightness(1.25); }
.mini { border: 0; border-radius: 7px; padding: 5px 9px; font-size: 13px;
  background: #343c4c; color: var(--fg); }
.mini.primary { background: var(--acc); color: #fff; }
.mini.danger { background: #7a2430; color: #ffd7db; }
.mini.ok { background: var(--ok); color: #07240f; }
.mini:active { filter: brightness(1.25); }
.row .qmv { min-width: 28px; padding: 4px 0; font-size: 15px; font-weight: 700; }
.row .qadd { border: 1px solid #3a4150; border-radius: 7px; width: 28px; height: 28px;
  padding: 0; font-size: 15px; line-height: 1; background: #15181f; color: #ff3b30;
  flex: none; display: inline-flex; align-items: center; justify-content: center; }
.row .qadd.queued { color: var(--ok); }
.row .qrmx { border: 0; border-radius: 50%; min-width: 24px; height: 24px; padding: 0;
  font-size: 12px; line-height: 1; background: #a32c34; color: #ffd7db; flex: none; }
.row .btn { flex: none; }

/* 队列里 ± 小按钮 */
.qbtns { display: flex; gap: 5px; }
.qbtns .mini { min-width: 30px; font-size: 15px; font-weight: 700; padding: 3px 0; }
.now-badge { color: var(--acc); font-size: 12px; font-weight: 700; }
.idx { color: var(--mut); font-size: 11px; min-width: 18px; text-align: center; }
.qtitle-row { display: flex; align-items: center; gap: 6px; }
.qtitle-row .t { flex: 1; }

.rowbar { display: flex; align-items: center; gap: 8px; padding: 6px 4px; }
.spacer { flex: 1; }

/* 待审核编辑框 */
.rev-inputs { display: flex; gap: 5px; margin-bottom: 6px; }
.rev-inputs input { flex: 1; min-width: 0; padding: 6px 8px; border-radius: 7px;
  border: 1px solid var(--line); background: #161a22; color: var(--fg); font-size: 13px; }
.rev-btns { display: flex; gap: 5px; justify-content: flex-end; }

/* 播放条 */
#player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; flex-direction: column; gap: 2px;
  background: rgba(20,22,28,.97); border-top: 1px solid var(--line);
  padding: 4px 10px calc(4px + env(safe-area-inset-bottom)); }
.vbtn { border: 0; border-radius: 14px; width: 54px; height: 34px; flex: none;
  font-size: 13px; font-weight: 700; background: #343c4c; color: #fff; }
.vbtn.on { background: var(--ok); color: #07240f; }
.vbtn.off { background: #343c4c; color: #cdd3dd; }
.ctrlrow { display: flex; align-items: center; gap: 8px; width: 100%; }
.pbtn { border: 0; border-radius: 50%; width: 44px; height: 44px; font-size: 18px;
  background: var(--acc); color: #fff; flex: none; }
#btnNext { background: #343c4c; }
#btnAuto.on { background: var(--ok); color: #07240f; box-shadow: 0 0 0 2px rgba(46,204,113,.4); }
#btnAuto.off { background: #343c4c; }
.pmeta { flex: 1; min-width: 0; }
#nowTitle { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 视频画面（歌词层覆盖其上） */
#videoBox { position: relative; margin: 4px 0 10px; border-radius: 12px; overflow: hidden; background: #000; }
#videoBox video { width: 100%; max-height: 45vh; display: block; background: #000; }
#btnFs { position: absolute; top: 8px; right: 8px; z-index: 20; border: none; cursor: pointer;
  background: rgba(0,0,0,.45); color: #fff; font-size: 16px; width: 34px; height: 34px;
  border-radius: 50%; line-height: 1; }
#videoBox:fullscreen { border-radius: 0; background: #000; }
#videoBox:fullscreen #stage { position: relative; width: 100%; height: 100%; }
/* 系统无法锁横屏时的兜底：内容整体旋转 90°（横持手机即正） */
#videoBox:fullscreen #stage.rot { position: absolute; left: 50%; top: 50%;
  width: 100vh; height: 100vw; transform: translate(-50%, -50%) rotate(90deg); }
#videoBox:fullscreen video { max-height: none; width: 100%; height: 100%; object-fit: contain; }
#videoBox:fullscreen #btnFs { display: none; }
#videoBox:fullscreen #lyricBox { padding: 40px 16px 14px; }
#videoBox:fullscreen .lyr.now { font-size: 30px; }
#videoBox:fullscreen .lyr.next { font-size: 17px; }

/* 弹窗 */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center; }
.modal-box { width: min(320px, 86vw); background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.mtitle { font-size: 15px; font-weight: 600; }
.mrow { display: flex; justify-content: flex-end; gap: 8px; }
#modalNum { text-align: center; font-size: 20px; }

/* toast */
#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: rgba(0,0,0,.85); color: #fff; padding: 8px 14px; border-radius: 8px;
  font-size: 13px; z-index: 60; max-width: 86vw; }
.list2 { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 4px; }
.tag { background: var(--card); border: 1px solid var(--line); color: var(--mut);
  border-radius: 7px; padding: 3px 8px; font-size: 12px; }

/* 可拖动进度条 */
.seekrow { display: flex; align-items: center; gap: 8px; width: 100%; }
.fspp { border: 0; border-radius: 50%; width: 30px; height: 30px; flex: none;
  background: rgba(255,255,255,.18); color: #fff; font-size: 13px; line-height: 1;
  display: none; align-items: center; justify-content: center; }
#videoBox:fullscreen .fspp { display: inline-flex; }
.syncbtn { border: 0; border-radius: 50%; width: 30px; height: 30px; flex: none;
  background: rgba(255,255,255,.18); color: #fff; font-size: 13px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; }
video { cursor: pointer; }
.st { font-size: 11px; color: rgba(255,255,255,.72); min-width: 36px; text-align: center;
  font-variant-numeric: tabular-nums; }
.seekbar { position: relative; flex: 1; height: 28px; display: flex; align-items: center;
  cursor: pointer; touch-action: none; }
.seekbar .track { position: absolute; left: 0; right: 0; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,.22); }
.seekbar .fill { position: absolute; left: 0; height: 4px; border-radius: 2px;
  background: var(--acc); width: 0%; }
.seekbar .thumb { position: absolute; top: 50%; left: 0%; width: 15px; height: 15px;
  border-radius: 50%; background: #fff; border: 2px solid var(--acc);
  transform: translate(-50%, -50%); box-shadow: 0 1px 4px rgba(0,0,0,.45); }
#lyricBox .seekrow { padding: 4px 12px 0; }
#lyricBox .st { color: rgba(255,255,255,.8); }

/* 逐字跟唱歌词层（覆盖在画面上：红字白描边醒目，唱过变金） */
#lyricBox { position: absolute; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 22px 12px 8px; display: flex; flex-direction: column; justify-content: flex-end;
  gap: 0; background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.72)); min-height: 0; }
.lyr { text-align: center; line-height: 1.75; }
.lyr.next { font-size: 13px; color: rgba(255,255,255,.82);
  text-shadow: 0 1px 3px rgba(0,0,0,.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lyr.now { font-size: 21px; font-weight: 800; letter-spacing: 1px; line-height: 1.9; }
/* 流水扫字：每字双层——底层红字白描边，上层金色按进度从左到右填充裁剪 */
.lyr .w { position: relative; display: inline-block; }
.lyr.now .c1 { color: #ff3b30; text-shadow: 2px 0 0 #fff, -2px 0 0 #fff, 0 2px 0 #fff, 0 -2px 0 #fff,
    1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
    0 0 8px rgba(0,0,0,.55); }
.lyr.now .c2 { position: absolute; left: 0; top: 0; bottom: 0; width: 0%;
  overflow: hidden; white-space: nowrap; color: #ffd60a;
  text-shadow: 2px 0 0 #fff, -2px 0 0 #fff, 0 2px 0 #fff, 0 -2px 0 #fff,
    1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
    0 0 10px rgba(255,214,10,.6); }
.lyr.now .c2 .i { display: inline-block; }
.lyr.next .w { color: rgba(255,255,255,.82); }

/* 演唱评分面板 */
.pbtn.score { background: #7a2430; color: #ffd7db; }
.pbtn.score.on { background: var(--acc); color: #fff; }
#scorePanel { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.72);
  display: flex; align-items: center; justify-content: center; padding: 18px; }
.sp-box { width: min(360px, 94vw); max-height: 86vh; overflow-y: auto;
  background: #1b1f29; border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.sp-title { font-size: 17px; font-weight: 800; margin-bottom: 10px; text-align: center; }
.sp-state { font-size: 14px; color: var(--fg); line-height: 1.7; min-height: 60px;
  display: flex; align-items: center; justify-content: center; text-align: center; }
.sp-result { text-align: center; }
.sp-total { font-size: 52px; font-weight: 900; color: var(--acc);
  font-variant-numeric: tabular-nums; line-height: 1.2; }
.sp-comment { font-size: 14px; color: var(--mut); margin: 2px 0 10px; }
.sp-lines { text-align: left; max-height: 34vh; overflow-y: auto; border-top: 1px solid var(--line);
  padding-top: 8px; font-size: 12px; }
.sp-lines .sl { display: flex; justify-content: space-between; gap: 8px; padding: 2px 2px;
  color: var(--mut); }
.sp-lines .sl b { color: var(--fg); }
.sp-lines .sl .good { color: var(--ok); font-weight: 700; }
.sp-lines .sl .mid { color: var(--warn); font-weight: 700; }
.sp-lines .sl .bad { color: #e05a5a; font-weight: 700; }
.sp-btns { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.sp-btns .mini { min-width: 96px; padding: 8px 10px; }
