/* ═══════════════════════════════════════════════════════════════
   audience-scoreboard.css
   观众计分板(C 路 · DMN 主播端 336px 浅色官方蓝版,窗口/浏览器源捕获进 OBS)
   重对齐依据(2026-09-05 最终稿):
     - ui/hifi/spectator_broadcaster_light.html (唯一主文件:悬浮窗形态、LOGO/
       赛季/局头部、RANK-TEAM-ALIVE-KILLS-PTS 表头与列宽、浅色行 + 深色健康竖条)
     - ui/hifi/spectator_scoreboard_final.html   (状态细节并入:击倒=白条清空并
       空-红-空-红闪烁 / 扶起=竖条恢复 / 击杀=置灰;light 未含 down 表现,故并入)
   主题令牌取自 ui/hifi/styleguide.md §1.2 浅色官方蓝 + light 稿 CSS 变量。
   ═══════════════════════════════════════════════════════════════ */
:root{
  --blue:#0030a8; --blue2:#001888;
  --line:#e8e8e8;
  --head-bg:#eef0f4;
  --text:#111111; --muted:#4a4a4a;
  --red:#c0392b;
  --mono:'Consolas','SF Mono',monospace;
  --font:'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif;
  --condensed:'Barlow Condensed','Rajdhani','Arial Narrow','Segoe UI',sans-serif;
  --row-a:.85;   /* 行底白色半透明,透明度可用滑杆调 */
}
*{box-sizing:border-box;margin:0;padding:0}
.num{font-family:var(--mono);font-variant-numeric:tabular-nums}
html,body{min-height:100%}
body{
  background:transparent;color:var(--text);font-family:var(--font);font-size:13px;
  display:flex;flex-direction:column;align-items:center;padding:6px 6px 24px;
  -webkit-font-smoothing:antialiased;
}
button{font:inherit;color:inherit}
input{font:inherit}

/* ───────────── 顶部控制条(预览/调试,OBS 捕获时 ?popup/?embed/live 自动隐藏) ───────────── */
.toolbar{
  position:fixed;left:50%;top:10px;transform:translateX(-50%);z-index:20;
  display:flex;gap:6px;align-items:center;flex-wrap:wrap;justify-content:center;
  padding:7px 10px;background:rgba(255,255,255,.94);border:1px solid rgba(0,48,168,.35);
  border-radius:99px;box-shadow:0 8px 24px rgba(0,48,168,.14);max-width:calc(100vw - 16px);
}
.toolbar .tb-sep{width:1px;height:18px;background:#d8dce4;flex-shrink:0}
.toggle-btn{
  display:inline-flex;align-items:center;gap:6px;padding:6px 14px;border:0;border-radius:99px;
  background:linear-gradient(180deg,var(--blue),var(--blue2));color:#fff;font-size:11.5px;
  font-weight:900;cursor:pointer;box-shadow:0 3px 10px rgba(0,48,168,.3);transition:.15s;
  white-space:nowrap;
}
.toggle-btn:hover{transform:translateY(-1px)}
.toolbtn{
  border:1px solid #c9cdd6;background:#fff;color:#4a4a4a;border-radius:99px;
  padding:5px 10px;font-size:10.5px;font-weight:800;cursor:pointer;white-space:nowrap;transition:.15s;
}
.toolbtn:hover{color:var(--blue);border-color:var(--blue)}
.toolbtn.on{background:linear-gradient(180deg,var(--blue),var(--blue2));color:#fff;border-color:transparent}
.toolbar .opt-label{display:inline-flex;align-items:center;gap:4px;font-size:9.5px;color:#777;white-space:nowrap}
.toolbar input[type=range]{width:64px;accent-color:var(--blue)}
.toolbar .tb-input{
  width:200px;background:#fff;border:1px solid #c9cdd6;border-radius:7px;color:#111;
  font-size:10.5px;padding:4px 8px;max-width:min(200px,34vw);
}

/* ───────────── 计分板本体(336px · 浅色官方蓝 · light 稿结构) ───────────── */
.boardWrap{display:flex;justify-content:center;width:100%;padding-top:78px}
.boardWrap.nobar{padding-top:0}
.board{
  width:336px;max-width:calc(100vw - 16px);display:flex;flex-direction:column;
  background:transparent;border:1px solid rgba(0,48,168,.35);border-radius:10px;
  overflow:hidden;box-shadow:none;
  /* 默认展开态由 JS 加 .show + .opening 打开;.board 基态为收起(与 light 稿一致) */
  opacity:0;visibility:hidden;clip-path:inset(50% 0 50% 0);
}
.board.show{opacity:1;visibility:visible;clip-path:inset(0 0 0 0)}
.board.opening{visibility:visible;opacity:1;animation:lineOpen .42s cubic-bezier(.65,0,.35,1) both}
.board.closing{visibility:visible;opacity:1;animation:lineClose .55s cubic-bezier(.7,0,.85,.2) both}
@keyframes lineOpen{
  0%{clip-path:inset(calc(50% - 2px) 0 calc(50% - 2px) 0);opacity:1}
  100%{clip-path:inset(0 0 0 0);opacity:1}
}
@keyframes lineClose{
  0%{clip-path:inset(0 0 0 0);opacity:1}
  58%{clip-path:inset(calc(50% - 2px) 0 calc(50% - 2px) 0);opacity:1}
  74%{clip-path:inset(calc(50% - 2px) 0 calc(50% - 2px) 0);opacity:1}
  76%,100%{clip-path:inset(50% 0 50% 0);opacity:0;visibility:hidden}
}

/* 头部:LOGO 白块 + 赛季行(蓝底)/分隔线/金局信息行(light 稿 headbar) */
.headbar{
  display:flex;align-items:center;gap:10px;padding:8px 10px;
  background:linear-gradient(180deg,var(--blue),var(--blue2));color:#fff;min-height:58px;
}
.headbar .logo{
  width:54px;height:54px;border-radius:6px;background:#fff;color:var(--blue);
  font-weight:900;font-size:15px;display:flex;align-items:center;justify-content:center;
  flex-shrink:0;overflow:hidden;letter-spacing:1px;
}
.headbar .logo img{width:100%;height:100%;object-fit:contain;display:block}
.headbar .head-meta{flex:1;min-width:0;padding-left:8px;display:flex;flex-direction:column;justify-content:center}
.headbar .season-line{
  font-family:var(--condensed);letter-spacing:2px;font-size:15px;font-weight:800;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-transform:uppercase;
}
.headbar .meta-divider{height:1px;margin:3px 0;background:rgba(0,0,0,.35)}
.headbar .round-line{
  font-size:11px;color:#ffd88a;letter-spacing:1px;font-weight:700;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}

/* 表头 + 行:统一 5 列网格(light 稿列宽) */
.thead,.row{
  display:grid;grid-template-columns:54px minmax(0,1fr) 58px 44px 52px;
  align-items:center;gap:4px;padding:0 6px;width:100%;
}
.thead span,.row>*{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.thead{
  height:32px;background:var(--head-bg);color:#333;font-size:12px;font-weight:800;
  letter-spacing:2px;border-bottom:1px solid rgba(0,0,0,.08);text-transform:uppercase;
}
.thead .team-h{justify-content:flex-start}
.thead span{display:flex;align-items:center;justify-content:center}

#rows{position:relative}
.row{
  height:46px;font-size:13px;color:var(--text);border-bottom:1px solid var(--line);
  background:rgba(250,250,250,var(--row-a));
  transition:transform 550ms cubic-bezier(.33,1,.68,1),opacity .3s;
  will-change:transform;position:relative;
}
.row:last-child{border-bottom:0}
.row .rk{font-family:var(--mono);font-weight:900;color:var(--blue);text-align:center;font-size:13.5px}
.team{display:flex;align-items:center;gap:6px;min-width:0;padding-left:4px}
.team .bar{width:4px;height:16px;border-radius:2px;flex-shrink:0}
.team .nm{font-weight:700;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* 生存 = 4 根健康竖条(白槽黑描边,深色=存活血量;击倒清空空-红-空-红;阵亡置灰) */
.alive{display:flex;gap:3px;justify-content:center;align-items:center}
.alive .hb{
  position:relative;width:5px;height:20px;background:#fff;border-radius:1px;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.4);overflow:hidden;
}
.alive .hb i{
  position:absolute;left:0;right:0;bottom:0;height:0;background:#111;
  transition:height .3s ease-out;
}
/* 击倒:白条清空 + 空-红-空-红 闪烁(scoreboard_final 语义,适配浅色底) */
.alive .hb.down{background:#fff;animation:downBlink 1.3s steps(1,end) infinite}
.alive .hb.down i{height:0 !important}
/* 阵亡:置灰 */
.alive .hb.dead{opacity:.4;filter:grayscale(.8);background:#fff}
.alive .hb.dead i{height:0 !important}
@keyframes downBlink{
  0%,22%{background:#fff;box-shadow:inset 0 0 0 1px rgba(0,0,0,.4)}
  23%,45%{background:#e04535;box-shadow:inset 0 0 0 1px #e04535,0 0 7px rgba(224,69,53,.55)}
  46%,68%{background:#fff;box-shadow:inset 0 0 0 1px rgba(0,0,0,.4)}
  69%,91%{background:#e04535;box-shadow:inset 0 0 0 1px #e04535,0 0 7px rgba(224,69,53,.55)}
  92%,100%{background:#fff;box-shadow:inset 0 0 0 1px rgba(0,0,0,.4)}
}

.kills{font-family:var(--mono);text-align:center;font-weight:700;color:#333}
.pts{font-family:var(--mono);text-align:center;font-weight:700;color:var(--blue)}

/* 底注(计分口径 · 仅预览可见) */
.caption{margin-top:10px;font-size:9.5px;color:#8a8f9a;text-align:center;letter-spacing:.4px;max-width:92vw}
