:root {
  color-scheme: dark;
  --bg: #07060b;
  --line: rgba(255, 255, 255, 0.08);
  --hover: rgba(255, 255, 255, 0.06);
  --field: rgba(255, 255, 255, 0.04);
  --text: #f3f2f8;
  --muted: #9594a8;
  --accent: #ffffff;        /* 介面不用彩色，強調色就是白 */
  --danger: #e08a8a;        /* 低彩度的紅，只用在刪除 */
  /* 透明質感：極淡的白 + 白色細邊 + 輕度模糊 */
  --glass: rgba(255, 255, 255, .06);
  --glass-border: rgba(255, 255, 255, .12);
  --glass-dark: rgba(22, 22, 24, .98); /* 下拉選單要看清楚，用近乎實心的深灰 */
  --glass-blur: blur(10px);
  --selected: rgba(255, 255, 255, .1);
  --sidebar: 360px;
  --bar: 84px;
  --gap: 12px;
  --radius: 24px;
  /* 被面板和控制列佔用的範圍，讓其他元素跟著避開 */
  --ui-right: 0px;
  --ui-bottom: calc(var(--bar) + var(--gap));
}
body.panel-open { --ui-right: calc(var(--sidebar) + var(--gap)); }

/* ---------- 透明玻璃面板 ---------- */
.surface {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
/* 需要看清楚內容的浮層（下拉選單、確認視窗）用深色玻璃 */
.surface-dark {
  background: var(--glass-dark);
  border: 1px solid rgba(255, 255, 255, .1);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

/* 捲軸 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .3); }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  overflow: hidden;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ---------- 舞台（特效區） ---------- */
#stage {
  position: fixed;
  inset: 0;
  background: var(--bg);
}
#stage canvas { display: block; width: 100%; height: 100%; }

/* YouTube 規定播放器至少 200×200 且要看得到：縮到最小尺寸、平常半透明，滑鼠移上去才完整顯示 */
#yt-wrap {
  position: absolute;
  right: calc(var(--ui-right) + var(--gap));
  bottom: calc(var(--ui-bottom) + var(--gap));
  width: 200px;
  height: 200px;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  opacity: .4;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .14);
  transition: right .35s ease, bottom .35s ease, opacity .3s ease;
}
#yt-wrap:hover { opacity: 1; }

/* 使用者可以自行隱藏播放器（預設顯示） */
.yt-hide {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .7);
  color: #fff;
  font-size: 12px;
  opacity: 0;
  transition: opacity .2s;
  z-index: 1;
}
#yt-wrap:hover .yt-hide { opacity: 1; }
.yt-hide:hover { background: rgba(255, 255, 255, .25); }
/* 播放器隱藏時，控制列音量左邊會出現「顯示播放器」按鈕 */
.icon-btn.yt-show { display: none; }
/* 不用 display:none，避免瀏覽器暫停 iframe 播放 */
body.player-hidden #yt-wrap { opacity: 0; pointer-events: none; }
body.player-hidden .icon-btn.yt-show { display: inline-grid; }
body.no-track #yt-wrap { opacity: 0; pointer-events: none; }
body.no-track .icon-btn.yt-show { display: none; }
#yt-wrap iframe { display: block; width: 100%; height: 100%; }

/* ---------- 右側歌單面板（按右上角 ≡ 開關） ---------- */
#panel {
  position: fixed;
  top: var(--gap);
  right: var(--gap);
  width: var(--sidebar);
  bottom: calc(var(--ui-bottom) + var(--gap));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(calc(100% + var(--gap) * 2));
  /* 無色透明玻璃：白色明暗漸層（像光打在玻璃上）＋背景模糊，不加邊框、不加任何色相 */
  background: linear-gradient(135deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
  border: 0;
  border-radius: 16px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  visibility: hidden;
  transition: transform .4s cubic-bezier(.2, .8, .2, 1), visibility .4s, bottom .35s ease;
  z-index: 6;
}
body.panel-open #panel { transform: none; visibility: visible; }

.brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 10px; }

/* 面板右上角的會員按鈕：沒登入顯示 Sign in，登入後顯示頭像，點開有 email 和登出 */
.account { position: relative; }
.account[hidden] { display: none; }
.account-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: rgba(255, 255, 255, .8);
  transition: color .15s, filter .15s, box-shadow .15s;
}
/* 跟其他圖示一樣：沒有邊框，滑到時發亮 */
.account-btn:hover { color: #fff; filter: drop-shadow(0 0 6px rgba(255, 255, 255, .9)); }
.account-btn svg { width: 22px; height: 22px; fill: currentColor; }
.account-btn.signed-in { overflow: hidden; background: var(--hover); }
.account-btn.signed-in:hover { filter: none; box-shadow: 0 0 10px rgba(255, 255, 255, .5); }
.account-btn img { width: 100%; height: 100%; object-fit: cover; }
.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 7;
  width: 220px;
  padding: 12px;
  border-radius: 12px;
  font-size: 12px;
}
.account-menu[hidden] { display: none; }
.account-email { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-status { margin: 4px 0 10px; color: var(--muted); }

/* ---------- MXV logo（賽博龐克） ---------- */
.logo { display: block; height: 30px; overflow: visible; }
.logo-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
/* 左上角的 MXV：全螢幕閒置時跟其他介面一起淡出 */
.stage-logo {
  position: absolute;
  top: calc(var(--gap) + 8px);
  left: calc(var(--gap) + 12px);
  z-index: 4;
  pointer-events: none;
  transition: opacity .4s ease;
}
body.immersive:not(.show-ui) .stage-logo { opacity: 0; }
.logo-main use { fill: #fcee0a; } /* 2077 黃 */
.logo-ghost { mix-blend-mode: screen; }
.logo-cyan { fill: rgba(0, 240, 255, .55); transform: translateX(-1.2px); }
.logo-red { fill: rgba(255, 0, 60, .45); transform: translateX(1.2px); }
.logo-line { fill: none; stroke: rgba(252, 238, 10, .5); stroke-width: 1; }
.logo-dot { fill: #fcee0a; }
/* 故障抖動：每次故障 1 秒（每 0.08 秒跳一次位置），接著停 2 秒，一直循環 */
.logo-slice { animation: logo-slice 3s steps(1, end) infinite; } /* steps：位置用跳的，不是滑過去 */
.logo-cyan { animation: logo-cyan 3s steps(1, end) infinite; }
.logo-red { animation: logo-red 3s steps(1, end) infinite; }
@keyframes logo-slice {
  33.3%, 100% { transform: none; }
  0.0% { transform: translateX(3px); }
  2.8% { transform: translateX(-4px); }
  5.5% { transform: translateX(5px); }
  8.3% { transform: translateX(-2px); }
  11.1% { transform: translateX(4px); }
  13.9% { transform: translateX(-5px); }
  16.6% { transform: translateX(2px); }
  19.4% { transform: translateX(-3px); }
  22.2% { transform: translateX(6px); }
  25.0% { transform: translateX(-1px); }
  27.8% { transform: translateX(3px); }
  30.5% { transform: translateX(-4px); }
}
@keyframes logo-cyan {
  33.3%, 100% { transform: translate(-1.2px, 0); }
  0.0% { transform: translate(-4px, 1px); }
  2.8% { transform: translate(-1px, -1px); }
  5.5% { transform: translate(-3px, 0px); }
  8.3% { transform: translate(-5px, 1px); }
  11.1% { transform: translate(-2px, -1px); }
  13.9% { transform: translate(-4px, 0px); }
  16.6% { transform: translate(-1px, 1px); }
  19.4% { transform: translate(-3px, -1px); }
  22.2% { transform: translate(-5px, 0px); }
  25.0% { transform: translate(-2px, 1px); }
  27.8% { transform: translate(-4px, -1px); }
  30.5% { transform: translate(-1px, 0px); }
}
@keyframes logo-red {
  33.3%, 100% { transform: translate(1.2px, 0); }
  0.0% { transform: translate(4px, -1px); }
  2.8% { transform: translate(1px, 1px); }
  5.5% { transform: translate(3px, 0px); }
  8.3% { transform: translate(5px, -1px); }
  11.1% { transform: translate(2px, 1px); }
  13.9% { transform: translate(4px, 0px); }
  16.6% { transform: translate(1px, -1px); }
  19.4% { transform: translate(3px, 1px); }
  22.2% { transform: translate(5px, 0px); }
  25.0% { transform: translate(2px, -1px); }
  27.8% { transform: translate(4px, 1px); }
  30.5% { transform: translate(1px, 0px); }
}



.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 20px;
}
.section-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--muted);
}

.text-btn {
  border: 0;
  background: none;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
}
.text-btn:hover { background: var(--hover); color: var(--text); }
.text-btn.danger:hover { color: var(--danger); }
.text-btn:disabled { opacity: .3; pointer-events: none; }

/* 歌單下拉選單：名稱＋底線＋右邊 ⌄ */
.playlist-picker { position: relative; margin: 4px 20px 12px; }
.picker {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  transition: border-color .2s;
}
.picker:hover, .playlist-picker.open .picker { border-color: rgba(255, 255, 255, .6); }
.picker-name {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  padding: 4px 0;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.picker-name:focus { outline: none; }
.picker-name[readonly] { user-select: none; }
.picker-name:not([readonly]) { cursor: text; }
.playlist-picker.renaming .picker { border-color: rgba(255, 255, 255, .8); }
.picker-arrow { display: grid; color: var(--muted); transition: transform .2s; }
.picker-arrow svg { width: 16px; height: 16px; fill: currentColor; }
.playlist-picker.open .picker-arrow { transform: rotate(180deg); }
.picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 5;
  padding: 6px;
  border-radius: 12px;
}
.picker-menu[hidden] { display: none; }
#playlist-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 240px;
  overflow-y: auto;
}
#playlist-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}
#playlist-list li:hover { background: rgba(255, 255, 255, .05); }
#playlist-list li.active { background: var(--selected); font-weight: 600; }
#playlist-list li.playing .name::before {
  content: "♪ ";
  color: var(--muted);
}
#playlist-list .name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.row-actions { display: flex; gap: 2px; flex-shrink: 0; opacity: .35; transition: opacity .15s; }
#playlist-list li:hover .row-actions { opacity: 1; }
.row-btn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
}
.row-btn[hidden] { display: none; }
.row-btn svg { width: 15px; height: 15px; fill: currentColor; }
.row-btn:hover { background: var(--hover); color: var(--text); }
.row-btn.danger:hover { color: var(--danger); }
#playlist-list li.add-row { color: var(--muted); }
#playlist-list li.add-row:hover { color: var(--text); }

.tracks {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-top: 8px;
}
.name-input {
  flex: 1;
  min-width: 0;
  border: 1px solid transparent;
  background: none;
  border-radius: 6px;
  padding: 4px 6px;
  margin-left: -6px;
  font-size: 18px;
  font-weight: 700;
}
.name-input:hover { border-color: var(--line); }
.name-input:focus { outline: none; border-color: var(--accent); }

#add-form {
  display: flex;
  gap: 8px;
  padding: 4px 20px 12px;
}
/* 一排：輸入框＋Add，都不加邊框 */
#add-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  border: 0;
  background: rgba(255, 255, 255, .08);
  border-radius: 12px;
  padding: 0 12px;
  font-size: 13px;
  transition: background .2s;
}
#add-input::placeholder { color: rgba(255, 255, 255, .4); }
#add-input:focus { outline: none; background: rgba(255, 255, 255, .14); }
.primary-btn {
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-weight: 600;
  transition: background .2s ease, box-shadow .2s ease;
}
.primary-btn:hover { background: rgba(255, 255, 255, .22); box-shadow: 0 0 18px rgba(255, 255, 255, .15); }

.empty { margin: 16px 20px; color: var(--muted); font-size: 13px; }

#track-list {
  list-style: none;
  margin: 0;
  padding: 0 12px 16px;
  overflow-y: auto;
  flex: 1;
}
.track {
  display: grid;
  grid-template-columns: 22px 64px 1fr 28px;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 14px;
  cursor: pointer;
}
.track:hover { background: rgba(255, 255, 255, .05); }
.track.current { background: var(--selected); }
.track.current .idx { color: #fff; }
.track.error { opacity: .45; }
.track.dragging { opacity: .4; }
.track .idx { color: var(--muted); font-size: 12px; text-align: right; }
.track img {
  width: 64px;
  height: 36px;
  object-fit: cover;
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
}
.track .meta { min-width: 0; }
.track .title, .track .author {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.track .title { font-size: 13px; }
.track .author { font-size: 12px; color: var(--muted); }
.track .remove {
  width: 28px;
  height: 28px;
  opacity: 0;
  font-size: 12px;
}
.track:hover .remove { opacity: 1; }

/* ---------- 下方控制列 ---------- */
#controls {
  position: fixed;
  left: var(--gap);
  right: var(--gap);
  bottom: var(--gap);
  height: var(--bar);
  display: grid;
  grid-template-columns: 1fr minmax(320px, 2fr) 1fr; /* 左右等寬，播放鍵保持在正中間 */
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  border-radius: var(--radius);
  transition: opacity .4s ease;
  z-index: 10;
}

.center { grid-column: 2; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.transport { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: rgba(255, 255, 255, .8);
  transition: color .15s ease, filter .15s ease, box-shadow .15s ease;
}
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }
/* 跟右上角一樣：沒有背景，滑到時發亮 */
.icon-btn:hover { color: #fff; filter: drop-shadow(0 0 6px rgba(255, 255, 255, .9)); }
.icon-btn.toggle { color: var(--muted); }
.icon-btn.toggle.on { color: #fff; }
.icon-btn.toggle:hover { color: #fff; }
.icon-btn.play { width: 44px; height: 44px; background: var(--text); color: #000; }
.icon-btn.play:hover { color: #000; background: #fff; filter: none; box-shadow: 0 0 16px rgba(255, 255, 255, .7); }
.icon-btn.play svg { width: 26px; height: 26px; }

.progress {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.progress span { width: 40px; text-align: center; }
.progress input { flex: 1; }

input[type="range"] {
  --p: 0%;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--text) var(--p), rgba(255, 255, 255, .18) var(--p));
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
}
input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}

.extras { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 12px; }

/* 左下角 BPM（控制列最左邊）：只顯示從音樂偵測到的速度，沒開音樂同步時顯示「—」 */
.bpm {
  grid-column: 1;
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 38px;
  padding: 0 5px;
  font-size: 12px;
  color: rgba(255, 255, 255, .6);
  font-variant-numeric: tabular-nums;
  opacity: .6;
  transition: opacity .3s;
}
.bpm:hover, .bpm:focus-within { opacity: 1; }
.bpm span { padding: 0 4px; }
.bpm b {
  display: inline-block;
  min-width: 3ch; /* 固定寬度：數字變成「—」時整排不會縮起來 */
  text-align: right;
  color: #fff;
  font-weight: 600;
}

/* 音量：滑鼠移到喇叭上就出現直立滑桿，上下拉調整（觸控裝置用點的） */
.volume { position: relative; }
.vol-pop {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  padding: 16px 12px; /* 沒有背景，但保留感應範圍方便拖曳 */
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility 0s linear .2s;
}
/* 補上喇叭和滑桿之間的空隙，滑鼠往上移時不會中斷 */
.vol-pop::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 12px;
}
.volume:hover .vol-pop {
  opacity: 1;
  visibility: visible;
  transition: opacity .2s ease, visibility 0s;
}
.vol-pop input {
  writing-mode: vertical-lr;
  direction: rtl; /* 往上是變大聲 */
  width: 4px;
  height: 110px;
  background: linear-gradient(to top, var(--text) var(--p), rgba(255, 255, 255, .18) var(--p));
}

/* ---------- 全螢幕 / 沉浸模式 ---------- */
/* 全螢幕閒置時介面原地淡出，不移動位置，特效也不會跟著重新置中 */
body.immersive:not(.show-ui) #controls { opacity: 0; pointer-events: none; }
body.immersive:not(.show-ui) { cursor: none; }

/* ---------- 提示訊息 ---------- */
#toast {
  position: fixed;
  left: 50%;
  top: 20px;
  transform: translate(-50%, -20px);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 20;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 窄螢幕 ---------- */
@media (max-width: 1100px) {
  #controls { grid-template-columns: 1fr minmax(260px, 2fr) 1fr; gap: 16px; }
}

@media (max-width: 800px) {
  :root { --sidebar: calc(100vw - var(--gap) * 2); --bar: 124px; --gap: 8px; }
  body.panel-open { --ui-right: 0px; } /* 手機上面板直接蓋在畫面上 */
  .brand { display: none; }
  #controls {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 6px 12px;
    padding: 10px 16px;
  }
  .bpm { grid-column: 1; grid-row: 1; }
  .extras { grid-column: 1; grid-row: 1; }
  .center { grid-column: 1; grid-row: 2; }
}

/* ---------- 音樂同步 ---------- */
/* 右上角工具：同步燈、配色、樣式。平常淡淡的，滑鼠移上去才清楚 */
#stage-tools {
  position: absolute;
  top: calc(var(--gap) + 4px);
  right: calc(var(--ui-right) + var(--gap) + 4px);
  display: flex;
  gap: 8px;
  z-index: 4;
  opacity: .6;
  transition: opacity .3s, right .4s cubic-bezier(.2, .8, .2, 1);
}
#stage-tools:hover, #stage-tools:focus-within { opacity: 1; }
body.immersive:not(.show-ui) #stage-tools { opacity: 0; pointer-events: none; }
.tool { position: relative; }
.tool-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, .7);
  transition: color .15s ease, filter .15s ease;
}
/* 滑到時發亮 */
.tool-btn:hover { color: #fff; filter: drop-shadow(0 0 6px rgba(255, 255, 255, .9)); }
.tool-btn svg { width: 18px; height: 18px; fill: currentColor; }
.sync-light i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6b6b6b;
  transition: background .3s, box-shadow .3s;
}
body.live .sync-light i { background: #a8e6c1; box-shadow: 0 0 4px rgba(168, 230, 193, .8), 0 0 10px rgba(168, 230, 193, .5); }
/* 配色、樣式選單：跟音量一樣滑到圖示就出現，沒有背景（觸控裝置用點的） */
.tool-menu {
  position: absolute;
  top: 100%;
  right: 0;
  display: flex;
  gap: 8px;
  padding: 10px 4px 4px; /* 上方留空當作圖示和選單之間的感應區，滑鼠往下移不會中斷 */
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility 0s linear .2s;
}
.tool:hover .tool-menu,
.tool-menu.open {
  opacity: 1;
  visibility: visible;
  transition: opacity .2s ease, visibility 0s;
}
.swatch {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background-clip: padding-box;
  color: #fff;
}
.swatch svg { width: 16px; height: 16px; fill: currentColor; }
.swatch:hover { transform: scale(1.12); }
/* 樣式選單的圖示：沒有背景圓圈，選中或滑到時發亮 */
.swatch.icon-swatch { border: 0; background: none; color: rgba(255, 255, 255, .6); }
.swatch.icon-swatch:hover,
.swatch.icon-swatch.active { color: #fff; filter: drop-shadow(0 0 6px rgba(255, 255, 255, .9)); }
.swatch.active { border-color: #fff; }

.modal-card.sync-card {
  width: min(420px, calc(100% - 32px));
  padding: 28px 28px 20px;
  border-radius: 20px;
  background: rgba(40, 40, 42, .55);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  text-align: center;
  animation: modal-pop .4s ease;
}
.sync-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  border: 1px solid var(--glass-border);
  font-size: 24px;
}
.sync-card h3 { margin: 0 0 8px; font-size: 18px; }
.sync-card p { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.sync-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sync-actions .primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 42px;
  font-size: 15px;
  text-decoration: none;
}
.sync-card b { color: #fff; }
.sync-card .sync-status {
  margin: -8px 0 18px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(168, 230, 193, .1);
  color: #a8e6c1;
  font-size: 12px;
}
.sync-card .sync-status[hidden] { display: none; }

/* ---------- 確認視窗：畫面中間跳出、背景模糊 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .6);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  animation: modal-fade .3s ease;
}
.modal[hidden] { display: none; }
.modal-card {
  width: min(360px, calc(100% - 32px));
  padding: 24px 24px 18px;
  border-radius: 20px;
  background: rgba(40, 40, 42, .55);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  text-align: center;
  animation: modal-pop .4s ease;
}
.modal-card h3 { margin: 0 0 8px; font-size: 17px; }
.modal-card p { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions button { flex: 1; height: 40px; font-size: 14px; }
.secondary-btn {
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 12px;
  background: rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .85);
  font-weight: 600;
  transition: all .2s;
}
.secondary-btn:hover { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .3); }
.danger-btn { background: rgba(224, 138, 138, .18); border-color: rgba(224, 138, 138, .35); color: #f0b4b4; }
.danger-btn:hover { background: rgba(224, 138, 138, .28); box-shadow: none; }
@keyframes modal-fade { from { opacity: 0; } }
@keyframes modal-pop { from { opacity: 0; transform: translateY(-30px) scale(.95); } }

/* ---------- 提示文字：取代瀏覽器內建的 title 提示，淡入淡出 ---------- */
.tip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  max-width: 240px;
  padding: 6px 10px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .06));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: rgba(255, 255, 255, .9);
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}
.tip.show { opacity: 1; }
