﻿/* overlay.css — OBS 浏览器源专用
 *
 * 三条硬性约束：
 * 1. 背景必须完全透明（OBS 叠加在画面上）；
 * 2. 不能有任何滚动条或白边（body margin 0、overflow hidden）；
 * 3. 字号用 rem 时根字号不能跟随页面缩放 —— 这里直接用 px。
 */

@layer page {
  /* overlay 页不加载 base.css（它带导航/排版等用不上的东西），
     所以这里必须自己声明 [hidden]，否则 JS 设了 hidden 也藏不住。 */
  [hidden] { display: none !important; }

  html.is-overlay, html.is-overlay body {
    margin: 0;
    padding: 0;
    background: transparent !important;
    background-image: none !important;
    overflow: hidden;
    height: 100%;
    color: #fff;
    font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  }

  /* 预览模式：仅用于在普通浏览器里检查效果，OBS 里不要加 ?preview=1 */
  html.is-preview, html.is-preview body {
    background: linear-gradient(135deg, #1c1811 0%, #2f2a20 55%, #14110c 100%) !important;
    background-image: linear-gradient(135deg, #1c1811 0%, #2f2a20 55%, #14110c 100%) !important;
  }

  .overlay-body { position: relative; }

  /* ── 弹幕 ─────────────────────────────────────────── */
  .danmaku-stage {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
  }
  .danmaku-item {
    position: absolute;
    left: 100%;
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    white-space: nowrap;
    font-weight: 700;
    text-shadow:
      0 0 2px rgba(0, 0, 0, 0.9),
      0 0 6px rgba(0, 0, 0, 0.55),
      0 2px 2px rgba(0, 0, 0, 0.6);
    will-change: transform;
  }
  .danmaku-item__user { color: #ffd76e; }
  .danmaku-item__user::after { content: "："; color: #fff; }
  .danmaku-item__text { color: #fff; }

  .overlay-hint {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    transform: translateX(-50%);
    padding: 0.3rem 0.8rem;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.72);
    background: rgba(0, 0, 0, 0.45);
    border-radius: 99px;
    transition: opacity 400ms ease;
  }
  .overlay-hint.is-hidden { opacity: 0; }

  /* ── 点歌面板 ─────────────────────────────────────── */
  .sq-panel {
    --sq-accent: #f0c96a;
    width: 380px;
    padding: 14px 16px;
    background: rgba(26, 21, 14, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    font-size: 14px;
  }
  .sq-panel__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  }
  .sq-panel__title { font-size: 16px; font-weight: 800; letter-spacing: 0.04em; }
  .sq-panel__meta { font-size: 12px; color: rgba(255, 255, 255, 0.72); }
  .sq-panel__meta strong { color: var(--sq-accent); font-size: 15px; }

  .sq-current {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    margin-bottom: 8px;
    background: color-mix(in srgb, var(--sq-accent) 22%, transparent);
    border-left: 3px solid var(--sq-accent);
    border-radius: 6px;
  }
  .sq-current__label {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--sq-accent);
    color: #06131f;
    font-weight: 800;
  }
  .sq-current__title { font-weight: 700; }
  .sq-current__requester { margin-left: auto; font-size: 12px; color: rgba(255, 255, 255, 0.65); }

  .sq-list { display: grid; gap: 4px; }
  .sq-list__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
  }
  .sq-list__pos {
    width: 20px;
    font-size: 12px;
    font-weight: 800;
    color: var(--sq-accent);
    text-align: center;
  }
  .sq-list__title { font-weight: 600; }
  .sq-list__artist { font-size: 12px; color: rgba(255, 255, 255, 0.6); }
  .sq-list__requester { margin-left: auto; font-size: 11px; color: rgba(255, 255, 255, 0.5); }
  .sq-empty { margin-top: 6px; font-size: 12px; color: rgba(255, 255, 255, 0.55); text-align: center; }
}
