/* ==========================================================================
   LinkHub · 播放器（浮动窗口 / 独立窗口共用）
   ========================================================================== */
.player {
  position: fixed;
  z-index: 76;
  left: 18px;
  bottom: 18px;
  width: 380px;
  max-width: calc(100vw - 24px);
  background: linear-gradient(180deg, #121a2c 0%, #0b1120 100%);
  color: #e8ecf8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow: 0 26px 60px rgba(5, 10, 25, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
  font-family: var(--font);
  transition: width 0.22s ease, height 0.22s ease, box-shadow 0.2s;
}

.player.is-video { width: 720px; }
.player.dragging { transition: none; box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6); }

.player-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px 9px 12px;
  cursor: grab; user-select: none; touch-action: none;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.player-head:active { cursor: grabbing; }
.player-head .dot { width: 8px; height: 8px; border-radius: 50%; background: #22d3ee; box-shadow: 0 0 10px #22d3ee; flex: none; }
.player-head .title { flex: 1; min-width: 0; font-size: 12.5px; color: #cfd7ee; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-head .head-btns { display: flex; gap: 2px; flex: none; }

.pbtn {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px;
  border: 1px solid transparent; background: rgba(255, 255, 255, 0.06);
  color: #cdd6ee; transition: all 0.16s;
}
.pbtn:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.pbtn.active { background: rgba(124, 123, 255, 0.28); color: #fff; border-color: rgba(124, 123, 255, 0.5); }
.pbtn:disabled { opacity: 0.35; cursor: not-allowed; }

.player-stage { position: relative; background: #05070f; }
.player-stage video { display: block; width: 100%; max-height: 62vh; background: #000; }
.player-stage .stage-placeholder {
  height: 96px; display: grid; place-items: center; text-align: center;
  color: #6b7391; font-size: 12px; padding: 10px; gap: 4px;
}
.player-stage .stage-audio { height: 96px; padding: 4px 12px 10px; display: block; }
.player-stage canvas { width: 100%; height: 100%; display: block; }

.player-lyrics {
  position: relative;
  padding: 6px 16px 2px;
  min-height: 54px;
  max-height: 132px;
  overflow-y: auto;
  scrollbar-width: thin;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
}
.player-lyrics .lyric-line {
  text-align: center; font-size: 12.5px; line-height: 1.9;
  color: #6d778f;
  transition: color 0.2s, transform 0.2s, font-size 0.2s;
  white-space: pre-wrap; word-break: break-word;
}
.player-lyrics.mode-full .lyric-line { padding: 1px 0; }
.player-lyrics .lyric-line.active {
  color: var(--lyric-color, #7cd4ff);
  font-size: 14.5px; font-weight: 700;
  text-shadow: 0 0 18px color-mix(in srgb, var(--lyric-color, #7cd4ff) 45%, transparent);
}
.player-lyrics.mode-three {
  display: flex; flex-direction: column; justify-content: center;
  min-height: 84px; max-height: 84px; overflow: hidden; padding-top: 2px;
}
.player-lyrics.mode-three .lyric-line { opacity: 0.55; font-size: 12px; }
.player-lyrics.mode-three .lyric-line.active { opacity: 1; }
.player-lyrics .lyric-empty { text-align: center; color: #5b6480; font-size: 12px; padding: 12px 0; }

.player-progress { padding: 8px 14px 0; }
.progress-bar {
  position: relative; height: 16px; display: flex; align-items: center; cursor: pointer;
}
.progress-bar .track { position: relative; width: 100%; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.progress-bar .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #7c7bff, #22d3ee); border-radius: 999px; }
.progress-bar:hover .track { height: 6px; }
.time-row { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; color: #7d87a3; }

.player-controls { display: flex; align-items: center; gap: 4px; padding: 6px 12px 10px; }
.player-controls .grow { flex: 1; }
.player-controls .play-main {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(120deg, #6366f1, #22d3ee);
  color: #fff; border: 0; display: grid; place-items: center;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.42);
}
.player-controls .play-main:hover { transform: scale(1.05); }

.volume { position: relative; display: flex; align-items: center; width: 26px; }
.volume input {
  position: absolute; right: 30px; bottom: 3px; width: 86px; height: 16px;
  opacity: 0; pointer-events: none; accent-color: #22d3ee;
  transition: opacity .16s ease;
}
.volume:hover input, .volume:focus-within input { opacity: 1; pointer-events: auto; }
@media (hover: none) {
  .volume { width: 96px; }
  .volume input { position: static; width: 72px; opacity: 1; pointer-events: auto; }
}
.loop-btn { position: relative; }
.loop-btn .mode-text { font-size: 9px; position: absolute; bottom: 2px; right: 4px; letter-spacing: 0.5px; color: #9aa6c8; }

.player-extra {
  display: none;
  flex-wrap: wrap; gap: 8px; padding: 0 14px 12px;
  font-size: 11.5px; color: #9aa6c8;
}
.player-extra.open { display: flex; }
.player-extra label { display: flex; align-items: center; gap: 5px; }
.player-extra select, .player-extra input[type="color"] {
  background: rgba(255, 255, 255, 0.08); color: #dfe6f8;
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 8px; padding: 3px 6px; font-size: 11.5px;
}
.player-extra input[type="color"] { width: 34px; height: 24px; padding: 0; }
.player-extra .seg { display: inline-flex; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 8px; overflow: hidden; }
.player-extra .seg button { border: 0; background: transparent; color: #9aa6c8; padding: 4px 8px; font-size: 11.5px; }
.player-extra .seg button.active { background: rgba(124, 123, 255, 0.3); color: #fff; }

/* 最小化形态 */
.player.min {
  width: 330px;
  bottom: 18px;
}
.player.min .player-stage,
.player.min .player-progress,
.player.min .player-extra,
.player.min .player-controls .full-only { display: none; }
.player.min .player-head { border-bottom: 0; }
.player.min .player-lyrics { min-height: 84px; max-height: 84px; padding-top: 0; }
.player.min .player-controls { padding: 0 12px 10px; }
.player.min .mini-wave { display: block; height: 26px; margin: 0 14px 8px; }
.player .mini-wave { display: none; }

/* 无边框视频 */
.player.borderless {
  border: 0; border-radius: 12px; background: #000; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.75);
}
.player.borderless .player-head,
.player.borderless .player-lyrics,
.player.borderless .player-progress,
.player.borderless .player-controls,
.player.borderless .player-extra { display: none; }
.player.borderless .player-stage video { max-height: 86vh; }
.player.borderless .borderless-exit {
  position: absolute; right: 10px; top: 10px; display: grid; opacity: 0; transition: opacity 0.2s;
  background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.2);
}
.player.borderless:hover .borderless-exit { opacity: 1; }

/* 解密 / 导出面板 */
.player-sheet {
  position: absolute; inset: 0; z-index: 8; display: none;
  background: linear-gradient(180deg, rgba(10, 15, 28, 0.98), rgba(8, 12, 22, 0.99));
  padding: 14px 16px; overflow-y: auto;
}
.player-sheet.open { display: block; }
.player-sheet h4 { margin: 0 0 4px; font-size: 14px; }
.player-sheet h4:not(:first-of-type) { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.player-sheet input[type="file"] { width: 100%; font-size: 11px; color: #9aa6c8; background: rgba(255,255,255,.04); border: 1px dashed rgba(255,255,255,.18); border-radius: 8px; padding: 7px 8px; }
.player-sheet input[type="file"]::file-selector-button { margin-right: 8px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.08); color: #dfe6f8; border-radius: 6px; padding: 3px 8px; font-size: 10.5px; }
.player-sheet .sheet-sub { margin: 0 0 12px; font-size: 11.5px; color: #8b95b2; line-height: 1.6; }
.export-picker { border: 1px solid rgba(255,255,255,.1); border-radius: 8px; background: rgba(255,255,255,.03); overflow: hidden; }
.export-picker-tools { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,.08); }
.export-picked { margin-left: auto; font-size: 10.5px; color: #8b95b2; }
.export-list { max-height: 132px; overflow-y: auto; display: flex; flex-direction: column; }
.export-item { display: flex; align-items: center; gap: 8px; padding: 6px 9px; font-size: 11.5px; color: #c8d1ea; border-bottom: 1px solid rgba(255,255,255,.04); cursor: pointer; }
.export-item:last-child { border-bottom: 0; }
.export-item:hover { background: rgba(255,255,255,.05); }
.export-item input { accent-color: #22d3ee; }
.export-empty { margin: 0; padding: 10px; color: #6f7a96; font-size: 11px; }
.player-sheet .row { margin-bottom: 10px; }
.player-sheet .row label { display: block; font-size: 11.5px; color: #9aa6c8; margin-bottom: 4px; }
.player-sheet input[type="text"], .player-sheet select {
  width: 100%; padding: 8px 10px; border-radius: 9px; font-size: 12.5px;
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12); color: #e8ecf8;
}
.player-sheet .sheet-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.player-sheet .sheet-log {
  margin-top: 10px; font-size: 11.5px; color: #9aa6c8; background: rgba(255, 255, 255, 0.04);
  border-radius: 9px; padding: 8px 10px; min-height: 40px; max-height: 96px; overflow: auto; line-height: 1.6;
  white-space: pre-wrap;
}
.player-sheet .sheet-close { position: absolute; right: 12px; top: 10px; }

/* 独立窗口页面 */
body.standalone {
  background: #05070f; margin: 0; min-height: 100vh; display: grid; place-items: stretch;
}
body.standalone .standalone-wrap { min-height: 100vh; display: flex; flex-direction: column; }
body.standalone .player {
  position: relative; left: auto; bottom: auto; width: 100%; max-width: none;
  border-radius: 0; border: 0; min-height: 100vh;
  box-shadow: none;
}
body.standalone .player.is-video { width: 100%; }
body.standalone .player-head { cursor: default; }
body.standalone .player-stage { flex: 1; display: flex; }
body.standalone .player-stage video { max-height: none; height: 100%; object-fit: contain; flex: 1; }
body.standalone .player-stage .stage-audio { height: auto; flex: 1; min-height: 140px; }
body.standalone .player-lyrics { max-height: 180px; }
body.standalone .sheet-close-standalone { display: none; }

@media (max-width: 760px) {
  .player, .player.is-video { width: calc(100vw - 20px); left: 10px; bottom: 10px; }
  .player-stage video { max-height: 46vh; }
  .player-extra { font-size: 11px; }
  .volume { width: 26px; }
}

/* ==========================================================================
   2026 播放列表 / 离线解密 / 图标提示
   ========================================================================== */
.loop-group { display: inline-flex; gap: 2px; }
.loop-mode { width: 27px; height: 27px; }
.loop-mode.active { background: rgba(124, 123, 255, 0.3); color: #fff; border-color: rgba(124, 123, 255, 0.52); }
#pListBtn { position: relative; }
#pListBtn .list-count {
  position: absolute; right: -2px; top: -3px; min-width: 14px; height: 14px; padding: 0 3px;
  border-radius: 99px; background: #22d3ee; color: #05121a; font-size: 9px; font-weight: 800;
  display: grid; place-items: center; line-height: 1;
}
.pbtn[data-tip] { position: relative; }
.pbtn[data-tip]::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 7px);
  transform: translateX(-50%) translateY(2px); white-space: nowrap; pointer-events: none;
  background: #020611; color: #e8ecf8; border: 1px solid rgba(255,255,255,.16);
  padding: 4px 7px; border-radius: 6px; font-size: 10.5px; line-height: 1.2;
  opacity: 0; visibility: hidden; transition: opacity .14s, transform .14s, visibility .14s; z-index: 20;
}
.pbtn[data-tip]:hover::after, .pbtn[data-tip]:focus-visible::after {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}

.player-playlist {
  position: absolute; left: 0; right: 0; top: 45px; bottom: 0; z-index: 6;
  background: linear-gradient(180deg, rgba(15, 22, 40, 0.99), rgba(8, 12, 22, 0.99));
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex; flex-direction: column; min-height: 0;
  overflow: hidden;
}
.player-playlist[hidden] { display: none; }
.pl-head { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-bottom: 1px solid rgba(255,255,255,.08); }
.pl-head strong { font-size: 12.5px; color: #e5ebff; }
.pl-count { color: #22d3ee; font-family: var(--mono); font-size: 11px; }
.pl-head-actions { margin-left: auto; display: flex; gap: 3px; }
.pl-head .pbtn { width: 27px; height: 27px; }
.pl-toolbar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 7px 10px; border-bottom: 1px solid rgba(255,255,255,.06); }
.mini-player-btn {
  border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); color: #c8d1ea;
  border-radius: 6px; font-size: 10.5px; padding: 3px 6px; line-height: 1.3;
}
.mini-player-btn:hover { background: rgba(255,255,255,.14); color: #fff; }
.mini-player-btn.danger:hover { color: #fecaca; border-color: rgba(248,113,113,.5); }
.pl-check { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; color: #9aa6c8; white-space: nowrap; }
.pl-check input { accent-color: #22d3ee; }
.pl-items { list-style: none; margin: 0; padding: 6px 8px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; flex: 1; min-height: 0; scrollbar-width: thin; }
.pl-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 5px;
  padding: 4px 5px; border-radius: 7px; border: 1px solid transparent;
}
.pl-item:hover { background: rgba(255,255,255,.055); }
.pl-item.active { background: rgba(124,123,255,.16); border-color: rgba(124,123,255,.35); }
.pl-check { margin: 0; }
.pl-main {
  display: flex; align-items: center; gap: 6px; min-width: 0; border: 0; background: transparent;
  color: #dfe6f8; text-align: left; padding: 2px 0;
}
.pl-num { font-family: var(--mono); font-size: 9px; color: #7d87a3; width: 16px; flex: none; }
.pl-name { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pl-badges { display: inline-flex; gap: 3px; flex: none; }
.pl-badge { font-size: 8.5px; border-radius: 999px; padding: 1px 4px; line-height: 1.4; }
.pl-badge.decrypt { color: #67e8f9; background: rgba(34,211,238,.15); border: 1px solid rgba(34,211,238,.3); }
.pl-badge.lyric { color: #c4b5fd; background: rgba(167,139,250,.14); border: 1px solid rgba(167,139,250,.3); }
.pl-badge.transcode { color: #fde68a; background: rgba(251,191,36,.12); border: 1px solid rgba(251,191,36,.26); }
.pl-del { border: 0; background: transparent; color: #8b95b2; font-size: 14px; line-height: 1; width: 18px; height: 18px; border-radius: 5px; }
.pl-del:hover { color: #fca5a5; background: rgba(239,68,68,.12); }
.pl-empty { padding: 26px 18px; text-align: center; color: #6f7a96; font-size: 11.5px; }
.pl-note { padding: 6px 12px 8px; border-top: 1px solid rgba(255,255,255,.06); color: #69738e; font-size: 9.5px; line-height: 1.5; }

.player-sheet b { color: #fde68a; font-weight: 700; }
.decrypt-folder-row .folder-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.decrypt-folder-row #pFolderName { font-size: 10.5px; color: #8b95b2; word-break: break-all; }
.player-sheet .sheet-actions .btn { border-radius: 8px; }
.player.borderless .player-playlist { display: none; }
.player.min .player-playlist {
  top: 42px; bottom: auto; height: 300px; max-height: 58vh;
  border-radius: 12px; box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}
body.standalone .player-playlist { top: 48px; }
@media (max-width: 760px) {
  .loop-mode { width: 25px; height: 25px; }
  .pl-badge { font-size: 8px; }
  .player-playlist { top: 43px; }
}

/* 单按钮循环模式 */
.loop-group { display: inline-flex; }
#pLoop { width: 30px; }
#pLoop.active { background: rgba(124, 123, 255, 0.26); color: #fff; border-color: rgba(124, 123, 255, 0.48); }

/* 播放器控件悬停显示与自动收起 */
.player-controls, .player-progress { transition: opacity .2s ease, transform .2s ease; }
.player.ui-idle .player-controls,
.player.ui-idle .player-progress { opacity: 0; pointer-events: none; transform: translateY(4px); }
.player.ui-idle:hover .player-controls,
.player.ui-idle:hover .player-progress,
.player.ui-idle:focus-within .player-controls,
.player.ui-idle:focus-within .player-progress { opacity: 1; pointer-events: auto; transform: none; }

/* 无边框：顶部拖拽条 + 悬停控制条 */
.borderless-drag-strip { display: none; }
.player.borderless .borderless-drag-strip {
  display: block; position: absolute; left: 0; right: 0; top: 0; height: 30px; z-index: 9;
  cursor: grab; touch-action: none;
  background: linear-gradient(180deg, rgba(0,0,0,.32), transparent);
  opacity: 0; transition: opacity .2s;
}
.player.borderless .borderless-drag-strip::after {
  content: '拖动'; position: absolute; left: 50%; top: 6px; transform: translateX(-50%);
  color: rgba(255,255,255,.82); font-size: 10px; letter-spacing: 2px;
  background: rgba(0,0,0,.38); border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 1px 9px;
}
.player.borderless:hover .borderless-drag-strip { opacity: 1; }
.player.borderless .player-controls {
  display: flex; position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  width: auto; max-width: calc(100% - 20px); z-index: 10; padding: 6px 9px;
  background: rgba(5, 7, 15, .74); border: 1px solid rgba(255,255,255,.14); border-radius: 999px;
  backdrop-filter: blur(8px); opacity: 0; transition: opacity .2s;
}
.player.borderless:hover .player-controls,
.player.borderless:focus-within .player-controls { opacity: 1; }
.player.borderless .player-controls .full-only { display: none; }
.player.borderless .player-controls .grow { display: none; }

/* 播放器透明背景（可选） */
.player.transparent { background: rgba(8, 12, 22, .38); backdrop-filter: blur(14px) saturate(140%); }
.player.transparent .player-stage { background: transparent; }
.player.transparent .player-lyrics { background: transparent; }
.player-extra .inline-check { display: inline-flex; align-items: center; gap: 4px; color: #9aa6c8; font-size: 11.5px; }
.player-extra .inline-check input { accent-color: #22d3ee; }
.lyric-placeholder { font-size: 11px !important; color: #7d87a3 !important; }
