/* ============================================================
   星海音乐 Web · overlays.css（v6.26 · 从 style.css 结构化拆分）
   内容：逐字歌词渐变 / 弹窗通用 / 下载音质 / MV 弹窗
   ⚠ 级联顺序即加载顺序（app.html 按本文件在链中的位置引入），
     调整 @media / 覆盖关系时请保持文件间相对顺序不变。
   ============================================================ */

/* ============================================================
   v5.0 新增：逐字歌词 / 下载弹窗 / MV 弹窗 / 手机端迷你条与全屏播放器
   ============================================================ */

/* ---------- 逐字歌词（卡拉OK） ---------- */
@property --p {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 0%;
}
.kw-w {
  background: linear-gradient(90deg, var(--accent) 0 var(--p, 0%), rgba(142, 154, 179, 0.55) var(--p, 0%) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
/* 已唱完的字保持满进度（旧版缺失该规则，唱过的字会退回未高亮状态） */
.kw-w.done { --p: 100%; }
.lyric-line.done-line .kw-w { background: linear-gradient(90deg, var(--text) 0 100%, rgba(142,154,179,.55) 100%); -webkit-background-clip: text; background-clip: text; }

/* ---------- 弹窗通用 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal.hidden { display: none; }
.modal-mask {
  position: absolute; inset: 0;
  background: rgba(4, 8, 18, 0.72);
  backdrop-filter: blur(4px);
}
.modal-card {
  position: relative;
  width: min(420px, 100%);
  background: var(--panel-solid);
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  /* 【v6.26 uiverse 风格】入场改过冲回弹（spring）曲线，弹窗有落位“坠感” */
  animation: modal-in 0.26s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .modal-card, .mv-card { animation: none; }
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-song-name { font-size: 15px; font-weight: 600; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-song-singer { font-size: 12px; color: var(--sub); margin-bottom: 14px; }
.modal-note { font-size: 11px; color: var(--sub); margin-top: 12px; text-align: center; }

/* ---------- 下载音质弹窗 ---------- */
.dl-q-list { display: flex; flex-direction: column; gap: 8px; }
.dl-q {
  /* 【v6.26 uiverse 风格】单选卡片：左侧圆点指示（空心→悬停主题色→按下实心）
     + 悬停浮起，结构不变（纯 CSS 增强） */
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: 12px 14px 12px 38px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s, box-shadow 0.18s;
  min-height: 48px;
}
.dl-q::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 9px; height: 9px;
  margin-top: -4.5px;
  border-radius: 50%;
  border: 2px solid #55617f;
  background: transparent;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.dl-q:hover { border-color: var(--accent); }
.dl-q:hover::before { border-color: var(--accent); box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.4); }
@media (hover: hover) and (pointer: fine) {
  .dl-q:hover { background: var(--hover); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(var(--accent-rgb), 0.22); }
}
.dl-q:active { transform: scale(0.985); }
.dl-q:active::before { border-color: var(--accent); background: var(--accent); }
.dl-q:disabled { opacity: 0.6; cursor: wait; transform: none; box-shadow: none; }
.dl-q-name { font-weight: 600; }
.dl-q-hint { font-size: 11px; color: var(--sub); }

/* ---------- MV 弹窗 ---------- */
.mv-modal { padding: 16px; }
.mv-card {
  position: relative;
  width: min(880px, 100%);
  background: #05080f;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
  animation: modal-in 0.18s ease;
}
.mv-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: rgba(17, 24, 39, 0.9);
  border-bottom: 1px solid var(--border);
}
.mv-video-box { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.mv-video-box video { width: 100%; height: 100%; display: block; object-fit: contain; }
.mv-loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--sub); font-size: 13px;
  background: rgba(0, 0, 0, 0.45);
}
.mv-loading.hidden { display: none; }


/* ---------- v6.29.3 隐私政策弹窗 ---------- */
.privacy-card {
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  max-height: min(82vh, 640px);
  padding: 0;
  overflow: hidden;
}
.privacy-head {
  padding: 20px 22px 14px;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.14);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.07), transparent);
  flex: none;
}
.privacy-title { font-size: 17px; font-weight: 700; letter-spacing: 0.2px; }
.privacy-sub { font-size: 12px; color: var(--sub); margin-top: 4px; }
.privacy-body {
  padding: 4px 22px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text);
}
.privacy-body h4 {
  font-size: 13.5px;
  margin: 16px 0 4px;
  color: var(--accent);
  font-weight: 600;
}
.privacy-body h4:first-child { margin-top: 6px; }
.privacy-body p { margin: 0 0 4px; color: rgba(203, 210, 227, 0.88); }
.privacy-body strong { color: var(--text); font-weight: 600; }
.privacy-note {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px dashed rgba(var(--accent-rgb), 0.25);
  color: var(--sub) !important;
  font-size: 12px;
}
.privacy-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  flex: none;
}
.privacy-accept { min-width: 128px; }
.privacy-decline { height: 34px; }
@media (max-width: 480px) {
  .privacy-card { max-height: 86vh; }
  .privacy-head, .privacy-body { padding-left: 16px; padding-right: 16px; }
  .privacy-foot { padding: 12px 16px; }
  .privacy-foot { flex-direction: column-reverse; }
  .privacy-accept, .privacy-decline { width: 100%; }
}


/* ============================================================
   【v6.31 阶段一】倍速 / 睡眠定时抽屉 + 续播浮条
   · .sheet-modal/.sheet-card：手机端底部抽屉（大屏居中卡片），
     选项行复用 .dl-q 单选卡片，补 .sel 选中态与 .danger-opt 危险项
   · .resume-bar：顶部居中浮条，滑入/滑出过渡同 pwa.js 提示条
   ============================================================ */
.sheet-modal { padding: 16px; align-items: flex-end; }
.sheet-card {
  /* 【v6.33 修复】抽屉标题/内容被自家遮罩糊掉：
     .sheet-card 原先无定位 —— 静态 flex 子元素在绘制顺序上先于绝对定位的
     .modal-mask（含 backdrop-filter: blur），整张卡片被压在遮罩之下，
     标题文字经 72% 暗色 + blur(4px) 采样后呈现"糊"态。
     同文件 .modal-card / .mv-card 均带 position:relative（隐私/登录弹窗
     复用 .modal-card 所以没出事），唯独 .sheet-card 漏了。 */
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  /* 【v6.32】背景色带字面兜底：即使某个变量链路异常（旧缓存/主题未注入），
     抽屉也是实心面板，绝不退化成“透明卡片浮在模糊遮罩上”的糊块 */
  background: var(--panel-solid, #121a2b);
  border: 1px solid var(--border, rgba(var(--accent-rgb, 124, 140, 255), 0.18));
  border-radius: 18px 18px 12px 12px;
  padding: 16px;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
  animation: sheetUp 0.28s cubic-bezier(0.22, 0.9, 0.3, 1);
}
@keyframes sheetUp {
  from { transform: translateY(36px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@media (min-width: 769px) {
  .sheet-modal { align-items: center; }
  .sheet-card { border-radius: 14px; animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet-card { animation: none; }
}
/* 【v6.32】手机底部抽屉避开 Home Indicator（全面屏手势条），
   且动画结束即回归普通渲染层（transform/opacity 不残留，文字清晰） */
@media (max-width: 768px) {
  .sheet-modal { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .sheet-card { backface-visibility: hidden; }
}
.sheet-body {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px;
  margin: 0 -2px;
}
/* .dl-q 选中态（v6.31）：实心主题色圆点 + 主题色描边 */
.dl-q.sel { border-color: var(--accent); background: var(--hover); }
.dl-q.sel::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.4);
}
.dl-q.danger-opt .dl-q-name { color: var(--danger); }
.dl-q.danger-opt::before { border-color: rgba(255, 93, 115, 0.55); }
.dl-q.danger-opt:hover { border-color: var(--danger); }
.dl-q.danger-opt:hover::before { border-color: var(--danger); box-shadow: 0 0 8px rgba(255, 93, 115, 0.35); }

/* ---------- 续播浮条（顶部居中） ---------- */
.resume-bar {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(-160%);
  z-index: 110;   /* 弹窗(120)之下、页面内容之上：开着弹窗时不抢戏 */
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100vw - 28px);
  padding: 6px 8px 6px 6px;
  border-radius: 999px;
  background: rgba(20, 24, 40, 0.94);
  border: 1px solid rgba(var(--accent-rgb), 0.34);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 0.32s cubic-bezier(0.22, 0.9, 0.3, 1), opacity 0.32s;
  opacity: 0;
}
.resume-bar.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.resume-bar.hidden { display: none; }
.resume-play {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px 8px 10px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(var(--accent-rgb), 0.18), rgba(var(--accent-2-rgb), 0.10));
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  line-height: 1.4;
  cursor: pointer;
  max-width: min(72vw, 460px);
}
.resume-play .icon { flex: none; color: var(--accent); width: 16px; height: 16px; }
.resume-play span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.resume-play:hover { background: linear-gradient(120deg, rgba(var(--accent-rgb), 0.3), rgba(var(--accent-2-rgb), 0.16)); }
.resume-play:active { transform: scale(0.97); }
.resume-close {
  flex: none;
  background: none;
  border: none;
  color: #9aa3bd;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 50%;
  font-family: inherit;
}
.resume-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
@media (prefers-reduced-motion: reduce) {
  .resume-bar { transition: opacity 0.2s; }
}


/* ============================================================
   【v6.31 阶段二】导入备份确认弹窗
   ============================================================ */
.import-summary {
  margin: 6px 0 4px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: "Sarasa Mono SC", "JetBrains Mono", Consolas, monospace;
  font-size: 12.5px;
  line-height: 2;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 46vh;
  overflow-y: auto;
}
.import-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}
.import-actions .btn-primary { min-width: 96px; }


/* ============================================================
   【v6.31 阶段四】歌词编辑器弹窗
   ============================================================ */
.lyric-editor-card { width: min(560px, 100%); }
.lyric-edit-area {
  width: 100%;
  min-height: 240px;
  max-height: 46vh;
  resize: vertical;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: "Sarasa Mono SC", "JetBrains Mono", Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.9;
  padding: 12px 14px;
  outline: none;
  margin: 4px 0 10px;
}
.lyric-edit-area:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18);
}
.lyric-edit-area::placeholder { color: var(--sub); opacity: 0.7; }
.lyric-edit-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.lyric-edit-tools-label { font-size: 12.5px; color: var(--sub); }
.lyric-edit-tools input[type="number"] {
  width: 76px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.lyric-edit-tools input[type="number"]:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18);
}
.lyric-edit-tools-hint { font-size: 11.5px; color: var(--sub); }
.lyric-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.lyric-edit-actions .btn-primary { min-width: 110px; }

/* 【v6.34】编辑对象切换标签页（.lyric-edit-tabs）：行级 LRC / 逐字歌词。
   与设置页 .seg 同族视觉（描边底 + 选中渐变），保持弹窗内控件一致性；
   逐字页无数据时 :disabled 置灰（lyric-editor.js syncTabUI 控制） */
.lyric-edit-tabs {
  display: flex;
  gap: 8px;
  margin: 2px 0 10px;
}
.le-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--sub);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}
.le-tab:hover:not(:disabled):not(.active) {
  color: var(--text);
  border-color: rgba(var(--accent-rgb), 0.4);
}
.le-tab.active {
  background: var(--grad, linear-gradient(135deg, var(--accent), var(--accent-2)));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(var(--accent-rgb), 0.35);
}
.le-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.le-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* 格式小标签（QRC/YRC/KRC/JSON）：选中态反白徽标 / 未选中主题色软底 */
.le-tab-tag {
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.5px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.le-tab:not(.active) .le-tab-tag {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
}
@media (prefers-reduced-motion: reduce) {
  .le-tab { transition: none; }
}
