@charset "UTF-8";
/* ============================================================
 *  CD 歌词同步网站 · 样式 (基于 HeoMusic 视觉风格)
 * ============================================================ */

:root {
  --cd-accent: #ffffff;
  --cd-bg-blur: 60px;
  --cd-lyric-size: 36px;
  --cd-lyric-opacity: 30%;
  --cd-lyric-blur: 2px;
  --heo-white: #fff;
  --heo-white-op: rgba(255, 255, 255, 0.2);
  --heo-black-op: rgba(0, 0, 0, 0.2);
  --heo-shadow-black: 0 0 12px 4px rgba(0, 0, 0, .05);
  /* 字体栈：Inter(拉丁/数字) + 系统 CJK */
  --cd-font: "Inter", "MiSans", "HarmonyOS Sans SC", "PingFang SC", "Hiragino Sans GB",
             "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --cd-mono: "Inter", "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: rgb(13, 13, 13);
  color: #fff;
  font-family: var(--cd-font);
  overflow: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  font-feature-settings: "tnum";
}

a { color: var(--cd-accent); }

/* ---------- 模糊背景 ---------- */
#music_bg {
  position: fixed;
  z-index: -999;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background-position: 0 0;
  background-size: 40%;
  background-image: url(./img/cover.webp);
  transition: background-image 0.6s;
}
#music_bg::before {
  content: '';
  position: fixed;
  z-index: -998;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(var(--cd-bg-blur));
  -webkit-backdrop-filter: blur(var(--cd-bg-blur));
  transform: translateZ(0);
}

/* ---------- 通用按钮 ---------- */
.cd-btn {
  appearance: none;
  border: 1px solid var(--heo-white-op);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all .25s ease;
  white-space: nowrap;
  font-family: inherit;
}
.cd-btn:hover { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.4); }
.cd-btn:active { transform: scale(0.96); }
.cd-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
.cd-btn.active { background: var(--cd-accent); color: #000; border-color: var(--cd-accent); }
.cd-btn-primary { background: var(--cd-accent); color: #000; border-color: var(--cd-accent); font-weight: 600; }
.cd-btn-primary:hover { background: #fff; border-color: #fff; }

/* 仅移动端显示的按钮（曲目入口） */
.cd-btn-mobile-only { display: none; }

/* ---------- CD 表头（玻璃面板） ---------- */
#cd-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(10, 10, 12, 0.55);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  z-index: 100;
}
.cd-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
#cd-header-cover {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: var(--heo-shadow-black);
}
.cd-header-text { min-width: 0; }
#cd-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#cd-artist, #cd-year-line, #cd-source-line {
  font-size: 12px;
  opacity: 0.6;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cd-header-actions { display: flex; gap: 8px; }

/* ---------- 主布局 ---------- */
#heoMusic-page {
  max-width: calc(1200px - 160px);
  margin: 0 auto;
  margin-top: 84px;
  height: calc(100dvh - 84px - 150px);
  display: flex;
  flex-direction: row;
  gap: 40px;
  padding: 0 24px;
}

/* 左列（CD 面板卡片） */
.aplayer-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 40%;
  max-width: 332px;
  height: 100%;
  min-width: 260px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  padding: 22px 16px;
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

/* ---------- CD 光盘 ---------- */
#cd-disc {
  width: 300px;
  height: 300px;
  flex: none;
  border-radius: 50%;
  position: relative;
  background: radial-gradient(circle at center, #1a1a1a 0%, #2a2a2a 30%, #111 62%, #000 100%);
  box-shadow: 0 14px 44px rgba(0, 0, 0, .6), inset 0 0 30px rgba(255, 255, 255, 0.04);
  transition: box-shadow .5s ease;
}
#cd-disc.spinning {
  box-shadow: 0 14px 44px rgba(0, 0, 0, .6),
              0 0 70px -10px color-mix(in srgb, var(--cd-accent) 45%, transparent);
}
.cd-disc-inner {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  transform: translateZ(0);
  will-change: transform;
}
/* 光盘高光 */
.cd-disc-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,.16), transparent 38%);
  pointer-events: none;
}
#cd-disc.spinning .cd-disc-inner {
  animation: cd-spin 10s linear infinite;
}
@keyframes cd-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
#cd-cover-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.cd-disc-hole {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46px;
  height: 46px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at center, #000 0%, #333 55%, #000 100%);
  box-shadow: inset 0 0 6px rgba(0,0,0,.9);
  z-index: 2;
}
.cd-disc-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 92px;
  height: 92px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  z-index: 1;
}

/* ---------- 曲目表头 ---------- */
.cd-tracklist-wrap {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.cd-tracklist-title {
  font-size: 13px;
  opacity: 0.5;
  letter-spacing: 2px;
  padding: 4px 8px 8px;
}
#cd-tracklist {
  list-style: none;
  margin: 0;
  padding: 0 4px 8px 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--heo-white-op) transparent;
  flex: 1;
}
#cd-tracklist::-webkit-scrollbar { width: 6px; }
#cd-tracklist::-webkit-scrollbar-thumb { background: var(--heo-white-op); border-radius: 3px; }
.cd-track {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background .25s ease, border-color .25s ease, transform .15s ease;
}
.cd-track:hover { background: rgba(255, 255, 255, 0.1); }
.cd-track:active { transform: scale(0.98); }
.cd-track.active {
  background: color-mix(in srgb, var(--cd-accent) 16%, transparent);
  border-color: color-mix(in srgb, var(--cd-accent) 45%, transparent);
  box-shadow: inset 3px 0 0 var(--cd-accent);
}
.cd-track-index {
  font-size: 13px;
  opacity: 0.45;
  font-family: Consolas, monospace;
  width: 26px;
  flex: none;
}
.cd-track.active .cd-track-index { color: var(--cd-accent); opacity: 1; }
.cd-track-info { flex: 1; min-width: 0; }
.cd-track-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cd-track-artist {
  font-size: 12px;
  opacity: 0.55;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cd-track-duration {
  font-size: 12px;
  opacity: 0.5;
  font-family: var(--cd-mono);
  font-variant-numeric: tabular-nums;
  flex: none;
}

/* ---------- 歌词区 ---------- */
.aplayer-body {
  flex: 1;
  height: 100%;
  min-width: 0;
  display: flex;
}
#cd-lyric-scroll {
  display: block; /* 覆盖 APlayer.css 中 .aplayer-lrc 的 display:none */
  width: 100%;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  mask-image: linear-gradient(to bottom, #0000, #000 10%, #000 90%, #0000);
  -webkit-mask-image: linear-gradient(to bottom, #0000, #000 10%, #000 90%, #0000);
}
#cd-lyric-scroll::-webkit-scrollbar { display: none; }
#cd-lyric-contents {
  padding: 22vh 20px 48vh 20px;
  width: 92%;
  margin-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
#cd-lyric-contents p {
  font-size: var(--cd-lyric-size);
  line-height: 1.38;
  margin: 0;
  padding: 8px;
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  letter-spacing: 1px;
  text-align: left;
  filter: blur(var(--cd-lyric-blur));
  opacity: var(--cd-lyric-opacity);
  transition: all 0.9s cubic-bezier(0.56, 0.17, 0.22, 0.76),
              opacity 0.3s ease, filter 0.3s ease, text-shadow 0.3s ease;
  user-select: none;
  text-shadow: 0px 2px 0px #ffffff00;
  position: relative;
  cursor: pointer;
  word-wrap: break-word;
  word-break: break-all;
}
#cd-lyric-contents p:hover { background: #ffffff47; }
#cd-lyric-contents p.aplayer-lrc-current {
  filter: blur(0px);
  opacity: 1;
  text-shadow: 0px 2px 16px #ffffff94;
  white-space: normal;
  transform: translateZ(0);
  transition: all 0.3s cubic-bezier(0.56, 0.17, 0.22, 0.76),
              text-shadow 8s 4s ease-in;
}
#cd-lyric-contents p.aplayer-lrc-current:hover { background: #ffffff1b; }
#cd-lyric-contents p.cd-lrc-empty {
  font-size: 18px;
  font-weight: normal;
  opacity: 0.5;
  filter: none;
  cursor: default;
  text-align: center;
}

/* ---------- 同步控制条 ---------- */
#sync-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 12, 0.55);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border-top: 1px solid color-mix(in srgb, var(--cd-accent) 22%, transparent);
  z-index: 200;
  padding: 14px 0 10px;
}
.sync-bar-inner {
  max-width: calc(1200px - 160px);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
}
.sync-progress {
  position: absolute;
  top: -14px;
  left: 24px;
  right: 24px;
  height: 3px;
  background: var(--heo-white-op);
  border-radius: 3px;
}
#sync-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, color-mix(in srgb, var(--cd-accent) 55%, #fff), var(--cd-accent));
  border-radius: 3px;
  transition: width 0.2s linear;
}
.sync-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}
.sync-controls { display: flex; align-items: center; gap: 8px; position: relative; }
#sync-controls.dimmed { opacity: 0.45; }
.sync-main {
  font-size: 16px;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--cd-accent);
  color: #000;
  border-color: var(--cd-accent);
  min-width: 150px;
}
.sync-main:hover { background: #fff; border-color: #fff; }
.sync-main.playing { background: rgba(255,255,255,0.15); color: #fff; border-color: var(--heo-white-op); }
.sync-main.ended { background: rgba(255,180,60,0.25); color: #ffd28a; border-color: rgba(255,180,60,0.5); }
.sync-delay-hint {
  position: absolute;
  left: 0;
  right: 0;
  top: -26px;
  text-align: center;
  font-size: 13px;
  color: #ffd28a;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.sync-delay-hint.show { opacity: 1; }

/* 微调弹出卡片（默认折叠，点击「微调」展开） */
#nudge-popover {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translateX(-50%);
  z-index: 300;
  background: rgba(22, 22, 26, 0.96);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  min-width: 250px;
  max-width: min(92vw, 440px);
}
#sync-bar.nudge-open #nudge-popover { display: block; animation: nudge-pop-in .22s ease; }
@keyframes nudge-pop-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.nudge-popover-title {
  font-size: 12px;
  opacity: 0.6;
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.nudge-popover-tip { font-size: 11px; opacity: 0.5; }
.sync-nudge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.sync-nudge .cd-btn { padding: 9px 13px; font-size: 13px; font-family: var(--cd-mono); }
#btn-reset-offset { border-color: rgba(255,180,60,.35); color: #ffd28a; }

.sync-delay {
  display: none; /* 默认折叠 */
}
#sync-bar.delay-open .sync-delay { display: flex; }
.sync-delay label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  opacity: 0.85;
}
.sync-delay input[type=range] {
  width: 110px;
  accent-color: var(--cd-accent);
  cursor: pointer;
}
#sync-delay-value { font-family: var(--cd-mono); font-size: 13px; min-width: 44px; font-variant-numeric: tabular-nums; }

/* 折叠按钮（微调 / 延时共用） */
.sync-collapse-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: var(--cd-mono);
  font-variant-numeric: tabular-nums;
  border-radius: 999px;
}
.sync-collapse-toggle .toggle-icon { opacity: 0.7; }
.sync-collapse-toggle .toggle-chev {
  transition: transform .25s ease;
  font-size: 10px;
  opacity: 0.7;
}
#sync-bar.delay-open #sync-delay-toggle .toggle-chev,
#sync-bar.nudge-open #sync-nudge-toggle .toggle-chev { transform: rotate(180deg); }

#sync-clock {
  font-family: var(--cd-mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  opacity: 0.9;
  min-width: 150px;
  text-align: center;
  letter-spacing: 0.5px;
}
.cd-mode-hint {
  text-align: center;
  font-size: 12px;
  opacity: 0;
  transition: opacity .3s;
  margin-top: 8px;
  color: #9be8c3;
}
.cd-mode-hint.show { opacity: 0.85; }

/* ---------- 模态框 ---------- */
.cd-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.cd-modal.show { display: flex; }
.cd-modal-content {
  background: rgba(22, 22, 26, 0.94);
  backdrop-filter: blur(30px) saturate(140%);
  -webkit-backdrop-filter: blur(30px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  width: 460px;
  max-width: 100%;
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .7);
}
.cd-modal-content-wide { width: 620px; }
.cd-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.cd-modal-title { font-size: 16px; font-weight: 700; }
.cd-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cd-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

fieldset {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 10px 14px 14px;
  margin: 0;
}
legend { font-size: 13px; opacity: 0.6; padding: 0 6px; }
.cd-form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.cd-form-row label {
  font-size: 13px;
  opacity: 0.85;
  width: 92px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cd-form-row input[type=text] {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  color: #fff;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  min-width: 0;
}
.cd-form-row input[type=text]:focus { border-color: var(--cd-accent); }
.cd-form-row input[type=range] { flex: 1; accent-color: var(--cd-accent); cursor: pointer; }
.cd-form-row input[type=color] { width: 44px; height: 30px; border: none; background: none; cursor: pointer; padding: 0; }
.cd-form-row input[type=file] { font-size: 12px; color: #aaa; }
.cd-form-val { font-family: Consolas, monospace; font-size: 12px; opacity: 0.7; min-width: 40px; }
.cd-form-check { font-size: 12px; opacity: 0.8; display: flex; align-items: center; gap: 4px; cursor: pointer; }
.cd-form-check input { accent-color: var(--cd-accent); cursor: pointer; }
.cd-form-tip { font-size: 12px; opacity: 0.55; line-height: 1.6; }

#lyric-text {
  width: 100%;
  height: 260px;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  color: #e8e8e8;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.7;
  padding: 12px;
  resize: vertical;
  outline: none;
}
#lyric-text:focus { border-color: var(--cd-accent); }
#lyric-preview-info { min-height: 18px; }
code, kbd {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 12px;
  font-family: Consolas, monospace;
}
kbd { border: 1px solid rgba(255,255,255,0.25); border-bottom-width: 2px; }

.cd-modal-body-list {
  padding: 8px 12px 16px;
}
#cd-tracklist-modal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 60dvh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--heo-white-op) transparent;
}
#cd-tracklist-modal-list::-webkit-scrollbar { width: 6px; }
#cd-tracklist-modal-list::-webkit-scrollbar-thumb { background: var(--heo-white-op); border-radius: 3px; }
#cd-tracklist-modal-list .cd-track {
  padding: 12px 12px;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: transparent;
}
#cd-tracklist-modal-list .cd-track.active {
  background: color-mix(in srgb, var(--cd-accent) 16%, transparent);
  border-bottom-color: transparent;
}
#cd-tracklist-modal-list .cd-track-name { font-size: 15px; }
#cd-tracklist-modal-list .cd-track-duration { font-family: var(--cd-mono); }

.cd-help-body h3 { margin: 14px 0 6px; font-size: 14px; color: var(--cd-accent); }
.cd-help-body ol { margin: 6px 0 0; padding-left: 20px; }
.cd-help-body li, .cd-help-body p { font-size: 13px; line-height: 1.9; opacity: 0.9; }
.cd-help-table { border-collapse: collapse; font-size: 13px; }
.cd-help-table td { padding: 5px 12px 5px 0; opacity: 0.9; }

/* ---------- 移动端（参考 HeoMusic 手机端：全屏歌词 + 底部控制条） ---------- */
@media screen and (max-width: 900px) {
  /* 页面：固定全屏，padding 预留顶栏/底栏 */
  #heoMusic-page {
    position: fixed;
    inset: 0;
    margin: 0;
    max-width: none;
    height: auto;
    padding: 58px 12px calc(174px + env(safe-area-inset-bottom, 0px));
    flex-direction: column;
    gap: 0;
  }

  /* 顶栏 */
  #cd-header {
    height: 54px;
    padding: 0 12px;
    padding-top: env(safe-area-inset-top, 0px);
    background: rgba(10, 10, 12, 0.6);
  }
  #cd-header-cover { width: 34px; height: 34px; }
  #cd-title { font-size: 15px; }
  #cd-artist, #cd-year-line, #cd-source-line { font-size: 11px; }
  .cd-header-actions .cd-btn { padding: 8px 10px; font-size: 12px; }
  .cd-btn-mobile-only { display: inline-flex; } /* 曲目入口 */

  /* 隐藏桌面左栏（光盘+曲目列表），歌词全屏 —— 与 HeoMusic 手机端一致 */
  .aplayer-left { display: none; }

  /* 歌词：占满剩余空间（修复高度塌陷，确保歌词始终显示） */
  .aplayer-body { flex: 1; min-height: 0; height: auto; }
  #cd-lyric-scroll { -webkit-overflow-scrolling: touch; }
  #cd-lyric-contents {
    margin-left: 0;
    width: 100%;
    padding: 16vh 8px 38vh 8px;
    gap: 14px;
  }
  #cd-lyric-contents p { font-size: 28px; }

  /* 同步控制条：控制 / 微调+时钟 / 延时 三行 */
  #sync-bar { padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px)); }
  .sync-bar-inner { padding: 0 10px; }
  .sync-progress { left: 10px; right: 10px; top: -8px; }
  .sync-row { flex-wrap: wrap; gap: 8px; }
  .sync-controls { order: 1; width: 100%; justify-content: center; gap: 10px; }
  .sync-controls .cd-btn:not(.sync-main) {
    width: 48px;
    height: 48px;
    padding: 0;
    font-size: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .sync-main {
    flex: 1;
    max-width: 210px;
    min-width: 0;
    height: 52px;
    padding: 0 18px;
    font-size: 16px;
  }
  #sync-nudge-toggle { order: 2; padding: 8px 10px; font-size: 12px; }
  #sync-clock { order: 2; font-size: 12px; min-width: 0; white-space: nowrap; }
  #sync-delay-toggle { order: 3; padding: 8px 10px; font-size: 12px; }
  .sync-delay {
    order: 4;
    width: 100%;
    justify-content: center;
    display: none;
  }
  #sync-bar.delay-open .sync-delay { display: flex; }
  .sync-delay label { font-size: 12px; }
  .sync-delay input[type=range] { width: 170px; }
  .cd-mode-hint { font-size: 11px; margin-top: 6px; }
  /* 微调卡片适配小屏：两行按钮 */
  #nudge-popover { padding: 12px; }
  .sync-nudge .cd-btn { padding: 9px 10px; font-size: 12px; min-width: 42px; }

  /* 模态框：底部弹窗 */
  .cd-modal { padding: 0; align-items: flex-end; }
  .cd-modal-content {
    width: 100%;
    max-width: none;
    max-height: 88dvh;
    border-radius: 18px 18px 0 0;
    border: none;
    border-top: 1px solid rgba(255,255,255,0.12);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .cd-modal-content-wide { width: 100%; }
}

/* 触控优化 */
@media (hover: none), (pointer: coarse) {
  .cd-btn { touch-action: manipulation; }
  #cd-lyric-contents p { touch-action: manipulation; }
}
