/* ============ player.css — 播放页 / 控制栏 / 弹幕 / 评论面板 ============ */
.player-page {
  display: flex; gap: 0;
  height: calc(100vh - var(--header-h));   /* 旧浏览器回退 */
  height: calc(100dvh - var(--header-h));  /* 现代浏览器：随地址栏自适应，底部不再被顶出屏幕 */
  background: var(--player-bg); overflow: hidden;
}
.pp-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

/* 播放页的整屏居中容器（加载中 / 错误 / 弹窗） */
.fill-screen {
  height: calc(100vh - var(--header-h));
  height: calc(100dvh - var(--header-h));
  display: grid; place-items: center; background: #000;
}

.video-wrap {
  position: relative; flex: 1; min-height: 0;
  background: #000; display: flex; align-items: center; justify-content: center;
}
.video-layer {
  position: relative; width: 100%; height: 100%;
  max-height: 100%;
}
.video-layer video {
  width: 100%; height: 100%; object-fit: contain; background: #000; display: block;
}
/* JASSUB 会自动在 video 后插入一块字幕 canvas（类名 JASSUB） */
canvas.JASSUB { z-index: 1; }
.dm-canvas {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
}

/* 中央大播放按钮 */
.big-play {
  position: absolute; inset: 0; z-index: 8; display: grid; place-items: center;
  background: rgba(0,0,0,.28); opacity: 0; transition: opacity .2s; cursor: pointer;
  pointer-events: none;
}
.big-play.show { opacity: 1; pointer-events: auto; }
.big-play .bp {
  width: 82px; height: 82px; border-radius: 50%; background: rgba(0,0,0,.6);
  border: 2px solid rgba(255,255,255,.85); color: #fff; font-size: 30px;
  display: grid; place-items: center; backdrop-filter: blur(4px);
}

/* ---------- 控制栏 ---------- */
.controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 34px 12px 8px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.85));
  opacity: 0; transition: opacity .25s; user-select: none;
}
.video-wrap.controls-visible .controls, .video-wrap.paused .controls { opacity: 1; }
.seek-row { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.seek {
  flex: 1; height: 5px; border-radius: 3px; background: rgba(255,255,255,.22);
  position: relative; cursor: pointer;
}
.seek .buf { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,255,255,.3); border-radius: 3px; }
.seek .played { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 3px; }
.seek .knob {
  position: absolute; top: 50%; width: 13px; height: 13px; border-radius: 50%;
  background: #fff; transform: translate(-50%, -50%); box-shadow: 0 0 4px rgba(0,0,0,.6);
  opacity: 0; transition: opacity .15s;
}
.seek:hover .knob, .seek.dragging .knob { opacity: 1; }
/* 触屏没有 hover，进度圆点常显，用户才知道这里能拖 */
@media (pointer: coarse) { .seek .knob { opacity: 1; } }
.time { color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.ctrl-row { display: flex; align-items: center; gap: 4px; }
.ctrl-btn {
  width: 36px; height: 36px; border-radius: 6px; color: #fff; display: grid; place-items: center;
  font-size: 18px; transition: background .15s;
}
.ctrl-btn:hover { background: rgba(255,255,255,.16); }
.ctrl-btn.small { font-size: 14px; }
.ctrl-btn.on { color: var(--accent); }
.ctrl-btn .lbl { font-size: 11px; }
.ctrl-spacer { flex: 1; }

.volume { display: flex; align-items: center; gap: 4px; }
.volume .vol-slider { width: 0; overflow: hidden; transition: width .2s; }
.volume:hover .vol-slider { width: 72px; }
.volume input[type=range] { width: 72px; accent-color: var(--accent); cursor: pointer; }

/* ---------- 设置菜单 ---------- */
.settings-menu {
  position: absolute; right: 10px; bottom: 58px; z-index: 20;
  background: rgba(24,26,30,.96); border-radius: 8px; color: #fff;
  min-width: 220px; padding: 6px; box-shadow: var(--shadow-lg);
  /* 字幕/音轨很多时，菜单可滚动，不会顶出屏幕 */
  max-height: min(62vh, 440px);
  max-height: min(62dvh, 440px);
  overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.settings-menu .sm-title { font-size: 12px; color: #9aa0a8; padding: 6px 10px 4px; }
.settings-menu .sm-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 10px; border-radius: 6px; font-size: 13px; cursor: pointer;
}
.settings-menu .sm-item:hover { background: rgba(255,255,255,.1); }
.settings-menu .sm-item.active { color: var(--accent); font-weight: 600; }
.settings-menu .sm-item .check { color: var(--accent); font-weight: 700; }

/* 弹幕设置面板 */
.settings-menu.dm-settings { padding: 6px; }
.dm-row { margin: 9px 0; }
.dm-label { display: block; font-size: 12px; color: #9aa0a8; margin-bottom: 5px; }
.dm-opts { display: flex; flex-wrap: wrap; gap: 5px; }
.dm-opts button {
  padding: 4px 10px; border: 1px solid rgba(255,255,255,.25); border-radius: 5px;
  background: transparent; color: #fff; font-size: 12px; cursor: pointer;
}
.dm-opts button:hover { background: rgba(255,255,255,.12); }
.dm-opts button.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 弹幕设置里的「弹幕匹配」行 */
.dm-match-row { border-top: 1px solid rgba(255,255,255,.12); padding-top: 10px; }
.dm-match-info { font-size: 12px; line-height: 1.5; margin-bottom: 7px; color: #c9cdd4; word-break: break-all; }
.dm-match-info.ok { color: #6fd07a; }
.dm-match-info.bad { color: #ff9a6a; }
.dm-match-btn {
  padding: 5px 12px; border: 1px solid rgba(255,255,255,.25); border-radius: 5px;
  background: transparent; color: #fff; font-size: 12px; cursor: pointer;
}
.dm-match-btn:hover { background: rgba(255,255,255,.12); }

/* ---------- 播放器上的「弹幕未匹配」提示条 ---------- */
.dm-match-prompt {
  position: absolute; left: 12px; right: 12px; top: 12px; z-index: 26;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 8px 14px; border-radius: 8px;
  background: rgba(24,26,30,.94); color: #e8eaee; font-size: 13px;
  box-shadow: var(--shadow-lg);
}
.dm-match-prompt span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-match-prompt .go {
  flex: none; background: var(--accent); color: #fff; font-weight: 600;
  padding: 5px 12px; border-radius: 6px; font-size: 12px;
}
.dm-match-prompt .go:hover { background: var(--accent-hover); }
.dm-match-prompt .x { flex: none; color: #9aa0a8; font-size: 14px; padding: 2px 4px; }
.dm-match-prompt .x:hover { color: #fff; }

/* ---------- 手动匹配弹窗 ---------- */
.dmm-mask {
  position: fixed; inset: 0; z-index: 5000; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.dmm-box {
  width: 100%; max-width: 560px;
  max-height: 86vh; max-height: 86dvh;
  display: flex; flex-direction: column;
  background: #14161a; color: #e8eaee; border-radius: 12px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.dmm-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; font-weight: 700; font-size: 15px; border-bottom: 1px solid #23272e;
}
.dmm-x { color: #9aa0a8; font-size: 15px; padding: 2px 6px; }
.dmm-x:hover { color: #fff; }
.dmm-cur { padding: 10px 16px; font-size: 12px; color: #9aa0a8; border-bottom: 1px solid #1e2229; }
.dmm-cur b { color: #e8eaee; }
.dmm-ok { color: #6fd07a; margin-top: 3px; }
.dmm-search { display: flex; gap: 8px; padding: 12px 16px; }
.dmm-search input {
  flex: 1; min-width: 0; background: #1a1e24; border: 1px solid #2b3038; border-radius: 6px;
  padding: 8px 10px; color: #e8eaee; font-size: 13px; outline: none;
}
.dmm-search input:focus { border-color: #3a4150; }
.dmm-go {
  flex: none; padding: 8px 16px; border-radius: 6px; background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 600;
}
.dmm-go:hover { background: var(--accent-hover); }
.dmm-body { flex: 1; min-height: 120px; overflow-y: auto; padding: 0 10px 10px; -webkit-overflow-scrolling: touch; }
.dmm-empty { padding: 26px 12px; text-align: center; color: #7d838c; font-size: 13px; }
.dmm-item { padding: 9px 12px; border-radius: 7px; cursor: pointer; transition: background .12s; }
.dmm-item:hover { background: rgba(255,255,255,.07); }
.dmm-item-t { font-size: 13px; }
.dmm-item-s { font-size: 11px; color: #8b9098; margin-top: 2px; }
.dmm-ep.guess .dmm-item-t { color: #ffd24a; }
.dmm-ep.sel { background: rgba(230,0,18,.22); outline: 1px solid var(--accent); }
.dmm-back { padding: 8px 12px; font-size: 12px; color: #9aa0a8; cursor: pointer; }
.dmm-back:hover { color: #fff; }
.dmm-sub { padding: 4px 12px 8px; font-size: 12px; color: #9aa0a8; }
.dmm-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #23272e; background: #101216;
}
.dmm-tip { flex: 1; min-width: 0; font-size: 11px; color: #7d838c; }
.dmm-clear { font-size: 12px; color: #ff9a6a; padding: 6px 8px; border-radius: 6px; }
.dmm-clear:hover { background: rgba(255,154,106,.12); }
.dmm-save { flex: none; padding: 8px 18px; border-radius: 6px; font-size: 13px; font-weight: 600; background: var(--accent); color: #fff; }
.dmm-save:disabled { opacity: .4; cursor: not-allowed; }
.dmm-save:not(:disabled):hover { background: var(--accent-hover); }

/* ---------- 评论面板（NICONICO 风格，右侧，深色） ---------- */
.comment-panel {
  width: 320px; flex: none; background: #101216; color: #e8eaee;
  display: flex; flex-direction: column; border-left: 1px solid #23272e;
}
.cp-head {
  padding: 12px 14px; font-weight: 700; font-size: 14px;
  border-bottom: 1px solid #23272e; display: flex; align-items: center; gap: 8px;
}
.cp-head .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* 面板切换页签：コメント / 推荐 */
.cp-tabs { flex: none; display: flex; border-bottom: 1px solid #23272e; }
.cp-tab {
  flex: 1; min-width: 0; padding: 11px 8px; font-size: 13px; font-weight: 700;
  color: #8b9098; display: flex; align-items: center; justify-content: center; gap: 6px;
  border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
}
.cp-tab:hover { color: #c9cdd4; }
.cp-tab.active { color: #fff; border-bottom-color: var(--accent); }
.cp-tab .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.cp-tab .muted { font-size: 11px; font-weight: 400; }

.cp-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* 推荐列表（Emby 原生相似推荐） */
.rec-list {
  flex: 1; min-height: 0; overflow-y: auto; padding: 10px;
  display: flex; flex-direction: column; gap: 6px;
  -webkit-overflow-scrolling: touch;
}
.rec-card {
  display: flex; gap: 10px; padding: 7px; border-radius: 8px;
  cursor: pointer; transition: background .12s;
}
.rec-card:hover { background: rgba(255,255,255,.06); }
.rec-poster {
  width: 46px; height: 66px; flex: none; object-fit: cover;
  border-radius: 5px; background: #1a1e24;
}
.rec-body { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.rec-title {
  font-size: 13px; font-weight: 600; line-height: 1.35; color: #e8eaee;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rec-meta { font-size: 11px; color: #8b9098; }
.cp-list { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.cp-item { display: flex; gap: 8px; align-items: flex-start; }
.cp-item .cp-num {
  flex: none; font-size: 11px; color: #8b9098; min-width: 30px; text-align: right;
  font-variant-numeric: tabular-nums; padding-top: 2px;
}
.cp-item .cp-text { font-size: 13px; line-height: 1.5; word-break: break-word; text-shadow: 0 1px 1px rgba(0,0,0,.6); }
.cp-item .cp-text.mode-top { color: #6ab7ff; }
.cp-item .cp-text.mode-bottom { color: #6fd07a; }
.cp-empty { color: #8b9098; font-size: 13px; text-align: center; padding: 30px 10px; }

.cp-input {
  border-top: 1px solid #23272e; background: #0d1013;
  /* 底部留出 iPhone 全面屏「home 指示条」安全区，避免输入框被遮住 */
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
}
.cp-input textarea {
  width: 100%; height: 44px; resize: none; border: 1px solid #2b3038; border-radius: 6px;
  padding: 8px 10px; font-size: 13px; outline: none; background: #1a1e24; color: #e8eaee;
}
.cp-input textarea:focus { border-color: #3a4150; }
.cp-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.cp-row .label { font-size: 11px; color: #8b9098; }
.cp-colors { display: flex; gap: 4px; }
.cp-color { width: 18px; height: 18px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; }
.cp-color.active { border-color: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.4) inset; }
.cp-size, .cp-pos { display: flex; gap: 3px; }
.cp-size button, .cp-pos button {
  padding: 3px 8px; border: 1px solid #2b3038; border-radius: 4px; font-size: 12px; background: #1a1e24; color: #c9cdd4;
}
.cp-size button.active, .cp-pos button.active { background: #e8eaee; color: #101216; border-color: #e8eaee; }
.cp-send { margin-left: auto; }
.cp-send button {
  background: var(--accent); color: #fff; border-radius: 5px; padding: 6px 16px; font-size: 13px; font-weight: 600;
}
.cp-send button:disabled { opacity: .5; cursor: not-allowed; }

.pp-info {
  flex: none; /* 标题栏固定高度，永远可见，不被压缩 */
  padding: 10px 16px; color: #e8eaee; font-size: 13px; display: flex; align-items: center; gap: 12px;
  background: #101216;
}
.pp-info .back { cursor: pointer; color: #9aa0a8; }
.pp-info .back:hover { color: #fff; }
.pp-info .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 加载遮罩 */
.player-loading {
  position: absolute; inset: 0; z-index: 30; display: grid; place-items: center;
  background: #000; color: #9aa0a8; font-size: 14px; gap: 12px; align-content: center;
}
.player-loading .spinner { margin: 0 auto; }

/* 缓冲提示（含网速） */
.player-buffering {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 25; display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: #fff; font-size: 13px; pointer-events: none;
}
.player-buffering .spinner { margin: 0 auto; width: 40px; height: 40px; border-width: 3px; border-color: rgba(255,255,255,.3); border-top-color: var(--accent); }
.player-buffering .speed { text-shadow: 0 1px 2px rgba(0,0,0,.85); }

/* 无法播放 HEVC 的弹窗 */
.unplayable-box {
  background: #1a1e24; border: 1px solid #2b3038; border-radius: 12px;
  padding: 28px 24px; max-width: 440px; width: 100%; text-align: center;
  box-shadow: var(--shadow-lg);
}
.unplayable-box .up-icon { font-size: 42px; margin-bottom: 10px; }
.unplayable-box h3 { margin: 0 0 8px; font-size: 18px; color: #fff; }
.unplayable-box p { margin: 0 0 18px; font-size: 13px; color: #9aa0a8; line-height: 1.6; }
.unplayable-box .up-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.unplayable-box .up-note { margin: 16px 0 0; font-size: 12px; color: #6b7280; }

/* ---------- 响应式 ---------- */
/* 移动端 / 平板竖屏：整页固定高度 = 视口高度，
   结构为「视频（16:9，封顶） + 标题栏 + 评论面板（占满剩余，内部滚动）」，
   页面本身不再滚动，标题栏永远可见。 */
@media (max-width: 900px) {
  .player-page {
    flex-direction: column;
    height: calc(100vh - var(--header-h));
    height: calc(100dvh - var(--header-h)); /* 关键：扣掉手机地址栏，底部不再被遮挡 */
    min-height: 0;
    overflow: hidden;
  }
  .pp-main { flex: none; height: auto; overflow: visible; }
  .video-wrap {
    flex: none; width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 44vh;
    max-height: 44dvh;
  }
  .pp-info { flex: none; }
  .comment-panel {
    width: 100%; flex: 1 1 auto; min-height: 0;
    border-left: none; border-top: 1px solid #23272e;
  }
  .cp-list { flex: 1 1 auto; min-height: 0; max-height: none; }
}
@media (max-width: 640px) {
  .video-wrap { max-height: 38vh; max-height: 38dvh; }
  .cp-input textarea { height: 36px; }
  .pp-info { font-size: 12px; padding: 8px 12px; }
  .controls { padding: 24px 8px 6px; }
  .ctrl-btn { width: 32px; height: 32px; font-size: 16px; }
  .ctrl-btn.small { font-size: 12px; }
  .settings-menu { min-width: 200px; }
  .time { font-size: 11px; }
}
/* 手机横屏：改成「视频 + 评论」左右并排，
   否则竖排时视频只剩很矮一条 */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 520px) {
  .player-page { flex-direction: row; }
  .pp-main { flex: 1 1 auto; min-width: 0; }
  .video-wrap {
    flex: 1 1 auto; width: auto; min-height: 0;
    aspect-ratio: auto; max-height: none;
  }
  .comment-panel {
    width: 42%; max-width: 360px; flex: none; min-height: 0;
    border-top: none; border-left: 1px solid #23272e;
  }
}

/* ---------- h265web.js（HEVC 软解）渲染层 ----------
   层级（.video-layer 内，从上到下）：
     .dm-canvas (z-index 2)  >  canvas.JASSUB(自动)  >  .h265-stage(z-index 0)  >  video.h265-clock(普通流)
   .h265-stage 负责画面，pointer-events:none 让点击穿透到上面的时钟 <video>（播放/暂停）。
   .h265-clock 只是 JASSUB 的尺寸基准 + 事件源，本身透明、不放任何画面。 */
.h265-stage {
  position: absolute; inset: 0; z-index: 0;
  display: grid; place-items: center;
  pointer-events: none;
  background: #000;
}
/* 不在用（H264 片源）时必须隐藏 —— 定位元素会盖住普通文档流里的 <video> */
.h265-stage:empty { display: none; }
.h265-stage canvas { display: block; max-width: 100%; max-height: 100%; }
.video-layer video.h265-clock { background: transparent; }

/* ---------- 手势提示（双击快进快退 / 长按 2x） ---------- */
.gesture-osd {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.92);
  z-index: 12; pointer-events: none; opacity: 0;
  background: rgba(0,0,0,.68); color: #fff; border-radius: 14px;
  padding: 14px 26px; font-size: 22px; font-weight: 700; line-height: 1.3;
  text-align: center; white-space: nowrap; backdrop-filter: blur(6px);
  transition: opacity .16s ease, transform .16s ease;
}
.gesture-osd.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.gesture-osd small { display: block; margin-top: 4px; font-size: 13px; font-weight: 400; color: #cfd4dc; }
.gesture-osd.back { border-left: 4px solid #60a5fa; }
.gesture-osd.fwd  { border-right: 4px solid #60a5fa; }
.gesture-osd.hold { background: rgba(230,0,18,.82); font-size: 20px; }

/* 双击快进/快退时，左右两侧闪一下，让操作有反馈 */
.video-wrap { touch-action: manipulation; }

/* ---------- 上一集 / 下一集（控制栏，紧贴播放键两侧） ---------- */
.controls button.ep-ctl { font-size: 17px; line-height: 1; }
.controls button.ep-ctl[hidden] { display: none; }
.controls button.ep-ctl:disabled { opacity: .3; }
.ep-pos {
  margin-left: 10px; padding: 2px 8px; border-radius: 10px;
  background: #f1f3f6; color: #6b7280; font-size: 12px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ep-pos[hidden] { display: none; }

/* ---------- 移动端 / 触屏优化 ---------- */
@media (pointer: coarse) {
  /* 控制栏按钮：只加高不加宽，否则小屏上按钮会挤爆挤出画面 */
  .controls button, .controls .ctl-btn {
    min-height: 40px; min-width: 34px; padding: 0 6px; font-size: 15px;
  }
  /* 进度条视觉保持 5px 细线，但把可点区域上下各扩 12px，手指才拖得住 */
  .seek { height: 6px; }
  .seek::before { content: ''; position: absolute; left: 0; right: 0; top: -12px; bottom: -12px; }
  .seek .knob { width: 16px; height: 16px; }   /* 拖动圆点放大，手指好抓 */
  .controls { padding: 20px 10px 8px; }
  .controls .time { font-size: 11.5px; }
  /* 设置菜单给足高度、加大行高 */
  .settings-menu { max-height: min(70dvh, 520px); }
  .settings-menu .row { padding: 11px 12px; font-size: 14px; }
  .gesture-osd { font-size: 20px; padding: 12px 22px; }
}

@media (max-width: 640px) {
  .pp-info { flex-wrap: wrap; }
  .ep-pos { margin-left: 0; }
}

/* ---------- 设置菜单：统一的行样式（音轨 / 字幕 / 倍速 / 弹幕 共用） ---------- */
.settings-menu .sm-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 7px 10px; border-radius: 6px; font-size: 13px;
}
.settings-menu .sm-row + .sm-row { border-top: 1px solid rgba(255,255,255,.06); }
.sm-row-label { color: #c9cdd4; flex: none; }
.sm-seg { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.sm-seg button {
  padding: 3px 9px; border-radius: 5px; font-size: 12px; line-height: 1.5;
  border: 1px solid rgba(255,255,255,.2); background: transparent; color: #d5dae1; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.sm-seg button:hover { background: rgba(255,255,255,.12); }
.sm-seg button.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* 弹幕匹配那一行：状态文字换行显示，不撑宽菜单 */
.settings-menu .dm-match-row { align-items: flex-start; flex-direction: column; gap: 7px; }
.settings-menu .dm-match-row .sm-row-label { color: #9aa0a8; font-size: 12px; }
.settings-menu .dm-match-info { margin: 0; width: 100%; }
.settings-menu .dm-match-btn { align-self: flex-start; }

/* ---------- 手动匹配弹窗：集号标签 ---------- */
.dmm-no {
  display: inline-block; min-width: 46px; margin-right: 8px; padding: 1px 7px;
  border-radius: 4px; background: rgba(230,0,18,.85); color: #fff;
  font-size: 11px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums;
}
.dmm-no-x { background: rgba(255,255,255,.14); color: #9aa0a8; font-weight: 600; }
.dmm-item.extra { opacity: .62; }
.dmm-item.extra .dmm-item-t { font-weight: 500; }

@media (max-width: 900px) {
  .settings-menu { min-width: 0; }
  .settings-menu .sm-row { padding: 9px 10px; }
  .sm-seg button { padding: 5px 11px; font-size: 12.5px; }
}

/* ---------- 卡顿时「换个线路试试」提示条 ---------- */
.hp-bar {
  position: absolute; left: 12px; right: 12px; bottom: 62px; z-index: 26;
  background: rgba(24,26,30,.95); color: #e8eaee; border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px; padding: 10px 12px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 9px; font-size: 13px;
  animation: hp-in .2s ease-out;
}
@keyframes hp-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.hp-bar .hp-head { display: flex; align-items: flex-start; gap: 7px; line-height: 1.45; }
.hp-bar .hp-ico { color: #f59e0b; flex: none; }
.hp-bar .hp-head b { color: #ffd24a; }
.hp-bar .hp-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hp-bar .hp-line {
  padding: 5px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--accent); color: #fff; cursor: pointer;
}
.hp-bar .hp-line:hover { background: var(--accent-hover); }
.hp-bar .hp-ignore {
  margin-left: auto; padding: 5px 10px; border-radius: 999px; font-size: 12.5px;
  background: transparent; color: #9aa0a8; cursor: pointer;
}
.hp-bar .hp-ignore:hover { color: #fff; background: rgba(255,255,255,.1); }

/* 自动刷新倒计时（配合 js/notice.js 的 autoRefreshSoon） */
.notice-bar .notice-count {
  flex: none; font-variant-numeric: tabular-nums;
  color: #ffd9b8; font-size: 12.5px; white-space: nowrap;
}
@media (max-width: 900px) {
  .hp-bar { bottom: auto; top: 10px; font-size: 12.5px; padding: 9px 10px; }
  .hp-bar .hp-line { padding: 4px 10px; font-size: 12px; }
}

/* ---------- 左右滑动调进度时的提示 ---------- */
.gesture-osd.scrub {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 200px; padding: 14px 30px;
  background: rgba(0,0,0,.8); border-left: 4px solid var(--accent); border-right: 4px solid var(--accent);
}
.gesture-osd.scrub .scrub-t {
  font-size: 32px; font-weight: 800; letter-spacing: 1px;
  font-variant-numeric: tabular-nums; line-height: 1.05;
}
.gesture-osd.scrub small { margin-top: 2px; }
/* 拖动时给画面一点反馈：压暗 + 隐藏控制栏，专心跳进度 */
.video-wrap.scrubbing::after {
  content: ''; position: absolute; inset: 0; z-index: 6; pointer-events: none;
  background: rgba(0,0,0,.18);
}
.video-wrap.scrubbing .controls { opacity: 0; }
@media (max-width: 900px) {
  .gesture-osd.scrub { min-width: 170px; padding: 12px 22px; }
  .gesture-osd.scrub .scrub-t { font-size: 26px; }
}

/* ================= 播放器：禁止长按选中 =================
   手机上长按视频会弹出"选择/放大镜/左右选择条"，非常影响手势操作。
   视频区域、字幕画布、控制条全部禁止选中。 */
.video-wrap,
.video-wrap video,
.video-wrap canvas,
.video-wrap .controls,
.video-wrap .big-play,
.video-wrap .gesture-osd,
.video-wrap .settings-menu,
.player-page .ep-list {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
/* 视频本身绝不能被拖动/选中 */
.video-wrap video {
  pointer-events: auto;
  -webkit-user-drag: none;
  user-drag: none;
}
/* 但字幕/弹幕的文字偶尔有人想复制，保留选择能力的开关：
   需要复制的容器加 class="selectable" 即可 */
.selectable, .selectable * {
  -webkit-user-select: text;
  user-select: text;
}
