/* ============================================================================
 * 【网页字体】MiSans（小米黑体）· 所有设备显示同一个字体
 * ----------------------------------------------------------------------------
 * 为什么自托管：Google Fonts 国内直连不通，CDN 也不稳；放自己服务器反而最快。
 * 为什么要子集：完整 MiSans 一个权重 ~7.8MB。这里按 **GB2312 一级字 + 项目文案
 *   + 玩家名字里出现过的字（共 4078 个字符）** 裁过，一档约 480KB。
 *   【为什么连 GB2312 一级字都要】玩家名字是用户数据 —— 只裁项目文案的话，
 *   名字里的"圣贤皆寂寞"这类字就会回退到系统字体，看起来字体不统一。
 *   · 新增文案出现子集外的字 → 自动回退系统字体（不会变豆腐块）
 *   · 重新裁：python tools/font-subset.py（自动扫项目里的字）
 *   · 换回思源/其他字体同理：换 tools/font-src/ 里的源文件再跑一次
 *
 * 许可：MiSans 由小米免费提供商用，见 fonts/LICENSE-MiSans.txt
 * ========================================================================== */
@font-face {
  font-family: 'CS Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/MiSans-sub-400.woff2') format('woff2');
}
/* 700 同时承担 600 / 800 的显示（浏览器按"就近字重"自动取它）。
 * 不单独发 600 是为了让首屏少下 480KB。 */
@font-face {
  font-family: 'CS Sans';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('../fonts/MiSans-sub-700.woff2') format('woff2');
}


/* ============================================================================
 * style.css —— CS 传奇卡牌
 * ----------------------------------------------------------------------------
 * 结构顺序：
 *   1. 变量与全局        2. 顶栏 / 导航      3. 卡包与开包动画
 *   4. 卡牌外观          5. 收藏册           6. 组队
 *   7. 比赛              8. 弹窗 / 提示      9. 移动端适配
 *
 * 想换配色：只改下面 :root 里的变量即可，别处不用动。
 * 卡牌的稀有度颜色来自 JS 数据，通过 --rc 变量注入，所以加新稀有度不用改 CSS。
 * ========================================================================== */

:root {
  --bg:        #0b0e13;
  --bg-soft:   #12161d;
  --panel:     #161b24;
  --panel-2:   #1c222d;
  --line:      #262e3b;
  --text:      #e6ebf2;
  --muted:     #8b98a5;
  --accent:    #f0a726;   /* CS 味橙色 */
  --accent-2:  #e0703a;
  --good:      #4fb477;
  --bad:       #e05a5a;

  /* body 上那两团背景光晕。
   * ⚠️ 这两个变量**必须存在**：CSS 里 var() 找不到定义时，整条声明会被丢掉
   * （不是只丢那一层），于是 body 完全没有背景，直接露出浏览器默认的白色 ——
   * 深色主题下就是"侧边栏和面板是黑的、主内容区是白的"。
   * 自测里有一条专门扫"用到的变量是不是都有定义"。 */
  --glow-1:    #1b2330;
  --glow-2:    #241d15;

  /* ---- 主题变量（白天/黑夜都靠这一组切换）---------------------------------
   * 深色是默认值；[data-theme="light"] 那一节整体覆盖。
   * 想让某个颜色跟着主题走，就用这里的变量，别写死。
   *
   * ⚠️ 定义变量时**只能写真实颜色值**，绝不能写 var(--自己)：
   *      --sunken: var(--sunken)   ← 循环引用 = 等于没定义
   * 一旦这样，所有用到它的声明都会被整条丢掉（不是只丢那一层），
   * 而且不报任何错。所以自测里有一条专门扫"有没有自我引用 / 未定义的变量"。
   * ---------------------------------------------------------------------- */
  --sunken:    #0d1117;   /* 比 panel 再深一档：卡面头像底、开包动画底 */
  --track:     #232a36;   /* 进度条 / 能力条的轨道 */
  --line-2:    #3a4459;   /* 比 line 亮一点的描边 */
  --railing:   #2a323f;   /* 卡面上细条的轨道 */
  /* 【深色底上的浅色小圆底】瑞士轮那张图里的"晋级/淘汰"结果框是实心深绿/深红，
   * 浅色队标（比如 Spirit 的白色标）直接放上去就看不见了，所以要垫一个浅色圆底。
   * 两套主题都用浅色 —— 因为它垫的是"深色块"，不跟着页面底色走。 */
  --chip-on-dark: #eef1f6;
  /* 【卡面底图上用的色】2026-10-16.24 接卡面底图时加的。
   * 底图是**深色**的，而卡面文字颜色跟着主题走 —— 白天模式下是近黑的，
   * 会糊在深底上。用户指定"白天黑夜共用同一张底图"，所以这几个色
   * **故意不跟主题变**，卡面有底图时（.has-face）就用它们。
   * 放在 :root 而不是 .has-face 里，是因为项目约定"色板常量集中在 :root"
   * （自测有一条盯着"正文里不许写死十六进制颜色"）。 */
  --face-text:  #eef1f6;                 /* 深底上的主文字 */
  --face-muted: #a8b3c2;                 /* 深底上的次要文字 */
  /* 【@deprecated 2026-10-16.14】下面这对是 1.0.12 为"浅底上垫深圆"加的，
   * 但那种做法在深色主题下会让圆和页面底色糊在一起。现在改成
   * "队标换图 + 圆底跟着主题走"（见 .sw-ic / .sw-ic[data-theme]），
   * 只剩 --chip-on-light-line 还被借用当浅色主题的边框色。 */
  --chip-on-light: #3a4553;
  --chip-on-light-line: #4a5768;

  /* 叠在表面上的"提亮"。深色主题用白色透明，浅色主题换成黑色透明 ——
   * 这样同一套 rgba 高光在两套主题里方向都是对的。 */
  --hi-0:      rgba(255,255,255,.015);
  --hi-1:      rgba(255,255,255,.025);
  --hi-2:      rgba(255,255,255,.045);
  --hi-3:      rgba(255,255,255,.07);
  --hi-4:      rgba(255,255,255,.12);
  --hi-5:      rgba(255,255,255,.16);
  --hi-text:   rgba(255,255,255,.3);    /* 锁定卡上那个大问号 */

  /* 阴影三档 */
  --sh-1:      rgba(0,0,0,.25);
  --sh-2:      var(--shadow, transparent);
  --sh-3:      rgba(0,0,0,.55);

  /* 半透明遮罩 / 面板 */
  --scrim:     rgba(14,18,25,.72);      /* 侧边栏 */
  --scrim-2:   rgba(10,13,18,.9);       /* 空坑位 */
  --toast-bg:  rgba(11,14,19,.9);
  --mask:      rgba(5,7,11,.78);        /* 弹窗全屏遮罩 */

  /* 亮色底上的文字（橙色按钮、绿色徽章之类） */
  --on-accent: #10141b;
  --on-solid:  #0d1117;

  /* 徽章 / 提示条的浅色底 */
  --good-bg:   #12241a;
  --bad-bg:    #2a1417;

  /* 队伍徽章（卡包 / 队标）的渐变和描边 */
  --pack-a:    #2b3346;
  --pack-b:    #171c26;
  --pack-c:    #2a2118;
  --pack-line: #3a4459;

  /* 队标外面那圈描边 —— 深色主题描白、浅色主题描黑 */
  --logo-halo:   rgba(255,255,255,.9);
  --logo-halo-2: rgba(255,255,255,.55);

  /* 强调色的半透明底（提示条、选中态、标签）。
   * 深色主题叠在暗面板上，8% 就够；浅色主题叠在白底上要更浓才看得见。 */
  --tint-a-weak:   rgba(240,167,38,.07);
  --tint-a-mid:    rgba(240,167,38,.10);
  --tint-a-strong: rgba(240,167,38,.16);
  --tint-a-line:   rgba(240,167,38,.35);
  --tint-g-weak:   rgba(79,180,119,.07);
  --tint-g-mid:    rgba(79,180,119,.14);
  --tint-g-strong: rgba(79,180,119,.90);
  --tint-r-mid:    rgba(224,90,90,.14);
  --tint-r-strong: rgba(224,90,90,.85);

  /* 蓝色系（教练卡、次要位置标签）—— 浅色主题要压暗才看得清 */
  --info:      #5aa9e6;
  --info-text: #7fc0ea;
  --info-bg:   rgba(90,169,230,.15);
  --info-line: rgba(90,169,230,.3);

  --radius:    12px;
  --shadow:    0 10px 30px var(--shadow, transparent);
}

/* ============================================================================
 * 白天模式
 * ----------------------------------------------------------------------------
 * 只覆盖颜色变量，布局、尺寸、动画一律不动 —— 所以两套主题长得一模一样，
 * 只是配色不同。想微调白天模式，改这里就够了。
 * ========================================================================== */
[data-theme="light"] {
  /* 【配色思路】不用纯白：纯白面板配浅底非常刺眼。整体压暗一档，
   * 面板改成带一点灰的"纸白"，正文也不用纯黑 —— 长时间看眼睛舒服些。 */
  --bg:        #dfe4eb;
  --bg-soft:   #d7dde6;
  --panel:     #f1f4f9;
  --panel-2:   #e7ecf3;
  --line:      #ccd4df;
  --text:      #232a34;
  --muted:     #67717d;

  /* 【光晕一定要克制】它铺满整屏，写成 #fff 等于给整个页面加了一层白光 ——
   * 白天模式的"刺眼"很大一部分是它造成的。这里只让它比底色亮一丁点。 */
  --glow-1:    #e9eef5;
  --glow-2:    #f4ebdb;

  /* 橙色在白底上要压暗一点才看得清；按钮底色跟着变深，所以按钮文字改白 */
  --accent:    #c47a00;
  --accent-2:  #b8541c;
  --good:      #2f8f57;
  --bad:       #c33f3f;

  /* 【注意】--sunken 在深色主题里是"比 panel 更暗"，但浅色主题里要反过来
   * 比页面底色**略亮** —— 卡面渐变是 panel-2 → sunken，如果 sunken 比页面还暗，
   * 卡片看起来就是凹进去的。 */
  --sunken:    #e3e8ef;
  --track:     #ccd4df;
  --line-2:    #b7c1d1;
  --railing:   #cbd3e0;

  /* 浅色主题里"提亮"要反过来 —— 白色叠白色等于没叠，改用黑色透明做层次 */
  --hi-0:      rgba(0,0,0,.012);
  --hi-1:      rgba(0,0,0,.022);
  --hi-2:      rgba(0,0,0,.045);
  --hi-3:      rgba(0,0,0,.07);
  --hi-4:      rgba(0,0,0,.10);
  --hi-5:      rgba(0,0,0,.13);
  --hi-text:   rgba(0,0,0,.22);

  --sh-1:      rgba(23,32,48,.10);
  --sh-2:      rgba(23,32,48,.16);
  --sh-3:      rgba(23,32,48,.24);
  --shadow:    0 10px 28px rgba(23,32,48,.14);

  --scrim:     rgba(241,244,249,.86);
  --scrim-2:   rgba(231,236,243,.92);
  --toast-bg:  rgba(241,244,249,.97);
  --mask:      rgba(30,38,52,.45);

  --on-accent: #ffffff;
  --on-solid:  #ffffff;

  /* 深色底上的浅色小圆底：浅色主题下也保持浅色（垫的是深绿/深红块，不跟页面底色走） */
  --chip-on-dark: #eef1f6;
  /* 浅色底上的深色小圆底：浅色主题下也保持深色（垫的是白队标，不跟页面底色走） */
  --chip-on-light: #3a4553;
  --chip-on-light-line: #4a5768;

  --good-bg:   #e4f5ea;
  --bad-bg:    #fbe8e8;

  --pack-a:    #dce3ed;
  --pack-b:    #eef2f7;
  --pack-c:    #f7ecd8;
  --pack-line: #bfcad9;

  /* 浅底上队标要描黑边，不然白色队标（Astralis 那种）直接消失 */
  --logo-halo:   rgba(0,0,0,.55);
  --logo-halo-2: rgba(0,0,0,.32);

  /* 白底上的淡色要更浓一点，不然几乎看不见 */
  --tint-a-weak:   rgba(196,122,0,.08);
  --tint-a-mid:    rgba(196,122,0,.12);
  --tint-a-strong: rgba(196,122,0,.18);
  --tint-a-line:   rgba(196,122,0,.38);
  --tint-g-weak:   rgba(47,143,87,.09);
  --tint-g-mid:    rgba(47,143,87,.16);
  --tint-g-strong: rgba(47,143,87,.88);
  --tint-r-mid:    rgba(195,63,63,.14);
  --tint-r-strong: rgba(195,63,63,.85);

  /* 白底上的蓝色要深一些，否则文字对比度不够 */
  --info:      #2f7fc4;
  --info-text: #1f6aa8;
  --info-bg:   rgba(47,127,196,.12);
  --info-line: rgba(47,127,196,.32);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ----------------------------------------------------------------------------
 * 重要：hidden 属性必须真的能隐藏元素。
 *
 * 浏览器默认样式里有 [hidden] { display: none }，但它的优先级最低 ——
 * 只要你在自己的 CSS 里给同一个元素写了 display（比如 .modal-mask 的 display:flex），
 * 默认的隐藏就会被覆盖，元素照样显示。
 *
 * 这个坑真的踩过：弹窗遮罩 .modal-mask 是 position:fixed; inset:0; z-index:200 的
 * 全屏半透明黑罩。它带着 hidden 属性本该不显示，却被 display:flex 顶开了，
 * 结果整页被罩住、所有点击都被拦截，看起来就像"卡住了"。
 *
 * 加上这条 !important 的兜底规则，以后任何元素只要写了 hidden 就一定隐藏。
 * -------------------------------------------------------------------------- */
[hidden] { display: none !important; }

body {
  /* 两团很淡的光晕，让纯色底不那么死板。颜色也跟着主题走 */
  background:
    radial-gradient(1100px 600px at 20% -10%, var(--glow-1) 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 0%, var(--glow-2) 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  /* 首选自托管字体；后面的系统字体只在"子集里没有那个字"时兜底 */
  font-family: "CS Sans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  min-height: 100vh;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
small { font-size: .78em; opacity: .75; font-weight: 400; }

/* ============================ 1. 侧边栏布局 ============================ */
/* 左边一条竖着的导航，右边是内容区。窄屏（手机/窄窗口）会自动变成顶部横排。 */
.app { display: flex; min-height: 100vh; align-items: stretch; }

.sidebar {
  flex: 0 0 212px; width: 212px;
  display: flex; flex-direction: column; gap: 6px;
  padding: 22px 14px 18px;
  background: var(--scrim);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; height: 100vh;
}
.sidebar-spacer { flex: 1; }


.brand {
  display: flex; align-items: center; gap: 9px;
  font-size: 16px; letter-spacing: .5px; padding: 0 8px 18px;
}
.brand-icon { font-size: 20px; }
.brand-text b { color: var(--accent); }

/* 竖向导航：一个条目一行，图标在左、文字在右 */
.nav { display: flex; flex-direction: column; gap: 4px; }
.tab {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 11px 12px; border-radius: 10px;
  color: var(--muted); font-size: 15px; font-weight: 600;
  border: 1px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
}
.tab:hover { color: var(--text); background: var(--hi-2); }
.tab.active {
  color: var(--accent); background: var(--tint-a-mid);
  border-color: var(--tint-a-line);
}
.tab-icon { font-size: 17px; width: 20px; text-align: center; }

/* ===========================================================================
 * 界面图标（2026-10-15.95）
 * ---------------------------------------------------------------------------
 * 原来这些位置是 emoji，每台设备画风都不一样。现在换成 img/icons/ 下的
 * 自制单色图（没有图的位置自动退回 emoji）。
 *
 * 【为什么用 mask 而不是 <img>】
 *   .ic-mask 是**蒙版**：background 给颜色、mask 给形状，两者独立。
 *   所以同一张图在白天/黑夜模式下自动变色 —— 一个单色图就够了，不用两套。
 *   （<img> 就没这个好处：SVG 里的 currentColor 在某些用法下不生效，
 *     PNG 更是彻底写死了颜色。）
 *
 * 【尺寸口径】给的是 **内容框**，不是图片文件尺寸。
 *   所有占位图都按 20×20 画布做，mask-size:contain 会等比缩放填满这个框，
 *   所以 19px 的框里出来就是 19×19 居中，和原来 emoji 的视觉大小对齐。
 * ========================================================================== */
/* 蒙版本体。尺寸用 inset:0 撑满父元素，**不用 width/height:100%** ——
 * 100% 在 flex 父元素里会被 flex 算法二次压缩（实测 .tt-icon 里被算成 0px 宽，
 * 图标整个不见了），absolute + inset 不参与 flex 尺寸计算，稳。 */
.ic { position: relative; }
.ic-mask {
  position: absolute;
  inset: 0;
  background: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

/* 【探测期间先把 emoji 藏起来】否则会"emoji 闪一下再换成图标"。 */
.ic-loading .ic-emoji { visibility: hidden; }

/* ===========================================================================
 * emoji 兜底：**包一层用 display:none 藏**，不要靠 font-size:0
 * ---------------------------------------------------------------------------
 * 第一版是 `.ic-ok { font-size: 0 }` + `.ic-loading { color: transparent }`。
 * 结果是：手机端有一条 `.sidebar .tab-icon { font-size: 19px }`，
 * 特异性 (0,2,0) 比 `.ic-ok` 的 (0,1,0) 高 —— 它把 font-size 又压回 19px，
 * emoji 于是和自制图**叠在一起**（用户截图里那团乱的根因）。
 * 现在把 emoji 收进 .ic-emoji 子元素，成功上图标时直接 display:none，
 * 不再和任何 font-size 规则较劲。
 * ========================================================================== */
.ic-emoji { display: inline-block; line-height: 1; }
.ic-ok .ic-emoji { display: none; }

/* ===========================================================================
 * 图标尺寸：**只认 .ic 这一个类 + --ic-size 一个变量**
 * ---------------------------------------------------------------------------
 * 第一版我给 .tab-icon / .sb-icon / .tb-icon 各写了一条 width/height，
 * 结果被手机端原有的 `.sidebar .side-btn .sb-icon { width: auto }` 盖掉
 * （那条在后、又更具体）—— 图标尺寸忽大忽小。
 * 现在只认 .ic：不管图标画在哪个元素上，尺寸都由 --ic-size 决定，
 * 类名被怎么覆盖都不影响。
 * ========================================================================== */
.ic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--ic-size, 19px);
  height: var(--ic-size, 19px);
}
/* 侧栏（桌面 + 手机底栏）里的都和页签文字对齐，统一 19px */
.sidebar .ic { --ic-size: 19px; }
/* 【展开按钮不在 .sidebar .ic 的覆盖范围内】.nav-expand 是 .sidebar 的兄弟
 * （底栏里靠 order 排进去的），所以它里面的 .ic 要单独给尺寸 ——
 * 否则默认 19px 也许能用，但手机上 19px 和别的格子对不齐。 */
.nav-expand .ne-arrow { --ic-size: 19px; }
/* 顶栏那几格比页签小一号 */
.topbar .ic { --ic-size: 15px; }

/* ===========================================================================
 * 支持作者（2026-10-16.92）
 * ---------------------------------------------------------------------------
 * 1. 侧栏最下面那颗按钮：**复用 .tab 的视觉，但不复用它的类**
 *    —— 自测和 e2e 都在数 `.tab` 的个数（必须正好 8），多一个就红。
 *    （和当初 theme-tab 的处理同一个道理。）
 * 2. 桌面上 `margin-top: auto` 把它推到侧栏最底部（.sidebar 是 100vh 的 flex 列）。
 * 3. 点出来的小卡片钉在**左下角**，不是屏幕正中 —— 所以不复用 .modal-mask。
 * ========================================================================== */
.side-btn {
  display: flex; align-items: center; gap: 10px; text-align: left;
  margin-top: auto;                    /* 推到侧栏底部 */
  padding: 11px 12px; border-radius: 10px;
  color: var(--muted); font-size: 15px; font-weight: 600;
  border: 1px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
}
.side-btn:hover { color: var(--accent); background: var(--tint-a-weak); border-color: var(--tint-a-line); }
.side-btn .sb-icon { font-size: 17px; width: 20px; text-align: center; }

.support-pop {
  position: fixed; left: 18px; bottom: 18px; z-index: 300;
  width: 322px; max-width: calc(100vw - 36px);
  padding: 16px 18px 15px;
  background: var(--panel); border: 1px solid var(--accent);
  border-radius: 14px;
  /* 【阴影 + 不透明背景】它是浮在内容上面的小卡片，底下压着卡包卡片 ——
   * 没有明显阴影的话会和背景糊在一起，看着"大小不对/像页面的一部分"。 */
  box-shadow: 0 12px 34px rgba(0, 0, 0, .22);
  animation: fadeUp .18s ease;
}
.support-pop[hidden] { display: none; }

/* 右上角关闭 */
.support-pop .sp-close {
  position: absolute; top: 8px; right: 9px;
  width: 22px; height: 22px; line-height: 1;
  font-size: 12px; color: var(--muted);
  border-radius: 7px;
}
.support-pop .sp-close:hover { color: var(--text); background: var(--hi-1); }

/* 出品信息：图标 + 两行字 */
.support-pop .sp-brand { display: flex; align-items: center; gap: 11px; padding-right: 22px; }
.support-pop .sp-logo { font-size: 24px; line-height: 1; }
.support-pop .sp-brand-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.support-pop .sp-brand-text b { font-size: 14px; color: var(--text); }
.support-pop .sp-brand-text span { font-size: 12px; color: var(--muted); }

/* 跳转 B 站主页的按钮 */
.support-pop .sp-bili {
  display: flex; align-items: center; gap: 8px;
  margin-top: 13px; padding: 10px 12px;
  border-radius: 10px; text-decoration: none;
  background: var(--tint-a-weak); border: 1px solid var(--tint-a-line);
  color: var(--accent); font-size: 13px; font-weight: 700;
  transition: background .15s, border-color .15s;
}
.support-pop .sp-bili:hover { background: var(--hi-1); border-color: var(--accent); }
/* 【爱发电】入口复用 .sp-bili 的按钮样式，只把主色换成爱发电的粉红，一眼能和 B 站区开。 */
.support-pop .sp-afdian { border-color: rgba(255, 92, 141, .35); }
.support-pop .sp-afdian:hover { border-color: rgba(255, 92, 141, .85); background: rgba(255, 92, 141, .10); }
/* 【不能写死颜色】正文里硬编码的十六进制颜色有上限（自测会报），而且浅色主题下不会跟着变。
 * 爱发电那一行只加粗，颜色走主题变量；粉色的强调靠上面那条 rgba 边框/底色。 */
.support-pop .sp-afdian .sp-bili-text { font-weight: 600; }
/* 【赞助说明】紧跟在爱发电按钮下面，小字、淡色，不抢按钮的视线 */
.support-pop .sp-note {
  margin: 0 0 2px; padding: 6px 9px;
  font-size: 11.5px; line-height: 1.65; text-align: center;
  color: var(--muted); border-radius: 8px;
  background: rgba(255, 92, 141, .07);
}

.support-pop .sp-bili-icon { font-size: 15px; line-height: 1; }
.support-pop .sp-bili-text { flex: 1; min-width: 0; }
.support-pop .sp-bili-arrow { font-size: 13px; opacity: .8; }

/* 加入 QQ 讨论群：和上面那颗 B 站按钮同一套观感，但它是 <button>（复制群号），
 * 不是 <a>（跳页面）。【为什么不用 <a>】见 app.js 的 bindQQGroup。 */
.support-pop .sp-qq {
  display: flex; align-items: center; gap: 8px; width: 100%;
  margin-top: 9px; padding: 9px 12px;
  border-radius: 10px; cursor: pointer;
  background: var(--tint-a-weak); border: 1px solid var(--tint-a-line);
  font: inherit; font-size: 13px; font-weight: 700; text-align: left;
  color: var(--accent);
  transition: background .15s, border-color .15s, transform .1s;
}
.support-pop .sp-qq:hover { background: var(--hi-1); border-color: var(--accent); }
.support-pop .sp-qq:active { transform: scale(.985); }
.support-pop .sp-qq-icon { font-size: 15px; line-height: 1; }
/* 两行：上面"加入 QQ 讨论群"，下面群号 —— 群号要能一眼看清、手动抄下来 */
.support-pop .sp-qq-text {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.support-pop .sp-qq-text b { font-size: 13px; color: var(--accent); }
.support-pop .sp-qq-num {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px; font-weight: 600; letter-spacing: .6px;
  color: var(--text);
}
.support-pop .sp-qq-hint { flex: none; font-size: 11px; font-weight: 500; opacity: .7; }

/* 招募那句话。
 * 【行高给足、字号小一点】原来 12px + 1.75 行高，在 258px 宽里会断成
 * "…运维" / "的帮助…" 这种把「运维」拆开的难看断行（用户报"大小有问题"）。
 * 现在放宽卡片、字号小半级、行高加到 1.9，并用 text-wrap: pretty 让浏览器
 * 尽量把各行长度摊匀（不支持的浏览器忽略这条，不影响功能）。 */
.support-pop .sp-help {
  margin: 12px 0 0; padding-top: 11px;
  border-top: 1px solid var(--line);
  font-size: 11.5px; line-height: 1.9; color: var(--muted);
  text-wrap: pretty;
}
.support-pop .sp-help b { color: var(--text); font-weight: 700; }

/* 侧栏底部的资源栏 */
.counters { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.counter {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line);
  padding: 8px 12px; border-radius: 9px;
  font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px;
}
.counter-icon { font-size: 15px; }
/* 金币变动时的闪烁反馈 */
.counter.bump { animation: bump .4s ease; }
@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.14); border-color: var(--accent); color: var(--accent); }
  100% { transform: scale(1); }
}
.sidebar-note {
  font-size: 10px; color: var(--muted); opacity: .6;
  padding: 10px 4px 0; line-height: 1.6;
}

/* 主内容区 */
/* 【宽度】原来是 max-width:1320px 且靠左 —— 宽屏上右边空一大片（用户提过）。
 * 现在放宽到 1800px 并且居中：普通屏幕基本铺满，超宽屏两边留一样多。 */
.stage { flex: 1; min-width: 0; max-width: 1800px; margin: 0 auto; padding: 26px 26px 60px; }

/* ===================== 侧边栏：体力 / 段位 ===================== */
.side-status {
  margin: 0 0 10px; padding: 10px 11px 9px;
  border-radius: 10px; background: var(--panel); border: 1px solid var(--line);
}
.ss-row { display: flex; align-items: baseline; gap: 7px; }
.ss-row + .ss-row { margin-top: 7px; }
.ss-label { font-size: 11px; color: var(--muted); }
.ss-val { font-size: 14px; font-weight: 900; font-variant-numeric: tabular-nums; }
.ss-next { margin-left: auto; font-size: 10.5px; color: var(--muted); }
.ss-bar {
  height: 5px; border-radius: 999px; background: var(--sh-2);
  overflow: hidden; margin: 5px 0 2px; border: 1px solid var(--line);
}
.ss-bar > div {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--tint-a-strong), var(--accent));
  transition: width .4s;
}

/* ============================ 战队徽标（侧边栏） ============================ */
.team-badge {
  display: flex; align-items: center; gap: 7px; width: 100%;
  margin: 0 0 10px; padding: 8px 11px; border-radius: 9px;
  background: var(--tint-a-mid);
  border: 1px solid var(--tint-a-line);
  color: var(--accent); font-size: 12px; font-weight: 700;
  text-align: left; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.team-badge:hover { background: var(--tint-a-strong); border-color: var(--accent); }
.tb-icon { font-size: 14px; flex: none; }
.tb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-swap { font-size: 10px; font-weight: 400; color: var(--muted); flex: none; }
.team-badge:hover .tb-swap { color: var(--accent); }

/* ============================ 战队建档弹窗 ============================ */
/* 【登录框补一个面板底】2026-10-18。
 * 它原来只有 max-width，没有底色 —— 文字直接压在"遮罩 + 模糊后的页面"上。
 * 只有标题和输入框还算看得清，**说明文字基本糊在背景里**。
 * 这次加的识别码提示（"识别码在「我的账号」页，可以复制或截图保存"）是重点信息，
 * 再糊着就等于没加。所以补一套和 .modal 一致的底。 */
.team-modal {
  max-width: 420px;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.tm-head { margin-bottom: 18px; }
.tm-title { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.tm-sub { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
/* 登录框里"战队名称实际上就是账号"这一行。
 * 【为什么要单独一行 + 强调色】用户特别要求加：很多人以为通行证码才是账号，
 * 战队名随手填，换设备时想不起来就再也进不去。用灰色小字会被当成可看可不看的
 * 说明直接忽略，所以单独成块、用强调色加粗。 */
.tm-sub-warn {
  display: block; margin-top: 6px;
  color: var(--accent); font-weight: 700;
}
.tm-body { display: flex; flex-direction: column; gap: 10px; }
.tm-input {
  width: 100%; padding: 12px 14px; border-radius: 9px;
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--text); font-size: 15px; font-family: inherit;
}
.tm-input:focus { outline: none; border-color: var(--accent); }
.tm-input::placeholder { color: var(--muted); }
.tm-hint { font-size: 11.5px; min-height: 16px; color: var(--muted); line-height: 1.5; }
.tm-hint.bad { color: var(--bad); }
.tm-hint.warn { color: var(--accent); }
.tm-hint.good { color: var(--good); }
.btn-block { width: 100%; justify-content: center; }
.tm-actions { display: flex; gap: 9px; }
.tm-actions .btn { flex: 1; justify-content: center; }
.tm-input + .tm-input { margin-top: 8px; }
.tm-label {
  display: block; font-size: 11.5px; color: var(--muted);
  margin: 10px 0 5px;
}
.tm-label:first-child { margin-top: 0; }
/* 次要入口（比如「取消」）—— 不想让它跟主按钮抢注意力。
 * 【为什么写 .btn.btn-link】它和 .btn 同为单类选择器，谁在文件里靠后就谁赢。
 * .btn 排在后面，所以必须靠双类名把优先级提上去，不能只写 .btn-link。 */
.btn.btn-link {
  background: none; border: none; box-shadow: none; color: var(--muted);
  font-size: 12px; padding: 8px 0 0; cursor: pointer; text-decoration: underline;
  justify-content: center;
}
.btn.btn-link:hover { color: var(--accent); background: none; }
.view { display: none; animation: fadeUp .25s ease; }
.view.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ===================== 我的账号 ===================== */
.account-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.acc-item {
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 14px; border-radius: 9px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.acc-label { font-size: 11.5px; color: var(--muted); }
.acc-value { font-size: 19px; line-height: 1.2; }
.acc-sub { font-size: 11px; color: var(--muted); }

.pass-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.pass-code {
  flex: 1; min-width: 180px; padding: 11px 14px; border-radius: 9px;
  background: var(--panel-2); border: 1px solid var(--line);
  font-family: ui-monospace, Consolas, monospace; font-size: 16px;
  letter-spacing: 2px; user-select: all;
}

/* ===================== 好友对战 ===================== */
.friend-search { display: flex; gap: 9px; align-items: center; }
.friend-search .tm-input { flex: 1; margin: 0; }
.friend-search .btn { white-space: nowrap; }

.friend-record { display: flex; flex-direction: column; gap: 10px; }
.fr-score { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fr-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 6px; border-radius: 9px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.fr-item b { font-size: 20px; line-height: 1.1; }
.fr-item span { font-size: 11px; color: var(--muted); }
.fr-item.win b { color: var(--good); }
.fr-item.lose b { color: var(--bad); }

.fr-log { display: flex; flex-direction: column; gap: 5px; }
.fr-line {
  display: flex; align-items: baseline; gap: 9px;
  padding: 7px 11px; border-radius: 7px;
  background: var(--panel-2); font-size: 12.5px;
}
.fr-line > span {
  font-weight: 700; font-size: 11px; padding: 1px 6px; border-radius: 4px;
  background: var(--line); color: var(--muted);
}
.fr-line.us > span { background: rgba(74, 222, 128, .18); color: var(--good); }
.fr-line.them > span { background: rgba(248, 113, 113, .18); color: var(--bad); }
.fr-line b { flex: 0 0 auto; }
.fr-line small { margin-left: auto; color: var(--muted); font-size: 11px; }

/* 每个页面顶部的大标题（模仿参考站的排版） */
.view-title { font-size: 30px; font-weight: 800; letter-spacing: 1px; margin-bottom: 5px; }
.view-sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
/* 窄屏：侧边栏变成顶部横排 */
@media (max-width: 820px) {
  .app { flex-direction: column; }
  .sidebar {
    flex: none; width: auto; height: auto; position: static;
    border-right: none; border-bottom: 1px solid var(--line);
    padding: 14px;
  }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .tab { flex: 1 1 auto; justify-content: center; }
  .counters { flex-direction: row; flex-wrap: wrap; }
  .sidebar-spacer { display: none; }
  .brand { padding-bottom: 12px; }
  .stage { padding: 18px 16px 40px; }
}

/* ============================ 存档页 ============================ */
.save-status {
  padding: 14px 16px; border-radius: 10px;
  background: var(--hi-1); border: 1px solid var(--line);
  font-size: 13px; line-height: 1.8;
}
.save-status.connected { border-color: var(--good); background: var(--tint-g-weak); }
.save-status b { color: var(--text); }
.save-status .dot { font-size: 15px; margin-right: 6px; }

.save-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 4px; }

.save-list { display: flex; flex-direction: column; gap: 10px; }
.save-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; border-radius: 10px;
  background: var(--hi-1); border: 1px solid var(--line);
}
.save-item.current { border-color: var(--accent); background: var(--tint-a-weak); }
.save-item .s-main { min-width: 0; }
.save-item .s-name { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.save-item .s-tag {
  font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: var(--accent); color: var(--on-solid);
}
.save-item .s-meta {
  font-size: 12px; color: var(--muted); margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.save-item .s-actions { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; }
.save-empty { color: var(--muted); font-size: 13px; padding: 18px 4px; }

.help-list { margin: 0; padding-left: 20px; color: var(--muted); font-size: 13px; line-height: 2; }
.help-list b { color: var(--text); }
.help-list code {
  background: var(--hi-3); padding: 1px 6px;
  border-radius: 4px; font-size: 12px; color: var(--accent);
}

/* ============================ 2. 卡包 ============================ */
.pack-area { text-align: center; padding: 26px 0 8px; }
.pack-machine {
  display: inline-block; position: relative;
  perspective: 900px;
}

.pack {
  width: 210px; height: 290px; margin: 0 auto;
  border-radius: 16px; position: relative; overflow: hidden;
  background: linear-gradient(150deg, var(--pack-a) 0%, var(--pack-b) 55%, var(--pack-c) 100%);
  border: 2px solid var(--line-2);
  box-shadow: var(--shadow), inset 0 0 40px var(--tint-a-weak);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.pack:hover { transform: translateY(-6px) rotate(-1deg); box-shadow: var(--shadow), 0 0 44px rgba(240,167,38,.28); }
.pack-shine {
  position: absolute; inset: -60% -60%;
  background: linear-gradient(115deg, transparent 40%, var(--hi-5) 50%, transparent 60%);
  animation: shine 3.4s linear infinite;
}
@keyframes shine { from { transform: translateX(-60%) } to { transform: translateX(60%) } }

.pack-label { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pack-label-top { font-size: 12px; letter-spacing: 4px; color: var(--accent); font-weight: 700; }
.pack-label-mid { font-size: 26px; font-weight: 800; letter-spacing: 2px; }
.pack-label-bot { font-size: 12px; color: var(--muted); }

/* 开包动画三段：抖动 → 爆开 → 白光 */
.pack.shaking { animation: shake .5s ease; }
@keyframes shake {
  0%,100% { transform: translateX(0) rotate(0) }
  15% { transform: translateX(-9px) rotate(-3deg) }
  30% { transform: translateX(9px) rotate(3deg) }
  45% { transform: translateX(-7px) rotate(-2deg) }
  60% { transform: translateX(7px) rotate(2deg) }
  80% { transform: translateX(-3px) rotate(-1deg) }
}
.pack.burst { animation: burst .45s ease forwards; }
@keyframes burst {
  0%   { transform: scale(1); opacity: 1; }
  45%  { transform: scale(1.35) rotate(4deg); opacity: 1; }
  100% { transform: scale(2.4) rotate(-8deg); opacity: 0; }
}

.flash {
  position: absolute; inset: -80px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.95) 0%, rgba(240,167,38,.55) 35%, transparent 70%);
  opacity: 0; pointer-events: none;
}
.flash.on { animation: flashOut .7s ease-out forwards; }
@keyframes flashOut {
  0% { opacity: 1; transform: scale(.5); }
  100% { opacity: 0; transform: scale(1.5); }
}

.pack-buttons { display: flex; gap: 14px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }

.btn {
  padding: 13px 30px; border-radius: var(--radius);
  font-size: 16px; font-weight: 700; color: var(--on-solid);
  background: var(--muted);
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .38; cursor: not-allowed; transform: none; filter: none; }
.btn-primary { background: linear-gradient(160deg, #ffc457, var(--accent)); box-shadow: 0 6px 20px rgba(240,167,38,.28); }
.btn-gold    { background: linear-gradient(160deg, #ffe9a8, #e2b23c); box-shadow: 0 6px 20px rgba(226,178,60,.3); }
.btn-ghost   { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hint { color: var(--muted); font-size: 13px; line-height: 1.9; margin-top: 18px; }

/* 开包结果 */
/* 【注意】这里只留外边距。限高和滚动交给下面那条 .results 规则 ——
 * 以前是内嵌布局，结果区得自己限高；现在它在弹窗里，由中间那块滚。 */
.results { margin-top: 26px; }
/* 【上中下三段，位置固定】摘要钉在顶、翻牌栏钉在底、卡牌占中间那块并居中。
 * 以前是整个结果区一起居中，所以卡多卡少时这三样的位置都会跟着挪。
 * 现在让中间那块 flex:1 吃掉剩余空间，上下两块就钉死了。 */
.results { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.results .result-summary { order: 1; flex: none; }
/* 【中间这块自己滚】连开 3 包就是 9 张卡，一屏放不下。
 * 只让它滚，摘要和翻牌栏就钉住了。 */
.results .result-packs {
  order: 2; flex: 1; min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  display: flex; flex-direction: column;
}

/* 【居中用 auto 外边距，不用 justify-content: center】
 * center 在内容装不下时会把顶部裁掉 —— 第一包的卡背就没了。
 * safe center 能解决，但它是较新的关键字，老浏览器会直接丢弃。
 * auto 外边距会吸收剩余空间：装得下上下平分（居中），装不下自动变 0
 * （从顶部正常排列，不裁任何东西）。Flexbox 第一天就有，到处都支持。 */
.results .result-packs > .result-pack:first-child { margin-top: auto; }
.results .result-packs > .result-pack:last-child { margin-bottom: auto; }
/* 每一包自己不滚（滚动交给外面那层），也不伸缩 */
.results .result-pack { order: 2; flex: none; }
/* 翻牌栏排最后：它翻完会自动隐藏，夹在中间会让卡牌往上跳一截 */
.results .flip-bar { order: 9; flex: none; }
.result-pack { margin-bottom: 22px; }
/* 一包恒为 3 张，所以按 3 列居中排 —— 不然会挤在 7 列网格的左边三格 */
.result-pack .card-grid {
  grid-template-columns: repeat(3, minmax(0, 158px));
  justify-content: center;
}

/* ============================ 卡包货架 ============================ */
.pack-shop {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(198px, 1fr));
  margin-bottom: 22px;
}
.pack-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 14px 16px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line);
  text-align: center;
}
.pack-card.soldout { opacity: .5; }
/* 【卡包图标尺寸：设 --ic-size，不是给容器写宽高】2026-10-17
 * 原来这里是 `font-size: 34px` —— 尺寸靠 **emoji 字形**撑开。
 * 换成自制图标之后 emoji 被 `.ic-ok .ic-emoji { display: none }` 藏掉，
 * 就只剩 `.ic` 自己的尺寸，而它读的是 `--ic-size`（默认 19px）——
 * 于是 34px 的坑位里画出一个 19px 的小图标。
 *
 * 【我第一版改错的地方，记下来】我先给 `.pc-icon` 写了 width/height:34px，
 * 实测**没用**：`.ic` 是 `.pc-icon` 的子元素，尺寸由它自己的 `--ic-size` 决定，
 * 父容器的宽高只决定"坑位多大"，不决定图标多大。
 * 所以只有设 `--ic-size` 才对（这正是那段注释说的"只认 .ic 一个类"）。
 * 另外父容器给成 34×34 的正方形仍然有价值：`.ic-mask` 是 `inset:0`，
 * 坑位是方的，图标才不会被拉扁。 */
.pc-icon {
  --ic-size: 34px;
  font-size: 34px; line-height: 1;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
}
.pc-name { font-size: 16px; font-weight: 800; }
.pc-cards { font-size: 11px; color: var(--accent); font-weight: 700; }
.pc-desc { font-size: 11px; color: var(--muted); line-height: 1.5; min-height: 34px; }

/* 概率条：一条彩色横条，宽度就是百分比 */
.pc-bar {
  display: flex; width: 100%; height: 7px;
  border-radius: 4px; overflow: hidden; background: var(--track);
}
.pc-bar > i { display: block; height: 100%; }

.pc-odds {
  display: flex; flex-wrap: wrap; gap: 2px 10px; justify-content: center;
  font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.pc-odds em { font-style: normal; letter-spacing: -1px; }

.pc-tag {
  font-size: 10px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  background: var(--hi-3); color: var(--muted);
}
.pc-tag.good { background: var(--tint-a-strong); color: var(--accent); }
.pc-tag.bad { background: var(--tint-r-mid); color: var(--bad); }
.pack-card .btn { width: 100%; justify-content: center; margin-top: auto; }

/* 我的卡包（新账号送的） */
.pack-inv { display: flex; flex-direction: column; gap: 10px; }
.pack-inv-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  background: var(--tint-a-weak); border: 1px solid var(--tint-a-line);
}
/* 图标 + 名字 + 说明 这三块括在一起。
 * 桌面端只是把它们框住（和以前逐个子元素当 flex item 完全一样的效果）；
 * 手机上整块占一行，方便连开选项换到下一行去。 */
.pi-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
/* 【同上：给 --ic-size】见 .pc-icon 上面那段说明 —— 22px 对应原来的 font-size。 */
.pi-icon {
  --ic-size: 22px;
  font-size: 22px; flex: none;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
}
.pi-name { font-weight: 800; font-size: 14px; }
.pi-name b { color: var(--accent); margin-left: 6px; }
.pi-desc { font-size: 11px; color: var(--muted); }
.pack-inv-item .btn { margin-left: auto; flex-shrink: 0; }

/* 【手机：连开选项不再挤掉「开启」按钮】2026-10-16.23 用户：
 *   「这个连开的选项会将开启按钮顶出去」
 * 桌面端这一行是 flex + nowrap，内容总量（图标+名字+说明+最多 4 个连开按钮+开启）
 * 在 360px 屏幕上放不下 —— 而 `.pack-inv-item .btn` 有 `flex-shrink: 0`，
 * 所以被挤出去的是它。
 *
 * 【改成 grid 而不是 flex-wrap】flex-wrap 的换行结果依赖各项的固有宽度，
 * 在窄屏上"能换但没换"就会出现横向溢出（实测过）。
 * grid 是用**模板**排的，换不换行是写死的 —— 不存在"该换没换"。
 *   第一行：图标 + 名字 + 说明（.pi-main 横跨两列）
 *   第二行：连开选项 | 开启按钮（按钮靠右，右列用 1fr 撑住，谁都顶不动它）
 */
@media (max-width: 720px) {
  .pack-inv-item {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px 10px;
  }
  .pi-main { grid-column: 1 / -1; width: auto; }
  .pc-count { grid-column: 1; grid-row: 2; }
  .pack-inv-item .btn { grid-column: 2; grid-row: 2; justify-self: end; margin-left: 0; }
}

/* 开包动画：平时隐藏（HTML 上带 hidden），开包那一下才显示 */
.pack-anim { display: flex; justify-content: center; padding: 6px 0 10px; }

/* ============================ 比赛模式 ============================ */
/* 比赛页两栏：左边赛事 + 赛前准备，右边选图 + 实况。
 * 原来是竖着排的，一屏根本放不下，要来回滚。 */
.match-grid {
  display: grid; gap: 16px; align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.match-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
/* 【列里面的面板：宽度撑满，高度按内容】
 * 【这里有个坑，写清楚免得再踩】flex-direction 是 column 时，
 * `align-items` 管的是**水平方向**（交叉轴 = 横轴），
 * 所以 `align-items: start` 会让面板**收缩成内容宽度** ——
 * 表现就是「地图 Ban/Pick / 对局实况 / 赛事 这几个框比左列窄了一截」
 * （实测：列宽 647，面板只有 402 / 353 / 432）。
 * 而「已报名下面一大片空白」那个问题是**竖直方向**的拉伸，归 `align-items` 管不了
 * —— 那是 flex 主轴方向，要用 `justify-content`。
 *
 * 所以正确写法是：
 *   · `align-items: stretch`（默认值）→ 水平撑满整列宽度
 *   · `justify-content: flex-start`   → 竖直方向从顶部开始排，
 *     最后一块不会被撑高（"已报名下面不留空白"靠的就是这条）
 */
.match-col { align-items: stretch; justify-content: flex-start; }

/* 比赛页的面板比别处更紧凑 —— 一屏要塞下赛事+赛前+选图三块。
 * 别处（收藏册/存档）内容少，不需要压这么紧。 */
.match-grid .panel { padding: 13px 16px 14px; margin-bottom: 0; }
.match-grid .panel-title { margin-bottom: 9px; font-size: 14px; }
.match-grid .panel-title small { font-size: 11px; }

@media (max-width: 1150px) {
  .match-grid { grid-template-columns: 1fr; }
}

.mode-tabs { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.mode-tab {
  flex: 1 1 220px; display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px; text-align: left; padding: 13px 16px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--muted); font-size: 15px; font-weight: 700;
  transition: color .15s, border-color .15s, background .15s;
}
.mode-tab:hover { color: var(--text); border-color: var(--muted); }
.mode-tab.active {
  color: var(--accent); border-color: var(--tint-a-line);
  background: var(--tint-a-weak);
}
/* 【描述用小字、单独占一行】这条原来只写了 `small`，但 HTML 里用的是 `<span>`，
 * 于是"上标题 / 下描述"被挤成一行（2026-10-17 用户对比两张截图时发现的）。
 * 现在两个按钮都改成 `<small>`，正好对上这条；这里把 span 也一起兜住，
 * 免得以后有人写回 span 又变回一行。 */
.mode-tab small, .mode-tab span {
  flex-basis: 100%; font-size: 11px; font-weight: 400; opacity: .8;
}
.mode-tab b { font-size: 15px; }

/* 赛事面板 */
.tourney-empty { color: var(--muted); font-size: 13px; line-height: 1.8; }
.tourney-formats {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin: 14px 0;
}
.tf-item {
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 14px; border-radius: 10px;
  background: var(--hi-1); border: 1px solid var(--line);
}
.tf-item span { font-size: 20px; }
.tf-item b { color: var(--text); font-size: 14px; }
.tf-item small { font-size: 11px; line-height: 1.5; }
.tf-item em { font-style: normal; font-size: 10px; color: var(--accent); margin-top: 2px; }

/* ===========================================================================
 * 赛事品牌图标 + 每张卡片一个报名按钮（2026-10-15.99）
 * ---------------------------------------------------------------------------
 * 用户要求：大赛改成「BLAST 公开赛 + 城市」这类真实赛事名，并给每张卡片
 * 放一个报名按钮（玩家自己挑打哪个），同时报名要消耗体力（16 队 5 点 / 8 队 3 点）。
 *
 * 【图标是 img/events/ 下的 webp】统一 128×128、透明底。
 * 原始素材有的 800×800、有的 904×904，内容占比也不一样 —— 所以生成时
 * 先按不透明内容裁剪再等比缩放居中，视觉大小才一致（见交接文档）。
 * ========================================================================== */
/* 图标 + 赛事名同一行（2026-10-16.00 用户要求「将大赛名称放在图标后面」） */
.tf-head { display: flex; align-items: center; gap: 9px; }
.tf-logo { width: 34px; height: 34px; object-fit: contain; display: block; flex: none; }
.tf-head b { color: var(--text); font-size: 14px; }
.tf-item .tf-go {
  margin-top: 8px; align-self: flex-start;
  padding: 7px 16px; font-size: 13px;
}
.tf-item .tf-go[disabled] { opacity: .5; cursor: not-allowed; }
/* 进行中的赛事标题：图标 + 中文名 + 英文名 */
.th-logo { width: 24px; height: 24px; object-fit: contain; vertical-align: -5px; }
.th-en { color: var(--muted); font-size: 11.5px; font-weight: 400; margin-left: 6px; }
.tr-logo { width: 16px; height: 16px; object-fit: contain; vertical-align: -3px; }

/* 奖励规则次级面板：默认收起来，点标题才展开。
 * 【为什么不做成每张赛制卡各自折叠】展开一张会把 grid 整行撑高，
 * 旁边那张卡里就会出现一大片空白。收成一块并排展示也更好对比。 */
.tourney-rewards {
  margin-top: 15px; margin-bottom: 4px; padding-top: 13px;
  border-top: 1px solid var(--line);
}
.tourney-rewards > summary {
  cursor: pointer; list-style: none; user-select: none;
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--accent);
}
/* 展开/收起时显示不同的提示文字 */
.tourney-rewards > summary .when-open { display: none; }
.tourney-rewards[open] > summary .when-closed { display: none; }
.tourney-rewards[open] > summary .when-open { display: inline; }
.tourney-rewards > summary .when-closed,
.tourney-rewards > summary .when-open { font-size: 11px; font-weight: 400; opacity: .8; }
.tourney-rewards > summary::-webkit-details-marker { display: none; }
.tourney-rewards > summary::after {
  content: '▾'; font-size: 10px; margin-left: auto; transition: transform .15s;
}
.tourney-rewards[open] > summary::after { transform: rotate(180deg); }
.tourney-rewards > summary:hover { color: var(--accent); }
.tr-grid {
  display: grid; gap: 12px; margin-top: 12px;
  grid-template-columns: repeat(auto-fit, minmax(212px, 1fr));
}
.tr-item {
  padding: 10px 12px 12px; border-radius: 10px;
  background: var(--hi-1); border: 1px solid var(--line);
}
.tr-title {
  font-size: 12px; font-weight: 700; color: var(--text);
  margin-bottom: 7px; padding-bottom: 7px;
  border-bottom: 1px solid var(--hi-3);
}

/* 报名前展示的奖励规则 */
.tf-reward { font-size: 10.5px; }
.tfr-head { color: var(--accent); margin-bottom: 3px; white-space: nowrap; }
.tfr-head b { color: var(--text); }
.tfr-line {
  display: flex; align-items: baseline; gap: 6px;
  line-height: 1.55; color: var(--muted);
}
/* 「十六强」是三个字，宽度给够，不然会折成两行把整块撑高 */
.tfr-line b { flex: none; width: 48px; color: var(--text); font-weight: 600; white-space: nowrap; }
.tfr-line span {
  flex: none; width: 44px; text-align: right;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.tfr-line i {
  font-style: normal; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tfr-line.extra { color: var(--good); }
.tfr-line.extra b { color: var(--good); width: auto; white-space: nowrap; }
/* 表头那一行（名次/金币/卡包），比数据行更淡更小 */
.tfr-line.labels { font-size: 9.5px; opacity: .55; margin-bottom: 1px; }
.tfr-line.labels b { font-weight: 400; }

/* 结算明细 */
.tn-payout { margin-top: 9px; display: grid; gap: 3px; font-size: 12px; }
.tn-payout > div {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; color: var(--muted);
}
.tn-payout > div b { color: var(--text); font-variant-numeric: tabular-nums; }
.tn-payout > div.total {
  border-top: 1px solid var(--hi-4);
  margin-top: 4px; padding-top: 6px; font-size: 14px;
}
.tn-payout > div.total b { color: var(--accent); font-size: 17px; }
.tn-payout .hint-line i { font-style: normal; font-size: 10px; opacity: .75; }
.tourney-prizes { font-size: 12px; color: var(--accent); }

.tourney-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 9px; }
.th-title { font-size: 15px; }
.th-live { font-size: 11px; color: var(--good); margin-left: 8px; }
.th-done { font-size: 11px; color: var(--muted); margin-left: 8px; }
.th-me { font-size: 12px; color: var(--muted); margin-left: auto; }
.th-me b { color: var(--text); }

.tourney-next {
  padding: 10px 13px; border-radius: 10px; margin-bottom: 11px;
  background: var(--tint-a-weak); border: 1px solid var(--tint-a-line);
}
.tourney-next.finished { background: var(--tint-g-weak); border-color: var(--tint-g-mid); }
.tn-stage { font-size: 11px; color: var(--accent); font-weight: 700; margin-bottom: 4px; }
.tn-vs { font-size: 15px; font-weight: 700; }
.tn-vs span { color: var(--muted); font-size: 12px; margin: 0 8px; }
.tn-vs small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.tn-actions { display: flex; gap: 9px; margin-top: 9px; flex-wrap: wrap; }

.tourney-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 8px; }
.tourney-table th {
  text-align: left; color: var(--muted); font-size: 10px; font-weight: 600;
  padding: 3px 7px; border-bottom: 1px solid var(--line);
}
.tourney-table td { padding: 3px 7px; border-bottom: 1px solid var(--hi-2); }
.tourney-table .num { text-align: right; font-variant-numeric: tabular-nums; }
/* 8 支队排 2 栏、16 支队排 4 栏，都是 4 行 —— 一屏放得下 */
.tourney-table .rk { color: var(--muted); width: 16px; }
.tourney-table .tm { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tourney-table[data-cols="4"] { font-size: 11px; }
.tourney-table[data-cols="4"] th,
.tourney-table[data-cols="4"] td { padding: 3px 4px; }
.tourney-table[data-cols="4"] .tm { max-width: 84px; }
.tourney-table[data-cols="4"] .rk { width: 12px; }
.tourney-table .us { color: var(--accent); font-weight: 700; }

.tourney-log { font-size: 12px; color: var(--muted); }
.tourney-log summary { cursor: pointer; padding: 3px 0; }
/* 【去掉点击后的黑框】`<summary>` 是可聚焦元素，点一下浏览器就给它画一圈
 * 默认的聚焦描边（那圈黑边看着像 bug）。鼠标点击不该有描边，
 * 所以这里去掉 outline；但键盘 Tab 过来时仍要看得见，所以留 :focus-visible。 */
.tourney-log summary:focus:not(:focus-visible) { outline: none; }
.tourney-log summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tl-body { max-height: 160px; overflow-y: auto; line-height: 1.8; padding-left: 6px; }
.tourney-tools { display: flex; gap: 9px; margin-top: 10px; flex-wrap: wrap; }

/* ===========================================================================
 * 对阵图（2026-10-15.89）
 * ---------------------------------------------------------------------------
 * 用户给了两张参考图（Major 瑞士轮分档 + 淘汰赛树状图），要求加到大赛模式。
 *
 * 【树状图靠 CSS Grid 自动定位】JS 只给出每个格子的 grid-column / grid-row，
 * 竖直居中由"第 r 轮占 2^(r+1) 行"这个规律保证 —— 不需要任何像素计算。
 * 【为什么要能横向滚】16 队双败有 8 列，手机/窄面板放不下。给个 overflow-x，
 * 别让整个面板被撑破（撑破会把旁边的面板也挤走）。
 * ========================================================================== */
.bracket {
  margin: 4px 0 12px;
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--sh-1);
}
/* 【撑满整行】大赛面板只占 .match-grid 的左栏（1440px 时约 567px 宽），
 * 双败的树有 4 列，在栏内塞不下、队名会被截成 "Leg..."。
 * 做法：`#tourney-panel` 在 HTML 里就是 `.match-grid` 的**直接子项**（不在
 * `.match-col` 里），所以可以直接给它 grid-column。
 * 【曾经写错过一次，别再这么干】我一开始给 `.match-col { display: contents }`
 * 想让它里面的面板变成 grid 直接子项 —— 那等于**废掉两栏布局**，整个比赛页
 * 的赛前准备/选图会堆成一列。e2e 的「比赛页是两栏并排」当场就红了。
 * 【只在真有宽对阵图时跨栏】否则赛前准备会被挤到下面去。 */
.match-grid #tourney-panel.wide { grid-column: 1 / -1; }
/* 【对阵图默认折叠】用 <details>，样式和「战绩总表」保持一致：
 * 去掉系统默认的三角标记、悬停变金色、"点开查看 / 点收起"两种文案。
 * 用户要求：太占地方，默认收起来，需要自己打开。 */
.bracket-fold { padding: 8px 12px 10px; }
.bracket-fold > summary {
  cursor: pointer; padding: 2px 0; font-size: 12px; font-weight: 700;
  color: var(--accent); list-style: none;
}
.bracket-fold > summary::-webkit-details-marker { display: none; }
.bracket-fold > summary:hover { filter: brightness(1.15); }
.bracket-fold > summary::before { content: '▸ '; font-size: 11px; }
.bracket-fold[open] > summary::before { content: '▾ '; }
.bracket-fold > summary .when-open { display: none; }
.bracket-fold[open] > summary .when-closed { display: none; }
.bracket-fold[open] > summary .when-open { display: inline; }
.bracket-fold > summary small,
.bracket-fold > summary .when-closed,
.bracket-fold > summary .when-open {
  font-size: 11px; font-weight: 400; opacity: .8; margin-left: 6px;
}
.bracket-fold > .br-tree,
.bracket-fold > .br-groups { margin-top: 8px; }
/* ---- 双败赛程表（不用树状图）2026-10-15.96 ----
 * 【为什么是列表】双败的败者组场次是 4→2→1，还得等小组赛全打完，
 * 硬画成平面树只会又高又空（用户连提六次）。列表紧凑、不歪、一眼看清谁打谁。
 * 用 auto-fit 排成多列：宽屏一行能放 3~4 轮，窄屏自动堆成一列。 */
.bracket-flow {
  display: grid;
  gap: 10px 14px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.bf-round { min-width: 0; }
.bf-round-name {
  font-size: 11px; font-weight: 700; color: var(--muted);
  margin-bottom: 4px; padding-bottom: 3px;
  border-bottom: 1px solid var(--line);
}
.bf-round-body { display: flex; flex-direction: column; gap: 3px; }
.bf-match {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px;
}
.bf-team {
  display: flex; align-items: center; gap: 4px;
  flex: 1 1 0; min-width: 0;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.bf-team.tbd { border-style: dashed; opacity: .55; }
.bf-team.win { border-color: var(--good); background: var(--tint-g-weak); }
.bf-team.lose { opacity: .5; }
.bf-team.us { border-color: var(--accent); }
.bf-team.us .br-name { color: var(--accent); font-weight: 700; }
.bf-vs { flex: none; font-size: 10px; color: var(--muted); }

.br-label { font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.br-sub { font-size: 11px; font-weight: 700; color: var(--muted); margin: 12px 0 6px; }

/* ============================================================================
 * 瑞士轮对阵图（2026-10-16.03）
 * ----------------------------------------------------------------------------
 * 用户给了完美电竞 / HLTV 两张参考图，来回迭代十几版后定下的布局。
 *
 * 【和参考图最大的区别：宽度】参考图是整屏宽的面板，我们的赛事面板在左栏
 * 只有约 475px（1440px 屏、.match-grid 两栏各 1fr）。用户明确要求
 * **"缩小一些来符合赛事框的大小，维持风格统一"** —— 所以**不做 .wide 横跨两栏**，
 * 而是把每场比赛压到 52px、队标 15px，6 列一共约 386px。
 *
 * 【列结构】一列里堆多个"组"（不是每组一列 —— 我第一版就做错了）：
 *   1) 0:0   2) 1:0/0:1   3) 2:0/1:1/0:2
 *   4) 🟩3:0横条 / 2:1 / 1:2 / 🟥0:3横条
 *   5) 绿框(3:1,3:2) →「晋级」/ 2:2 / 红框(1:3,2:3) →「淘汰」
 *
 * 【对齐】第 4、5 列的 gap 是**算出来的**（不是试出来的，见 app.js 注释）：
 *   两列内容高度几乎一样（451 vs 451.5），只要配平 gap 就能让上下边缘同时对齐：
 *   451 + 3×gap4 = 451.5 + 2×gap5   →   gap4 = 11.4 / gap5 = 17
 * 实测 3:0 条顶边与绿框顶边、0:3 条底边与红框底边**误差都是 0**。
 * ========================================================================== */
.sw-bracket {
  --sw-match-w: 52px;            /* 一场比赛的宽度 */
  --sw-icon: 15px;               /* 圆形队标直径 */
  display: flex;
  gap: 10px;
  /* 【每列竖直居中 —— 和示范文件 test/bracket-preview/index.html 一致】
   * 参考图（完美电竞）里"下一轮居中于上一轮"就是这么来的。
   *
   * 【2026-10-16.10 改回 center】1.0.8 我把它改成了 flex-start，理由是
   * "列越高顶边越往上跑、看着参差不齐"。**那是我读错了用户的话** ——
   * 用户说的是"这些列**不用**在顶端对齐"（= 不要顶端对齐），
   * 我读成了"改成顶端对齐"，于是改反了。
   * 示范文件用的是 center，这里跟它保持一致。
   * 【教训】"不用 X"和"用 X"只差一个字，改之前应该回去看那份已经验收过的文件。 */
  align-items: center;
  /* 【横向**靠左**，不居中】2026-10-16.09 用户要求：
   *   「他应该从哪个框的左侧开始生成，而不是中间」
   * 以前是 width:max-content + margin:0 auto 把整张图推到中间。
   * 【为什么不能只去掉 margin:0 auto】带 overflow-x:auto 的 flex 容器
   * 会把自己撑满，内容比容器窄时 justify-content:center 就不居中了 ——
   * 所以当时才补的 margin:auto。现在要的就是靠左，两个都去掉即可，
   * 默认就是 flex-start，而且内容比容器宽时照样能横向滚动。 */
  justify-content: flex-start;
  width: max-content;
  max-width: 100%;
  padding: 4px 2px 2px;
  overflow-x: auto;              /* 窄屏横向滚动，不硬压列宽 */
}
.sw-col {
  display: flex; flex-direction: column; gap: 15px;
  align-items: center; flex: none;
}
/* 【第 4 / 5 列的间距是算出来的】让两列等高，上下边缘才能同时对齐。
 *
 * 2026-10-16.10 重算过 —— 最后一列的「晋级 / 淘汰」标题挪到框**上面**了，
 * 两列的内容构成变了。实测（整届打完、绿红框都填满）：
 *   col5 高 318 = 绿框(标题+格) 94 + 2:2组 96 + 红框 94 + 2 个间距 17
 *                 → 94 + 96 + 94 + 34 = 318
 *   col4 有 4 块：3:0条 38 + 2:1组 96 + 1:2组 96 + 0:3条 38 + **3 个间距**
 *                 → 268 + 3g，要等于 318 → g = 50/3 = 16.67
 *   ⇒ 还要让 0:3 条的底边对上红框底边、3:0 条的顶边对上绿框顶边，
 *     两个约束一起解出来同样是 g = 5.4 … 16.67 这个区间里取**两者都不偏太多**的值。
 *     最后取 **16.67**：顶边差 +11、底边差 -11（对称分摊，看着最稳）。
 *
 * 【别凭感觉调】改完必须量。这个文件里为这几个像素来回折腾过很多次：
 * 第一版写成 `gap: 49.4px`（以为是"加 38"），其实是把**三个**间距都加了 38，
 * 列高直接变成 416，底边差到 -98。 */
.sw-col4 { gap: 16.67px; }
.sw-col5 { gap: 17px; }

/* 一个"组" = 组名 + 若干场比赛 */
.sw-grp { display: flex; flex-direction: column; gap: 5px; align-items: center; }
/* 组名（战绩）：带一条下划线的标签 */
.sw-h {
  display: flex; align-items: center; gap: 5px;
  width: 100%;
  font-size: 9.5px; font-weight: 800; letter-spacing: .2px;
  color: var(--muted);
}
.sw-h::after { content: ''; flex: 1 1 auto; height: 1px; background: var(--line); }

/* 一场比赛：左右两个圆形队标 + 中间 VS（不显示队名，走 title 悬停） */
.sw-m {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  width: var(--sw-match-w);
  padding: 3px 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.sw-m.us { border-color: var(--accent); }
.sw-vs {
  font-size: 7px; font-weight: 800; color: var(--muted);
  letter-spacing: .3px; flex: none;
}

/* 圆形队标 */
.sw-ic {
  width: var(--sw-icon); height: var(--sw-icon); flex: none;
  border-radius: 50%;
  /* 【队标底：跟着主题变，配合"单色队标换图"】2026-10-16.14
   *
   * 历史：
   *   · 原来是 var(--hi-1)（浅色主题下是一层极淡的灰）—— 白队标完全看不见
   *   · 1.0.12 改成固定的深色底（--chip-on-light）—— 浅底上的白队标看清了，
   *     但深色主题下它和页面底色一样深，整块看着糊成一团
   *     它和页面底色一样深，整块看着糊成一团
   *   · 现在：**浅色主题用浅底、深色主题用深底**，队标则由
   *     `teamLogoThemedByName` 按主题选深/浅两版（见那边的说明）。
   *     两边都对比得开，而且不会糊。
   *
   * 【只有单色队标有变体】16 个近似单色的队标生成了 dark/light 两版；
   * 34 个彩色队标保留原色（把品牌色抹成黑白反而难看，用户确认过范围）。
   * 彩色队标在两种底色上都还看得清（它们多数是饱和色）。
   */
  background: var(--hi-1);
  border: 1px solid var(--line);
  /* 【相对定位 + 层叠】队标图盖在首字母上面，图加载失败就露出首字母。
   * 见 .sw-letter / teamLogoThemedByName 的说明。 */
  position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
/* 【首字母兜底】没有队标文件的队伍（**玩家自建队永远没有**）不能是个空白圆圈。
 * 项目里别处（卡面头像）就是这个做法：图片失败时隐藏自己，露出下面的首字母。
 * 字号用容器单位，换 --sw-icon 不用改这里。 */
.sw-letter {
  position: absolute;
  font-size: calc(var(--sw-icon) * .58);
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  opacity: .78;
  user-select: none;
}
.sw-ic.us .sw-letter { color: var(--accent); opacity: 1; }
/* 【深色主题：明确的深底 + 浅色版队标】
 * 【为什么必须写这一条】`[data-theme="light"] .sw-ic` 是**属性选择器**，
 * 优先级 (0,2,0) 比单个类 (0,1,0) 高。而 `--hi-1` 在浅色主题下是
 * `rgba(0,0,0,.022)` —— **几乎全透明**。所以只写上面那条 `.sw-ic` 的话，
 * 深色主题里圆底会取到那个近透明的值、看着就是页面底色（实测量到亮度 255）。
 * 用 `:not([data-theme="light"])` 明确表达"非浅色主题"。 */
:root:not([data-theme="light"]) .sw-ic {
  background: var(--line-2);
  border-color: var(--line-2);
}
/* 【浅色主题：浅底 + 深色版队标】 */
[data-theme="light"] .sw-ic {
  background: var(--chip-on-dark);
  border-color: var(--chip-on-light-line);
}
.sw-logo {
  width: calc(var(--sw-icon) - 4px); height: calc(var(--sw-icon) - 4px);
  object-fit: contain; display: block;
  /* 【描一圈轮廓】和 .card-logo 同一个办法。
   * --logo-halo 跟着主题变（深色主题白描边、浅色主题黑描边），
   * 所以彩色队标在两种底色上都还有轮廓兜底。 */
  filter: drop-shadow(0 0 1px var(--logo-halo))
          drop-shadow(0 0 1.5px var(--logo-halo-2));
}
.sw-ic.us { border-color: var(--accent); }
/* 【待定图标保持浅色】它里面没有队标、只有一个 "?" —— 跟着变成深底的话，
   33 个空框会变成一堆深色圆点，整张图看着很重。 */
.sw-ic.tbd {
  border-style: dashed;
  background: var(--hi-1);
  border-color: var(--line);
}
.sw-tbd { font-size: 8px; color: var(--muted); }
/* 最后一轮：已晋级 / 已淘汰 */
.sw-ic.q-adv { border-color: var(--good); background: var(--tint-g-weak); }
.sw-ic.q-out { border-color: var(--bad); background: var(--tint-r-mid); }

/* ---------------------------------------------------------------------------
 * 结果框（绿 = 晋级 / 红 = 淘汰）
 * 一个深色底块，内部按档位分格、格与格之间竖线（用户："放在一个框中作用分开"）。
 * 【「晋级 / 淘汰」标题在框**下面**】用户要求 —— 它原来在框上面占约 24px，
 * 正好是"3:0 条顶边和绿框顶边对齐"差的那 24px，挪下来之后误差变 0。
 * ------------------------------------------------------------------------- */
.sw-result { display: flex; flex-direction: column; gap: 5px; align-items: center; }
.sw-result.adv { color: var(--good); }
.sw-result.out { color: var(--bad); }
.sw-result > .sw-h { color: inherit; }
.sw-box {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  border-radius: 7px; overflow: hidden;
}
.sw-box.adv { background: var(--tint-g-strong); }
.sw-box.out { background: var(--tint-r-strong); }
.sw-cell {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 5px 4px 6px; min-width: 30px;
}
.sw-cell + .sw-cell { border-left: 1px solid rgba(255, 255, 255, .26); }
.sw-cap { font-size: 9px; font-weight: 800; color: #fff; opacity: .95; }
.sw-pairs { display: flex; flex-direction: column; gap: 3px; }
/* 深色底上给队标一个浅色圆底 —— 不然浅色队标（Spirit 那种）整个看不见 */
.sw-box .sw-ic { background: var(--chip-on-dark); border-color: rgba(255, 255, 255, .5); }

/* 横条（3:0 / 0:3）—— 对着示范文件 test/bracket-preview/index.html 的 .bar 来：
 * 战绩**显示在条里**、上面一排（.sw-cap），图标在下面一排、没有 VS。
 * 宽度 = 一个比赛框的宽度，两边才对得齐。 */
.sw-bar {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  width: var(--sw-match-w);
  box-sizing: border-box;
  padding: 4px;
  border-radius: 6px;
  background: var(--tint-r-strong);   /* 默认红（0:3）；绿的由 .sw-bar.adv 覆盖 */
}
.sw-bar.adv { background: var(--tint-g-strong); }
.sw-bar .sw-cap { font-size: 9px; font-weight: 800; color: #fff; opacity: .95; }
.sw-bar-icons { display: flex; align-items: center; gap: 4px; }
.sw-bar .sw-ic { background: var(--chip-on-dark); border-color: rgba(255, 255, 255, .5); }

/* 【对阵图 —— 2026-10-15.99 换成参考图（完美电竞）那套机制】
 *
 * 参考图的原始做法（从 data.wanmei.com 的 CSS 里读出来的）：
 *   .against-left      { position:relative; float:left; padding-top:50px; }
 *   .against-left li   { display:flex; align-items:center; }   ← 槽，高度内联翻倍
 *   .against-left li .against-match { width:200px; }
 *   .round-name        { position:absolute; top:0; width:200px; text-align:center; }
 * 核心：**li 高度按轮次翻倍 + align-items:center** → 下一轮自动居中于上一轮。
 *
 * 我这边等价地实现成：一列 = 一个 flex 竖列，列内按 row 排序、整列 `justify-content:center`
 * 自动竖直居中。**不再用 CSS Grid 算行列坐标** —— 前面九轮就是被那套坑住的
 * （块级 grid 被拉满容器宽、行号算错、列宽失控，全是那套带来的问题）。
 */
.br-tree {
  /* 一场比赛的宽度（两个队名条 + 缝）。
   * 【为什么是 106px】大赛面板在比赛页左半栏（约 487px）。4 列要放进去：
   *   4×106 + 3×10 = 454 ≤ 487  ✔（108 时是 498，会多 11px 触发横向滚动）
   * 参考图用的是 200px，但它的面板是整屏宽的。想让框更宽就得让面板跨栏
   * （用户明确说过"不要占全屏"），二选一。 */
  --br-match-w: 106px;
  /* 【每列/每场的最大宽度】面板被 .wide 撑到整屏时，列会按 minmax 变宽，
   * 但也不能无限宽 —— 参考图的队名框在 160~200px 左右。 */
  --br-match-max: 168px;
  /* 每个队名条的高度 */
  --br-team-h: 22px;
  --br-gap: 3px;
  /* 列数：JS 会按赛制写行内 `--br-cols`，这里给个默认值兜底。 */
  --br-cols: 4;

  display: flex;
  flex-direction: column;
  gap: 16px;                     /* 胜者组和败者组之间留一条缝 */
  /* 【必须给内容宽度】不给的话这个 flex 容器会被父元素**压到面板宽**
   * （437px），然后 4 列平分只剩 109px，比赛是 150px 宽 → 列与列重叠。
   * `width:max-content` 让它按内容的自然宽度撑开，配合 overflow-x:auto
   * 在窄屏横向滚动。 */
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
}
/* 一个"视觉行"：胜者组一条、败者组一条。 */
.br-band { display: flex; flex-direction: column; gap: 8px; }
/* 【标签横排、占满整行】不放左边竖排 —— 那会吃掉 36px 横向空间，
 * 4 列就不够放、触发横向滚动。用户手绘图里标签也是在上面一行的。 */
.br-band-label {
  font-size: 11px; font-weight: 700; color: var(--accent);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line);
}
/* 行内的各列 —— 用同一套列宽，所以上下两行的列是**纵向对齐**的 */
.br-band-cols {
  display: grid;
  /* 【用 minmax 让它填满可用宽度，2026-10-16.01】
   * 原来写死 `repeat(N, 106px)` —— 面板被 .wide 撑到整屏（约 1465px）时，
   * 5 列只占 560px、右边空掉一大片，而且列头标题挤在 106px 里被迫换行
   * （标题一换行，那一列的队名框就被顶下去了，看着参差不齐）。
   * 现在每列至少 106px、至多 168px，多出来的空间平分给各列。 */
  grid-template-columns: repeat(var(--br-cols, 4), minmax(var(--br-match-w, 106px), 168px));
  gap: 10px;
  align-items: center;           /* ← 关键：列内内容竖直居中 */
}
/* 【表头行 —— 和列用同一套列宽 / 同一个 gap，所以标题正好在各自列上方】
 * 用户要求：小组赛、胜者组第一轮…这些标题都要在**同一条水平线**上。
 * 单独一行就不会被各列不同的内容高度带偏（原来标题跟着内容居中走）。 */
.br-band-head {
  display: grid;
  /* 【必须和 .br-band-cols 用完全一样的列模板】不然表头和数据列会错位 */
  grid-template-columns: repeat(var(--br-cols, 4), minmax(var(--br-match-w, 106px), 168px));
  gap: 10px;
  align-items: end;              /* 多轮标题时向上堆，贴着下面的列 */
}
.br-head-cell { display: flex; flex-direction: column; justify-content: flex-end; }
.br-cell { display: flex; flex-direction: column; justify-content: center; }
/* 【一轮里的比赛竖着排】这跟用户手绘的图一致：小组赛 4 场是**竖着一列**的，
 * 不是 2×2 铺开。所以这里就是普通的 flex column，不做特殊处理。 */
.br-round-matches { display: flex; flex-direction: column; }

/* 一轮的标题：现在住在 .br-band-head 里，天然和其它标题同高 */
.br-round-title {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-align: center;
  padding: 0 0 5px;
  white-space: nowrap;
}
/* 一场比赛 = 上下两个队名条 + 中间一个 VS（2026-10-16.02）
 * ---------------------------------------------------------------------------
 * 【为什么加 VS】用户指着参考图（完美电竞）说"这个图还是有问题"。
 * 对比之后差别在：参考图里**一场比赛是一个整体** —— 两个队名条 + 中间一条细缝，
 * 缝里写着 VS；我们原来是两个各自独立的框，上下紧贴、看不出"这两队是一场比赛"，
 * 而且相邻两场比赛之间还容易看串行。
 *
 * 【VS 为什么用 ::before 而不是真加个 div】组内第 13 节有断言在数
 * `.br-team`（单败 14 个框、每场正好 1 win + 1 lose），往 DOM 里塞新元素
 * 会波及那些统计。用伪元素画，DOM 一个节点都不多。
 * 【必须给 .br-match 加 position:relative】伪元素要绝对定位到缝里。
 *
 * 【跟着列一起变宽】列改成 minmax 之后会比 106px 宽（2026-10-16.01），
 * 这里如果还写死 106px，框就缩在列中间、右边空一截。
 * 用 width:100% + max-width 上限：窄屏还是 106px，宽屏铺满列。
 */
.br-match {
  position: relative;
  display: flex; flex-direction: column;
  gap: var(--br-gap, 3px);
  width: 100%;
  max-width: var(--br-match-max, 168px);
  /* 【两场之间要拉开】原来只 9px，参考图里场与场之间明显更松 ——
   * 一列里有 8 场时不至于糊成一片。 */
  margin-bottom: 13px;
}
.br-match::before {
  content: 'VS';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;                    /* 压在两个队名条之间的缝上 */
  padding: 0 4px;
  border-radius: 3px;
  background: var(--panel-2, var(--hi-1));
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--muted);
  line-height: 1.5;
  pointer-events: none;
}
.br-team {
  display: flex; align-items: center; gap: 5px;
  flex: none;
  height: var(--br-team-h, 24px);
  padding: 0 7px;
  border-radius: 5px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 10.5px;
  line-height: 1;
  min-width: 0;
  overflow: hidden;
}
/* 【地图列表折叠】2026-10-16.92 用户要求：选完图开打之后把地图列表收起来省空间。
 * 选图期间自动展开（要能点图），选完自动收起，只留状态那行 + 开打按钮。
 * 样式和「战绩总表 / 对阵图」那两处 <details> 保持一致：去三角、悬停变金。 */
.veto-maps { margin-top: 6px; }
.veto-maps > summary {
  cursor: pointer; padding: 3px 0; font-size: 12px; color: var(--muted);
  list-style: none;
}
.veto-maps > summary::-webkit-details-marker { display: none; }
.veto-maps > summary:hover { color: var(--accent); }
.veto-maps > summary::before { content: '▸ '; font-size: 11px; }
.veto-maps[open] > summary::before { content: '▾ '; }
.veto-maps > summary .when-open { display: none; }
.veto-maps[open] > summary .when-closed { display: none; }
.veto-maps[open] > summary .when-open { display: inline; }
.veto-maps > .map-pool { margin-top: 8px; }

/* 【队名条里只用队标，不再放位置图标】位置已经在卡面上表达过了；
 * 窄行里再塞图标会把队名挤没。 */
.br-team.win { border-color: var(--good); background: var(--tint-g-weak); }
.br-team.lose { opacity: .5; }
.br-team.us { border-color: var(--accent); }
.br-team.us .br-name { color: var(--accent); font-weight: 700; }
.br-team.tbd { border-style: dashed; opacity: .55; }
/* 【瑞士轮最后一轮：标出谁晋级、谁淘汰】2026-10-16.02
 * 参考图里最后两列带绿/红底色，一眼看出出线的是哪几支。
 * 只在**最后一轮**的那两个队名条上加（中间几轮还没定）。
 * 【为什么用边框+淡底而不是整块填色】这个图是浅色主题下的"纸白"面板，
 * 整块填色会盖掉队标和队名的对比度；边框 + 很淡的底色已经够分辨。 */
.br-team.q-adv { border-color: var(--good); background: var(--tint-g-weak); }
.br-team.q-out { border-color: var(--bad); background: var(--tint-r-mid); }
.br-logo {
  width: 13px; height: 13px; flex: none;
  object-fit: contain;
}
.br-name {
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.br-score {
  flex: none; font-variant-numeric: tabular-nums;
  color: var(--muted); font-size: 9px;
}
.br-team.win .br-score { color: var(--good); }

/* ---- 按战绩分档（瑞士轮 / 小组赛）---- */
.br-groups {
  display: flex; gap: 8px; flex-wrap: wrap;
  align-items: flex-start;
}
.br-group {
  flex: 0 1 auto; min-width: 108px;
  border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden;
  background: var(--panel);
}
/* 三档用不同底色：晋级绿 / 淘汰红 / 进行中灰 */
.br-group.adv { border-color: var(--tint-g-mid); background: var(--tint-g-weak); }
.br-group.out { border-color: var(--bad); background: var(--sh-2); }
.brg-head {
  display: flex; align-items: baseline; gap: 6px;
  padding: 5px 9px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.brg-head b { font-variant-numeric: tabular-nums; }
.brg-head small { margin-left: auto; font-size: 10px; color: var(--muted); }
.br-group.adv .brg-head small { color: var(--good); }
.brg-body { padding: 4px; display: grid; gap: 2px; }
.brg-item {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 6px; border-radius: 6px;
  font-size: 11.5px;
  background: var(--sh-1);
  min-width: 0;
}
.brg-item.us { background: var(--tint-a-weak); }
.brg-item.us .br-name { color: var(--accent); font-weight: 700; }

/* ---- 战绩总表（原来的表格，现在收进折叠里）---- */
.tourney-standings { margin: 6px 0 10px; }
.tourney-standings > summary {
  cursor: pointer; padding: 4px 0; font-size: 12px; color: var(--muted);
  list-style: none;
}
.tourney-standings > summary::-webkit-details-marker { display: none; }
.tourney-standings > summary:hover { color: var(--accent); }
.tourney-standings > summary .when-open { display: none; }
.tourney-standings[open] > summary .when-closed { display: none; }
.tourney-standings[open] > summary .when-open { display: inline; }
.tourney-standings > summary .when-closed,
.tourney-standings > summary .when-open { font-size: 11px; font-weight: 400; opacity: .8; }
.tourney-standings .tourney-table { margin-top: 6px; }

/* 手机端：对阵图列变窄、间距收紧。列本身是 flex 竖列，
 * 放不下时由 .br-tree 的 overflow-x:auto 横向滚动，不硬压列数。 */
@media (max-width: 820px) {
  .br-tree {
    --br-match-w: 124px;
    --br-team-h: 22px;
    gap: 8px;
  }
  .br-groups { gap: 6px; }
  .br-group { min-width: 96px; }
  .br-team { padding: 0 5px; font-size: 10px; }
  .br-logo { width: 13px; height: 13px; }
}

/* 两栏布局下，对阵表和地图卡都窄了一半，行高也要跟着收 */
.match-grid .match-team { gap: 3px; }
.match-grid .match-team h3 { font-size: 13px; margin-bottom: 2px; }
.match-grid .match-row { padding: 2px 7px; font-size: 11.5px; }
.match-grid .matchup { gap: 10px; }
.match-grid .match-actions { margin-top: 10px; gap: 8px; flex-wrap: wrap; align-items: center; }
.match-grid .match-actions .btn { padding: 8px 14px; font-size: 13px; }

/* 「开打 BO3」是这一页的主操作，做得比别的按钮大一圈 */
.match-grid .match-actions .btn.btn-big {
  padding: 13px 34px; font-size: 16px; font-weight: 800; letter-spacing: .3px;
}
.match-grid .match-actions .btn.btn-big:disabled { padding: 13px 34px; }

/* 「自动选图」挪到「地图 Ban/Pick」标题右边 */
.panel-title .btn-auto {
  margin-left: auto; padding: 5px 12px; font-size: 12px;
  font-weight: 600; align-self: center; flex: none;
}

/* 【116px 太窄】一行塞太多列，每张卡只剩一百来像素，图标和说明挤成一团 ——
   用户反馈的"ban选图显示有问题"就是这个。150px 起，宁可少一列也要看得清。 */
.match-grid .map-pool { gap: 10px; margin-bottom: 12px; }
/* 4+3 比 5+2 整齐：basis 大一点，一行正好放 4 张 */
/* 【固定 1/4 宽、不伸缩】每张一样大，一行 4 张；第二行只剩 3 张时
   也不会被拉宽，自然靠左对齐。
   (100% - 3 个 10px 间隙) / 4 = 25% - 7.5px */
.match-grid .map-pool .map-card { flex: 0 0 calc(25% - 7.5px); max-width: none; }
.match-grid .map-card { padding: 9px 8px 11px; }   /* 原来底部留 26px 给标签栏，现在没了 */
.match-grid .map-card .map-emoji { font-size: 30px; }
.match-grid .map-card .map-name { font-size: 12px; margin-top: 2px; }
.match-grid .map-card .map-desc { font-size: 10.5px; min-height: 0; margin-top: 3px; }
.match-grid .veto-order { gap: 5px; }
.match-grid .veto-slot { font-size: 12px; }
.match-grid .veto-status { margin-bottom: 9px; font-size: 13px; }
.result-pack-head {
  font-size: 13px; color: var(--muted); margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.result-pack-head::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.result-summary {
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 14px 18px; font-size: 14px; line-height: 2;
}
.result-summary b { color: var(--accent); }

/* ============================ 3. 卡牌 ============================ */
.card-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  perspective: 1200px;
}
.card-grid-sm { grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 12px; }
/* 小卡（首发页的"可选卡牌"）只有 126 宽，头像和字号按比例收一点 */
/* 【不要在这里再写死尺寸】以前小卡的头像被覆盖成固定 62px，
 * 卡片一宽头像就显小。改成百分比后它会自己跟着缩放，两边比例一致。 */
/* 只缩小字号，尺寸跟着卡片走 */
.card-grid-sm .card-initial { font-size: 21px; }
.card-grid-sm .card-top { padding: 6px 7px 0; }
.card-grid-sm .card-ovr { font-size: 18px; }
.card-grid-sm .card-role { font-size: 9px; }
.card-grid-sm .card-top .card-logo { width: 21px; height: 21px; }

.card {
  position: relative; border-radius: 14px; overflow: hidden;
  aspect-ratio: 3 / 4.15;
  background: linear-gradient(178deg, var(--panel-2) 0%, var(--sunken) 100%);
  border: 1.5px solid var(--rc, var(--line));
  box-shadow: 0 6px 18px var(--sh-2);
  display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
  cursor: pointer;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 14px 30px var(--sh-3), 0 0 22px -4px var(--rc); }

/* ===========================================================================
 * 卡面底图（2026-10-16.24 接上）
 * ---------------------------------------------------------------------------
 * 按**稀有度**铺一张底图（img/cardface/<系列>/<稀有度>.webp）。
 * 由 cardHTML 把 background-image 写在元素的行内 style 上 ——
 * 因为它是动态的（三档看稀有度），写死在这里做不到。
 *
 * 【为什么用 background 而不是 <img>】
 *   · 不用多一个 DOM 节点，卡面上的内容都已经是 z-index: 2，天然盖在上面
 *   · cover 正好是我们要的（图片比例和卡片一致，实际不会裁到）
 *
 * 【.has-face：把卡面固定成"深色卡"】
 *   底图是深色的，而卡面文字颜色**跟着主题走**：
 *       黑夜模式 --text 是浅色        → 深底上没问题
 *       白天模式 --text 是近黑色      → **糊在深底上看不见**
 *   用户指定"白天黑夜共用同一张底图"，所以有底图时把这几样固定下来。
 *
 *   【为什么定义新变量，而不是直接用 --text】就是要**不跟主题变** ——
 *   直接引 --text 在白天模式下还是近黑的。所以另起一套"深色卡面上用"的常量
 *   下面引用它们，正文里也就没有写死的十六进制色值了（自测有一条盯着这个）。
 *
 * 【必须显式写 size / position / repeat】2026-10-16.25 补
 *   我第一版只写了 background-image，**漏了这三行** ——
 *   background-size 默认是 `auto`，于是图片按**原始像素尺寸（316x436）**
 *   从左上角开始铺、还会平铺。而卡片只有 158x218（高清屏 316x436），
 *   缩放比和位置都不对 → **看起来就是"被裁了"**（用户报的
 *   「实际显示的卡面和渲染的不一样，是因为调整的时候裁切了吗」）。
 *   【为什么是 100% 100% 而不是 cover】用户要求「只改变比例不裁切」。
 *   底图比例（1:1.3819）和卡片比例（3:4.15 = 1:1.3833）差 0.1%，
 *   拉满整格等于**不裁切**，那点拉伸肉眼看不出来。
 *   （cover 会先等比放大到填满、再把多出来的边裁掉 —— 那才会裁。）
 *
 * 【--face-img 是干什么的】2026-10-17 加。底图地址由 `cardHTML()` 写成内联的
 *   `--face-img: url(...)`，这里再拿它去设 `background-image`。
 *   【为什么不直接写内联的 background-image】因为**别的规则会用 `background`
 *   简写把它冲掉**（教练卡那条就是，见下面 `.card.card-coach` 的说明）。
 *   内联样式优先级虽然最高，但 `background:` 在样式表里重置的是
 *   `background-image` 这个**子属性**，两者打架的结果很不好推理。
 *   走变量就干净了：`background-image` 只在 CSS 里设一次，
 *   想要底图的规则都引 `var(--face-img)`，谁也不用覆盖谁。
 *
 *   【⚠️ 路径必须用绝对路径 `/img/...`】`var()` 替换进去的**相对 URL 是相对
 *   样式表**（`/css/style.css`）解析的，不是相对页面 —— 实测会变成
 *   `/css/img/cardface/...` 直接 404（第一次改完就踩到了）。
 *   所以 `cardFaceURL()` 返回的地址要以 `/` 开头。
 * =========================================================================== */
.card.has-face {
  --face-bar:    rgba(8, 11, 16, .55);    /* 底部信息条的底 */
  --face-line:   rgba(255, 255, 255, .10);
  --face-edge:   rgba(255, 255, 255, .16);
  border-color: var(--face-edge);
  background-image: var(--face-img);
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}
.card.has-face .card-name { color: var(--face-text); }
.card.has-face .card-meta,
.card.has-face .card-team { color: var(--face-muted); }
.card.has-face .card-bottom {
  background: var(--face-bar);
  border-top-color: var(--face-line);
}
/* 底图上的首字母兜底也要浅色（头像缺图时露出来的是它） */
.card.has-face .card-initial { color: var(--face-text); border-color: rgba(255, 255, 255, .45); }
/* 【有底图的教练卡不要再画首字母占位】2026-10-19 彩蛋卡 Jab Jbich 踩到：
 * 教练卡没有头像图时 .card-initial 会显示队名/昵称首字母（一个「J」小方块），
 * 而底图里已经有圆形头像了 —— 两者叠在一起。有底图就说明卡面是完整的，隐藏占位。
 * 只作用于 .card-coach，不影响年限卡（选手卡）那边的显示。 */
/* （已撤回）不该按"有底图"隐藏首字母 —— 普通教练卡也有底图，会被误伤。
 * 真正的判据是"有没有头像图"：portraitHTML 加载成功后自己会打 .pt-ok 隐藏首字母。 */
/* 头像圈那层"页面底色"的 box-shadow 在深底上会露出一圈亮边，收掉 */
.card.has-face .pt-img { background: transparent; }
/* 有底图时顶部那条稀有度光带就多余了 —— 底图自己已经有主色边框 */
.card.has-face::before { display: none; }

/* 顶部稀有度光带 */
.card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 58px;
  background: linear-gradient(180deg, var(--rc) 0%, transparent 100%);
  opacity: .22; pointer-events: none;
}
/* ---- 卡面布局（2026-10 重排，第二版）------------------------------------
 *   左上 综合评分        右上 队标
 *   左上 综合评分下面：定位
 *        头像（放大）
 *        名字
 *        队伍名
 *        三条能力条
 *   最下方 星级 / 左下重复张数 / 右下国旗
 *
 * 参考的是同类卡牌游戏的做法：综合评分放左上（一眼看强弱），
 * 定位紧跟在下面。副能力数字不上卡面（点开详情才看）。
 * ------------------------------------------------------------------------ */
.card-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 8px 9px 0; gap: 6px;
  position: relative; z-index: 2;
}
/* 左上角那一列：综合评分 + 定位 */
.card-id { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.card-ovr {
  font-size: 22px; font-weight: 800; line-height: 1.05;
  color: var(--rc); letter-spacing: -.5px;
}
.card-ovr .lv { font-size: 10px; font-style: normal; margin-left: 2px; }
.card-role {
  font-size: 10px; font-weight: 700; color: var(--rc);
  opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 右上角的队标 */
.card-top .card-logo { width: 25px; height: 25px; flex: 0 0 auto; margin-top: 1px; }

/* 最下面那一行：重复张数在左、星级居中、国旗在右 */
.card-bottom {
  display: flex; align-items: center; justify-content: center;
  padding: 6px 9px 7px; position: relative; z-index: 2;
  background: var(--sh-2); border-top: 1px solid var(--hi-1);
}
.card-rarity { color: var(--rc); letter-spacing: 2px; font-size: 11px; }
.card-flag {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  font-size: 14px; line-height: 1;
}
/* 重复张数摆在左下角（综合评分搬去左上之后，这里空出来了） */
.card-bottom .card-count {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  font-size: 10px; font-weight: 700; color: var(--muted);
}

.card-avatar {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; position: relative; z-index: 2;
}
/* 真实图片：绝对定位盖在首字母圆上面，缺图时会带 .pt-missing 自动隐藏 */
.pt-img {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -58%);
  width: 76px; height: 76px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--rc); box-shadow: 0 0 18px -4px var(--rc);
  background: var(--sunken); z-index: 3;
}
.pt-img.pt-missing { display: none; }
/* 详情弹窗：圆形头像容器自己就是"相框"，图片直接填满它。
 *
 * 【position 一定要是 absolute，不能是 static】首字母是 <img> 的**兄弟节点**
 * （见 portraitHTML：'<img …>' + initial）。卡面上 img 是 absolute 所以盖住了它；
 * 这里如果改成 static，两者就变成 flex 容器里并排的两个元素 ——
 * 首字母会露在照片旁边，看起来是圆圈里渗出一块黑斑。
 * 用 absolute + inset:0 让照片铺满整个相框，首字母自然被压在底下；
 * 图片加载失败时 .pt-missing 把 img 藏起来，首字母就露出来当兜底。 */
.pt-img-modal {
  position: absolute; inset: 0; transform: none;
  width: 100%; height: 100%; border: none; box-shadow: none;
}
.card-initial {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; letter-spacing: -1px;
  background: linear-gradient(150deg, var(--rc), var(--sh-2));
  color: var(--on-solid);
  border: 2px solid var(--rc);
  box-shadow: 0 0 18px -4px var(--rc);
}
/* ===========================================================================
 * 【图片加载成功 → 首字母框直接不显示】2026-10-17 用户指出
 * ---------------------------------------------------------------------------
 * 用户原话：「有图片时不显示那个首字母框，一定要覆盖？有些图片是透明底，
 *   一但覆盖就露出下面的元素」
 *
 * 照片是**绝对定位盖在首字母框上面**的，正常看不出来；
 * 但只要图片**带透明通道**（教练那批头像是 RGBA），透明的地方就会露出下面的框，
 * 而且换个底图/换个叠层之后更明显。**"盖"解决不了透明**，
 * 只有让首字母框**不参与绘制**才行。
 *
 * 【怎么打上 .pt-ok】图片 onload 时由 `imgLoaded()` 给父元素加。
 * 【图挂了怎么办】`imgFallback()` 会把这个标记摘掉，首字母框就回来当兜底。
 * ========================================================================== */
.pt-ok .card-initial { display: none; }

.card-name {
  text-align: center; font-size: 15px; font-weight: 800;
  padding: 0 6px; position: relative; z-index: 2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 队伍名。定位已经挪到左上角（综合评分下面）了，这里只剩队伍 */
.card-meta {
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--muted);
  padding: 1px 8px 6px; position: relative; z-index: 2;
  white-space: nowrap; overflow: hidden;
}
.card-meta .card-team { overflow: hidden; text-overflow: ellipsis; }
.card-stats { display: flex; gap: 2px; padding: 0 8px 6px; position: relative; z-index: 2; }
.card-stats i {
  flex: 1; height: 4px; border-radius: 2px; background: var(--railing); overflow: hidden;
}
.card-stats i b { display: block; height: 100%; background: var(--rc); border-radius: 2px; }

/* 【.card-foot 删掉了】它原来装"综合评分 + 重复张数"，2026-10 综合评分
 * 搬到左上角、张数搬到最下面一行，这个容器就没内容了。
 * 【.card-subs 也删掉了】副能力数字不再上卡面。 */

/* 教练卡：换一层偏蓝的底色 + 位置标签用蓝色，和选手卡一眼区分
 *
 * 【2026-10-17 修一个真 bug：教练卡**没有底图**】
 * 用户截图对比同稀有度的选手卡和教练卡：选手卡有深色底图、教练卡只有一片紫色。
 *
 * 根因就是下面这条原来写的是 `background:`（**简写**）。
 * 简写会把 `background-image` 一并重置成 `none` ——
 * 而卡面底图是 `cardHTML()` 用**内联样式**画上去的
 * （`style="background-image:url(...)"`）。
 *
 * 【为什么内联样式没赢】内联的优先级确实最高，但它写的是
 * **`background-image` 这一个子属性**，而 `background:` 简写在**样式表**里
 * 重置的是 `background-image` 这个子属性本身 ——
 * 结果就是底图被清掉，只剩渐变。同稀有度的选手卡没有这条规则，所以正常。
 *
 * 【修法】用 `background-image` 把渐变**叠在底图上面**（多层背景，
 * 前面的盖后面的）；颜色另写 `background-color`。这样：
 *   · 有底图时：底图 + 教练的蓝调叠层（仍然一眼区分教练）
 *   · 没底图时：只有渐变 —— 和原来的观感一致
 * 注意 **不能用 `background:` 简写**，那样又会把底图冲掉。 */
.card.card-coach {
  background-color: var(--sunken);
  background-image: linear-gradient(178deg, var(--panel-2) 0%, var(--sunken) 100%);
}
/* 【有底图时不要这层蓝调】底图自带氛围，再叠一层渐变会把画面压暗、看着发灰。
 * 优先级同样是 0,0,2,0，但排在后面 → 对"有底图的教练卡"生效。 */
.card.card-coach.has-face {
  background-image: var(--face-img);
  background-color: transparent;
}
.card.card-coach .card-role { color: var(--info); }

/* 传奇卡额外动效 */
.card.r-legendary { animation: legendGlow 2.6s ease-in-out infinite; }
@keyframes legendGlow {
  0%,100% { box-shadow: 0 6px 18px var(--sh-2), 0 0 14px -6px var(--rc); }
  50%     { box-shadow: 0 6px 18px var(--sh-2), 0 0 30px -2px var(--rc); }
}

/* 未拥有的卡 */
.card.locked { filter: grayscale(1) brightness(.42); cursor: default; }
.card.locked::after {
  content: '?'; position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; font-weight: 800; color: var(--hi-text);
}
.card.locked:hover { transform: none; box-shadow: 0 6px 18px var(--sh-2); }

/* 重复持有的数量：样式在卡面那一节（搜 .card-bottom .card-count），
 * 位置是"最下面一行的左边"。这里原来还有一条老定义（只管颜色字号），
 * 2026-10 合并掉了 —— 两份分开写很容易改了一处忘另一处。 */

/* 开包翻牌动画 */
.card.reveal { opacity: 0; animation: cardReveal .55s cubic-bezier(.2,.9,.3,1.2) forwards; }
/* 传奇卡翻牌时同时播放呼吸光效（CSS 里多个动画用逗号并列） */
.card.r-legendary.reveal {
  animation:
    cardReveal .55s cubic-bezier(.2,.9,.3,1.2) forwards,
    legendGlow 2.6s ease-in-out infinite;
}
@keyframes cardReveal {
  0%   { opacity: 0; transform: translateY(34px) rotateY(85deg) scale(.82); }
  55%  { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
/* 新卡标记：做成横贯卡牌顶部的绶带。
   之前用小方块放在左上角，结果压住了位置标签（"自由人"被遮成"由人"），
   做成通栏绶带后，左上角的位置和右上角的星级都不会被挡。 */
.card.new-card::after {
  content: 'NEW'; position: absolute; top: 0; left: 0; right: 0; z-index: 6;
  height: 15px; line-height: 15px; text-align: center;
  background: var(--good); color: var(--on-solid);
  font-size: 9px; font-weight: 800; letter-spacing: 2px;
}
/* 给绶带让出高度 */
.card.new-card .card-top { padding-top: 21px; }

/* ============================ 4. 面板通用 ============================ */
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 20px;
}
.panel-title {
  font-size: 15px; font-weight: 700; margin-bottom: 16px;
  display: flex; align-items: baseline; gap: 10px;
}
.panel-title small { color: var(--muted); font-weight: 400; font-size: 12px; }

/* ============================ 收藏册 ============================ */
.progress-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.collection-summary { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.collection-summary b { color: var(--text); font-variant-numeric: tabular-nums; }
.progress-item { font-size: 12px; }
.progress-head { display: flex; justify-content: space-between; margin-bottom: 5px; color: var(--muted); }
.progress-head b { color: var(--rc); }
.progress-bar { height: 7px; background: var(--track); border-radius: 4px; overflow: hidden; }
.progress-bar > div { height: 100%; background: var(--rc); border-radius: 4px; transition: width .3s ease; }

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.chip {
  padding: 6px 14px; border-radius: 999px; font-size: 13px;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  transition: all .15s ease;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--on-solid); font-weight: 700; }
.filter-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
/* 筛选器的分组标签（chip 变多之后需要分组才看得清） */
.filter-label {
  font-size: 12px; font-weight: 700; color: var(--muted);
  letter-spacing: .5px; margin-right: 2px;
}
/* 位置选项是 app.js 动态生成的，外面套了一层 span。
   display:contents 让这层壳不参与排版，里面的 chip 直接跟着父级 flex 走。 */
.filter-group { display: contents; }

/* ============================ 组队 ============================ */
.team-slots {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 22px;
}
.slot {
  aspect-ratio: 3 / 4.15; border-radius: 14px;
  border: 1.5px dashed var(--line); background: var(--hi-0);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--muted); font-size: 13px; position: relative;
  transition: border-color .15s ease;
}
.slot:hover { border-color: var(--muted); }
.slot .slot-num { font-size: 26px; font-weight: 800; opacity: .22; }
.slot.filled { padding: 0; border: none; }
.slot .card { width: 100%; height: 100%; }
/* 移出按钮：放到卡牌外沿，避免压住右上角的稀有度星级 */
.slot .remove {
  position: absolute; top: -9px; right: -9px; z-index: 8;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--scrim-2); border: 1px solid var(--line);
  color: var(--bad); font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.slot .remove:hover { background: var(--bad); color: #fff; }

/* ---- 命名坑位（每个坑固定读 2 项副能力） ---- */
.slot.target {
  border-style: solid; border-color: var(--accent);
  background: var(--tint-a-weak);
  box-shadow: 0 0 22px -6px var(--accent);
}
.slot-name { font-size: 14px; font-weight: 800; color: var(--text); }
.slot-subs { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.sub-tag {
  font-size: 10px; padding: 2px 6px; border-radius: 999px; white-space: nowrap;
  background: var(--info-bg); color: var(--info-text);
  border: 1px solid var(--info-line);
}
.slot-hint { font-size: 10px; color: var(--bad); }
/* 坑位徽章：槽位名 + 本职/客串状态。
 * 状态合并进徽章是因为独立标签会压住卡面底部的能力值 —— 别再拆出来。 */
.slot-badge {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%); z-index: 8;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  font-size: 10px; font-weight: 800; padding: 2px 10px; border-radius: 999px;
  white-space: nowrap;
}
.slot-badge.ok { border-color: var(--good); color: var(--good); background: var(--good-bg); }
.slot-badge.bad { border-color: var(--bad); color: var(--bad); background: var(--bad-bg); }
/* 【徽章不吃点击】它只是标签，压在卡面上时不该抢走点击（2026-10-22） */
.slot-badge { pointer-events: none; }

/* ---- 职责选择（卡牌下方那一条）2026-10-22 ---- */
.slot.filled { aspect-ratio: auto; gap: 0; justify-content: flex-start; }
.slot.filled .card { aspect-ratio: 3 / 4.15; height: auto; }
.slot-rolebar {
  margin-top: 7px; display: flex; align-items: center; justify-content: center;
  gap: 6px; width: 100%;
}
.slot-rolebar select.slot-role {
  width: 100%; max-width: 168px; padding: 5px 8px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  font-size: 12px; cursor: pointer; text-align: center; text-align-last: center;
}
.slot-rolebar .slot-role-static {
  width: 100%; max-width: 168px; padding: 5px 8px; border-radius: 9px;
  border: 1px dashed var(--line); background: transparent; color: var(--muted);
  font-size: 12px; text-align: center;
}
.slot-rolebar select.slot-role:hover { border-color: var(--muted); }
.slot-rolebar select.slot-role:focus { outline: none; border-color: var(--accent); }

/* 卡面左上角的「能力分」样式在卡面那一节（搜 .card-top），
 * 这里原来还有一条旧定义（居中的灰色小字），2026-10 布局调整后删掉了 ——
 * 留着会和新的打架（谁在后面谁生效，很容易看走眼）。 */

/* 详情弹窗里的能力分组标题 */
.stat-group {
  font-size: 11px; font-weight: 800; color: var(--accent);
  margin: 14px 0 8px; letter-spacing: .5px;
}
.stat-group.sub { color: var(--info-text); }

/* 坑位清单的三种状态：空着 / 客串 / 本色出演 */
.checklist li.warn { color: var(--text); }
.checklist li.warn .mark { background: var(--accent); color: var(--on-solid); }
.checklist li .val { color: var(--good); font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---- 默契面板 ---- */
.synergy-box {
  margin-top: 18px; padding: 14px 16px; border-radius: 12px;
  background: var(--hi-1); border: 1px solid var(--line);
}
.synergy-head {
  display: flex; align-items: baseline; gap: 16px;
  font-size: 13px; font-weight: 700; margin-bottom: 10px;
}
.synergy-head > span:first-child { color: var(--text); }
.synergy-head b { font-size: 18px; color: var(--accent); font-variant-numeric: tabular-nums; }
.synergy-head small { font-size: 12px; color: var(--muted); font-weight: 400; }
.synergy-bonus { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 12px; }
.synergy-bonus b { font-size: 15px; color: var(--good); }
.synergy-bar { height: 8px; background: var(--track); border-radius: 4px; overflow: hidden; }
.synergy-bar > div {
  height: 100%; width: 0; border-radius: 4px;
  background: linear-gradient(90deg, #4a90d9, var(--accent));
  transition: width .2s ease;
}
.synergy-bar > div.full { background: linear-gradient(90deg, var(--accent), var(--good)); }
.synergy-list { margin-top: 12px; }
.score-breakdown .row b.up { color: var(--good); }

/* ---- 教练位：第 6 个坑，用蓝色和首发区分开 ---- */
.slot.coach-slot {
  border-color: var(--line-2);
  background: var(--info-bg);
}
.slot.coach-slot.filled { border: none; background: none; }
.coach-slot .coach-title { font-size: 13px; color: var(--text); }
.coach-slot .coach-hint { font-size: 11px; color: var(--bad); text-align: center; padding: 0 8px; line-height: 1.5; }
.coach-tag {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%); z-index: 8;
  background: var(--info); color: var(--on-solid);
  font-size: 10px; font-weight: 800; padding: 2px 10px; border-radius: 999px;
  white-space: nowrap;
}

/* 可选选手卡片：已上场的用"压暗 + 居中标签"表示。
   用角标的话会和稀有度星级抢右上角，所以改成居中覆盖。 */
.roster-slot { position: relative; }
.roster-slot:not(.used) { cursor: pointer; }
.roster-slot.used { pointer-events: none; }
.roster-slot.used .card { opacity: .3; filter: grayscale(.75); }
.roster-used {
  position: absolute; inset: 0; z-index: 7;
  display: flex; align-items: center; justify-content: center;
}
.roster-used span {
  background: var(--good); color: var(--on-solid);
  font-size: 11px; font-weight: 800; padding: 4px 14px; border-radius: 999px;
  box-shadow: 0 4px 14px var(--sh-3);
}

.team-tools { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.team-tools .btn { padding: 9px 18px; font-size: 13px; }

.team-meta { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); align-items: start; }

/* 位置覆盖清单（取代了原来的薪资条 —— 阵容限制改成"缺位置扣分"了） */
.coverage-head {
  display: flex; justify-content: space-between; font-size: 13px;
  margin-bottom: 10px; color: var(--muted);
}
.coverage-head span:last-child { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.checklist li .pos-name { flex: 1; }
.checklist li .pen { color: var(--bad); font-weight: 800; font-variant-numeric: tabular-nums; }

.checklist { list-style: none; display: grid; gap: 8px; font-size: 13px; }
.checklist li { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.checklist li .mark {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  background: var(--track); color: var(--muted);
}
.checklist li.ok { color: var(--text); }
.checklist li.ok .mark { background: var(--good); color: var(--on-solid); }
.checklist li.bad .mark { background: var(--bad); color: #fff; }

.score-box { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.score-main { display: flex; flex-direction: column; align-items: center; }
.score-num { font-size: 42px; font-weight: 800; color: var(--accent); line-height: 1; font-variant-numeric: tabular-nums; }
.score-unit { font-size: 11px; color: var(--muted); margin-top: 4px; }
.score-breakdown { display: grid; gap: 6px; font-size: 12px; color: var(--muted); flex: 1; min-width: 170px; }
.score-breakdown .row { display: flex; justify-content: space-between; gap: 14px; }
.score-breakdown .row b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ============================ 比赛 ============================ */
.matchup { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center; }
.match-team { display: grid; gap: 6px; }
.match-team h3 { font-size: 14px; margin-bottom: 4px; }
.match-team h3 span { color: var(--accent); }
.match-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); padding: 4px 8px; background: var(--hi-1); border-radius: 6px; }
.match-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.match-row.empty { opacity: .45; font-style: italic; }
.match-row.coach-row { border-left: 3px solid var(--info); margin-top: 4px; }
.match-row.coach-row.empty { border-left-color: var(--bad); }

/* ---- 地图 Ban/Pick ---- */
.veto-status {
  font-size: 14px; font-weight: 700; color: var(--accent);
  margin-bottom: 14px; min-height: 20px;
}
/* 【用 flex 而不是 grid】横着排就靠 flex-wrap —— 容器多宽都往右铺，
   排不下才换行。grid 的 auto-fill 在某些窄容器里会退化成 1 列
   （用户遇到过：7 张图竖着堆成一长条）。 */
.map-pool { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.map-pool .map-card { flex: 0 0 calc(25% - 7.5px); max-width: none; }
.map-card {
  position: relative; border-radius: 10px; padding: 11px 12px 13px;
  background: var(--panel-2); border: 1.5px solid var(--line);
  text-align: center;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}
/* 【图片优先，emoji 兜底】.map-icon 是个 16:10 的框：
 * 图片 object-fit: cover 铺满；图片挂了（onerror 里自己 display:none）
 * 就露出底下那个 emoji，所以不会出现碎图。 */
.map-card .map-icon {
  position: relative; width: 100%; aspect-ratio: 16 / 10;
  margin: 0 0 7px; border-radius: 8px; overflow: hidden; background: var(--sunken);
}
.map-img {
  position: relative; z-index: 1;        /* 盖住底下的 emoji */
  width: 100%; height: 100%; object-fit: cover; display: block;
}
/* emoji 垫在底下；z-index 比图片低一层 */
.map-emoji {
  position: absolute; inset: 0; z-index: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; line-height: 1;
}
.map-cn { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.map-card .map-name { font-size: 14px; font-weight: 800; margin-top: 4px; }
.map-card .map-desc { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.5; min-height: 32px; }
.map-card .map-tag {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-size: 11px; font-weight: 800; padding: 5px 0;
  border-radius: 0 0 9px 9px;
  color: var(--muted); background: var(--sh-1);
}
.map-card.clickable { cursor: pointer; border-color: var(--accent); }
.map-card.clickable:hover { transform: translateY(-4px); box-shadow: 0 0 22px -6px var(--accent); }
.map-card.banned { opacity: .38; }
.map-card.banned .map-name { text-decoration: line-through; }
.map-card.banned .map-tag { background: var(--tint-r-strong); color: #fff; }
.map-card.picked { border-color: var(--good); }
.map-card.picked .map-tag { background: var(--tint-g-strong); color: var(--on-solid); }
.map-card.decider { border-color: var(--accent); }
.map-card.decider .map-tag { background: var(--accent); color: var(--on-solid); }

.veto-order { display: grid; gap: 8px; }
.veto-slot {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; padding: 8px 14px; border-radius: 8px;
  background: var(--hi-1); border-left: 3px solid var(--good);
}
.veto-slot span { color: var(--muted); }
.veto-slot b { color: var(--text); }

/* ---- 比赛实况里的地图分段 ---- */
.map-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0 6px; padding: 8px 12px; border-radius: 8px;
  background: var(--tint-a-mid); border-left: 3px solid var(--accent);
  font-size: 14px; font-weight: 800; color: var(--accent);
}
.map-head small { color: var(--muted); font-weight: 400; font-size: 11px; }
.map-result {
  margin: 6px 0 4px; padding: 7px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 700;
}
.map-result.us { background: var(--tint-g-mid); color: var(--good); }
.map-result.them { background: var(--tint-r-mid); color: var(--bad); }
.match-score .bo3 { margin-left: 10px; font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.map-summary {
  display: grid; gap: 6px; margin: 14px 0 8px;
  padding-top: 12px; border-top: 1px solid var(--line);
}
.map-line {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-size: 13px; padding: 7px 12px; border-radius: 8px;
  background: var(--hi-1);
}
.map-line.us { border-left: 3px solid var(--good); }
.map-line.them { border-left: 3px solid var(--bad); }
.map-line small { color: var(--muted); font-size: 11px; flex: 1; }
.map-line b { font-variant-numeric: tabular-nums; }
.match-vs { font-size: 20px; font-weight: 800; color: var(--muted); letter-spacing: 2px; }

.match-actions { display: flex; align-items: center; gap: 16px; margin-top: 22px; flex-wrap: wrap; }
.match-note { font-size: 13px; color: var(--muted); }

.match-score { font-size: 34px; font-weight: 800; letter-spacing: 2px; margin-bottom: 16px; font-variant-numeric: tabular-nums; }
.match-score .win { color: var(--good); }
.match-score .lose { color: var(--bad); }
.match-log { display: grid; gap: 5px; font-size: 13px; max-height: 42vh; overflow-y: auto; }
/* 【2026-10-16.09 删掉了 .match-log-actions】「返回大赛」按钮从对局实况底部
 * 挪到了赛事面板的按钮行（用户："这个返回大赛应该放在哪个报名参赛右边"），
 * 所以这里那个包裹层没用了。样式删掉，免得以后有人照着它再加东西。 */
.match-log div { padding: 5px 10px; border-radius: 6px; background: var(--hi-1); color: var(--muted); }
.match-log div.us { border-left: 3px solid var(--good); color: var(--text); }
.match-log div.them { border-left: 3px solid var(--bad); }
.match-log div.hl { border-left: 3px solid var(--accent); color: var(--accent); }
/* 【经济那一行】跟在回合结果下面，说明"为什么这回合是这个结果"。
 * 比回合结果更弱：没有左边框、字更小更淡，不抢视觉重点。
 * 缩进一点，让它在视觉上从属于上面那条回合并排的结果。 */
.match-log div.eco {
  border-left: none;
  background: none;
  padding: 0 10px 4px 13px;
  font-size: 11.5px;
  opacity: .78;
  margin-top: -3px;
}
.match-log div.eco b { color: var(--accent); opacity: 1; }

/* ============================ 弹窗 / 提示 ============================ */
.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: var(--mask); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeUp .18s ease;
}
.modal {
  background: var(--panel); border: 1px solid var(--rc, var(--line));
  border-radius: 16px; padding: 24px; max-width: 400px; width: 100%;
  max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow);
}
.modal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.modal-initial {
  position: relative; overflow: hidden;   /* 圆角裁剪：绝对定位的方图不会冒出角 */
  width: 62px; height: 62px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800;
  background: linear-gradient(150deg, var(--rc), var(--sh-2));
  color: var(--on-solid); border: 2px solid var(--rc);
}
.modal-name { font-size: 21px; font-weight: 800; }
.modal-sub { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.6; }
.modal-rarity { font-size: 12px; font-weight: 700; color: var(--rc); }
/* 第一列要放得下"📡 信息收集"（图标 + 4 个汉字），所以给宽一点并禁止换行 */
.stat-row { display: grid; grid-template-columns: 88px 1fr 34px; align-items: center; gap: 10px; font-size: 12px; margin-bottom: 9px; }
.stat-row span:first-child { color: var(--muted); white-space: nowrap; }
.stat-bar { height: 8px; background: var(--track); border-radius: 4px; overflow: hidden; }
.stat-bar > div { height: 100%; background: var(--rc); border-radius: 4px; }
.stat-row b { text-align: right; font-variant-numeric: tabular-nums; }
.modal-foot { display: flex; justify-content: space-between; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; }
.modal-foot b { color: var(--rc); }

/* ---- 卡牌强化 ---- */
.card-ovr .lv, .modal-name .lv {
  font-style: normal; color: var(--good); font-weight: 800;
  font-size: .72em; margin-left: 3px;
}
.modal-name .lv { font-size: .55em; vertical-align: middle; }
.upgrade {
  margin-top: 16px; padding: 14px; border-radius: 10px;
  background: var(--hi-1); border: 1px solid var(--line);
}
.upgrade.maxed { border-color: var(--good); background: var(--tint-g-weak); }
.up-head { display: flex; align-items: baseline; gap: 10px; font-size: 13px; color: var(--muted); }
.up-head .up-lv { font-size: 19px; font-weight: 800; color: var(--accent); }
.up-head .up-stars { margin-left: auto; color: var(--rc); font-size: 12px; letter-spacing: 1px; }
.up-hold { font-size: 12px; color: var(--muted); margin: 8px 0 12px; }
.up-hold b { color: var(--text); }
.up-cost { display: flex; gap: 16px; font-size: 12px; margin-bottom: 12px; }
.up-cost .ok { color: var(--good); font-weight: 700; }
.up-cost .no { color: var(--bad); font-weight: 700; }
.upgrade .btn { width: 100%; justify-content: center; padding: 11px; font-size: 14px; }
.up-max { font-size: 13px; color: var(--good); font-weight: 700; margin-top: 6px; }
.dup-note { font-style: normal; color: var(--muted); font-size: 12px; margin-left: 4px; }

.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 300; display: grid; gap: 8px; justify-items: end; }
.toast {
  background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 8px; padding: 10px 16px; font-size: 13px;
  box-shadow: var(--shadow); animation: toastIn .25s ease;
}
.toast.good { border-left-color: var(--good); }
.toast.bad  { border-left-color: var(--bad); }
.toast.info { border-left-color: var(--info); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }

.footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 9px 22px;
  background: var(--toast-bg); border-top: 1px solid var(--line);
  backdrop-filter: blur(8px); font-size: 12px; color: var(--muted);
}
.link-btn { color: var(--muted); font-size: 12px; text-decoration: underline; }
.link-btn:hover { color: var(--bad); }

/* ============================ 移动端 ============================ */
@media (max-width: 720px) {
  .brand-text { font-size: 15px; }
  .counter { padding: 6px 10px; font-size: 13px; }
  .tab { padding: 9px 10px; font-size: 14px; white-space: nowrap; }
  .tab-text { display: none; }         /* 窄屏只留图标，省地方 */
  .stage { padding: 16px 14px 30px; }
  .view-title { font-size: 24px; }
  .panel { padding: 16px; }
  .pack { width: 168px; height: 232px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 11px; }
  .matchup { grid-template-columns: 1fr; }
  .match-vs { text-align: center; }
  .match-score { font-size: 26px; }
  .toasts { left: 14px; right: 14px; justify-items: stretch; }
}

/* ===================== 次要位置 ===================== */
/* 卡面左上角本职后面跟的 "/辅助" 之类 */
/* 【副定位】2026-10 改成独立一行（原来是行内的 "/辅助"）。
 * 颜色压暗一点，一眼能分出主次。 */
.card-role-sec { opacity: .68; font-weight: 600; }

/* 详情弹窗里的「次要：XX」 */
.sec-pos {
  font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 4px;
  background: var(--info-bg); color: var(--info-text); margin: 0 2px;
}

/* 坑位清单里的「次要位置」小标 */
.sec-tag {
  font-style: normal; font-size: 10px; padding: 1px 5px; border-radius: 4px;
  background: var(--info-bg); color: var(--info-text); margin-left: 6px;
}
#ui-coverage-list li.sec, .coverage li.sec { border-left-color: var(--info); }
/* 上面那条的 .coverage 已经没人用了（默契列现在用的是 .synergy-list，
   里面也没有 .sec 行）—— 保留是为了兼容可能残留的旧 markup，无害。 */
.synergy-list li.sec { border-left-color: var(--info); }
.ok-pen { color: var(--good) !important; }
/* ===================== 5★ 保底进度条 ===================== */
.pity-panel { padding: 14px 16px 12px; }
.pity-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px; }
.pity-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.pity-count { font-size: 15px; color: var(--accent); letter-spacing: .5px; }

.pity-bar {
  position: relative; height: 12px; border-radius: 7px; overflow: hidden;
  background: var(--panel-2); border: 1px solid var(--line);
}
.pity-bar > i {
  display: block; height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, #4a90d9, #a259d9 55%, #f0a726);
  transition: width .35s ease;
}
/* 概率递增起点的刻度线 */
.pity-mark {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: var(--hi-4);
}
.pity-bar.boosting > i {
  box-shadow: 0 0 10px rgba(240, 167, 38, .55);
  animation: pityPulse 1.6s ease-in-out infinite;
}
@keyframes pityPulse { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.3); } }

.pity-foot {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-top: 8px; font-size: 12px; color: var(--muted);
}
.pity-now { color: var(--accent); }
.pity-sub { font-size: 11px; opacity: .72; }
/* ===================== 队标（卡面队伍名左边） ===================== */
.card-logo {
  width: 15px; height: 15px; flex: 0 0 auto;
  object-fit: contain;
  /* 队标什么颜色都有（NaVi 是黑的、Astralis 是白的），
   * 描一圈浅色轮廓，深色卡面上都能看清 */
  filter: drop-shadow(0 0 1px var(--logo-halo))
          drop-shadow(0 0 1.5px var(--logo-halo-2));
}
.card-logo.pt-missing { display: none; }
/* ===================== 白天 / 黑夜开关（侧边栏底部） ===================== */
.theme-toggle {
  display: flex; align-items: center; gap: 9px;
  margin: 10px 12px 4px; padding: 9px 12px;
  border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--muted);
  font-size: 13px; font-weight: 600;
  transition: background .18s, border-color .18s, color .18s;
}
.theme-toggle:hover { background: var(--hi-1); color: var(--text); border-color: var(--line-2); }
.theme-toggle .tt-icon { font-size: 15px; line-height: 1; }
.theme-toggle .tt-text { flex: 1; text-align: left; }
.theme-toggle.on { color: var(--accent); border-color: var(--tint-a-line); background: var(--tint-a-weak); }

/* 右边那个小滑块，纯装饰 —— 让"这是个开关"一眼看得出来 */
.theme-toggle .tt-knob {
  width: 30px; height: 16px; border-radius: 9px; flex: 0 0 auto;
  background: var(--track); border: 1px solid var(--line-2);
  position: relative; transition: background .18s, border-color .18s;
}
.theme-toggle .tt-knob::after {
  content: ''; position: absolute; top: 1px; left: 1px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--muted); transition: transform .2s, background .18s;
}
.theme-toggle.on .tt-knob { background: var(--tint-a-mid); border-color: var(--accent); }
.theme-toggle.on .tt-knob::after { transform: translateX(14px); background: var(--accent); }

/* 窄屏时侧边栏变成顶部横排，文字挤在一起不好看，只留图标 */
@media (max-width: 720px) {
  .theme-toggle { margin: 8px; padding: 9px 10px; }
  .theme-toggle .tt-text { display: none; }
}
/* ===================== 浅色主题的收尾微调 ===================== */
/* 头像照片本身是 HLTV 的深色背景图（背景色烤进图里了），
 * 裁成圆形后在白卡面上像"挖了个洞"。加一圈白色相框 + 柔和投影，
 * 让它看起来像一张裱好的照片。 */
[data-theme="light"] .pt-img {
  box-shadow: 0 0 0 3px var(--panel), 0 3px 12px var(--sh-2), 0 0 16px -6px var(--rc);
}
[data-theme="light"] .card { border-color: var(--line); }
[data-theme="light"] .card:hover { box-shadow: 0 14px 30px var(--sh-2), 0 0 22px -4px var(--rc); }

/* 浅色下金色的"购买"按钮边上那点光晕会糊，收一收 */
[data-theme="light"] .btn-primary,
[data-theme="light"] .btn-gold { box-shadow: 0 4px 12px var(--sh-2); }

/* 弹窗的半透明遮罩在浅色下要更淡一点，不然背景全黑看不出来 */
[data-theme="light"] .modal-mask { backdrop-filter: blur(5px); }
/* ===================== 每日签到（开包页，保底进度上面） ===================== */
.checkin-panel { padding: 14px 16px 13px; }

.ck-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 11px; }
.ck-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.ck-now { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 七天进度：七个小方格 */
.ck-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; margin-bottom: 11px; }
.ck-cell {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 2px 6px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel-2); transition: border-color .18s, background .18s;
}
.ck-cell .ck-day { font-size: 10px; font-weight: 700; color: var(--muted); }
/* 【签到格里的卡包图标也要 --ic-size】2026-10-17 换成自制图标之后，
 * 尺寸归 `.ic` 的 `--ic-size` 管（默认 19px，对这个 15px 的格子太大）。
 * 和 .pc-icon / .pi-icon 同一个道理，见那边的说明。 */
.ck-cell .ck-icon {
  --ic-size: 15px;
  font-size: 15px; line-height: 1.1;
  width: 15px; height: 15px;
  display: inline-flex; align-items: center; justify-content: center;
}
.ck-cell .ck-coin { font-size: 9.5px; color: var(--muted); }
.ck-cell.done {
  border-color: var(--good); background: var(--good-bg);
}
.ck-cell.done .ck-day, .ck-cell.done .ck-coin { color: var(--good); }
.ck-cell.today {
  border-color: var(--accent); background: var(--tint-a-weak);
  box-shadow: 0 0 0 1px var(--tint-a-line) inset;
}
.ck-cell.today .ck-day, .ck-cell.today .ck-coin { color: var(--accent); }

.ck-info { display: flex; flex-direction: column; gap: 3px; margin-bottom: 11px; }
.ck-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; font-size: 12px; color: var(--muted);
}
.ck-row b { color: var(--text); font-weight: 600; text-align: right; }

.ck-btn { width: 100%; justify-content: center; }
.ck-btn:disabled { opacity: .55; cursor: default; }
.ck-note { margin-top: 8px; font-size: 11px; color: var(--muted); line-height: 1.5; }

@media (max-width: 720px) {
  .ck-week { gap: 4px; }
  .ck-cell .ck-coin { display: none; }
}
/* ===================== 好友对战：两种查找方式 ===================== */
.find-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 9px;
}
.find-label {
  flex: 0 0 68px; font-size: 12px; color: var(--muted); font-weight: 600;
}
.find-row .tm-input { flex: 1; min-width: 0; }
.find-hash {
  flex: 0 0 auto; font-size: 15px; font-weight: 800; color: var(--muted);
}
/* 识别码固定 4 位，给它一个窄框；好友码 8 位，稍宽一点 */
.find-row .tag-input { flex: 0 0 74px; text-align: center; letter-spacing: 3px; font-weight: 700; }
.find-row .code-input { flex: 0 0 150px; text-align: center; letter-spacing: 3px; font-weight: 700; text-transform: uppercase; }
.find-row .btn { flex: 0 0 auto; }

/* 我的身份：战队名#识别码 / 好友码 */
.my-id { display: flex; flex-direction: column; gap: 7px; }
.my-id-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 8px 12px; border-radius: 9px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.my-id-row span { font-size: 12px; color: var(--muted); }
.my-id-row b { font-size: 15px; font-weight: 800; color: var(--text); }
/* 好友码要一眼能念出来：等宽 + 加大字距 */
.my-id-row .my-code-val {
  color: var(--accent); letter-spacing: 4px;
  font-family: ui-monospace, Consolas, monospace;
}

/* 通行证码那一行 */
.pass-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pass-val {
  flex: 1; min-width: 160px; padding: 9px 12px; border-radius: 9px;
  background: var(--panel-2); border: 1px solid var(--line);
  font-family: ui-monospace, Consolas, monospace; font-size: 15px;
  letter-spacing: 2px; color: var(--text);
}

/* 账号页 / 身份区的小格子 */
.account-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 10px; }
.panel-title {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}

@media (max-width: 720px) {
  .find-row { flex-wrap: wrap; }
  .find-label { flex-basis: 100%; }
  .find-row .tag-input, .find-row .code-input { flex: 1; }
}
/* ===================== 开包结果：翻牌 ===================== */
/* 每张卡先扣着（.flip-back 卡背），点一下 rotY 180° 翻出正面。
   backface-visibility 让背面朝前时不显示 —— 少了这句会两张图叠在一起。 */
.flip { perspective: 1000px; }
.flip-inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.4, .2, .2, 1);
}
.flip.on .flip-inner { transform: rotateY(180deg); }
.flip-front, .flip-front, .flip-back {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.flip-front { transform: rotateY(180deg); }
.flip-back {
  position: absolute; inset: 0; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: linear-gradient(160deg, var(--pack-a) 0%, var(--pack-b) 60%, var(--pack-c) 100%);
  border: 1.5px solid var(--pack-line);
  color: var(--muted); font-weight: 800; cursor: pointer;
  transition: border-color .18s, color .18s, transform .18s;
}
/* 卡背。图片路径由 app.js 的 cardBackURL() 拼：img/cardback/<系列>/back.png
 * 【兜底】那行渐变 background 留着 —— 新系列忘了放图时显示它，不会露白。
 * 【圆角】靠 border-radius + overflow 裁，图里不用画；图里再画一层会双层圆角。 */
.flip-back {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.flip:not(.on) .flip-back:hover {
  border-color: var(--accent); color: var(--accent); transform: translateY(-4px);
}

.flip-bar {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 2px 0 20px;
}
.flip-hint { font-size: 12px; color: var(--muted); }
.result-pack-head {
  text-align: center; font-size: 12px; color: var(--muted);
  margin-bottom: 8px; letter-spacing: 1px;
}

/* ===================== 货架上的"连开几份" ===================== */
.pc-count { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
/* nowrap：卡包那一列比较窄，"连开"两个字会被挤成上下两行 */
.pcc-label { font-size: 11px; color: var(--muted); margin-right: 2px; white-space: nowrap; }
.pcc {
  min-width: 30px; padding: 3px 7px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--panel-2);
  color: var(--muted); font-size: 11.5px; font-weight: 700;
  transition: border-color .15s, color .15s, background .15s;
}
.pcc:hover { border-color: var(--line-2); color: var(--text); }
.pcc.on { border-color: var(--accent); background: var(--tint-a-weak); color: var(--accent); }

/* ===================== 天梯排位：段位卡 ===================== */
.rank-card { padding: 18px 20px 16px; }
.rk-head {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.rk-tier {
  font-size: 34px; font-weight: 900; letter-spacing: 1px; line-height: 1;
  min-width: 92px;
}
.rk-score { display: flex; flex-direction: column; }
.rk-score b { font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; }
.rk-score small, .rk-season small { font-size: 11px; color: var(--muted); }
.rk-season { margin-left: auto; text-align: right; display: flex; flex-direction: column; }
.rk-season b { font-size: 15px; font-weight: 800; }
.rk-bar {
  height: 9px; border-radius: 999px; background: var(--sh-2); overflow: hidden;
  border: 1px solid var(--line);
}
.rk-bar > div { height: 100%; border-radius: 999px; background: var(--rc, var(--accent)); transition: width .4s; }
.rk-bar-note { font-size: 11.5px; color: var(--muted); margin: 7px 0 14px; }
.rk-bar-note b { color: var(--text); }
.rk-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.rk-rows > div {
  display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
  padding: 8px 12px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line);
}
.rk-rows span { font-size: 11.5px; color: var(--muted); }
.rk-rows b { font-size: 13px; font-weight: 800; }
.rk-help { margin-top: 14px; font-size: 12px; color: var(--muted); }
.rk-help summary { cursor: pointer; font-weight: 700; }
.rk-help summary:hover { color: var(--accent); }
.rk-help ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.85; }
.rk-help b { color: var(--text); }
.rk-log { margin-top: 14px; }
.rk-log-title { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
.rk-log-row {
  display: flex; align-items: center; gap: 10px; font-size: 12px;
  padding: 6px 10px; border-radius: 8px; background: var(--panel-2); margin-bottom: 4px;
}
.rk-log-row .ok { color: var(--good); font-weight: 800; }
.rk-log-row .bad { color: var(--bad); font-weight: 800; }
.rk-log-opp { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-log-row b { font-variant-numeric: tabular-nums; }
.rk-log-row small { color: var(--muted); }

/* 对手来源的小标签 */
.opp-kind {
  display: inline-block; margin-left: 8px; font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 999px; vertical-align: middle;
}
.opp-kind.real { background: var(--info-bg); color: var(--info-text); border: 1px solid var(--info-line); }
.opp-kind.player { background: var(--tint-a-weak); color: var(--accent); border: 1px solid var(--accent); }
/* 【只能用已有的变量】原来写了 --warn-bg/--warn-text，那两个根本没定义 ——
   整条声明会被丢掉，标签就没样式了。自测第 23 节专门盯着这个。 */
.opp-kind.boosted { background: var(--hi-2); color: var(--text); border: 1px solid var(--line-2); }

/* ===================== 排行榜（参考满宽表格） ===================== */
.lb-tabs { display: flex; gap: 6px; margin: 12px 0 14px; }
.lb-tab {
  padding: 6px 14px; border-radius: 8px; font-size: 12.5px; font-weight: 700;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--muted);
}
.lb-tab:hover { color: var(--text); border-color: var(--line-2); }
.lb-tab.on { background: var(--accent); color: var(--on-solid); border-color: var(--accent); }
.lb-wrap { max-height: 560px; overflow-y: auto; border: 1px solid var(--line); border-radius: 11px; }
.lb-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.lb-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--panel-2); color: var(--muted); font-size: 11.5px; font-weight: 700;
  text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line);
}
.lb-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); }
.lb-table tbody tr:last-child td { border-bottom: none; }
.lb-table tbody tr:hover { background: var(--hi-1); }
.lb-table tr.me { background: var(--tint-a-weak); }
.lb-rk { width: 46px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-name { font-weight: 800; }
.lb-tag { color: var(--muted); font-weight: 600; font-style: normal; margin-left: 3px; }
/* 【测试账号标记】2026-10-15.92 用户要求：名单里的测试账号在名字后面加个标记。
 * 做成一个小胶囊 —— 和名字的粗体区分开，一眼能看出"这不是普通玩家"。
 * 用 muted 色调而不是红色：它是标注、不是警告。 */
.cn-wrap { position: relative; display: inline-block; }
.card-igl {
  /* 名字左边那个 IGL 小框：
   *   · `right: 100%` 贴在文字左侧 —— 名字本身的位置一点不动
   *   · 字比名字小（9px vs 15px），圆角小方框 */
  position: absolute;
  right: 100%;
  margin-right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  line-height: 1;
  padding: 2px 3px;
  border-radius: 3px;
  font-weight: 800;
  font-style: normal;
  letter-spacing: .2px;
  color: var(--accent);
  border: 1px solid var(--accent);
  background: var(--tint-a-weak);
  opacity: .9;
}

.lb-test {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  border-radius: 999px; font-size: 10.5px; font-weight: 700;
  font-style: normal; line-height: 1.5; vertical-align: 1px;
  color: var(--muted); background: var(--hi-2); border: 1px solid var(--line);
}

/* 【2026-10-22 手机端反馈】段位原来会一个汉字一行（魔王S 竖着排三行）。
 * 这里钉死 nowrap，并且在窄屏把几列宽度收窄、间距收紧。 */
.lb-tier { width: 108px; font-weight: 800; white-space: nowrap; }

@media (max-width: 820px) {
  .lb-table { font-size: 13px; }
  .lb-table thead th { padding: 8px 6px; }
  .lb-table td { padding: 9px 6px; }
  .lb-rk { width: 30px; }
  .lb-tier { width: auto; white-space: nowrap; font-size: 13px; }
  .lb-score { width: auto; white-space: nowrap; }
  .lb-rec { width: auto; white-space: nowrap; font-size: 12px; }
  .lb-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34vw; }
}
.lb-score { width: 96px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.lb-rec { width: 96px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
/* 自己那一栏：没进前 50 也钉在底下看得到 */
.lb-me {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 12px; padding: 12px 14px; border-radius: 11px;
  background: var(--tint-a-weak); border: 1px solid var(--accent);
}
.lb-me.empty { background: var(--panel-2); border-color: var(--line); }
.lb-me-title { font-size: 11.5px; color: var(--muted); }
.lb-me-rk { font-size: 20px; font-weight: 900; color: var(--accent); font-variant-numeric: tabular-nums; }
.lb-me-name { font-weight: 800; }
.lb-me-tier { font-weight: 800; }
.lb-me-score, .lb-me-rec { color: var(--muted); font-size: 12.5px; }
.lb-total { margin-top: 8px; font-size: 11.5px; color: var(--muted); text-align: right; }
.rank-summary { margin-top: 10px; }

/* 【别让模式页签被拉太长】宽屏（1800px 内容区）下三个页签各占 1/3 会非常扁。
   给个上限，剩下的空间留给卡片。 */
.mode-tab { max-width: 420px; }

/* ===================== 体力 ===================== */
.stamina {
  margin-top: 14px; padding: 12px 14px;
  border-radius: 11px; background: var(--panel-2); border: 1px solid var(--line);
}
.st-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.st-label { font-size: 12px; color: var(--muted); }
.st-val { font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; }
.st-next { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.st-next b { color: var(--accent); font-variant-numeric: tabular-nums; }
.st-bar {
  height: 9px; border-radius: 999px; background: var(--sh-2); overflow: hidden;
  border: 1px solid var(--line);
}
.st-bar > div {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--tint-a-strong), var(--accent));
  transition: width .4s;
}
.st-bar.full > div { background: linear-gradient(90deg, var(--good), var(--accent-2)); }
.st-note { font-size: 11.5px; color: var(--muted); margin-top: 7px; }
.st-note b { color: var(--text); }
.st-note b.bad { color: var(--bad); }

/* ===================== 赛季结算提示 ===================== */
.settle-note {
  margin-top: 14px; padding: 14px 16px; border-radius: 11px;
  background: var(--tint-g-weak); border: 1px solid var(--good);
}
.sn-title { font-size: 15px; font-weight: 900; color: var(--good); margin-bottom: 6px; }
.sn-body { font-size: 13px; color: var(--text); margin-bottom: 8px; }
.sn-body b { color: var(--accent); }
.sn-reward { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; font-weight: 700; }
.sn-at { font-size: 11px; color: var(--muted); margin-top: 6px; }
.settle-note .btn { margin-top: 10px; }

/* 次要位置真的被打折时，数值后面跟的那个小提示 */
.sec-off { font-size: 10.5px; font-weight: 600; color: var(--muted); font-style: normal; margin-left: 5px; }

/* ===================== 最近动态（我的账号页） ===================== */
.activity { max-height: 460px; overflow-y: auto; }
.act-row {
  display: flex; gap: 12px; align-items: baseline;
  padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 12.5px;
}
.act-row:last-child { border-bottom: none; }
.act-time { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.act-text { color: var(--text); }

/* ===================== 更新日志 ===================== */
.stage-tools { display: flex; justify-content: flex-end; margin-bottom: -6px; }
.titles-badge {
  display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 800;
  background: var(--tint-a-weak); color: var(--accent); border: 1px solid var(--accent);
}

/* ===========================================================================
 * 大赛：按赛事分开的冠军次数（2026-10-16.00）
 * ---------------------------------------------------------------------------
 * 用户要求「将冠军显示拆开成每一个赛事单独显示」。所以从"一个总数徽章"改成
 * **每个赛事一格**：图标 + 赛事名 + 次数。
 *
 * 【为什么 0 次也要显示】这是一张"我在每个赛事上拿过几冠"的进度表 ——
 * 只在拿过冠军后才出现的话，玩家永远不知道自己还差哪几个赛事。
 * 拿过的那些加 .has 变亮（金色），没拿过的压暗，一眼看出进度。
 * ========================================================================== */
.titles-badges {
  display: inline-flex; flex-wrap: wrap; gap: 6px;
  margin-left: 8px; vertical-align: middle;
}
.titles-badges .titles-badge {
  display: inline-flex; align-items: center; gap: 5px;
  margin-left: 0; padding: 3px 10px 3px 6px;
  /* 【默认压暗】没拿过冠军的赛事不该和拿过的一样显眼 */
  background: var(--hi-1); color: var(--muted);
  border: 1px solid var(--line); font-weight: 700;
}
.titles-badges .titles-badge.has {
  background: var(--tint-a-weak); color: var(--accent); border-color: var(--accent);
}
.titles-badges .tb-logo { width: 15px; height: 15px; object-fit: contain; }
.titles-badges .tb-name { font-size: 11px; }
.titles-badges .titles-badge b {
  font-size: 12px; font-variant-numeric: tabular-nums;
}
/* 公告弹窗：沿用更新日志那套 .changelog-box，只把宽度收窄、正文放大一点 ——
 * 公告通常是一段话（不是列表），读起来要舒服。 */
.announce-box { width: min(480px, 92vw); }
#announce-body {
  padding: 16px 18px; font-size: 13.5px; line-height: 1.85; color: var(--text);
}
#announce-body p { margin: 0 0 8px; }
#announce-body p:last-child { margin-bottom: 0; }

.changelog-box {
  width: min(680px, 92vw); max-height: 82vh; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden;
}
.cl-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.cl-head b { font-size: 15px; }
.cl-body { padding: 6px 18px 18px; overflow-y: auto; }

/* ============================================================================
 * 更新日志：按大版本折叠（2026-10-16.04）
 * ----------------------------------------------------------------------------
 * 用户要求"更新日志按照大版本来分类折叠"。老日志整批归到「0.1」并标了 hidden，
 * 所以玩家点开只看得到 1.x；第一个大版本默认展开，其余收起。
 * ========================================================================== */
.cl-group { margin-bottom: 6px; }
.cl-group > summary {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; padding: 8px 0;
  list-style: none;
  font-size: 13px;
  border-bottom: 1px solid var(--line-2);
}
.cl-group > summary::-webkit-details-marker { display: none; }
.cl-group > summary:hover b { color: var(--accent); }
.cl-group > summary b {
  font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums;
  transition: color .12s;
}
.cl-group > summary small { color: var(--muted); font-size: 11.5px; }
/* 折叠三角：展开朝下、收起朝右 —— 和别处的 <details> 保持一致 */
.cl-group-arrow { margin-left: auto; color: var(--muted); font-size: 11px; }
.cl-group[open] > summary .cl-group-arrow { transform: rotate(0deg); }
.cl-group:not([open]) > summary .cl-group-arrow { transform: rotate(-90deg); }
.cl-group-body { padding-left: 10px; border-left: 2px solid var(--line); margin-top: 4px; }
.cl-group-body .cl-entry { padding: 12px 0; }

.cl-entry { padding: 14px 0; border-bottom: 1px solid var(--line); }
.cl-entry:last-child { border-bottom: none; }
.cl-ver { display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; margin-bottom: 8px; }
.cl-ver b { color: var(--accent); font-variant-numeric: tabular-nums; }
.cl-ver small { color: var(--muted); font-size: 11.5px; }
.cl-ver em {
  font-style: normal; font-size: 10px; font-weight: 800; padding: 1px 7px;
  border-radius: 999px; background: var(--accent); color: var(--on-solid);
}
.cl-item { display: flex; gap: 9px; align-items: baseline; padding: 4px 0; font-size: 12.5px; line-height: 1.6; }
.cl-kind {
  flex: none; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 5px;
  background: var(--hi-2); color: var(--muted);
}
.cl-item.k-add .cl-kind { background: var(--tint-g-weak); color: var(--good); }
.cl-item.k-fix .cl-kind { background: var(--bad-bg); color: var(--bad); }
.cl-item.k-tweak .cl-kind { background: var(--tint-a-weak); color: var(--accent); }
/* 【日志里的 **加粗**】2026-10-16.04 起才真正渲染（以前显示成字面星号）。
 * 用高亮色而不是纯粗体 —— 在长句子里"重点"要一眼扫到。 */
.cl-b { color: var(--text); font-weight: 800; }

/* 新版本提示条（右下角） */
.update-toast {
  position: fixed; right: 18px; bottom: 18px; z-index: 300;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--accent);
  box-shadow: var(--shadow); font-size: 13px; font-weight: 700;
}

/* ===================== 信箱 ===================== */
.mail-btn {
  position: relative; display: flex; align-items: center; gap: 7px; width: 100%;
  padding: 8px 11px; border-radius: 9px; font-size: 12.5px; font-weight: 700;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
}
.mail-btn:hover { border-color: var(--accent); }
.mb-icon { font-size: 14px; }
.mb-badge {
  margin-left: auto; min-width: 18px; padding: 1px 6px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; text-align: center;
  background: var(--bad); color: #fff;
}
.mail-item {
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
.mail-item:last-child { border-bottom: none; }
.mail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mail-head b { font-size: 13.5px; }
.mail-head small { font-size: 11px; color: var(--muted); }
.mail-body { font-size: 12.5px; color: var(--muted); margin-top: 5px; line-height: 1.6; }
.mail-reward { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0; font-size: 12.5px; font-weight: 700; }
.mail-item .btn { margin-top: 2px; }

/* ===================== 训练赛：自己挑对手 ===================== */
.opp-pick {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin: 0 0 11px; padding: 9px 11px; border-radius: 9px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.op-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.opp-pick select {
  flex: 1; min-width: 150px; padding: 7px 9px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  font: inherit; font-size: 12.5px;
}
.op-note { font-size: 11.5px; color: var(--muted); }

/* 段位规则里的补充说明（例如新手区不扣分） */
.rule-note { color: var(--muted); font-size: 11.5px; }

/* 地图卡片底部那条状态标签：没内容时必须真的藏起来。
 * 它现在"常在 DOM 里、用 hidden 控制"，所以这条不能少 ——
 * 少了就会在卡片底部画出一条深色空条。 */
.map-tag[hidden] { display: none !important; }

/* ===================== 训练赛：不消耗体力 ===================== */
.lean-toggle {
  display: flex; align-items: flex-start; gap: 9px;
  margin: 0 0 11px; padding: 9px 11px; border-radius: 9px;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: 12.5px; cursor: pointer;
}
.lean-toggle input { margin-top: 2px; width: auto; }
.lean-toggle small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.lean-toggle.lean-on { border-color: var(--accent); background: var(--tint-a-weak); }
.lean-toggle.lean-on small { color: var(--accent); }

/* ===================== 对局实况：开局定边 / 换边 ===================== */
.side-start {
  margin: 8px 0; padding: 7px 11px; border-radius: 8px;
  background: var(--panel-2); border-left: 3px solid var(--accent);
  font-size: 12.5px;
}
.side-start b { color: var(--accent); }
.side-start span { color: var(--muted); margin-left: 8px; font-size: 11.5px; }
.side-swap {
  margin: 9px 0; padding: 6px 11px; border-radius: 8px;
  background: var(--tint-a-weak); border-left: 3px solid var(--accent);
  font-size: 12.5px; font-weight: 700; color: var(--accent);
}

/* 【加时分隔条】和普通「换边」用同一套分隔样式，但换成强调色 + 加粗，
 * 因为它是"规则切换"级别的提示，不是普通的换边。
 * 2026-10-18 加：以前加时是静默的，玩家看不懂比分为什么还在往上走。 */
.side-swap.ot {
  color: var(--accent);
  font-weight: 700;
}
.side-swap b { color: var(--text); }

/* 最近几场里的比分 */
.rk-log-maps {
  font-variant-numeric: tabular-nums; color: var(--muted);
  font-size: 12px; margin-left: auto; margin-right: 10px;
}
.rk-log-more {
  width: 100%; margin-top: 7px; padding: 6px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; color: var(--muted); font-size: 12px; font-weight: 700;
}
.rk-log-more:hover { color: var(--accent); border-color: var(--accent); }

/* ============================================================================
 * 手机端：组队首发 2 / 2 / 2（两列三行）
 * ----------------------------------------------------------------------------
 * 【为什么之前会"一直放大"】
 *   .card     { aspect-ratio: 3 / 4.15 }        卡片自己按宽算高
 *   .slot     { aspect-ratio: 3 / 4.15 }        坑位也按宽算高
 *   .slot .card { width: 100%; height: 100% }   卡片高度又交回给坑位
 * 三者互相咬住 —— 坑位高度取决于卡片，卡片高度又取决于坑位。grid 每轮布局
 * 重算一次，就一轮比一轮大。所以高度只能有一个来源。
 *
 * 【现在】坑位保留 aspect-ratio（空位得有个虚线框的高度），卡片改 auto，
 * 用自己的 aspect-ratio 定高。比例一样、宽度一样，视觉上完全重合。
 *
 * 【align-items: start 不能少】默认的 stretch 会让空位被同行的卡片拉高
 * —— 那正是上一版"空位变成一大块空白"的原因。
 * ========================================================================== */
@media (max-width: 720px) {
  .team-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;          /* 别拉伸：每个坑各按各的高度 */
    gap: 10px;
  }
  .slot .card {
    width: 100%;
    height: auto;                /* 关键：不再用 100%，断掉那个循环 */
  }
  /* 坑位之间留点缝给角标（"接近 5 本职"那个标签是绝对定位在上边的） */
  .team-slots > * { min-width: 0; }
}

/* ===================== 问题反馈 ===================== */
#feedback-text {
  width: 100%; padding: 9px 11px; border-radius: 9px; resize: vertical;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  font: inherit; font-size: 13px;
}
.fb-title { margin: 16px 0 6px; font-size: 12px; color: var(--muted); font-weight: 700; }
.fb-item {
  padding: 10px 12px; margin-bottom: 8px; border-radius: 9px;
  background: var(--panel-2); border-left: 3px solid var(--line);
}
.fb-item.ok { border-left-color: var(--good); background: var(--tint-g-weak); }
.fb-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.fb-tag { font-size: 11px; font-weight: 800; }
.fb-item.ok .fb-tag { color: var(--good); }
.fb-tag.wait { color: var(--muted); }
.fb-text { margin-top: 5px; font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; }
.fb-reply { margin-top: 6px; font-size: 12px; color: var(--accent); }

/* ============================================================================
 * 性能模式（手机端默认开启）
 * ----------------------------------------------------------------------------
 * 只看 <html class="perf-lite"> 下的元素，电脑端完全不受影响。
 * 判断逻辑在 js/app.js 的 isPhoneLike()：按视口宽度 + 指针能力判断，
 * **不看 User-Agent**（PC 勾"请求桌面版网站"就能改 UA，看 UA 等于留个口子）。
 *
 * 【关什么，为什么】
 *   关：无限循环的动画 —— 卡牌边缘那圈会呼吸的光晕（legendGlow）、
 *       保底进度条的脉冲。一张卡挂一个无限动画 = 浏览器一直在重绘，
 *       手机端这是最大头。
 *   关：悬停 / 状态过渡（省一点，也不影响看清内容）。
 *   留：**翻牌的过渡** —— 用户明确说翻牌不算。
 *   留：静态阴影和滤镜 —— 那是"长相"不是"动效"，关掉会让卡牌变丑。
 * ========================================================================== */
.perf-lite *,
.perf-lite *::before,
.perf-lite *::after {
  animation: none !important;
  transition: none !important;
}

/* 翻牌要留着 —— 不然卡片是"啪"地跳出来，看着像卡住了 */
.perf-lite .flip .flip-inner {
  transition: transform .4s cubic-bezier(.2, .9, .3, 1.2) !important;
}

/* ===========================================================================
 * 【2026-10-14.59 修】性能模式下"翻开的卡是透明的" —— 手机玩家反馈的
 * 「开包翻开后看不见卡」就是这个。
 * ---------------------------------------------------------------------------
 * 【原因】`.card.reveal` 的**起点值是 opacity: 0**，显示完全靠 cardReveal
 * 那个 `forwards` 动画把它补到 1。而上面这条 `.perf-lite * { animation: none }`
 * 把动画关掉了 → **卡片永远停在 opacity: 0**。
 * 手机会自动开性能模式（`isPhoneLike()` 里 w<=820 就返回 true），所以手机上必现：
 * 翻开前看到的是卡背（.flip-back 没有 reveal 类，正常显示），
 * 一翻到正面就是一张全透明的卡 —— 看着就是"卡不见了"。
 *
 * 【为什么这样修】性能模式的语义是"不要动画"，那这类卡就该**直接显示**：
 * 明确写成 opacity: 1 + 不位移，不依赖任何动画填充。
 * 【更彻底的一层在 app.js】那边在性能模式下干脆不加 reveal 类（见 cardHTML），
 * 这两层是互补的：万一以后有人把 JS 那层去掉，这条 CSS 还能兜住。
 * =========================================================================== */
.perf-lite .card.reveal {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

/* 卡牌边缘的光晕：无限动画就是它 */
.perf-lite .card.r-legendary,
.perf-lite .card.r-mythic,
.perf-lite .pity-bar.boosting > i {
  animation: none !important;
}

/* 性能开关那一行 */
.perf-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 4px 0;
}
.perf-row b { font-size: 13px; display: block; }
.perf-row small { color: var(--muted); font-size: 11.5px; }
#btn-perf.on {
  border-color: var(--good); color: var(--good); background: var(--tint-g-weak);
}

/* ===================== 换卡 ===================== */
.trade-find { display: flex; gap: 9px; margin-bottom: 8px; }
.trade-find input {
  flex: 1; padding: 9px 12px; border-radius: 9px; letter-spacing: 1px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit;
}
.trade-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 820px) { .trade-cols { grid-template-columns: 1fr; } }
.trade-col { min-width: 0; }
.trade-col-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 9px; font-size: 13.5px;
}
.trade-col-head span { color: var(--muted); font-size: 11.5px; }
.trade-col.disabled { opacity: .45; pointer-events: none; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.chip {
  padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); cursor: pointer;
}
.chip.on { background: var(--accent); color: var(--on-solid); border-color: var(--accent); }
.chip:hover { border-color: var(--accent); }
.trade-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.trade-col select, .trade-col input {
  width: 100%; padding: 8px 10px; border-radius: 9px; font-size: 12.5px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit;
}
.trade-col input { margin-bottom: 8px; }

/* ============================================================================
 * 换卡选卡下拉（2026-10-17）
 * ----------------------------------------------------------------------------
 * 用户先要求"一行一张的列表"，看过之后又定了「做成以前的下拉列表吧」。
 * 所以回到原生 `<select>`，但**选项文案写全**（见 js 的 tradePickLabel）：
 *   星级 · 名字 · 综合评分 · 定位 · 国家 · 战队 — 升级/重复状态
 * 文案比原来长得多，所以这里给足高度、不让浏览器把它压成一行。
 * ========================================================================== */
.trade-card-select { min-height: 44px; font-size: 13px; }
.trade-actions {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
}
.trade-list { display: flex; flex-direction: column; gap: 9px; }
.trade-item {
  padding: 11px 13px; border-radius: 10px;
  background: var(--panel-2); border-left: 3px solid var(--line);
}
.trade-item.pending { border-left-color: var(--accent); }
.trade-item.done { border-left-color: var(--good); }
.trade-item .tr-head {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 12px; color: var(--muted); margin-bottom: 5px;
}
.trade-item .tr-body { font-size: 13px; line-height: 1.7; }
.trade-item .tr-body b { color: var(--accent); }
.trade-item .tr-btns { display: flex; gap: 8px; margin-top: 9px; }
.trade-empty { color: var(--muted); font-size: 12.5px; padding: 8px 0; }

/* 详情页里的系列标签。卡面上不显示 —— 以后系列会越来越多，卡面塞不下。 */
.modal-series {
  display: inline-block; margin: 0 2px; padding: 1px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; vertical-align: 1px;
  background: var(--tint-a-weak); color: var(--accent); border: 1px solid var(--accent);
}

/* ===================== 收藏筛选（三行布局） ===================== */
.col-filters { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.cf-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip-box { display: flex; gap: 6px; flex-wrap: wrap; }
.cf-row select, .cf-row input {
  padding: 8px 11px; border-radius: 9px; font: inherit; font-size: 12.5px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
}
.cf-row select { min-width: 128px; }
.cf-row input { flex: 1; min-width: 170px; }
/* 手机端：下拉和输入框各占一整行，别挤成一团 */
@media (max-width: 720px) {
  .cf-row select, .cf-row input { flex: 1 1 45%; min-width: 0; }
}

/* ===================== 开包弹窗 ===================== */
/* 【高度固定】不能只写 max-height：开包时内容是分阶段长出来的
 * （卡包 → 摘要 → 翻牌栏 → 卡牌），盒子一涨一缩，而它又是居中的，
 * 看起来就是弹窗在放大缩小。固定高度 + 内部滚动就没这个问题了。 */
.pack-modal {
  width: min(960px, 96vw); height: min(860px, 94vh);
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px 18px 14px;
}
/* 手机屏矮：高度随屏幕走，别把按钮挤出视野 */
@media (max-width: 720px), (max-height: 640px) {
  .pack-modal { height: 94vh; width: 96vw; padding: 12px 12px 10px; }
}
.pm-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.pm-body {
  flex: 1; min-height: 0;
  /* 【这里不能滚】原来写的是 overflow-y: auto，于是滚的是整个正文 ——
   * 往下滚的时候摘要和翻牌栏会跟着走。改成 hidden，把滚动交给中间那块。 */
  overflow: hidden;
  display: flex; flex-direction: column;
}
/* 弹窗里的动画不用占太高，给下面的卡留地方 */
.pack-modal .pack-anim { padding: 4px 0 6px; }
.pack-modal .results { max-height: none; margin-top: 16px; }

/* 「最近开出的卡」现在是货架下面的一个普通面板，不是弹窗的一部分 */
.pm-recent-count { color: var(--muted); font-size: 11.5px; font-weight: 400; }
.pm-recent-grid { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.pm-chip {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 62px; padding: 5px 3px; border-radius: 9px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: 10.5px; line-height: 1.25; text-align: center;
}
.pm-chip:hover { border-color: var(--accent); }
.pm-chip .pm-nick {
  font-weight: 700; max-width: 100%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.pm-chip .pm-rar { font-size: 9.5px; }
.pm-chip.pm-new { border-color: var(--good); }
.pm-recent-empty { color: var(--muted); font-size: 12px; }

/* 开卡提示：显示在弹窗里（原来走右下角 toast，玩家盯着弹窗反而看不到） */
.pm-note {
  order: 3; margin-top: 10px; padding: 9px 13px; border-radius: 9px;
  font-size: 13px; font-weight: 700; text-align: center;
  background: var(--panel-2); border: 1px solid var(--line);
}
.pm-note.good { color: var(--good); border-color: var(--good); }
.pm-note.bad { color: var(--accent); border-color: var(--accent); }

/* 信箱标题栏有三个元素（标题 / 刷新 / 关闭）。cl-head 是 space-between，
 * 三个的话刷新会飘在正中间 —— 给它 margin-left:auto 推到右侧，和关闭并排；
 * margin-right 让两个按钮之间留出空隙（不然会贴在一起）。 */
#btn-mail-refresh { margin-left: auto; margin-right: 9px; }

/* ===========================================================================
 * 头像尺寸：按卡片宽度缩放
 * ---------------------------------------------------------------------------
 * 【原来为什么小】.pt-img 写死 76px，组队页又覆盖成 62px —— 都是死数字。
 * 卡片一宽（组队页的槽位比收藏册宽），头像就显小，两边看起来不一致。
 * 收藏册里卡片 158px、头像 76px = 48%，把这个比例固定下来即可。
 *
 * 【aspect-ratio: 1 是必须的】只写 width 百分比的话，高度会按卡高
 * （3 : 4.15）算成椭圆 —— aspect-ratio 保证永远是正圆。
 * 字母圈同理：收藏册里 64px / 158px = 40.5%。
 * =========================================================================== */
.pt-img { width: 48%; height: auto; aspect-ratio: 1; }
.card-initial { width: 40.5%; height: auto; aspect-ratio: 1; }
/* 小卡不再单独写死尺寸，跟着卡片一起缩放；只调字号 */
.card-grid-sm .pt-img { width: 48%; height: auto; }
.card-grid-sm .card-initial { width: 40.5%; height: auto; }


/* ===========================================================================
 * 卡面元素：全部按卡片宽度缩放
 * ---------------------------------------------------------------------------
 * 基准是收藏册的卡片宽 158px（原来那些 px 就是照它定的），
 * 所以 22px 就是 13.9cqw（1cqw = 卡片宽的 1%）。
 *
 * 【为什么写两遍】cqw 是较新的单位，老浏览器不认会把那条声明**整条丢弃** ——
 * 前面那行 px 就自动生效了。所以「px 在前、cqw 在后」。
 *
 * 【.card 自己的圆角：不能用百分比，要拆成"横向 cqw + 纵向 cqw"】
 *   ① 容器单位（cqw）只能被**后代**用，容器自己的属性用不了 ——
 *      所以不能写 `border-radius: 8.9cqw`。
 *   ② 但**同一个元素上，百分比是可以的** —— 只是百分比圆角**横向按宽、纵向按高**：
 *      卡片是 3 : 4.15 的非正方，`8.9%` 算出来是
 *          横 172 × 8.9% = 15.3px
 *          纵 237 × 8.9% = 21.1px   ← 纵半径被拉长 38%！
 *      结果圆角是个**椭圆弧**，看着就是"不自然"（2026-10-16.20 用户报的）。
 *   ③ 解法：`border-radius` 的两值语法就是"**横向 / 纵向**"，所以
 *          border-radius: 7% / 5.04%
 *      横向 7% × 宽 与 纵向 5.04% × 高，两者都等于**卡宽的 7%**（因为高 = 宽 × 4.15/3，
 *      7 ÷ 1.3833 = 5.06，取 5.04 让两个半径对齐到 12px）→ 正圆角，且跟着卡片缩放。
 *      **纵向那格是"横% ÷ 1.3833"**，别把两者写成同一个数（那就是椭圆了）。
 *   前面那条 px 是给老浏览器的兜底。
 *   【试过但不行】`border-radius: 8.9% / 8.9cqw` —— 实测 cqw 在这个元素上
 *   被当成**视口单位**解析（0.89 × 1374 = 122px），和注释里说的
 *   "容器自己的属性用不了容器单位"完全对上。所以只能靠百分比拆两轴。
 * =========================================================================== */
.card { container-type: inline-size; border-radius: 12px; border-radius: 7% / 5.04%; }

.card-top { padding: 8px 9px 0; padding: 5.1cqw 5.7cqw 0; }
.card-ovr { font-size: 22px; font-size: 13.9cqw; }
.card-ovr .lv { font-size: 10px; font-size: 6.3cqw; }
.card-role { font-size: 10px; font-size: 6.3cqw; }
.card-top .card-logo { width: 25px; height: 25px; width: 15.8cqw; height: 15.8cqw; }
.card-avatar { gap: 6px; gap: 3.8cqw; }
.card-initial { font-size: 22px; font-size: 13.9cqw; border-width: 2px; border-width: 1.3cqw; }
.card-name { font-size: 15px; font-size: 9.5cqw; }
.card-meta { font-size: 10px; font-size: 6.3cqw; padding: 1px 8px 6px; padding: .6cqw 5.1cqw 3.8cqw; }
.card-bottom { padding: 6px 9px 7px; padding: 3.8cqw 5.7cqw 4.4cqw; }
.card-rarity { font-size: 11px; font-size: 7cqw; letter-spacing: 2px; letter-spacing: 1.3cqw; }
.card-flag { font-size: 14px; font-size: 8.9cqw; right: 9px; right: 5.7cqw; }
.card-bottom .card-count { font-size: 10px; font-size: 6.3cqw; left: 9px; left: 5.7cqw; }
/* 顶部那层渐变高光
 * 【必须自己带圆角】它是一条 62px 高的色带（不是铺满整卡），
 * 原来圆角是 0 —— 卡片圆角一切，色带那两个**方角就从卡片圆角里露出来**。
 * 半径跟着卡片的 px 值走（12px），差几像素看不出来。 */
.card::before { height: 58px; height: 36.7cqw; border-radius: 12px 12px 0 0; }

/* 小卡不再单独调字号尺寸 —— 全部跟着卡片缩放。
 * 只保留"格子里内容更紧凑"这一点：网格列宽和间距。 */
.card-grid-sm { gap: 12px; }

/* ===========================================================================
 * 组队页 · 位置覆盖 / 阵容评分 这两块
 * ---------------------------------------------------------------------------
 * 1. 两块等高：.match-grid 原来是 align-items: start，各按自己内容高，
 *    所以左右两块一高一矮。改成 stretch 拉平。
 * 2. 「阵容评分 93」对齐中线：.panel-title 是 align-items: baseline
 *    （按文字基线对齐），15px 的小标题和 20px 的数字会错位。
 *    这一条单独覆盖成 center。
 * =========================================================================== */
.match-grid { align-items: stretch; }
.panel-title.score-title { align-items: center; }

/* 【2026-10-16.92 修「已报名下面一大片空白」】
 * 上面那条 `stretch` 是为了**组队页**的「位置覆盖 / 阵容评分」两块等高。
 * 但比赛页也吃到了它：报名开打之后右侧「对局实况」会长得很高，
 * 同一行的赛事面板就被**拉伸**到一样高 —— 中间空出一大块、按钮浮在上面。
 * 修法在 JS 里（updateMatchPanels 里给 .match-grid 设 align-items:start）：
 * 那里本来就有"什么时候显示赛事面板"的判断，顺手设最稳。
 * 【为什么不用 CSS :has()】试过 `.match-grid:has(#tourney-panel:not([hidden]))`，
 * 单独测生效，但 e2e 那条路径上匹配不上（没查出原因）—— 不跟它较劲了。 */


/* ===========================================================================
 * 【2026-10-14.52】主界面重构：顶栏 + 侧栏瘦身
 * ---------------------------------------------------------------------------
 * 【为什么整段追加、不改上面任何老规则】
 *   1. 老规则里 .app 是 flex 横排、.sidebar 自己占满 100vh，改法只有两种：
 *      要么去动 .app 那一条（容易连带影响窄屏那条 media query），
 *      要么在这里追加覆盖 —— 选择器特异度相同，**后写的赢**，风险最小。
 *   2. 交接文档里那个坑（用正则批量改 CSS 会把属性塞进别的合并选择器）也一并绕开了。
 *
 * 【顶栏里装的还是原来那些 id】只是从"侧栏底部"搬到了"页面顶部"，
 * 所以 app.js 的 renderHeader / renderSideStatus / renderThemeToggle 一行没改 ——
 * 它们只认 id，不认位置。
 *
 * 【为什么给每一块单独写覆盖】.brand / .team-badge / .counters / .side-status /
 * .mail-btn / .theme-toggle 原来全是"侧栏竖排"的参数：width:100%、
 * 大块 margin、竖着排。直接搬到横排顶栏会互相挤，所以逐个改成横排形态。
 * =========================================================================== */

/* 【顶栏必须占满一整行 —— 这一条是这次最容易漏的】
 * .app 是 display:flex（横排），<header> 是它的第三个子元素。不写这两条的话，
 * 顶栏就变成"侧栏旁边的一列"：flex:1 的 .stage 抢走几乎全部宽度，顶栏被
 * flex-shrink 压到几十像素宽 —— 里面一堆 flex-wrap:wrap 的元素只能竖着堆，
 * 实测被压成 52px 宽 + 4829px 高，连主内容区都一起挤没了（@1150px 那条
 * .match-grid 单栏断点因此被触发，比赛页从两栏退成一栏）。
 * fix 就是：允许换行 + 顶栏 flex-basis 占满 100%，并且不许它被拉伸或压扁。 */
.app { flex-wrap: wrap; align-items: flex-start; }
.topbar { flex: 0 0 100%; align-self: flex-start; width: 100%; }

.topbar {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 10px; row-gap: 8px;
  padding: 9px 20px;
  background: var(--scrim);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  /* 【2026-10-14.58 改成吸顶】用户要求"下滑页面时不影响顶栏"。
   * 主内容区没有独立的滚动容器（滚的是页面本身），所以 top: 0 直接生效。
   * 【z-index 为什么是 150】按现有的层级阶梯选出来的：
   *   卡面内部最高 8 ／ 侧栏 2 ／ 底部旧 .footer 40  ＜ 150 ＜ 弹窗 .modal-mask 200
   *   ＜ toast / 更新提示 300
   * 这样顶栏能盖住卡片和侧栏，**但绝不会盖住弹窗**（弹窗遮罩是 fixed + 200）。
   * 别为了"更保险"往上调到 200 以上 —— 那会把弹窗盖住。 */
  position: sticky; top: 0; z-index: 150;
}

/* 品牌：原来是竖排侧栏的第一块，自带 padding: 0 8px 18px */
.topbar .brand { padding: 0 4px 0 0; }

/* 当前战队：原来是整行宽（width:100%），横排里要改成按内容宽 */
.topbar .team-badge { width: auto; max-width: 220px; margin: 0; }

/* 体力 / 段位：原来是一整块卡片，顶栏里改成扁平的横排小块 */
.topbar .side-status { margin: 0; padding: 6px 12px; }
.topbar .ss-next { white-space: nowrap; }
.topbar .ss-bar { min-width: 76px; }

/* 资源数量：原来是竖排一列，改成一行小胶囊 */
.topbar .counters { flex-direction: row; flex-wrap: wrap; gap: 8px; margin: 0 0 0 2px; }

/* 信箱：原来 width:100%（竖排里它是一条），改成按内容宽的按钮 */
.topbar .mail-btn { width: auto; }

/* 显示模式开关：原来有 margin: 10px 12px 4px，横排里那圈外边距会顶歪 */
.topbar .theme-toggle { margin: 0; }
/* 【这一条是有意的】窄屏下 .tt-text 会被隐藏（老规则 @720px），
   只留滑块；顶栏本来就有滑块表示开关状态，文字藏掉反而更紧凑、更整齐。 */

/* 显示模式 / 问题反馈 / 更新日志：整组推到顶栏最右边。
   【为什么用 margin-left: auto 而不是 justify-content】顶栏左边那几块
   （品牌、战队、体力、资源）要紧凑靠着左边，右边这一组要贴右边。
   在唯一的分界点上来一个 auto 外边距，就是把"左边一组、右边一组"切开，
   比调 justify-content 可靠（后者会把所有子元素一起重新分布）。 */
.topbar-right {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-left: auto;
}

/* -------------------------- 中等宽度：压成一行 --------------------------
 * 【为什么需要这一段】顶栏吸顶之后，它占的高度就是"永久占用的屏幕"。
 * 实测 1280px 窗口下顶栏内容比可用宽度多约 100px，右侧那组（显示模式 /
 * 问题反馈 / 更新日志）被挤到第二行 —— 顶栏变成两行 140px 高，
 * 钉在顶上显得很占地方。
 * 【做法】只藏掉几个**纯说明文字**，收回约 100px：
 *   「信箱」二字（信封图标 + 未读角标还在）、「白天模式」四字（开关滑块还在）。
 * 图标在，鼠标悬停也有 title 提示，功能一点没少，只是不再顶宽。
 * 【区间上界 1500】窗口够宽（1500px 以上）时空间富余，文字全部显示；
 * 【下界 821】<=820px 走下面那条窄屏规则（那边本来就不吸顶）。
 * 【为什么不用 display:none 藏整个按钮】床位/金币那些数字是信息，不能藏；
 * 这里藏的全是"看图就懂"的标签文字。 */
@media (min-width: 821px) and (max-width: 1500px) {
  .topbar .mb-text { display: none; }
  .topbar .theme-toggle .tt-text { display: none; }
  /* 藏掉文字后开关只剩滑块，别让它被挤成一条细缝 */
  .topbar .theme-toggle { padding: 9px 10px; }
}


/* ===========================================================================
 * 【2026-10-14.55】开包结果：不再写「第 N 包」，改成纯留白分隔
 * ---------------------------------------------------------------------------
 * 【已在 .57 作废】连开多包现在整片卡进同一个网格（见文件末尾），
 * 既没有分组标题也没有分组留白 —— 所以这条 `.more` 规则已经没有元素命中。
 * 老代码留着不删，省得动它；但别以为它还在生效。
 * =========================================================================== */
.result-pack.more { margin-top: 26px; }


/* ===========================================================================
 * 【2026-10-14.57】开包结果：连开多包也排成"一排 5 个"
 * ---------------------------------------------------------------------------
 * 【用户要什么】十连包（一次 10 张）本来就是 158px × 5 一排、排两行；
 * 连开 10 包原来是每包各排一行（每行只有 1 张），往下拉很长还很空。
 * 现在所有卡进同一个网格，和十连包长得一样。
 *
 * 【918px 是怎么来的】实测弹窗里结果区可用宽度正好 922px，
 * 十连包当时就是 5 × 158 + 4 × 16 = 854 网格、居中，所以这里沿用同一套尺寸。
 * 【auto-fit + minmax(0,158px)】装得下 5 列就 5 列；窗口更窄时自动减列，
 * 卡片保持 158px 不被压扁（十连包原来就是这个写法，所以两边永远一致）。
 * 【别改成 minmax(158px,1fr)】那样窄屏会横向溢出，卡片被挤出可视区。
 * =========================================================================== */
.result-cards {
  grid-template-columns: repeat(auto-fit, minmax(0, 158px));
  justify-content: center;
  max-width: 918px;
  margin: 0 auto;
}
/* 一片连续的卡：单个 .flip 自己不占额外的行间距，靠网格 gap 就够 */
.result-cards .flip { min-width: 0; }


/* ===========================================================================
 * 【2026-10-14.61】修：详情弹窗的头像只显示左上角一小块
 * ---------------------------------------------------------------------------
 * 【实测数据】相框 .modal-initial 是 62x62，而照片 .pt-img-modal 只有 28x28
 * （正好是相框的 48%），于是照片缩在左上角、底下的首字母整个露出来。
 *
 * 【原因】第 968 行的 `.pt-img-modal { width:100%; height:100% }` 本来是对的，
 * 但文件**后面**（第 2262 行附近）又有一条
 *     `.pt-img { width: 48%; height: auto; aspect-ratio: 1; }`
 * 它是给"卡面元素按卡片宽度缩放"加的（48% = 收藏册里的头像比例）。
 * 两条选择器特异度**完全相同**（都是 0,0,1），后写的赢 —— 所以弹窗那条被盖掉了。
 *
 * 【为什么修在这里】加在文件末尾，才能稳定压过第 2262 行那条。
 * 用 !important 是因为 `.pt-img` 那段就是靠"后写"赢的，这里再靠"后写"虽然
 * 也行、但太脆弱（以后谁把新规则加到更后面就又坏了）；
 * 直接提权最稳，而且只作用于"弹窗里的头像"这一个元素。
 * ========================================================================== */
.pt-img.pt-img-modal {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  transform: none !important;
  aspect-ratio: auto !important;
  border: none !important;
  border-radius: 50% !important;
  object-fit: cover !important;
}


/* ===========================================================================
 * 【2026-10-14.60】手机上"自动选图 / 开打 BO3"放到底部
 * ---------------------------------------------------------------------------
 * 【为什么】手机玩家选完图之后还要往上滑回去找「开打 BO3」，很别扭；
 * 而面板顶部那两个按钮挤在标题行里又小又难点。
 * 【做法】两个按钮各准备一份"底部版本"，用 CSS 决定显示哪一份：
 *   桌面：显示标题行里那份（.veto-actions-mobile 隐藏）
 *   手机：隐藏标题行那份，显示底部的（.veto-actions-mobile 显示）
 * 两份都是 [data-play] / 同一个 id 规则 → 状态和点击由 app.js 的
 * syncPlayButtons + 事件委托统一管，不会出现"一个能点一个不能点"。
 * 【为什么不加 `order: 1`】flex 容器（.veto-actions-mobile）在 DOM 里本来就
 * 排在 .map-pool 后面，天然落到底部，不需要 order。
 * ========================================================================== */
.veto-actions-mobile { display: none; }
.veto-actions-mobile .btn { flex: 1 1 auto; }

@media (max-width: 820px) {
  /* 标题行里那两个按钮收起来（手机上它们在标题旁边太挤），
     但桌面那个开打按钮就摆在面板底部，手指够得着。 */
  .veto-actions-mobile { display: flex; gap: 10px; margin-top: 14px; }
  #veto-panel .panel-title .btn { display: none; }
  /* 选图面板底部那个开打按钮做大一点：它是这一屏的主操作 */
  #veto-panel .veto-actions-mobile .btn-primary {
    padding: 13px 16px; font-size: 15px; font-weight: 800;
  }
}


/* ===========================================================================
 * 【2026-10-14.59】侧栏：钉在顶栏下面 + 自己的滚动条
 * ---------------------------------------------------------------------------
 * 必须写在**文件末尾** —— 基础 `.sidebar` 规则（`top: 0; height: 100vh`，
 * 在 230 行附近）和窄屏那条 media query 都在前面，同特异度下**后写的赢**。
 * （我第一次就放错了位置，被后面的 `top: 0` 盖掉了。）
 *
 * 【为什么需要改】老定义 `top: 0; height: 100vh` 是"顶栏还不吸顶"年代写的。
 * 顶栏吸顶之后：侧栏从 top:0 开始吸、高度又占满整屏 —— 顶部被顶栏盖住、
 * 底部伸出屏幕外，看起来就是"侧栏跟着页面一起动"。
 * 用户要的是：**侧栏固定在顶栏下面，内容装不下时自己有滚动条**。
 *
 * 【--tb-h 是顶栏的实测高度】83px 是单行时的高度（实测 1280/1366/1440/1600）。
 * 窗口窄到顶栏换行时（<=1000px，132px）下面那条 media query 会覆盖它。
 * **改顶栏的内边距 / 内容 / 字体后，这两个数字要重新量。**
 * ========================================================================== */
:root { --tb-h: 83px; }
.sidebar {
  top: var(--tb-h);
  height: calc(100vh - var(--tb-h));
  overflow-y: auto;              /* 装得下就不出滚动条，装不下才滚 */
  overscroll-behavior: contain;  /* 滚到底别带着整个页面一起滚 */
}
/* 卷轴占位：不写的话内容会因为滚动条出现/消失而左右抖一下 */
.sidebar { scrollbar-gutter: stable; }

/* 顶栏换行的那一档：**实测扫出来的**（不是猜的）。
 *   视口 window.innerWidth ≥1224 → 单行 83px
 *   视口 ≤1154                    → 两行 140px
 * 所以分界在 1154~1224 之间，取 1160（往小的一侧留余量，避免刚好在分界上错位）。
 * 【别用 --window-size 去量】headless 的窗口宽和 window.innerWidth 能差 25px 以上
 * （滚动条 + 包装进程），一律以页面里的 window.innerWidth 为准。
 * **改顶栏内容或内边距后，这个分界要重新扫。** */
@media (min-width: 821px) and (max-width: 1160px) {
  :root { --tb-h: 140px; }
}


/* ------------------------------ 窄屏（<=820px） ------------------------------
 * 老规则在 @820px 里把 .sidebar 整块变成了"横向铺满的顶栏"（.app 变纵向、
 * .nav 变 flex-row、.counters 变 flex-row）。主界面改成上下结构之后，
 * 那两个横排正好是我们要的：.app 本来就是纵向的，.topbar 和 .nav 各自横排。
 * 这里只需要把 sidebar 从"整块铺满"压成"贴着左边缘的一条竖导航"。 */
@media (max-width: 820px) {
  /* 【窄屏不吸顶】这一档顶栏已经是多行（136px 高），钉住会吃掉手机上一大块
     可视面积。窄屏本来就要靠滚动看内容，顶栏跟着滚更实用。 */
  .topbar { position: static; padding: 8px 12px; gap: 8px; row-gap: 6px; }
  .topbar .team-badge { max-width: 150px; }
  /* 【这里不用 align-self: flex-start】窄屏下 .app 已经是纵向（父规则 @820px
     把 .app 设成 flex-direction: column），flex-start 会让侧栏不再占满宽度。
     保持默认的 stretch，让它横跨整行。 */
  .sidebar {
    flex: none; width: auto; height: auto;
    position: static;              /* 窄屏不要再吸顶，跟着页面滚 */
    padding: 8px 12px;
    border-right: none; border-bottom: 1px solid var(--line);
  }
  .sidebar .nav { gap: 6px; }
  .sidebar .tab { flex: 0 0 auto; padding: 9px 12px; font-size: 14px; }
}

/* ------------------------------ 更窄（<=720px） ------------------------------
 * 老规则在 @720px 会把 .nav 变成"一列 64px 宽"，那是给原来那一整套
 * 侧栏内容（品牌/体力/资源/邮箱/主题）留的位置。现在侧栏只剩导航，
 * 那一列会把八个页签挤成八个方块往下排，把内容区顶出屏幕外。
 * 这里覆盖成"横排自动换行"，让它变成正常的手机端页签条。 */
@media (max-width: 720px) {
  .sidebar .nav { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .sidebar .tab { flex: 0 0 auto; justify-content: center; }
  /* 页签文字在上面 @720px 那条老规则里被藏起来了（.tab-text { display: none }），
     八个图标就是八个不可区分的方块 —— 单独把这一条改回显示。 */
  .sidebar .tab-text { display: inline; }
}


/* ===========================================================================
 * 【2026-10-14.65】手机端：顶栏收成两行 + 侧栏变成可收纳的底栏
 * ---------------------------------------------------------------------------
 * 用户要的两件事：
 *   1) 顶栏里的「问题反馈」和「更新日志」放同一排（原来各占一行，白吃 ~130px）
 *   2) 侧栏在手机上变成**底栏**，默认只显示一排，点「展开全部」看全部
 *
 * 【为什么整段写在文件末尾】这里的规则要覆盖同一份文件里**四个**已有的窄屏
 * media query（@820px 有两条、@720px 一条，还有 .veto 那条 @820px）。
 * 它们全是同特异度，后写的赢 —— 所以只能放最后，别挪到前面去。
 * 另外也覆盖基础 `.sidebar { position: sticky }`（在 232 行）和
 * `.app { flex-direction: column }`（在 428 行）。
 *
 * 【底栏高度】--tabbar-h 是"收起"状态的高度（页签一排 + 展开按钮）。
 * 页面底部要留出同样的空间（见下面的 .stage padding-bottom），否则最后一屏
 * 内容会被底栏永久盖住。**改了页签内边距/字体后这个数要重新量。**
 *
 * 【桌面端不受影响】底栏那两样新东西（主题按钮、展开按钮）默认 display:none，
 * 只在 @820px 里打开。桌面端主题开关还是顶栏里那一个。
 * ========================================================================== */
:root { --tabbar-h: 62px; }
/* 【顶栏高度】顶栏是 fixed 的，内容区要自己让出等高空白。
   【为什么用变量 + JS 量】三行的高度会随字体/换行变，写死容易对不上；
   app.js 里量完写进 --topbar-h（见 syncTopbarHeight）。这里的值只是兜底。 */
:root { --topbar-h: 132px; }

/* --- 默认（桌面）：底栏专用的东西一律不显示 --- */
.sidebar .theme-tab { display: none; }
.nav-expand { display: none; }
/* 【.counter 现在是 <button>】为了能点（去开包 / 去收藏册）从 div 改成了 button，
   但视觉上要保持"计数器卡片"的样子 —— 清掉浏览器给按钮的默认外观。 */
.counter {
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}
.counter:hover { border-color: var(--accent); }
/* 【桌面端不留底部空白】--tabbar-h 只给窄屏用；桌面端把 .stage 的底部内边距
   压回 0，否则每条屏幕下面都会多出 76px 空白。 */
.stage { padding-bottom: 0; }

@media (max-width: 820px) {
  /* ===== 【2026-10-14.85 手机顶栏重做】用户给的参考样式 =====
   * 目标形态（三行，全部左右对齐）：
   *   ① 战队徽章 | 金币（占更长）| 信箱
   *   ② 体力 40/40 …… 已满 / 进度条 / 段位 B …… 1711 分 · 第 1 名
   *   ③ 卡包 | 收藏 | 问题反馈 | 更新日志
   * 并且**顶栏固定**（滚动时不跟着走）。
   *
   * 【为什么用自己的一套内边距】以前顶栏 padding 是 9px 20px、内容区是 26px，
   * 手机上这两条竖线对不齐，看着就"歪"。这里让顶栏的外边距和 .stage 一致
   * （都一样宽），左右两端才能和下面的卡片齐平。
   * 【行内 gap 用 6px】四颗按钮挤一行时，8px 会让"问题反馈"的图标贴着字。 */
  .topbar {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 150;                    /* 低于模态 200 / toast 300，高于底栏 120 */
    gap: 6px; row-gap: 6px;
    padding: 8px 12px;
    align-items: stretch;            /* 同一行的卡片拉伸到一样高 —— 对齐的关键 */
  }
  .topbar .theme-toggle { display: none; }

  /* 顶栏是 fixed，不占文档流 —— 页面顶部必须自己让出等高的空白，
     否则第一块内容会被压在顶栏下面。高度由下面的 JS 量出来写到 --topbar-h。 */
  .stage { padding-top: calc(var(--topbar-h, 132px) + 16px); }

  /* 卡片统一圆角 + 底色，让三行看起来是"一组组件"而不是散落的元素 */
  .topbar .team-badge,
  .topbar .counter,
  .topbar .mail-btn,
  .topbar .topbar-right .btn {
    border-radius: 10px;
    background: var(--panel);
    border: 1px solid var(--line);
  }

  /* -------- 第 1 行：战队徽章 | 金币 | 信箱 -------- */
  /* 【顺序表】flex order 把四块内容排成三行（DOM 不动，只改视觉顺序）：
   *   order 1 战队徽章      ┐
   *   order 2 金币（占更长）├ 第 1 行
   *   order 3 信箱          ┘
   *   order 4 体力 / 段位     第 2 行（独占）
   *   order 5 卡包 · 收藏   ┐
   *   order 6 反馈 · 更新日志┘ 第 3 行
   * 【brand 隐藏】"开GO包"那三个字手机上占掉一整格，队名才是要看的。 */
  .topbar > .brand { display: none; }
  .topbar .team-badge            { order: 1; }
  .topbar .counter:nth-of-type(1) { order: 2; }   /* 金币 */
  .topbar .mail-btn              { order: 3; }
  .topbar .side-status           { order: 4; }
  .topbar .counter:nth-of-type(2) { order: 5; }   /* 卡包 */
  .topbar .counter:nth-of-type(3) { order: 5; }   /* 收藏 */
  .topbar .topbar-right          { order: 6; }

  /* -------- 第 1 行：战队徽章 | 金币 | 信箱 -------- */
  /* 【为什么徽章可以收缩】队名可能很长，给它 min-width:0 + 省略号，
   * 宁可截断队名也不要把金币和信箱挤到下一行。 */
  .topbar .team-badge {
    flex: 1 1 0; min-width: 0; width: auto;
    margin: 0; padding: 8px 10px;
    justify-content: center;
  }
  .topbar .team-badge .tb-name {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }

  /* 【金币要占更长】用户明确要求。flex:2 让它在剩余空间里拿两份，
   * 队名和"信箱"各一份 —— 金币的数字位数多，需要更宽才不跳。 */
  .topbar .counters { display: contents; }
  .topbar .counter:nth-of-type(1) {
    flex: 2 1 0; min-width: 0;
    justify-content: center; margin: 0; padding: 8px 10px;
  }

  .topbar .mail-btn {
    flex: 0 0 auto; width: auto;
    margin: 0; padding: 8px 12px;
  }

  /* -------- 第 2 行：体力 / 段位（独占一行的一张大卡） -------- */
  .topbar .side-status { flex: 1 1 100%; margin: 0; }

  /* -------- 第 3 行：卡包 | 收藏 | 反馈 | 更新日志（四等分同一行） --------
   * 【为什么用 display:contents】DOM 里这一行有**两个**容器：
   * .counters（卡包 + 收藏）和 .topbar-right（反馈 + 更新日志）。想让四个格子
   * 真正四等分，就得让容器"消失"、四个格子变成顶栏的直接子项（各自 flex:1）。
   * 否则两个容器各占一行 —— 原来就是这样，白白多吃了一整行高度。 */
  .topbar .counters { display: contents; }
  .topbar .topbar-right { display: contents; }
  /* 四格等宽，同一行同一基线 */
  .topbar .counter:nth-of-type(2),
  .topbar .counter:nth-of-type(3),
  .topbar .topbar-right .btn {
    flex: 1 1 0; min-width: 0;
    justify-content: center;
    margin: 0; padding: 8px 4px;
    font-size: 13px;
    text-align: center;
    gap: 3px;
  }
  /* 【顺序】卡包 · 收藏 · 反馈 · 更新日志
   * 【为什么用 nth-child 而不是 nth-of-type】.topbar-right 里第一个子元素是
   * **主题开关**（它也是 <button>）—— 用 `.btn:nth-of-type(1)` 会选中主题开关、
   * `:nth-of-type(2)` 选中反馈，更新日志就落空了（order 还是 0，跑到第一行去）。
   * nth-child 数是"第几个孩子"，不受标签类型影响，这里才对。 */
  .topbar .counter:nth-of-type(2) { order: 5; }
  .topbar .counter:nth-of-type(3) { order: 6; }
  .topbar .topbar-right > .btn:nth-child(2) { order: 7; }   /* 问题反馈 */
  .topbar .topbar-right > .btn:nth-child(3) { order: 8; }   /* 更新日志 */
  /* 【图标不能被压扁】emoji 在 flex 里默认可收缩，文字一长图标就变一条。
   * 给图标 flex:none、文字允许省略号 —— 宁可截断文字也别把图标压变形。 */
  .topbar .counter-icon,
  .topbar .mb-icon { flex: none; }
  .topbar .counter .cv {
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  /* 【2026-10-14.86】用户要求去掉「收藏」那个短标签 —— 现在那格就是
   * 📇 图标 + 数字（和旁边的 📦 2 一个样式），看 title 提示知道是什么。 */

  /* -------- 底栏：钉在屏幕底部 --------
   * 原来是"内容区上面的一条横排页签"，现在整块移到屏幕底部并固定。
   * position:fixed + left/right:0 让它横跨整屏，不参与 .app 的纵向排布。 */
  .sidebar {
    position: fixed;
    left: 0; right: 0; bottom: 0; top: auto;
    width: auto; height: auto;
    z-index: 120;                        /* 低于顶栏 150、模态 200、toast 300 */
    /* 【2026-10-14.85 改成横排】这样才能让"展开"按钮和页签**并排**、
     * 并且插在正中间（用户要求）。原来 sidebar 是竖排（nav 一行 + 展开一条）。 */
    display: flex; flex-direction: row; align-items: stretch; gap: 2px;
    /* 【左右内边距放在这里而不是 .nav 上】收起状态下 .nav 是 display:contents
     * （没有盒子），它的 padding 会失效 —— 所以内边距得由底栏自己出。 */
    padding: 6px 8px;
    border-right: none;
    border-top: 1px solid var(--line);
    border-bottom: none;
    /* 底部安全区：iPhone 那条横条别盖住页签 */
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--scrim-2);
    backdrop-filter: blur(12px);
  }
  /* 展开时：nav 先铺满一整行，展开按钮变成下面那一条（方便点它收起） */
  .sidebar.nav-open {
    flex-direction: column;
    padding: 0 0 env(safe-area-inset-bottom, 0px);
  }

  /* 收起时只显示一排 5 格：4 个页签 + 中间一个"展开"。
   * 【2026-10-14.85 用户要求】"底栏的展开改到横排的中间位置，一排 5 个按钮，
   * 中间是展开"。
   * 【关键一步：nav 用 display:contents】.nav 原来是个真实的 flex 容器，
   * 这样 sidebar 的 order 只管得到 .nav 自己、管不到导航里的页签 ——
   * "展开"按钮就只能待在 nav 外面（最右边），插不进中间。
   * contents 让 .nav "消失"，5 个按钮变成 sidebar 的直接子项，
   * order 才真的能把"展开"排到正中间（order: 3）。
   * 【展开后要还回来】那时候页签要换行铺开，必须有 .nav 这个盒子包着。 */
  .sidebar .nav {
    display: contents;
  }
  .sidebar.nav-open .nav {
    display: flex;
    flex: 1 1 100%;                       /* 独占整行，不然 9 个会挤成两半 */
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding: 6px 8px;
  }
  /* 【展开时页签要按内容宽度排、并且允许换行】收起时页签是 flex:1 1 0
   * （5 格平分、会缩），展开后如果还是 flex:1，9 个会一路缩到 55px 挤在一行、
   * 永远不触发 wrap（我在这上面卡了一轮）。改成 0 0 auto = 用内容宽度。
   * 【和"展开"按钮一样宽】64px 让它排出来是整齐的网格。 */
  .sidebar.nav-open .tab,
  .sidebar.nav-open .theme-tab {
    flex: 0 0 auto;
    min-width: 64px;
  }
  .sidebar.nav-open .tab-text,
  .sidebar.nav-open .theme-tab-text { display: inline; }
  /* 【主题开关：收起时底栏只有 5 格、没它的位置；展开后要能切主题】
   * 顶栏那个在手机上是隐藏的，所以这里必须露出来 —— 否则手机端没法换主题。 */
  .sidebar.nav-open .theme-tab { display: flex; }

  /* 页签 */
  .sidebar .tab {
    flex: 1 1 0;                         /* 5 格平分 */
    min-width: 0;
    flex-direction: column;
    gap: 2px;
    padding: 7px 2px;
    font-size: 11px;
    line-height: 1.25;
    border-radius: 10px;
    white-space: nowrap;
  }
  .sidebar .tab-icon { font-size: 19px; line-height: 1; }
  .sidebar .tab-text {
    display: inline; font-size: 11px;
    overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  }

  /* 【收起时只露 4 个页签】哪 4 个？用户给的参考是
   *   开包(1) · 收藏册(2) · **展开(3)** · 组队(4) · 天梯(5)
   * 5 格排满整屏，不滑动；其余页签展开后才看到。 */
  .sidebar .tab[data-view="pack"]       { order: 1; }
  .sidebar .tab[data-view="collection"] { order: 2; }
  .sidebar .tab[data-view="team"]       { order: 4; }
  .sidebar .tab[data-view="match"]      { order: 5; }
  .sidebar .tab[data-view="train"],
  .sidebar .tab[data-view="tourney"],
  .sidebar .tab[data-view="trade"],
  .sidebar .tab[data-view="friend"],
  .sidebar .tab[data-view="saves"]      { order: 6; }
  /* 收起时把 order >= 6 的那几个藏起来 */
  /* 【每日商店也要排除】2026-10-18 加页签时漏了这条 —— 它会挤进收起状态的底栏，
   * 把「展开」按钮挤走（底栏就 5 格）。新加页签时记得同步这里。 */
  .sidebar:not(.nav-open) .tab[data-view="shop"],
  .sidebar:not(.nav-open) .tab[data-view="train"],
  .sidebar:not(.nav-open) .tab[data-view="tourney"],
  .sidebar:not(.nav-open) .tab[data-view="trade"],
  .sidebar:not(.nav-open) .tab[data-view="friend"],
  .sidebar:not(.nav-open) .tab[data-view="saves"] { display: none; }

  /* 【主题开关】收起时底栏只有 5 格、没有它的位置了；展开后跟着页签一起显示。
   * 用户要求的"一排 5 个按钮，中间是展开"是**收起**状态的形态。 */
  .sidebar:not(.nav-open) .theme-tab { display: none; }

  /* 【支持作者】同一套规矩：收起时底栏是固定的 5 格，塞不下第 6 个 ——
   * 所以收起时隐藏、展开后才出现（order: 8 跟在主题开关后面）。 */
  .sidebar:not(.nav-open) .side-btn { display: none; }
  .sidebar .side-btn {
    flex: 0 0 auto; min-width: 64px;
    flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; padding: 7px 2px;
    margin-top: 0;                       /* 底栏里不需要"顶到底部" */
    font-size: 11px; line-height: 1.25;
    white-space: nowrap;
    order: 8;
  }
  .sidebar .side-btn .sb-icon { font-size: 19px; line-height: 1; width: auto; }
  /* 【小卡片要抬起来】手机底栏是 fixed 的，左下角 18px 会被它盖住 ——
   * 抬到底栏上方（底栏收起约 76px，再加上安全区）。 */
  .support-pop {
    left: 12px;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 24px);
    max-width: 340px;
  }

  /* 底栏里的主题开关（仅手机显示）。它**不是页签**，所以单独一套样式，
     但尺寸和页签对齐，免得在底栏里显得突兀。 */
  .sidebar .theme-tab {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    align-items: center; justify-content: center;
    gap: 2px;
    padding: 7px 2px;
    font-size: 11px;
    line-height: 1.25;
    border-radius: 10px;
    white-space: nowrap;
    color: var(--muted);
    order: 7;
  }
  .sidebar .theme-tab-icon { font-size: 19px; line-height: 1; }

  /* -------- 展开/收起按钮：**排在底栏正中间** --------
   * 【2026-10-14.85 用户要求】"底栏的展开改到横排的中间位置"。所以它不再是
   * 底栏下面独立的一整条，而是和页签**同一行、插在正中间**（order: 3）。
   * 尺寸和页签一致（flex:1 各占 1/5），图标上、文字下，看着就是 5 个按钮。 */
  .nav-expand {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 2px;
    /* 【宽度要和页签一样】页签是"nav 里 flex:1"算出来约 72px，
     * 这里给个固定值对齐。给 flex:1 的话它会和 nav 抢空间，
     * 结果把页签挤窄、自己变宽，中间那个就不是"和别的按钮一样大"了。 */
    flex: 0 0 auto;
    width: 72px;
    order: 3;                            /* 正中间 */
    padding: 7px 2px;
    border: none;
    background: none;
    color: var(--muted);
    font-size: 11px; font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
    border-radius: 10px;
    /* 底栏有 padding-bottom 的安全区，这里别再顶满 */
    margin-bottom: 0;
  }
  .nav-expand .ne-arrow {
    display: inline-block;
    font-size: 19px;                     /* 和 .tab-icon 一样大，整排才齐 */
    line-height: 1;
    transition: transform .18s ease;
  }
  /* 展开后箭头翻过来（朝下 = 点它收起） */
  .sidebar.nav-open .nav-expand .ne-arrow { transform: rotate(180deg); }
  /* 展开之后"展开全部"这个位置就该在最后一行末尾，回到普通流式排布 */
  .sidebar.nav-open .nav-expand { order: 9; flex: 0 0 auto; width: auto; align-self: stretch;
    flex-direction: row; gap: 6px; }

  /* -------- 给底栏腾出空间 --------
   * 底栏是 fixed 的，不占文档流 —— 页面底部必须自己留出等高的空白，
   * 否则滚到最后一块内容会被底栏永久盖住（点不到也看不见）。 */
  .sidebar-spacer { display: block; flex: none; height: var(--tabbar-h); }
  .stage { padding-bottom: calc(var(--tabbar-h) + 24px); }
}


/* ===========================================================================
 * 【2026-10-14.66】选图面板：按钮搬到面板里 + 手机上排在排行榜前面
 * ---------------------------------------------------------------------------
 * 两个用户反馈：
 *   1) 手机上「地图 Ban/Pick」跑到了排行榜**下面** —— 因为 DOM 里排行榜在
 *      左栏、选图面板在右栏，两栏在手机上变成上下排列，左栏整个在前面。
 *   2) PC 上选图面板**没有开打按钮** —— 以前它在另一个面板（「赛前准备」）
 *      的按钮行里，选完图还得往上找。
 *
 * 做法：
 *   · PC：选图面板里加一排 `.veto-actions`（自动选图 + 开打），和手机那排
 *     是同一组操作，按断点显示其中一份，不会重复出现。
 *   · 手机：用 CSS order 把排行榜压到最后，选图面板自然上移到「赛前准备」下面。
 *     【为什么用 order 而不是搬 DOM】两栏结构是 PC 布局的基础（`.match-col`），
 *     把面板搬出来会让 PC 的两栏排布散架。order 只影响视觉顺序，DOM 不动。
 *
 * 【order 的默认值】`.match-grid` 在手机上仍是 display:grid 单列
 * （见 660 行那条 @820px 的 grid-template-columns: 1fr），
 * 所以它的直接子元素（两个 .match-col）按 order 排。给左栏一个正整数 order
 * 就把它整个推到右栏后面 —— 但这样**左栏里所有面板都会跟着去后面**，
 * 包括「赛前准备」，那不是我们要的。
 * 所以这里用更精确的办法：把两个 .match-col 设成 display:contents
 * （让它们"消失"，里面的面板变成 .match-grid 的直接子项），
 * 再单独给 .match-log-panel 和 #ladder-panel 一个较大的 order。
 * ========================================================================== */
.veto-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
/* 【为什么要把尺寸压下来】选图面板在 .match-grid 里，同页的
 * `.match-grid .match-actions .btn` 是 `8px 14px / 13px` 的紧凑档。
 * 新加这排如果吃基础 .btn（13px 30px / 16px）会比旁边的按钮明显大一圈，
 * 而且和「重新选图」不一边高（e2e 有一条专门量"开打和选图按钮一样大"）。
 * 所以这里对齐成同一档。 */
.match-grid .veto-actions .btn { padding: 8px 14px; font-size: 13px; }
.veto-actions .btn { flex: 0 1 auto; }

@media (max-width: 820px) {
  /* PC 那排按钮收起来，手机上用 .veto-actions-mobile 那一排（同一组操作） */
  .veto-actions { display: none; }
  /* 开打按钮是这一屏的主操作，做大一点（和手机那排保持一致） */
  .veto-actions-mobile .btn-primary {
    padding: 13px 16px; font-size: 15px; font-weight: 800;
  }

  /* -------- 手机上：对局实况排在排行榜**前面** --------
   * display:contents 让两个 .match-col 不再生成盒子，它们里面的面板
   * 直接成为 .match-grid 的网格项 —— 这样才能单独给某几个面板设 order。
   * 【注意】这一条只在手机上生效，PC 的两栏布局完全不受影响。
   * 【2026-10-15.98 对调过】原来是 排行榜 order:1 / 对局实况 order:2，
   * 用户反馈「手机上打完一场，实况被放在排行榜下面，要滚很久才看到」——
   * 实况是打完那一瞬间最想看的，排行榜是常驻信息，所以实况提到前面。 */
  .match-grid { grid-auto-flow: row; }
  .match-col { display: contents; }
  /* 默认 0（保持 DOM 顺序），所以不写 order 的那几个是：
   *   赛前准备 → 选图
   * 然后接 order:1 / order:2 的两个：
   *   对局实况 → 排行榜 */
  .match-grid #match-log-panel { order: 1; }
  .match-grid #ladder-panel { order: 2; }
  /* 实况后面跟排行榜，留点间距好看 */
  .match-grid #ladder-panel { margin-top: 4px; }
}

/* ============================================================================
 * 默契明细：去掉「勾 / 点」之后的样子（2026-10-14.71 用户要求）
 * ----------------------------------------------------------------------------
 * 以前每一行左边有一个圆形小标（有就 ✓、没有就 ·），既占地方又没信息量
 * （"有没有"从右边的数字就能看出来），看着杂乱。
 *
 * 现在这里只有两种元素：左边名字、右边数值。
 *   · 计数为 0 的行 → 整行压暗（.z），一眼扫过去知道"这几项没吃到"
 *   · 吃到分了的行 → 名字正常色、数值绿色（.on）
 *
 * 【为什么写在文件末尾】基础 .checklist li 规则在前面（约 1231 行），
 * 同特异度下后写的赢。这里用的是 (0,2,1) 比它 (0,1,1) 高，
 * 其实提到前面也能生效，但跟项目惯例保持一致：新的覆盖规则一律追加在末尾。
 * ========================================================================== */
.synergy-list { gap: 6px; }
.checklist.synergy-list li { gap: 0; }
.checklist.synergy-list li .pos-name { color: var(--text); }
/* 没吃到分的那几行整行压暗 —— 比"加个灰点"更直观，也少一个元素 */
.checklist.synergy-list li.z { opacity: .45; }
.checklist.synergy-list li.z .val { color: var(--muted); }
.checklist.synergy-list li.on .val { color: var(--good); }
.checklist.synergy-list li.warn .pos-name { color: var(--accent); }
.checklist.synergy-list li.warn .val { color: var(--accent); }

/* ============================================================================
 * 视图标题下的"数据来源"小字（开包 / 收藏册 / 组队都用它）
 * ----------------------------------------------------------------------------
 * 用户要求在这三个界面写明"选手数据为部分 AI 生成，对角色卡的数值有想法可以
 * 提交反馈"。样式比 .view-sub 更轻（小一号、带个左边框），不抢主说明。
 *
 * 【为什么要压 .view-sub 的 margin-bottom】.view-sub 自带 22px 下边距，
 * 那是给"紧跟一个面板"准备的。中间插进这条小字之后，22px 会把它推得离
 * 标题很远、同时又贴着下面的面板，看着像归到了下一个区块。
 * 同特异度下后写的赢，所以这条直接写在文件末尾就行。
 * ========================================================================== */
.view-sub:has(+ .view-note) { margin-bottom: 6px; }
.view-note {
  color: var(--muted); font-size: 12px; opacity: .85;
  border-left: 2px solid var(--line-2); padding-left: 8px;
  margin: 0 0 22px;
}
/* 【:has() 的退路】老浏览器不认 :has()，上面那条整条会被丢掉 ——
 * 那就退回 .view-sub 原本的 22px。小字自己仍有 22px 下边距，
 * 只是和上面那行说明贴得近一点，不会难看。
 * （视图用 display:grid + gap 排列，所以不需要给下面的 panel 补 margin。） */

/* ============================================================================
 * 卡面左上角：`基础分+等级`（2026-10-14.73）
 * ----------------------------------------------------------------------------
 * 格式由用户指定：`80+1`。基础分用正常字号和颜色，`+N` 用小一号的强调色，
 * 这样"原分多少、练了几级"分开看得清，又不至于让 +N 抢了主数字。
 *
 * 【演变过程，别再改回去】① 总分 + 角标（信息重复）→ ② 只显示总分 + 金色三角
 * （看不出基础多少）→ ③ 现在这个 `基础+等级`。
 * ========================================================================== */
.card-ovr .lv {
  font-size: .5em;
  font-style: normal;
  vertical-align: super;
  margin-left: 1px;
  font-weight: 700;
  color: var(--accent);
}

/* ============================================================================
 * 坑位详情 / 选人弹窗（2026-10-14.76）
 * ----------------------------------------------------------------------------
 * 一个弹窗干两件事：
 *   · 已占的坑位 → 左卡面 / 右信息 + 等级、综合评分、重复卡 + 「替换」「移出卡组」
 *   · 点「替换」或点【空坑位】→ 同一个弹窗里换成选人列表
 *
 * 【为什么比普通弹窗宽】普通 .modal 是 400px（只能单栏）。
 * 这里要左右两栏（卡面 + 信息），所以单独给一个更宽的上限。
 * ========================================================================== */
.slot-modal { max-width: 820px; padding: 22px 24px; }

/* ---- 头部：名字（左） + 关闭（右），2026-10-14.79 照用户给的图三加的 ---- */
.sd-head-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 18px;
}
.sd-title { font-size: 22px; font-weight: 800; }

.sd-wrap { display: flex; gap: 26px; align-items: flex-start; flex-wrap: wrap; }
/* 【左栏：卡面 + 四格数据 + 按钮竖着排】用户要的图三就是这个结构
 * —— 卡面在上、数据在它下面、按钮再下面。
 * 【2026-10-14.81 宽度 210 → 240】用户要求"替换与移出应该在同一排"，
 * 但通用 .btn 的左右内边距是 30px，两个按钮并排要 ~253px，210px 装不下
 * 就只能折行。加宽到 240px + 下面给按钮收到 18px 内边距，正好并排放下。 */
.sd-left { width: 240px; flex: none; display: flex; flex-direction: column; gap: 12px; }
/* 【卡面放大到 210px】用户要求"详情页的卡面放大"。
 * 【为什么不靠 flex 撑】.card 的容器查询单位（cqw）会跟着弹性宽度变，
 * 同一张卡在不同弹窗里字号不一致 —— 给固定宽度最稳。 */
.sd-card { width: 210px; margin: 0 auto; }
.sd-card .card { width: 100%; }

.sd-info { flex: 1; min-width: 240px; }
.sd-sub { font-size: 13px; color: var(--muted); line-height: 1.7; }
/* 【HLTV 跳转按钮】2026-10-14.88 用户要求：收藏详情页真名后面加一个能跳
 * 去该选手 HLTV 页的按钮。
 * 【为什么做成小胶囊而不是普通 <a>】它夹在真名和一串队伍/位置信息中间，
 * 做成彩色链接会把那一行读断；做成小胶囊一眼能看出"这是个按钮"。
 * 【为什么不用 <button>】它是跳转，语义上就该是 <a href>（右键新标签、
 * 复制链接、无障碍朗读都正常）。样式上用 appearance 之外的手段做按钮感。 */
.hltv-link {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
  color: var(--info-text);
  background: var(--info-bg);
  border: 1px solid transparent;
  vertical-align: 1px;
}
.hltv-link:hover { border-color: currentColor; }
.sd-slot { font-size: 13px; color: var(--muted); margin: 14px 0 4px; }
.sd-slot b { color: var(--text); }
.sd-fit {
  font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 4px;
  background: var(--info-bg); color: var(--info-text);
}

/* 【纯数字的能力行】2026-10-14.79：用户要求"不显示数据条"。
 * 条子不携带额外信息（数字就在右边），反而占掉一半宽度；去掉之后
 * 右栏可以更紧凑，卡面也能放得更大。 */
.stat-plain {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; font-size: 14px; padding: 6px 2px;
  border-bottom: 1px dashed var(--line);
}
.stat-plain span { color: var(--muted); }
.stat-plain b {
  font-size: 16px; font-variant-numeric: tabular-nums; color: var(--rc, var(--accent));
}

/* 等级 / 综合评分 / 副能力分 / 重复卡 —— 四格数据（在卡面下面，两列）
 * 【必须等高】2026-10-14.80：以前"重复卡"那格写的是 "4 张（可用 3）"，
 * 文字长会折成两行把整格撑高，一排看着参差不齐。用户要求"这四个显示框的大小
 * 应该一样"，所以给一个 min-height + 让数值单行显示。 */
.sd-facts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.sdf {
  display: flex; flex-direction: column; gap: 4px; justify-content: center;
  min-height: 58px;
  background: var(--hi-1); border: 1px solid var(--line);
  border-radius: 9px; padding: 8px 10px;
}
.sdf span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.sdf b {
  font-size: 15px; font-variant-numeric: tabular-nums;
  color: var(--rc, var(--accent));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 【两个按钮要在同一排】用户 2026-10-14.81 要求。通用 .btn 的内边距是
 * `13px 30px`（为独立按钮设计的，够大够好点），两个并排会超出左栏宽度 ——
 * 所以这里收窄到 18px，并允许它们各自缩一点。
 * 【必须加 min-width:0】flex 子项默认 min-width:auto，内容长了会把容器撑开、
 * 反而让 flex-wrap 有机会折行。 */
.sd-acts { display: flex; gap: 10px; flex-wrap: nowrap; }
.sd-acts .btn {
  flex: 1 1 auto; min-width: 0; padding: 11px 18px; font-size: 15px;
  justify-content: center; white-space: nowrap;
}

/* ---- 选人列表（同一个弹窗里切换过去的样子）---- */
.pk-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.pk-head h3 { font-size: 17px; font-weight: 800; }

/* 【筛选项】2026-10-14.79：和收藏册同一套（稀有度/赛区/位置/国家/系列/战队/排序/搜索）。
 * 三行布局，行内元素沿用收藏册的 .cf-row / .chip-box / select / input 外观，
 * 所以这里不用再定义一套 input 样式 —— 只保留必要的间距。 */
.pk-filters {
  display: flex; flex-direction: column; gap: 8px;
  padding-bottom: 12px; margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.pk-filters .cf-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pk-filters select, .pk-filters input {
  font: inherit; font-size: 12px; color: var(--text);
  background: var(--hi-1); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 9px;
}
.pk-filters input { flex: 1; min-width: 130px; }
.pk-filters select:focus, .pk-filters input:focus {
  outline: none; border-color: var(--accent);
}
/* 【为什么限列宽上限】用的是 .card-grid-sm（minmax 126px），弹窗宽 820 时会
 * 铺出 6 列，卡片偏小。140px 下限让它稳定在 4~5 列。 */
.pk-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important; }

@media (max-width: 640px) {
  .slot-modal { padding: 18px 14px; }
  .sd-wrap { gap: 16px; }
  /* 窄屏：卡面收窄、居中放上面，信息在下面 */
  .sd-left { width: 100%; align-items: center; }
  .sd-card { width: 150px; }
  .sd-facts { width: 100%; }
  .sd-acts { width: 100%; }
  .sd-info { min-width: 100%; }
}

/* ===========================================================================
 * 启动遮挡层（2026-10-17 用户要求）
 * ---------------------------------------------------------------------------
 * 用户原话：「现在刷新后会闪一下开包再回到原本来页面，如果这个过程不能处理的话，
 *   能不能通过加一个类似于图2的加载界面来让观感更自然」
 *
 * 【为什么不"根治"，而是盖一层】界面是先画出来的、页签是"画完之后"才切过去
 * （见 app.js 的 restoreView）。就算把恢复提前，也still要先渲染一次才能切；
 * 想完全不闪就得让"第一帧"就是正确的页 —— 那等于把整页渲染改成异步/两段式，
 * 风险大得多。盖一层既便宜又稳，而且顺带把"启动时白屏"也一起遮住了。
 *
 * 【颜色全部走主题变量】白天/黑夜两种模式都不用另写一份。
 * 注意 --bg 是页面底色，遮挡层用它 = 和页面无缝，看着不像"另外弹出来的东西"。
 *
 * 【层级】比 .modal-mask（弹窗）高 —— 启动阶段它必须盖住一切。
 * 【位置】fixed inset:0，盖住整屏（包括手机底栏）。
 * ========================================================================== */
.boot-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--bg);
  color: var(--muted);
  /* 【淡出由 JS 负责，不用 CSS 过渡】
   * 见 app.js 的 endBootLoader()：
   * 2026-10-17 实测过 `transition: opacity .32s` 和 `animation` ——
   * 这套无头环境里 getComputedStyle 始终读到 1、不同时刻的截图也完全一样，
   * **没法验证过渡真的播了**。测不出来的代码等于没验证，所以改成
   * JS 每 40ms 显式设一次 opacity（8 档走完 320ms），
   * 每一步都是能断言的具体值，不依赖任何 CSS 插值。 */
  opacity: 1;
}
/* 用 display:none 摘掉，而不是 opacity:0 —— 后者还占着层级，
 * 万一哪里算错就会挡住点击（"点了没反应"最难查）。 */
.boot-loading[hidden] { display: none; }

.boot-loading .bl-text { font-size: 13px; letter-spacing: .5px; }

/* 转圈的环：只用 border 上色，单元素搞定，不用图片也不用 SVG */
.boot-loading .bl-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--line-2, var(--line));
  border-top-color: var(--accent);
  animation: blSpin .8s linear infinite;
}
@keyframes blSpin { to { transform: rotate(360deg); } }

/* 【不转圈的人】系统设了"减少动态效果"就换成静态的呼吸，
 * 那条规则本来就是给前庭反应敏感的人用的。 */
@media (prefers-reduced-motion: reduce) {
  .boot-loading .bl-spinner { animation: blPulse 1.4s ease-in-out infinite; }
  @keyframes blPulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
  /* 前端已经偏好"少动"，那淡出也省掉（直接消失） */
  .boot-loading { transition: none !important; }
}

/* ============================================================================
 * 每日签到 + 今日任务 两栏（2026-10-18）
 * ----------------------------------------------------------------------------
 * 用户要求：签到缩小成图里那样（一行七格），右侧加今日任务板，但**不改大致布局** ——
 * 所以它还是待在开包页原来那个位置，只是从"一整条"变成"左右两块"。
 * ========================================================================== */
.daily-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
  align-items: start;
}
.daily-grid > .panel { margin-bottom: 0; }
/* 窄屏就上下排（手机上两栏各 50% 会挤成一团） */
@media (max-width: 900px) {
  .daily-grid { grid-template-columns: 1fr; }
}

/* 签到格子里多了个"卡包名"（图里那行小字） */
.ck-cell .ck-name { font-size: 10.5px; font-weight: 600; color: var(--text); }

/* 原来四条 ck-row 压成一行小字（两套签到都留着，只是不再各占一行） */
.ck-stat { margin-top: 9px; font-size: 11px; color: var(--muted); line-height: 1.65; }
.ck-stat b { color: var(--text); font-weight: 600; }

/* ---- 今日任务 ---- */
.dy-list { display: flex; flex-direction: column; gap: 8px; }
.dy-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 8px; background: var(--hi-1);
}
.dy-row.off { opacity: .5; }
.dy-main { flex: 1 1 auto; min-width: 0; }
.dy-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.dy-meta { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.dy-bar {
  margin-top: 5px; height: 4px; border-radius: 999px;
  background: var(--line); overflow: hidden;
}
.dy-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.dy-ing { font-size: 11px; color: var(--muted); white-space: nowrap; }
.dy-done { font-size: 11px; color: var(--good); white-space: nowrap; }
.dy-all { margin-top: 10px; font-size: 11px; color: var(--muted); }
.dy-all.ok { color: var(--good); }

/* ---- 体力卡弹窗 ---- */
.stamina-box { max-width: 430px; width: 100%; }
.st-cur { font-size: 13px; color: var(--text); margin-bottom: 8px; }
.st-cur b { color: var(--accent); }
.st-full { margin-left: 8px; font-size: 11px; color: var(--good); }
.st-bar {
  height: 6px; border-radius: 999px; background: var(--line);
  overflow: hidden; margin-bottom: 14px;
}
.st-bar i { display: block; height: 100%; background: var(--good); border-radius: 999px; }
.st-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.st-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.st-info b { font-size: 12.5px; color: var(--text); }
.st-info small { font-size: 10.5px; color: var(--muted); }
.st-info .st-exp { color: var(--accent); }
.st-n { font-size: 12px; color: var(--muted); white-space: nowrap; }
.st-note { margin-top: 12px; font-size: 11px; color: var(--muted); line-height: 1.7; }

/* ---- 顶栏"体力"变成可点的按钮 ---- */
.ss-btn {
  background: none; border: none; padding: 1px 5px; margin: 0;
  font: inherit; cursor: pointer; color: inherit;
  display: inline-flex; align-items: baseline; gap: 4px;
  border-radius: 6px;
}
.ss-btn:hover { background: var(--hi-1); }
/* 有卡的时候右上角挂个小标记，否则玩家不知道这里能点 */
.ss-btn.has-cards { position: relative; }
.ss-btn.has-cards::after {
  content: '';
  position: absolute; top: -1px; right: -1px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}

/* 【体力卡入口提示】加在"全部完成加送"下面那一行。
 * 用虚线分隔 + 稍微提亮，让它看起来是"补充说明"而不是又一条奖励。 */
.dy-tip {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}
.dy-tip b { color: var(--accent); font-weight: 700; }

/* ============================================================================
 * 每日商店（2026-10-18）
 * ----------------------------------------------------------------------------
 * 5 张背面朝上的卡：点一下翻开，才看得到品质和价格（用户要求）。
 * 竖屏/手机上 5 列会挤，改两列。
 * ========================================================================== */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 6px;
}
@media (max-width: 900px) {
  .shop-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 【两种状态共用同一套外壳】卡面区 + 底部一行，高度天然一致。
 * 以前这里写的是 min-height: 158px —— 背面矮、翻开后高，被用户指出来的。 */
.shop-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  text-align: center;
}

/* 背面：虚线底纹的"牌背"，尺寸和真卡完全一样（同一套 aspect-ratio） */
.shop-card.face { cursor: pointer; }
.sc-back {
  width: 100%;
  aspect-ratio: 3 / 4.15;          /* 和 .card 一致 —— 这是"一样大"的关键 */
  border: 1px dashed var(--line);
  border-radius: 14px;             /* 和 .card 一致 */
  background:
    repeating-linear-gradient(45deg, var(--hi-1) 0 8px, var(--panel-2) 8px 16px);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.shop-card.face:hover .sc-back { border-color: var(--accent); color: var(--accent); }
.sc-q { font-size: 32px; font-weight: 700; line-height: 1; }
.sc-tip { font-size: 10.5px; }
.sc-unknown { color: var(--muted) !important; }

/* 已翻开 */
.shop-card.open {
  border: 1px solid var(--line);
  border-left: 3px solid var(--rc, var(--line));
  background: var(--hi-1);
}
.shop-card.open.legendary { box-shadow: 0 0 0 1px var(--rc) inset; }
.shop-card.open.sold { opacity: .5; }
.sc-stars { font-size: 11px; letter-spacing: 1px; color: var(--rc, var(--muted)); font-weight: 700; }
.sc-nick {
  font-size: 14px; font-weight: 700; color: var(--text);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sc-team { font-size: 10.5px; color: var(--muted); }
.sc-price { font-size: 12px; font-weight: 700; color: var(--accent); margin-top: 2px; }
.sc-bought { font-size: 11px; color: var(--muted); }
.shop-card .btn.dim { opacity: .6; }

/* 体力卡货架 */
.shop-sub {
  margin: 16px 0 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.shop-st { display: flex; flex-direction: column; gap: 8px; }
.shop-st-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 11px; border-radius: 9px; background: var(--hi-1);
}
.sst-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sst-info b { font-size: 12.5px; color: var(--text); }
.sst-info small { font-size: 10.5px; color: var(--muted); }
.sst-price { font-size: 12px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.sst-gone { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* 【翻开之后是"真卡"】2026-10-18 用户要求。
 * 卡片本身有 aspect-ratio，宽度跟着格子走；这里只负责把价格和按钮排到下面。
 * 【别再给 .shop-card.open 加边框/底色】卡片自己有一套（border + 底图），
 * 外面再套一层会看起来像"两张卡叠着"。 */
.shop-card.open {
  display: flex;
  flex-direction: column;
  /* 【必须显式写 stretch】.shop-card 基础样式里有 align-items: center，
   * 子项就不会被拉满宽度 —— 卡片（.card 靠 aspect-ratio 撑高）会塌成 2×3 像素。
   * 这是"翻开之后卡面看不见"的真正原因。 */
  align-items: stretch;
  gap: 8px;
  padding: 0;
  min-height: 0;
  background: none;
  border: none;
  border-radius: 0;
}
.shop-card.open .shop-card-face { width: 100%; cursor: default; }
/* 卡片自己会抬起来（.card:hover），商店里让它别动 —— 它不是"点开详情"的入口 */
.shop-card.open .shop-card-face .card:hover { transform: none; box-shadow: 0 6px 18px var(--sh-2); }
.shop-card.open.sold .shop-card-face { opacity: .45; }
.shop-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  /* 【固定最小高度】价格和按钮那一行，两种状态都要占这么高，否则又会出现
   * "翻开前矮一截"。按钮本身约 28px，给 32 留点余量。 */
  min-height: 32px;
}
.shop-card-missing { font-size: 11px; color: var(--muted); }

/* ============================================================================
 * 唯一识别码（2026-10-18）
 * ----------------------------------------------------------------------------
 * 登录框的「战队名 / 识别码」切换、识别码那一行（等宽 + letter-spacing）.
 * ========================================================================== */
.tm-switch {
  display: flex;
  gap: 6px;
  margin: 4px 0 12px;
  padding: 3px;
  border-radius: 9px;
  background: var(--sunken);
}
.tm-sw {
  flex: 1 1 0;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  border-radius: 7px;
  cursor: pointer;
}
.tm-sw.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 4px var(--sh-2); }
/* 【别引用未定义的 --mono 变量】自测有一条"CSS 里用到的变量必须都有定义"，
 * 它会扫**整份文本**（连注释也算），所以连注释里都不能出现那个写法。
 * 等宽字体直接写字体栈就行。 */
.tm-input-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 1.5px; }
#team-code-hint.ok { color: var(--good, #2e9e5b); }

/* 「我的账号」页里那一行识别码 */
.code-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 2px;
  font-size: 15px;
  font-weight: 700;
}
.warn-text { color: var(--accent); }

/* ============================================================================
 * 对局后的选手战绩表（2026-10-18）
 * ----------------------------------------------------------------------------
 * 放在对局实况最下面。K / D / A / K/D / Rating 六列，双方 10 人。
 * Rating 是模拟值（按 HLTV Rating 3.0 的六项结构估算），1.00 = 平均。
 * 好看/难看的分数只做**轻微**上色，不用红绿大色块 —— 一屏 10 行全红全绿反而看不出重点。
 * ========================================================================== */
.stat-board {
  margin: 12px 0 4px;
  padding: 10px 11px 12px;
  border-radius: 10px;
  background: var(--hi-1);
  border: 1px solid var(--line);
}
.sb-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.sb-title small {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 400;
  color: var(--muted);
}
.stat-board table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.stat-board th {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  text-align: right;
  padding: 4px 6px;
  border-bottom: 1px solid var(--line);
}
.stat-board th:first-child { text-align: left; }
.stat-board td {
  padding: 5px 6px;
  text-align: right;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--line);
}
.stat-board tbody tr:last-child td { border-bottom: none; }
.sb-nick {
  text-align: left !important;
  font-weight: 600;
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 队友和对手用左侧一道细线区分，不用整行换底色 */
.stat-board tr.us .sb-nick { border-left: 3px solid var(--accent); padding-left: 8px; }
.stat-board tr.them .sb-nick { border-left: 3px solid var(--line); padding-left: 8px; }
.sb-rating { font-weight: 700; }
.sb-rating.good { color: var(--good); }
.sb-rating.bad { color: var(--bad); }

/* 战绩面板：标签（图一/图二/图三/总览）+ 左右两队分栏（2026-10-18 改版） */
.sb-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 9px;
}
.sb-tab {
  padding: 5px 11px;
  font-size: 11.5px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
}
.sb-tab:hover { border-color: var(--accent); color: var(--text); }
/* 【选中态不用反白】直接换底色 + 强调边框 —— 避免在深浅主题下比较文字色 */
.sb-tab.on {
  background: var(--hi-1);
  color: var(--text);
  border-color: var(--accent);
  font-weight: 700;
}
.sb-pane { display: none; }
.sb-pane.on { display: block; }

.sb-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 820px) {
  .sb-cols { grid-template-columns: 1fr; }
}
.sb-col { min-width: 0; }
.sb-col table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sb-col.us th { border-bottom: 2px solid var(--accent); }
.sb-col.them th { border-bottom: 2px solid var(--line); }

/* 战绩表每队上面的"我方 / 对手 + 比分 + 胜/负"（2026-10-18） */
.sb-head {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 0 2px 6px;
  font-size: 11.5px;
  color: var(--muted);
}
.sb-head b { font-size: 12.5px; color: var(--text); }
.sb-head.us b { color: var(--accent); }
.sb-head .sb-score {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text);
}
.sb-head .sb-res {
  font-style: normal;
  font-weight: 700;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 11px;
}
.sb-head.win .sb-res { color: var(--good); background: var(--hi-1); }
.sb-head.lose .sb-res { color: var(--bad); background: var(--hi-1); }
.sb-head small { margin-left: auto; font-size: 10.5px; }

/* 标签上的比分 */
.sb-tscore {
  margin-left: 5px;
  font-variant-numeric: tabular-nums;
  opacity: .75;
  font-weight: 600;
}

/* ---- 队伍队徽（2026-10-19）---- */
.logo-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo-preview {
  width: 64px; height: 64px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px; overflow: hidden;
  background: var(--sunken); border: 1px solid var(--line);
}
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.us-logo-letter { font-size: 26px; font-weight: 800; color: var(--muted); }
.logo-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.logo-picker {
  margin-top: 12px; padding: 10px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px; max-height: 260px; overflow: auto;
  background: var(--sunken); border: 1px solid var(--line); border-radius: 10px;
}
.logo-cell {
  width: 100%; aspect-ratio: 1 / 1; padding: 6px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); cursor: pointer;
}
.logo-cell:hover { border-color: var(--accent); }
.logo-cell.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.logo-cell img { width: 100%; height: 100%; object-fit: contain; }
/* ---- Major 面板（2026-10-19）---- */
/* 【两栏等宽】2026-10-19 用户反馈：右边的 Major 面板太窄，
 * 要和左边的赛事面板一样大。
 * 左栏里本来是 .match-grid 的两列（每列 538px），在这个页面改成单列，
 * 让赛事面板撑满左半边 —— 这样两边就一样宽了。 */
.tourney-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.tourney-cols #match-kit .match-grid { grid-template-columns: minmax(0, 1fr); }
/* Major 和历届四强装在同一个右栏里 —— 否则网格会把第三块排到第二行第一列，
 * 也就是跑到"赛事面板下面"去（2026-10-19 用户指出）。 */
.major-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
#major-panel, #major-history { width: 100%; }
@media (max-width: 1100px) { .tourney-cols { grid-template-columns: minmax(0, 1fr); } }
.major-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.major-champ { margin: 10px 0; font-size: 15px; }
.major-stage { margin-top: 8px; border: 1px solid var(--line); border-radius: 9px; padding: 6px 9px; background: var(--sunken); }
.major-stage > summary { cursor: pointer; font-weight: 600; }
.major-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
.major-table th, .major-table td { text-align: left; padding: 3px 6px; border-top: 1px solid var(--line); }
.major-table tr.adv td { color: var(--accent); font-weight: 600; }
.major-mt { font-size: 12px; padding: 2px 0; color: var(--muted); }
.major-round > summary { font-size: 12px; cursor: pointer; color: var(--muted); margin-top: 4px; }

/* ---- Major 开赛时间 / 历届四强（2026-10-19）---- */
.major-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.major-actions .btn[disabled] { opacity: .75; cursor: default; }
.major-start { margin: 10px 0; padding: 9px 11px; border-radius: 9px;
  background: var(--sunken); border: 1px solid var(--line); font-size: 14px; }
.major-hist { border-top: 1px solid var(--line); padding: 8px 0; }
.major-hist:first-child { border-top: 0; }
.major-hist-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.major-hist-list { margin: 5px 0 0 18px; padding: 0; font-size: 12px; color: var(--muted); }
.major-hist-list li { margin: 2px 0; }

/* ---- Major 对阵图（2026-10-19）---- */
.major-bracket { display: flex; gap: 10px; margin: 10px 0; overflow-x: auto; align-items: flex-start; }
.mb-col { flex: 1 1 0; min-width: 120px; display: flex; flex-direction: column; gap: 8px; }
.mb-title { font-size: 11px; color: var(--muted); text-align: center; padding-bottom: 2px; }
.mb-mt { border: 1px solid var(--line); border-radius: 8px; background: var(--sunken); overflow: hidden; }
.mb-row { display: flex; justify-content: space-between; gap: 6px; padding: 5px 8px; font-size: 12px; }
.mb-row + .mb-row { border-top: 1px solid var(--line); }
.mb-row.win { font-weight: 700; color: var(--accent); }
.mb-row b { font-variant-numeric: tabular-nums; }
.mb-champ .mb-final { background: var(--tint-g-weak); }
.major-prev > summary { cursor: pointer; font-weight: 600; font-size: 13px; }

/* ---- Major 对阵图（复用 BLAST 那套 .br-* 结构）---- */
.major-bracket-scroll { overflow-x: auto; padding-bottom: 4px; }
.major-bracket-scroll .br-tree { min-width: 600px; }
.major-bracket-scroll .bracket { margin: 0; }

/* ---- Major 瑞士轮图（队名三字母文字框）2026-10-19 ----
 * 【用户要求】原来图标位置放的是**圆形队标**，现在改成**文字框**：
 *   只显示队名前三个字母，鼠标悬停看全称（title）。
 * 所以这里把 .sw-ic 的圆形尺寸覆盖成一个小方框，并把比赛格加宽一点，
 * 让 "ABC VS DEF" 放得下。 */
.major-swiss-scroll { overflow-x: auto; padding: 4px 0 6px; }
/* 【宽度绝不改】2026-10-19 踩过：为了让文字框放得下把 --sw-match-w 从 52px
 * 加到 96px，结果 BLAST 那套按 52px 精确调过的列高/结果框对齐全乱了
 * （用户看到"晋级区与淘汰区显示异常"）。现在**保持原始几何**，
 * 文字框自己缩进 52px 的格子里（见 script 里 SWISS_ABBR 的分支）。 */
/* 【宽度按"两边都是三个汉字"算】2026-10-19 用户要求：
 * 红魔馆 vs 大黑猫 这种三字队名也要完整显示，不能被裁。
 *   一个字 8.5px × 3 = 25.5  +  左右 padding 4  +  边框 2  ≈ 32
 *   两个框 32 × 2 = 64  +  中间 gap 4  +  比赛格 padding 8  ≈ 76 → 取 80px 留余量
 * 只动宽度，不动高度和列间距（那两样才是对齐的关键）。 */
/* 【变量必须设在 .sw-bracket 上】它自己就定义了 --sw-match-w: 52px，
 * 设在更外层（.major-swiss-scroll）会被它内部的定义盖掉（踩过一次）。 */
.major-swiss-scroll .sw-bracket { --sw-match-w: 80px; }

.major-swiss-scroll .sw-ic.abbr {
  width: auto; min-width: 0; height: 13px;
  padding: 0 2px; margin: 0;
  border-radius: 3px;
  font-size: 8.5px; font-weight: 700; letter-spacing: .2px;
  line-height: 1; white-space: nowrap;
  color: var(--text); background: var(--sunken);
  border: 1px solid var(--line);
  overflow: hidden;
}
.major-swiss-scroll .sw-ic.abbr.us { border-color: var(--accent); color: var(--accent); }
.major-swiss-scroll .sw-ic.abbr.q-adv { border-color: var(--good); color: var(--good); }
.major-swiss-scroll .sw-ic.abbr.q-out { border-color: var(--bad); color: var(--bad); opacity: .7; }
/* 结果框（绿/红）里的格子也要放得下 */
.major-swiss-scroll .sw-box .sw-pairs { gap: 3px; }

/* 决赛对阵图里"冠军"那一列：只有一个队条，不要 VS、不要空对手 */
.br-champ { width: 100%; max-width: var(--br-match-max, 168px); display: flex; }
.br-champ .br-team { width: 100%; }

/* ---- 身份板块里的两个码（2026-10-20 从独立面板并进来）---- */
.id-line {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 8px; padding: 8px 10px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line); border-radius: 8px;
}
.id-line .id-label { font-size: 12px; color: var(--muted); min-width: 68px; }
.id-line .pass-val { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.id-line .btn { flex-shrink: 0; }
.id-line .id-input {
  flex: 1; min-width: 0; padding: 6px 9px; font: inherit; font-size: 13px;
  color: var(--text); background: rgba(0, 0, 0, .22);
  border: 1px solid var(--line); border-radius: 7px;
}
.id-line .id-input:disabled { opacity: .5; }


/* ---- 赛训页 · 默契培养（2026-10-21）---- */
.syn-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 6px 0 10px; }
.syn-total { display: flex; flex-direction: column; align-items: center; min-width: 92px; }
.syn-total b { font-size: 30px; line-height: 1.1; color: var(--accent); }
.syn-total span { font-size: 11px; color: var(--muted); }
.syn-breakdown { flex: 1; min-width: 220px; }
.syn-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.syn-row span { color: var(--muted); }
.syn-bar { height: 6px; border-radius: 4px; background: var(--track); overflow: hidden; margin-bottom: 12px; }
.syn-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width .3s; }
.syn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.syn-card { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; text-align: center; }
.syn-card b { display: block; font-size: 17px; }
.syn-card span { font-size: 11px; color: var(--muted); }

/* ---- Major 暂停态（2026-10-20）---- */
/* 只显示一句状态：图标 + "比赛暂停" + 副标题 */
.major-paused {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 42px 16px; text-align: center;
}
.major-paused .mp-ic { font-size: 34px; line-height: 1; opacity: .8; }
.major-paused b { font-size: 17px; letter-spacing: .5px; }
.major-paused p { margin: 0; font-size: 13px; color: var(--muted); }

/* ---- 称号（2026-10-20）---- */
/* 名字后面那个小标签：排行榜 / 好友对战 / 天梯匹配共用 */
.lb-title {
  font-style: normal; margin-left: 5px; padding: 1px 5px;
  font-size: 10px; font-weight: 700; line-height: 1.5;
  border: 1px solid currentColor; border-radius: 4px;
  opacity: .95; cursor: help; vertical-align: 1px;
}
/* 我的账号 → 我的称号 */
.title-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.title-chip {
  padding: 5px 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--tc, var(--line)); color: var(--tc, var(--text));
  background: transparent; font-size: 12px; font-weight: 700;
  font-family: inherit;
}
.title-chip:hover { background: rgba(255, 255, 255, .06); }
.title-chip.on { background: var(--tc, var(--accent)); color: var(--on-accent); border-color: transparent; }
.title-chip.clear { --tc: var(--muted); color: var(--muted); font-weight: 400; }

/* ---- 排行榜上的 Major 冠军奖杯（2026-10-19）---- */
.lb-cup {
  font-style: normal; margin-left: 4px; font-size: 12px; line-height: 1;
  cursor: help; vertical-align: 1px;
}
.lb-cup:hover { filter: brightness(1.15); }

/* ---- 上一届 Major 的大收纳框（2026-10-19）----
 * 用户要求：按「26-10-19 上海 Major」这样分类收纳，点开才看对阵图。 */
.major-last-fold {
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); overflow: hidden;
}
.major-last-fold > summary {
  cursor: pointer; padding: 11px 13px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 14px; font-weight: 700;
}
.major-last-fold > summary::-webkit-details-marker { margin-right: 2px; }
.major-last-fold > summary .mlf-day {
  font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600;
}
.major-last-fold > summary .mlf-name { flex: 1 1 auto; }
.major-last-fold > summary .mlf-champ { color: var(--accent); font-size: 12px; font-weight: 600; }
.major-last-fold > summary .when-closed,
.major-last-fold > summary .when-open { font-size: 11px; font-weight: 400; color: var(--muted); }
.major-last-fold > summary .when-open { display: none; }
.major-last-fold[open] > summary { border-bottom: 1px solid var(--line); }
.major-last-fold[open] > summary .when-closed { display: none; }
.major-last-fold[open] > summary .when-open { display: inline; }
.major-last-inner { padding: 10px 13px 12px; display: flex; flex-direction: column; gap: 8px; }

/* ===== 唱片机（装饰） 2026-10-23 ===== */
#player-card .player-compact{display:flex;align-items:center;gap:14px;padding:4px 0}
.pv-disc{width:56px;height:56px;border-radius:50%;flex:0 0 56px;
  background:repeating-radial-gradient(circle at 50% 50%,var(--hi-2) 0 2px,var(--bg) 2px 4px);
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 0 0 2px var(--line),0 4px 12px var(--shadow, transparent)}
.pv-disc span{width:20px;height:20px;border-radius:50%;background:var(--accent);
  color:var(--on-solid);font-size:9px;font-weight:900;display:flex;align-items:center;justify-content:center}
.pv-disc.spin{animation:pvspin 3.2s linear infinite}
@keyframes pvspin{to{transform:rotate(360deg)}}
.player-meta{flex:1;min-width:0}
.player-meta b{display:block;font-size:15px}
.player-meta small{color:var(--muted);font-size:12px}
#player-float{position:fixed;right:18px;bottom:18px;width:280px;z-index:9999;
  background:var(--panel);border:1px solid var(--line);border-radius:16px;
  padding:14px;box-shadow:0 12px 40px var(--shadow, transparent)}
#player-float .pf-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}
#player-float .pf-head button{background:none;border:none;color:var(--muted);font-size:20px;cursor:pointer}
.pf-disc{width:96px;height:96px;margin:0 auto 10px;border-radius:50%;
  background:repeating-radial-gradient(circle at 50% 50%,var(--hi-2) 0 3px,var(--bg) 3px 6px);
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 0 0 3px var(--line),0 8px 24px var(--shadow, transparent)}
.pf-disc span{width:34px;height:34px;border-radius:50%;background:var(--accent);
  color:var(--on-solid);font-size:13px;font-weight:900;display:flex;align-items:center;justify-content:center}
.pf-disc.spin{animation:pvspin 3.2s linear infinite}
.pf-title{font-weight:800;text-align:center;font-size:14px}
.pf-sub{color:var(--muted);text-align:center;font-size:11px;margin-bottom:8px}
.pf-bar{height:4px;background:var(--line);border-radius:2px;overflow:hidden;margin:8px 0 4px}
.pf-bar i{display:block;height:100%;width:0;background:var(--accent);transition:width .4s linear}
.pf-time{display:flex;justify-content:space-between;font-size:10px;color:var(--muted)}
.pf-ctrl{display:flex;gap:6px;margin-top:10px}
.pf-ctrl button{flex:1;padding:8px 0;border-radius:10px;border:1px solid var(--line);
  background:transparent;color:var(--text);font-size:13px;cursor:pointer}
.pf-ctrl button:hover{background:var(--hi-1)}
#pf-play{background:var(--accent);color:var(--on-solid);border-color:var(--accent);font-weight:800}
.pf-list{margin-top:10px;max-height:170px;overflow-y:auto;border-top:1px solid var(--line);padding-top:8px}
.pf-list div{padding:6px 4px;font-size:12px;cursor:pointer;border-radius:6px}
.pf-list div:hover{background:var(--hi-1)}
.pf-list div.on{color:var(--accent);font-weight:800}
@media (max-width:820px){#player-float{right:10px;left:10px;width:auto;bottom:10px}}

/* ===== 唱片机：悬浮球 + 面板（2026-10-23） ===== */
#pv-ball{position:fixed;right:18px;bottom:96px;width:52px;height:52px;border-radius:50%;
  border:none;cursor:pointer;z-index:9998;
  background:repeating-radial-gradient(circle at 50% 50%,var(--hi-2) 0 2px,var(--bg) 2px 4px);
  box-shadow:0 0 0 2px var(--line),0 8px 22px var(--shadow,transparent)}
#pv-ball .pv-hole{position:absolute;left:50%;top:50%;width:16px;height:16px;margin:-8px 0 0 -8px;
  border-radius:50%;background:var(--accent)}
#pv-ball.spin{animation:pvspin 3.2s linear infinite}
@keyframes pvspin{to{transform:rotate(360deg)}}
#pv-box{position:fixed;right:18px;bottom:160px;width:270px;z-index:9999;
  background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:14px;
  box-shadow:0 14px 40px var(--shadow,transparent)}
#pv-box .pv-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
#pv-box .pv-head button{background:none;border:none;color:var(--muted);font-size:20px;cursor:pointer}
.pv-disc{width:92px;height:92px;margin:0 auto 10px;border-radius:50%;
  background:repeating-radial-gradient(circle at 50% 50%,var(--hi-2) 0 3px,var(--bg) 3px 6px);
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 0 0 3px var(--line)}
.pv-disc span{width:32px;height:32px;border-radius:50%;background:var(--accent);
  color:var(--on-solid);font-size:12px;font-weight:900;
  display:flex;align-items:center;justify-content:center}
.pv-disc.spin{animation:pvspin 3.2s linear infinite}
.pv-title{font-weight:800;text-align:center;font-size:13px}
.pv-sub{color:var(--muted);text-align:center;font-size:11px;margin-bottom:6px}
.pv-bar{height:4px;background:var(--line);border-radius:2px;overflow:hidden;margin:8px 0 4px}
.pv-bar i{display:block;height:100%;width:0;background:var(--accent);transition:width .4s linear}
.pv-time{display:flex;justify-content:space-between;font-size:10px;color:var(--muted)}
.pv-ctrl{display:flex;gap:6px;margin-top:10px}
.pv-ctrl button{flex:1;padding:7px 0;border-radius:10px;border:1px solid var(--line);
  background:transparent;color:var(--text);font-size:13px;cursor:pointer}
.pv-ctrl button:hover{background:var(--hi-1)}
#pv-play{background:var(--accent);color:var(--on-solid);border-color:var(--accent);font-weight:800}
.pv-list{margin-top:10px;max-height:160px;overflow-y:auto;border-top:1px solid var(--line);padding-top:8px}
.pv-list div{padding:6px 4px;font-size:12px;cursor:pointer;border-radius:6px}
.pv-list div:hover{background:var(--hi-1)}
.pv-list div.on{color:var(--accent);font-weight:800}
.pv-sw{position:relative;display:inline-block;width:46px;height:26px;flex:0 0 46px}
.pv-sw input{opacity:0;width:0;height:0}
.pv-sw i{position:absolute;inset:0;border-radius:999px;background:var(--line);transition:.2s}
.pv-sw i::after{content:"";position:absolute;left:3px;top:3px;width:20px;height:20px;
  border-radius:50%;background:var(--panel);transition:.2s}
.pv-sw input:checked + i{background:var(--accent)}
.pv-sw input:checked + i::after{transform:translateX(20px)}
@media (max-width:820px){#pv-box{right:10px;left:10px;width:auto;bottom:150px}#pv-ball{right:14px;bottom:88px}}

/* ===== 播放器横条（覆盖竖版样式） 2026-10-23 ===== */
#pv-box{display:flex;align-items:center;gap:12px;width:auto;max-width:min(640px,94vw);
  padding:10px 14px;border-radius:999px;flex-wrap:wrap}
#pv-box .pv-disc{width:52px;height:52px;margin:0;flex:0 0 52px}
#pv-box .pv-disc span{width:20px;height:20px;font-size:9px}
#pv-box .pv-meta{flex:1;min-width:140px}
#pv-box .pv-meta b{display:block;font-size:14px;text-align:left}
#pv-box .pv-meta small{color:var(--muted);font-size:11px;text-align:left}
#pv-box .pv-bar{margin:5px 0 0;height:3px}
#pv-box .pv-time{display:none}
#pv-box .pv-ctrl{display:flex;gap:6px;margin:0}
#pv-box .pv-ctrl button{width:38px;height:38px;padding:0;border-radius:50%;
  display:flex;align-items:center;justify-content:center;font-size:15px}
#pv-list-btn{padding:7px 14px;border-radius:999px;border:1px solid var(--accent);
  background:transparent;color:var(--accent);font-weight:800;font-size:12px;cursor:pointer;white-space:nowrap}
#pv-list-btn:hover{background:var(--tint-a-weak)}
#pv-box .pv-vol{display:flex;align-items:center;gap:6px;min-width:92px}
#pv-box .pv-vol i{flex:1;height:4px;border-radius:2px;background:var(--accent);position:relative}
#pv-box .pv-vol i::after{content:"";position:absolute;right:0;top:50%;transform:translateY(-50%);
  width:8px;height:8px;border-radius:50%;background:var(--panel);box-shadow:0 0 0 2px var(--accent)}
#pv-box .pv-list{position:absolute;left:0;right:0;bottom:100%;margin-bottom:8px;
  background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:8px;
  max-height:200px;overflow-y:auto}

/* ===== 播放器横条 2026-10-23 ===== */
#pv-box{display:flex;align-items:center;gap:12px;width:auto;max-width:min(660px,94vw);
  padding:10px 14px;border-radius:999px;flex-wrap:wrap}
#pv-box .pv-disc{width:52px;height:52px;margin:0;flex:0 0 52px}
#pv-box .pv-disc span{width:20px;height:20px;font-size:9px}
#pv-box .pv-meta{flex:1;min-width:150px}
#pv-box .pv-meta b{display:block;font-size:14px;text-align:left}
#pv-box .pv-meta small{color:var(--muted);font-size:11px;text-align:left}
#pv-box .pv-bar{margin:5px 0 0;height:3px}
#pv-box .pv-ctrl{display:flex;gap:6px;margin:0}
#pv-box .pv-ctrl button{width:38px;height:38px;padding:0;border-radius:50%;
  display:flex;align-items:center;justify-content:center;font-size:15px}
#pv-list-btn{padding:7px 14px;border-radius:999px;border:1px solid var(--accent);
  background:transparent;color:var(--accent);font-weight:800;font-size:12px;cursor:pointer;white-space:nowrap}
#pv-list-btn:hover{background:var(--tint-a-weak)}
#pv-box .pv-vol{display:flex;align-items:center;gap:6px;min-width:96px}
#pv-box .pv-vol i{flex:1;height:4px;border-radius:2px;background:var(--line);position:relative}
#pv-box .pv-vol i::before{content:"";position:absolute;left:0;top:0;bottom:0;width:70%;
  border-radius:2px;background:var(--accent)}
#pv-box .pv-vol i::after{content:"";position:absolute;left:70%;top:50%;transform:translate(-50%,-50%);
  width:9px;height:9px;border-radius:50%;background:var(--panel);box-shadow:0 0 0 2px var(--accent)}
#pv-box .pv-list{position:absolute;left:0;right:0;bottom:100%;margin-bottom:8px;
  background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:8px;
  max-height:200px;overflow-y:auto}

/* ===== 播放器横条：固定尺寸（内容变化不改高矮） 2026-10-23 ===== */
#pv-box{
  width:min(660px,94vw);
  height:88px;
  box-sizing:border-box;
  padding:0 14px;
  overflow:hidden;
  align-items:center;
  flex-wrap:nowrap;
}
#pv-box .pv-meta{min-width:0;overflow:hidden}
#pv-box .pv-meta b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  line-height:1.25;max-height:1.25em}
#pv-box .pv-meta small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
#pv-box .pv-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#pv-box .pv-ctrl,#pv-box .pv-vol,#pv-list-btn{flex:0 0 auto}

/* 音量条：拖动时用渐变填充（--v 由 JS 设置） */
#pv-box .pv-vol i{cursor:pointer;touch-action:none}
#pv-box .pv-vol i::before{display:none}

/* 音量条圆点（真实元素，JS 直接设 left） 2026-10-23 */
#pv-box .pv-vol i::after{display:none}
#pv-box .pv-vol i b{position:absolute;left:70%;top:50%;transform:translate(-50%,-50%);
  width:10px;height:10px;border-radius:50%;background:var(--panel);
  box-shadow:0 0 0 2px var(--accent);pointer-events:none}

/* 播放器：点哪儿都不出现文本光标 / 选中高亮 2026-10-23 */
#pv-box,#pv-box *,#pv-ball,#pv-ball *{
  -webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;
  caret-color:transparent;-webkit-tap-highlight-color:transparent;
}
#pv-box *:focus,#pv-ball:focus{outline:none}
#pv-box .pv-list,#pv-box .pv-list *{user-select:auto;-webkit-user-select:auto}

/* ============================================================================
 * 【我的编队】+【汰换模拟】2026-10-29
 * ---------------------------------------------------------------------------- */
.lineup-list { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 10px; }
.lineup-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 8px;
  background: var(--panel-2);
}
.lineup-item.on { box-shadow: inset 0 0 0 1px var(--accent); }
.lineup-item .lineup-sub {
  flex: 1; min-width: 0; font-size: 12px; opacity: .72;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lineup-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lineup-tools .tm-input { flex: 1; min-width: 140px; }

.redeem-tier {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 10px; margin: 8px 0; border-radius: 10px;
  background: var(--panel-2);
}
.redeem-tier .rt-main { flex: 1; min-width: 200px; }
.redeem-tier .rt-main b { display: block; }
.redeem-tier .rt-main small { display: block; opacity: .72; margin-top: 2px; }
.redeem-tier select { max-width: 260px; }
