/* ============================================================
   好友杀 样式表（单文件）
   结构索引（按出现顺序）：
     通用 → 首页 → 卡牌 → 对局 → 弹窗 → 图鉴 → 武将卡片墙
     → 详情页 → 页面：广场/设置/帮助/隐私/反馈/战绩 → 手机端适配
   改版面前先搜类名（.plate / .hand / .wcard / .modal / .cg-title），
   不要靠行号定位——同特异性的规则后写的赢，改错位置会静默失效。
   ============================================================ */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(ellipse at 50% -10%, #3a2d1f 0%, #211a12 45%, #15120d 100%);
  color: #e8e2d6;
  overflow: hidden; user-select: none;
}
#app { height: 100%; overflow: hidden; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; border: none; }

/* ---------- 通用 ---------- */
.page { height: 100%; overflow-y: auto; padding: 16px; padding-bottom: 32px; }
.page-title {
  font-size: 18px; font-weight: 600; margin: 0 0 14px; color: #f0c870;
  display: flex; align-items: center; gap: 8px;
  text-shadow: 0 1px 6px rgba(240,200,112,.25);
}
.back-btn {
  background: rgba(255,255,255,.06); color: #cfd3d9; font-size: 13px;
  padding: 7px 14px; margin-bottom: 8px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.14); cursor: pointer;
}
.back-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.back-btn:active { background: rgba(255,255,255,.18); }

.btn-primary {
  background: linear-gradient(#c0392b, #96281b); color: #fff;
  border-radius: 10px; padding: 13px 18px; font-size: 15px; font-weight: 500;
  width: 100%; margin-bottom: 10px;
}
.btn-primary:active { transform: translateY(1px); }
.btn-second {
  background: rgba(255,255,255,.08); color: #e8e2d6;
  border-radius: 10px; padding: 13px 18px; font-size: 15px; width: 100%; margin-bottom: 10px;
}
.btn-small {
  background: rgba(255,255,255,.1); color: #e8e2d6;
  border-radius: 8px; padding: 8px 12px; font-size: 13px;
}
.btn-danger { background: #c0392b; color: #fff; border-radius: 8px; padding: 8px 12px; font-size: 13px; }

/* ---------- 首页 ---------- */
/* 合照背景：照片铺满卡片、人物头顶贴近卡片顶边（等于把原版顶部裁掉一块），
   标题/副标题/按钮保持原版相对位置不动 */
.page.home-page { padding-top: 0; }
.home-logo {
  position: relative; text-align: center;
  max-width: 420px; margin: 0 auto; padding: 75px 14px 18px;
  border-radius: 14px; overflow: hidden;
  background: url('../img/group-photo.webp?v=20261121b') center top / cover no-repeat;
  box-shadow: 0 4px 18px rgba(0,0,0,.45), inset 0 0 0 1px rgba(232,200,122,.25);
}
.home-logo::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(180deg,
    rgba(18,14,6,0) 0%, rgba(18,14,6,.08) 32%,
    rgba(18,14,6,.45) 58%, rgba(18,14,6,.78) 100%);
}
.home-logo > * { position: relative; z-index: 1; }
/* 标题毛笔楷书字体（霞鹜文楷 TC 粗体，OFL 开源可商用，仅含"好友殺"3 字，1.8KB） */
@font-face {
  font-family: 'MaoBi';
  src: url('../fonts/TitleFont.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
/* 标题+版本号外层：给版本号预留右侧空间，避免与「殺」字重叠 */
.home-logo .title-wrap {
  position: relative; display: inline-block; padding-right: 40px;
}
.home-logo h1 {
  font-family: 'MaoBi', "STXingkai", "华文行楷", "STLiti", "华文隶书", "LiSu", "隶书", "STKaiti", "华文楷体", "KaiTi", "楷体", serif;
  font-size: 64px; letter-spacing: 12px; margin: 0; font-weight: 700;
  background: linear-gradient(180deg, #fdf3c0 0%, #f5d97a 35%, #d4a017 60%, #a87708 78%, #f0d080 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.55)) drop-shadow(0 0 12px rgba(240,200,112,.35));
  position: relative; display: inline-block;
}
/* 版本号：普通小字，固定 11px，不随标题缩放 */
.home-logo .ver-badge {
  position: absolute; right: 2px; bottom: 4px;
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 11px; line-height: 1; font-weight: 400; letter-spacing: 0;
  color: #cfc4a4; text-shadow: 0 1px 2px rgba(0,0,0,.6); filter: none;
}
@media (max-width: 420px) {
  .home-logo { padding: 59px 10px 14px; }
  .home-logo h1 { font-size: 46px; letter-spacing: 8px; }
  .home-logo .title-wrap { padding-right: 34px; }
}
.home-logo .logo-chapter {
  margin: 12px 0 0; color: #ecd9a0; font-size: 13px; letter-spacing: 4px; font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,.7);
}
.home-logo .logo-sub {
  margin: 8px 0 0; color: #b8a87f; font-size: 13px; letter-spacing: 3px;
}
.home-logo .logo-ver { margin: 6px 0 0; color: #6d6450; font-size: 11px; letter-spacing: 1px; }
.home-menu .home-foot {
  text-align: center; color: #6d6450; font-size: 11px; letter-spacing: 1px; margin-top: 16px;
}
.home-menu { max-width: 420px; margin: 0 auto; padding: 0 20px; }
.home-menu .btn-primary {
  background: linear-gradient(135deg, #d4a017 0%, #b8860b 50%, #9a6d0a 100%);
  border: 1px solid #e8c87a; box-shadow: 0 3px 12px rgba(212,160,23,.35);
  font-weight: 600; letter-spacing: 2px;
}
.home-menu .btn-second {
  background: rgba(255,255,255,.05); border: 1px solid rgba(240,200,112,.18);
  color: #e8d9a8; letter-spacing: 1px;
}

/* ---------- 卡牌 ---------- */
.card-mini {
  display: inline-flex; flex-direction: column; justify-content: space-between;
  width: 62px; height: 86px; border-radius: 7px; background: #fdfaf3;
  border: 1px solid #cbbf9f; padding: 4px 5px; flex: 0 0 auto;
  box-shadow: 0 2px 6px rgba(0,0,0,.4); position: relative;
}
.card-mini .cm-top { font-size: 13px; line-height: 1; font-weight: 600; }
.card-mini .cm-name { font-size: 12px; text-align: center; color: #2b2b2b; line-height: 1.15; font-weight: 500; }
.card-mini .cm-bottom { font-size: 11px; align-self: flex-end; transform: rotate(180deg); }
.card-mini.red { color: #c0392b; }
.card-mini.black { color: #222; }
.card-mini.equip { background: #f2ead6; }
.card-mini.sel { outline: 2px solid #e8c87a; transform: translateY(-8px); }
.card-mini.dim { opacity: .38; }

.card-row { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; }
.card-row::-webkit-scrollbar { height: 4px; }
.card-row::-webkit-scrollbar-thumb { background: #444; border-radius: 2px; }

/* ---------- 对局 ---------- */
.game-root { height: 100%; display: flex; flex-direction: column; background: #20242a; }
.skill-banner {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(90deg, #7a4a1a, #c0392b, #7a4a1a);
  color: #fff; font-size: 14px; font-weight: 600; padding: 8px 20px; border-radius: 20px;
  z-index: 300; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s;
  box-shadow: 0 4px 16px rgba(192,57,43,.5); white-space: nowrap;
}
.skill-banner.on { opacity: 1; transform: translateX(-50%) translateY(0); }
/* 中央阶段提示横幅（不挡手牌与武将） */
.phase-banner {
  position: fixed; top: 34%; left: 50%; transform: translateX(-50%) scale(.9);
  background: linear-gradient(90deg, rgba(60,40,15,.92), rgba(120,60,20,.92), rgba(60,40,15,.92));
  border: 1px solid rgba(232,200,122,.5); color: #f0d8a0;
  font-size: 16px; font-weight: 700; letter-spacing: 2px;
  padding: 10px 28px; border-radius: 10px; z-index: 290;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
  max-width: 86vw; white-space: normal; line-height: 1.45; text-align: center;
}
.phase-banner.on { opacity: 1; transform: translateX(-50%) scale(1); }
/* 多行效果（V1.7.0）：一次结算的每一步各占一行，行间用细线分开，字号略收小 */
.phase-banner .pb-line { font-size: 14px; letter-spacing: 1px; }
.phase-banner .pb-line + .pb-line { margin-top: 4px; padding-top: 4px; border-top: 1px solid rgba(232,200,122,.16); }
.phase-banner .pb-more { font-size: 12px; font-weight: 600; color: rgba(240,216,160,.6); }
/* 弃牌提示（#41）：中央偏下，用牌形卡片列出弃了什么，停留时间比普通横幅长 */
.discard-banner {
  position: fixed; left: 50%; top: 45%; transform: translateX(-50%) translateY(8px);
  /* z-index 必须高于效果横幅（290）：弃牌这一下常跟在一串战报后面，
     压在下面就被横幅整块盖住，玩家只看到「弃置 N 张」却看不到牌 */
  z-index: 292; opacity: 0; pointer-events: none; width: max-content; max-width: 88vw;
  background: rgba(16,18,22,.94); border: 1px solid rgba(232,200,122,.45);
  border-radius: 10px; padding: 8px 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.55);
  transition: opacity .22s, transform .22s;
}
.discard-banner.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.discard-banner .db-head {
  font-size: 12px; color: #cfd3d8; text-align: center; letter-spacing: 1px; margin-bottom: 6px;
}
.discard-banner .db-cards { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.discard-banner .db-card {
  font-size: 13px; font-weight: 700; color: #eceff3;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16);
  border-radius: 6px; padding: 3px 8px; white-space: nowrap;
}
.discard-banner .db-card.red { color: #e05555; }
/* 当前阶段常驻徽标（手牌区上方，直到下一阶段切换） */
.phase-badge {
  position: fixed; left: 50%; bottom: 216px; transform: translateX(-50%);
  background: rgba(30,22,10,.85); border: 1px solid rgba(232,200,122,.45);
  color: #e8c87a; font-size: 13px; font-weight: 700; letter-spacing: 1px;
  padding: 3px 14px; border-radius: 999px; z-index: 285;
  opacity: 0; pointer-events: none; transition: opacity .2s;
  text-shadow: 0 1px 3px rgba(0,0,0,.8); white-space: nowrap;
}
.phase-badge.on { opacity: 1; }
.g-top {
  flex: 0 0 auto; padding: 8px 12px; background: #191c21;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.g-body { flex: 1 1 auto; display: flex; min-height: 0; }
.g-main { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.g-side {
  flex: 0 0 218px; display: flex; flex-direction: column; min-height: 0;
  background: #171a1f; border-left: 1px solid rgba(255,255,255,.08); padding-top: 6px;
}
.g-play { flex: 1 1 auto; position: relative; overflow: hidden; }
/* 左侧浮动操作区（结束出牌按钮 / 状态提示，位于武将旁空白处） */
.float-actions { position: absolute; left: 14px; top: 30%; z-index: 5; }
.btn-float {
  background: linear-gradient(#c0392b, #96281b); color: #fff;
  border: 1px solid rgba(232,200,122,.5); border-radius: 10px;
  padding: 12px 20px; font-size: 15px; font-weight: 600; letter-spacing: 2px;
  box-shadow: 0 3px 12px rgba(192,57,43,.45);
}
.btn-float:active { transform: translateY(1px); }
.float-tip {
  font-size: 12px; color: #e8c87a; background: rgba(0,0,0,.45);
  padding: 6px 10px; border-radius: 8px; max-width: 220px; line-height: 1.5;
}
/* 回合出牌记录（含花色点数，最多10条） */
.turn-history {
  position: absolute; left: 14px; top: 12px; z-index: 4; width: 240px;
  background: rgba(0,0,0,.35); border: 1px solid rgba(232,200,122,.25); border-radius: 8px;
  overflow: hidden;
}
.th-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11px; color: #e8c87a; padding: 4px 10px;
  border-bottom: 1px solid rgba(232,200,122,.18); font-weight: 600;
}
.th-log-btn {
  display: none; background: rgba(232,200,122,.1); color: #e8c87a;
  border: 1px solid rgba(232,200,122,.3); border-radius: 6px;
  padding: 3px 9px; font-size: 11px; white-space: nowrap;
}
/* 手机端：战报抽屉收起时，牌堆张数改在这里显示 */
.th-deck { display: none; font-size: 11px; color: #9aa0a8; font-weight: 400; flex: 1 1 auto; text-align: right; }
.th-list { max-height: 200px; overflow-y: auto; padding: 4px 10px; }
.th-item { font-size: 11.5px; color: #cfd3da; padding: 2px 0; line-height: 1.5; }
.th-empty { font-size: 11px; color: #6d7278; padding: 2px 0; }
/* 电脑手牌背面 */
.ai-hand { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; max-width: 220px; }
.card-back {
  width: 26px; height: 36px; border-radius: 4px; flex: 0 0 auto;
  background:
    repeating-linear-gradient(45deg, rgba(232,200,122,.18) 0 3px, transparent 3px 6px),
    linear-gradient(135deg, #6d3a2a, #3a1f16);
  border: 1px solid rgba(232,200,122,.4);
  box-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.g-bottom { flex: 0 0 auto; background: #191c21; border-top: 1px solid rgba(255,255,255,.06); padding: 8px; }

.plate { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.plate-frame {
  width: 58px; height: 58px; border-radius: 8px; border: 2px solid; position: relative;
  flex: 0 0 auto; box-shadow: 0 2px 8px rgba(0,0,0,.5); overflow: hidden;
}
.plate-frame .plate-img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0; box-shadow: none; }
.plate-faction {
  position: absolute; left: 0; top: 0; font-size: 9px; line-height: 1;
  padding: 2px 4px; border-radius: 0 0 5px 0; color: #fff; opacity: .92;
}
.ai-tag {
  font-size: 10px; padding: 1px 5px; border-radius: 4px;
  background: #c0392b; color: #fff; margin-left: 4px;
}
.plate-title { font-size: 10px; color: #8b8f96; font-weight: 400; }
.hp-bar { display: flex; align-items: center; gap: 3px; margin: 3px 0; }
.hp-num { font-size: 10px; color: #9aa0a8; margin-left: 4px; }
/* 体力勾玉：使用官方风格高清素材，颜色跟随势力 */
:root {
  --magatama: url("../img/ui/magatama.png");
  --magatama-empty: url("../img/ui/magatama_empty.png");
}
/* 势力配色（魏蓝、蜀红、吴绿、群银、信红、神金、侪银灰）
   V2.1.1：补上神/侪的勾玉（此前两者没有定义，一直掉回默认绿色）；
   同时给每个势力配同色的「空体力」勾玉，体力上限 > 当前体力时第 N+1 个显示空位。 */
.f-wei { --magatama: url("../img/ui/magatama_wei.png"); --magatama-empty: url("../img/ui/magatama_wei_empty.png"); }
.f-shu { --magatama: url("../img/ui/magatama_shu.png"); --magatama-empty: url("../img/ui/magatama_shu_empty.png"); }
.f-wu  { --magatama: url("../img/ui/magatama_wu.png");  --magatama-empty: url("../img/ui/magatama_wu_empty.png"); }
.f-qun { --magatama: url("../img/ui/magatama_qun.png"); --magatama-empty: url("../img/ui/magatama_qun_empty.png"); }
.f-xin { --magatama: url("../img/ui/magatama_xin.png"); --magatama-empty: url("../img/ui/magatama_shu_empty.png"); filter: saturate(1.2) hue-rotate(-10deg) brightness(.88); }
/* 友势力（第二弹 SP 系列）：复用吴的勾玉图，偏黄绿、压饱和，与吴的青绿一眼可分 */
.f-you { --magatama: url("../img/ui/magatama_wu.png"); --magatama-empty: url("../img/ui/magatama_wu_empty.png"); filter: hue-rotate(-28deg) saturate(1.05) brightness(1.02); }
/* 神势力（第三弹）：官方神武将的金色勾玉 */
.f-shen { --magatama: url("../img/ui/magatama_shen.png"); --magatama-empty: url("../img/ui/magatama_shen_empty.png"); }
/* 侪势力（第四弹）：沿用群势力的银灰，与群同色系（势力条颜色另用 #8b95a6 区分） */
.f-chai { --magatama: url("../img/ui/magatama_chai.png"); --magatama-empty: url("../img/ui/magatama_chai_empty.png"); }
.hp-pip {
  width: 13px; height: 16px; flex: 0 0 auto;
  background: var(--magatama) center/contain no-repeat; border: none;
}
.hp-pip.empty { background: var(--magatama-empty) center/contain no-repeat; box-shadow: none; }
.hero-img {
  width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: 0 0 auto;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.pick-img {
  width: 100%; height: 74px; object-fit: cover; border-radius: 6px; margin-bottom: 6px;
}
.pi-avatar {
  width: 100%; height: 74px; border-radius: 6px; margin-bottom: 6px;
  display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 600; color: #fff;
}
.pick-item.on2 { border-color: #e8c87a; background: rgba(232,200,122,.08); }
.plate-info { flex: 1 1 auto; min-width: 0; }
.plate-name { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; row-gap: 2px; }
.plate-name .faction { font-size: 11px; padding: 1px 5px; border-radius: 4px; color: #fff; opacity: .85; }
/* 状态标记（V1.10.0 · #61）：名字后面的持续效果标签，颜色由 JS 按状态给（逃课/拖延/熬夜…） */
.state-tag {
  font-size: 10px; line-height: 1.5; font-weight: 700; letter-spacing: 0;
  border: 1px solid currentColor; border-radius: 3px;
  padding: 0 4px; white-space: nowrap; vertical-align: 1px;
}
.plate-skills { font-size: 11px; color: #9aa0a8; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 4px; flex-wrap: wrap; }
.skill-chip {
  font-size: 10px; padding: 2px 7px; border-radius: 4px;
  background: rgba(232,200,122,.12); color: #e8c87a; border: 1px solid rgba(232,200,122,.28);
  cursor: pointer; white-space: nowrap;
}
.skill-chip:active { background: rgba(232,200,122,.25); }
.skill-chip.locked {
  background: rgba(128,128,128,.08); color: #6d7278; border: 1px dashed rgba(128,128,128,.35);
  cursor: not-allowed; text-decoration: none;
}
.skill-btn { flex: 0 0 auto; }
.hp-bar-old { display: flex; gap: 3px; margin-top: 4px; }
.hp-pip-old { width: 15px; height: 7px; border-radius: 2px; background: #c0392b; }
.hp-pip-old.empty { background: #3a3f46; }

.equip-zone { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.equip-chip {
  font-size: 10px; padding: 2px 6px; border-radius: 4px;
  background: rgba(232,200,122,.15); color: #e8c87a; border: 1px solid rgba(232,200,122,.3);
}
.judge-zone { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.judge-chip {
  font-size: 10px; padding: 2px 7px; border-radius: 4px;
  color: #fff; border: 1px solid transparent; font-weight: 500;
}
.judge-chip.j-joy { background: rgba(192,57,43,.55); border-color: rgba(192,57,43,.8); }
.judge-chip.j-ration { background: rgba(41,128,185,.55); border-color: rgba(41,128,185,.8); }
.judge-chip.j-lightning { background: rgba(155,89,182,.55); border-color: rgba(155,89,182,.8); }

/* 战报 */
.log-box {
  flex: 1 1 auto; overflow-y: auto; padding: 5px 12px; font-size: 11px; line-height: 1.55;
  color: #b9bec6; min-height: 0;
}
.log-box .lg-line { padding: 1px 0; }
.log-box .lg-line.hl { color: #e8c87a; }
.log-box .lg-line.dmg { color: #e07a5f; }
.log-box .lg-line.lg-skill-desc { color: #9aa3b5; font-size: 11px; padding-left: 10px; opacity: .95; }
.log-toggle { font-size: 11px; color: #6d7278; text-align: center; padding: 3px; }

/* 手牌区 */
.hand-bar { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; }
.hand-bar .card-mini { width: 58px; height: 80px; }
.action-bar { display: flex; gap: 8px; align-items: center; }
.action-bar .btn-small { flex: 0 0 auto; }
.phase-tip { font-size: 12px; color: #e8c87a; margin-bottom: 6px; }

/* ---------- 弹窗 ---------- */
.modal-root { position: fixed; inset: 0; display: none; z-index: 500; }
.modal-root.on { display: block; }
.modal-mask { position: absolute; inset: 0; background: rgba(8,9,11,.97); }
/* 对局页弹窗：不把背景弄暗 */
.modal-mask.clear { background: transparent; }
.modal-panel {
  position: absolute; left: 12px; right: 12px; top: 8vh; bottom: auto;
  margin: 0 auto; max-width: 420px; background: #1e2127; opacity: 1;
  border-radius: 12px; padding: 16px; max-height: 66vh; overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.85);
}
.modal-title { font-size: 15px; font-weight: 600; margin-bottom: 10px; color: #e8c87a; }
.modal-desc { font-size: 13px; color: #9aa0a8; margin-bottom: 12px; line-height: 1.6; }
.modal-actions { display: flex; gap: 10px; margin-top: 14px; }
.modal-actions button { flex: 1; }
.modal-actions.top { margin-top: 0; margin-bottom: 12px; justify-content: flex-end; gap: 8px; }
.modal-actions.top button { flex: 0 0 auto; }
.report-actions-sticky { position: sticky; top: 0; z-index: 6; background: #171a1f; padding: 8px 0; }
.report-actions-bottom { position: sticky; bottom: 0; z-index: 6; background: #171a1f; padding: 8px 0; }

/* 对局弹窗：右上角「战报」入口 + 底部最近战报摘要（V1.3.0） */
.modal-panel { position: absolute; }
.modal-log-btn { position: absolute; right: 10px; top: 10px; z-index: 3; }
.modal-peek {
  margin-top: 10px; padding-top: 8px; border-top: 1px dashed rgba(255,255,255,.12);
  font-size: 12px; color: #8d939c; line-height: 1.55;
}
.modal-peek b { display: block; color: #c9a55a; font-weight: 500; margin-bottom: 2px; }
/* 对局页弹窗靠左：不挡手牌与右侧战报 */
.modal-panel.modal-left {
  left: 16px; right: auto; top: 26vh; bottom: auto; margin: 0;
  max-width: 300px; width: auto; max-height: 56vh;
}
.btn-mini {
  border-radius: 6px; padding: 4px 12px; font-size: 12px; font-weight: 500;
}
.btn-mini.primary { background: #c0392b; color: #fff; }
.btn-mini.ghost { background: rgba(255,255,255,.08); color: #b9bec6; }
.opt-list { display: flex; flex-direction: column; gap: 6px; }
.opt-list .opt-item { padding: 8px 12px; font-size: 13px; margin-bottom: 0; width: 100%; border-radius: 7px; text-align: left; }
.opt-list .opt-item { margin-bottom: 0; }

/* ---------- 图鉴 ---------- */
.hero-card {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px; padding: 12px; margin-bottom: 10px; cursor: pointer;
}
.hero-card-head { display: flex; align-items: center; gap: 10px; }
.hero-avatar {
  width: 44px; height: 44px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600; color: #fff;
}
.hero-meta { flex: 1; }
.hero-name { font-size: 15px; font-weight: 600; }
.hero-sub { font-size: 11px; color: #8b8f96; margin-top: 2px; }
.hero-hp { font-size: 12px; color: #e07a5f; }
.skill-line { font-size: 12px; color: #b9bec6; margin-top: 8px; line-height: 1.6; }
.skill-line b { color: #e8c87a; font-weight: 600; }
.tag-variant {
  font-size: 10px; background: rgba(232,200,122,.18); color: #e8c87a;
  padding: 1px 5px; border-radius: 3px; margin-left: 4px;
}
.filter-bar { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.filter-chip {
  font-size: 12px; padding: 5px 12px; border-radius: 14px;
  background: rgba(255,255,255,.06); color: #9aa0a8;
}
.filter-chip.on { background: #c0392b; color: #fff; }
/* 分类工具条（V1.7.0 · #44/#47）：范围按钮 + 排列下拉并到一行，把纵向空间留给武将图 */
.hero-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.hero-toolbar .filter-bar { flex: 0 1 auto; margin-bottom: 0; flex-wrap: nowrap; }
.hero-toolbar .filter-chip { padding: 5px 10px; white-space: nowrap; }
.sort-select-wrap { position: relative; margin-left: auto; display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.sort-select {
  font-family: inherit; font-size: 12px; padding: 4px 8px; border-radius: 12px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16);
  color: #d6d9de; outline: none; cursor: pointer; line-height: 1.5;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.sort-select:active { background: rgba(255,255,255,.12); }
.sort-select[aria-expanded="true"] { border-color: rgba(232,200,122,.55); color: #f0d8a0; }
.sort-select .ss-caret {
  width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid currentColor; opacity: .7; transition: transform .15s;
}
.sort-select[aria-expanded="true"] .ss-caret { transform: rotate(180deg); }
/* V1.7.1：自绘下拉菜单——原生 select 在手机上会弹系统选择器并要求确认，与游戏风格不符 */
.sort-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  min-width: 112px; padding: 5px; border-radius: 12px;
  background: #23262c; border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 10px 28px rgba(0,0,0,.55);
  display: flex; flex-direction: column; gap: 2px;
}
.sort-menu[hidden] { display: none; }
.sort-menu .sort-opt {
  font-family: inherit; font-size: 13px; text-align: left; padding: 8px 12px;
  border: 1px solid transparent; border-radius: 8px; background: transparent;
  color: #c8ccd3; cursor: pointer; white-space: nowrap;
}
.sort-menu .sort-opt:active { background: rgba(255,255,255,.08); }
.sort-menu .sort-opt.on { background: rgba(192,57,43,.22); border-color: rgba(192,57,43,.55); color: #f0d8a0; }
/* 图鉴工具条容器（V1.7.2）：第一行范围+排列，第二行势力标签 */
.hero-filters { margin-bottom: 10px; }
.hero-filters .hero-toolbar { margin-bottom: 8px; }
/* 势力标签行：一行到底，宽度不够就左右滑，绝不折行顶到第二行 */
.fac-bar {
  display: flex; align-items: center; gap: 6px;
  overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap;
  padding-bottom: 3px; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.fac-bar::-webkit-scrollbar { display: none; }
.fac-chip {
  flex: 0 0 auto; white-space: nowrap;
  font-family: inherit; font-size: 12px; line-height: 1.4;
  padding: 4px 9px; border-radius: 12px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.13);
  color: #9aa0a8; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.fac-chip:active { background: rgba(255,255,255,.11); }
.fac-chip i { font-style: normal; font-size: 10px; color: #6d7278; }
/* 选中：用该势力的颜色点亮左侧圆点 + 描边，一眼看出选了哪几个 */
.fac-chip.on { color: #f4e6c4; border-color: var(--fc, #c0392b); background: rgba(255,255,255,.09); }
.fac-chip.on i { color: #c9b98d; }
.fac-chip.on::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--fc, #c0392b); display: inline-block;
}
/* V1.7.3：不再有「全部势力」按钮（第一行的范围已经承担「看全部」） */
.hero-empty { text-align: center; color: #6d7278; font-size: 13px; padding: 40px 0; }
/* 选将页（#46）：头部固定，只有武将列表滚动 */
.page.select-page { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
/* V1.7.1：.page.corner-pad 的 padding-bottom:104px 会盖掉上面的 0，底部留出一大块纯色空洞 */
.page.select-page.corner-pad { padding-bottom: 0; }
.select-fixed { flex: 0 0 auto; }
/* 底部留 76px 给右下角返回圆钮，避免压住最后一张卡 */
.pick-scroll { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 76px; }
.pick-scroll .hero-group-head:first-child { margin-top: 4px; }
/* 排列方式一行（与上面「全部/官方/自定义」同属单选，只有一个是亮的） */
.sort-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: -6px 0 12px; }
.sort-bar .sort-label { font-size: 11px; color: #7d828a; letter-spacing: 1px; margin-right: 2px; }
.sort-chip {
  font-size: 12px; padding: 4px 10px; border-radius: 12px; line-height: 1.4;
  background: transparent; border: 1px solid rgba(255,255,255,.14); color: #9aa0a8;
}
.sort-chip.on { border-color: #c0392b; background: rgba(192,57,43,.2); color: #f0d8a0; }
/* 武将分类组头（V1.6.0 · #37）：版式与「卡牌欣赏」标题一致——左对齐 + 金色竖条 */
.hero-group-head { display: flex; align-items: center; gap: 8px; margin: 18px 0 0; }
.hero-group-head .hg-title {
  font-size: 13px; font-weight: 600; color: #e8c87a; letter-spacing: 2px;
  display: flex; align-items: center; gap: 6px;
}
.hero-group-head .hg-title::before {
  content: ''; width: 3px; height: 12px; border-radius: 2px; background: #e8c87a; display: inline-block;
}
.hero-group-head .hg-count {
  font-size: 11px; color: #8b8f96; background: rgba(255,255,255,.07);
  border-radius: 9px; padding: 1px 7px; line-height: 1.5;
}
.faction-group { margin-bottom: 18px; }
.faction-head {
  font-size: 13px; font-weight: 600; color: #fff; padding: 7px 12px;
  border-radius: 8px 8px 0 0; display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.faction-head span { font-size: 11px; opacity: .8; font-weight: 400; }

/* ---------- 武将卡片墙（仿官方武将介绍） ---------- */
.hero-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 14px; margin-top: 14px;
}
.wcard {
  position: relative; aspect-ratio: 3 / 4.2; border-radius: 8px; overflow: hidden;
  cursor: pointer; background: #1a1611;
  box-shadow: 0 3px 10px rgba(0,0,0,.5);
  border: 1px solid rgba(255,255,255,.12);
  transition: transform .15s, box-shadow .15s;
}
.wcard:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,.6); }
.wcard.on { outline: 2px solid #e8c87a; }
.wcard img.wimg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top;
}
/* 左侧竖排势力条（仿官方：势力色窄条 + 竖排势力字/武将名） */
.wcard .wside {
  position: absolute; left: 0; top: 0; bottom: 0; width: 22px;
  display: flex; flex-direction: column; align-items: center;
  padding: 6px 0; z-index: 2;
}
.wcard .wside .wfac {
  font-size: 12px; font-weight: 700; color: #fff;
  width: 16px; height: 16px; line-height: 16px; text-align: center;
  border-radius: 3px; background: rgba(0,0,0,.3); margin-bottom: 4px;
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
}
.wcard .wside .wname {
  font-size: 13px; font-weight: 700; color: #fff; letter-spacing: 2px;
  writing-mode: vertical-rl; text-shadow: 0 1px 3px rgba(0,0,0,.85);
}
/* 体力：左下角勾玉 */
.wcard .whp {
  position: absolute; left: 5px; bottom: 9px; display: flex; flex-direction: column; gap: 4px; z-index: 2;
}
.wcard .whp i {
  width: 12px; height: 15px;
  background: var(--magatama) center/contain no-repeat;
}
.wcard .whp i.empty { background-image: var(--magatama-empty); }
.wcard .whp i.mag { filter: hue-rotate(-75deg) saturate(.85); }
/* 右下角称号 */
.wcard .wtitle {
  position: absolute; right: 0; bottom: 0; left: 26px; z-index: 2;
  padding: 14px 6px 4px 8px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.78));
  font-size: 10px; color: #e8dcc0; text-align: right;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 选将页扩展：技能名角标 + 技能详情按钮 */
.wcard.pick-card.on { outline: 2px solid #e8c87a; box-shadow: 0 0 12px rgba(232,200,122,.5); }
.wcard.pick-card.on2 { outline: 2px dashed rgba(232,200,122,.6); }
.wcard .wskills {
  position: absolute; top: 5px; right: 5px; z-index: 2;
  display: flex; flex-direction: column; gap: 2px; align-items: flex-end;
}
.wcard .wskills span {
  font-size: 9px; padding: 1px 4px; border-radius: 3px;
  background: rgba(0,0,0,.6); color: #f0d8a0; border: 1px solid rgba(232,200,122,.35);
}
/* 图鉴大卡片弹窗 */
.wdetail { display: flex; gap: 14px; }
.wdetail .wd-img {
  flex: 0 0 150px; aspect-ratio: 3 / 4.2; border-radius: 8px; overflow: hidden; position: relative;
}
.wdetail .wd-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
/* 详情页立绘可点开看大图（右下角放大镜提示） */
.wdetail .wd-img.zoomable { cursor: zoom-in; }
.wdetail .wd-img.zoomable::after {
  content: ''; position: absolute; right: 5px; bottom: 5px; width: 22px; height: 22px;
  border-radius: 50%; z-index: 3; pointer-events: none;
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 1px 4px rgba(0,0,0,.5);
  background: rgba(0,0,0,.45) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.6 15.6 21 21'/%3E%3C/svg%3E") center/13px 13px no-repeat;
}
.wdetail .wd-info { flex: 1; min-width: 0; }
.wdetail .wd-hp { font-size: 13px; color: #e07a5f; margin: 4px 0 8px; }
.hp-dot {
  display: inline-block; width: 13px; height: 16px; vertical-align: -3px;
  background: var(--magatama) center/contain no-repeat; margin-right: 2px;
}
/* V2.1.1：体力上限 > 当前体力的空位（如神朱卫刚 4/5 的第 5 个） */
.hp-dot.empty { background-image: var(--magatama-empty); }
.hp-cap { font-size: 11px; color: #9aa0a7; margin-left: 5px; letter-spacing: .3px; }
/* 武将详情页内视图 + 雷达图 */
.hero-detail { display: flex; flex-direction: column; gap: 16px; }
/* 五维雷达图：容器与标题直接复用「卡牌欣赏」的 .card-gallery / .cg-title，
   版式（左对齐 + 金色竖条 + 同字号同色）与卡牌欣赏完全一致 */
.radar-wrap .cg-body { padding: 2px 0 2px; }
/* 武将玩法（V1.7.2）：与「武将属性」「卡牌欣赏」同一套版式（.card-gallery + .cg-title），
   正文改成左对齐的多行标签式，保持与详情页其它区块一致的观感。
   注意：.card-gallery .cg-body 的 display:flex 写在文件更后面（同特异性会盖掉这里），
   所以选择器必须写成 .card-gallery.guide-wrap 这种三段式才压得住。 */
.card-gallery.guide-wrap .cg-body { display: block; padding: 2px 0 0; justify-content: flex-start; }
.guide-line {
  font-size: 12.5px; color: #b9bec6; line-height: 1.7;
  padding: 3px 0; display: flex; gap: 6px;
}
.guide-line b {
  flex: 0 0 auto; color: #e8c87a; font-weight: 600;
  font-size: 11px; line-height: 18px; padding: 0 5px; height: 18px;
  background: rgba(232,200,122,.14); border-radius: 4px; margin-top: 3px;
}
.guide-line span { flex: 1 1 auto; min-width: 0; }
.radar-svg { width: 200px; height: 200px; display: block; }
@media (max-width: 420px) {
  .wdetail { flex-direction: column; }
  .wdetail .wd-img { flex-basis: auto; width: 55%; margin: 0 auto; }
}

/* ---------- 英雄胜率统计 ---------- */
.hs-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.hs-row:last-child { border-bottom: none; }
.hs-name { flex: 0 0 92px; font-size: 13px; color: #e8dcc0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* V1.8.0：战绩按势力区分（信/友/魏/蜀/吴/群），同名武将分两条 */
.hs-fac { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }
.hs-bars { flex: 1; height: 10px; background: rgba(255,255,255,.08); border-radius: 5px; overflow: hidden; }
.hs-bar { height: 100%; position: relative; }
.hs-win { display: block; height: 100%; background: linear-gradient(90deg, #c0392b, #e05555); border-radius: 5px; transition: width .3s; }
.hs-num { flex: 0 0 auto; font-size: 11px; color: #8b8f96; }
/* 战绩页（V1.7.2）：四格总览 + 分区小标签 */
.rec-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.rec-cell {
  background: rgba(255,255,255,.05); border-radius: 8px; padding: 10px 4px; text-align: center;
}
.rec-cell b { display: block; font-size: 19px; font-weight: 700; color: #e8c87a; line-height: 1.25; }
.rec-cell b.rc-win { color: #e05555; }
.rec-cell b.rc-lose { color: #4a9e6e; }
.rec-cell span { font-size: 11px; color: #8b8f96; }
/* V1.7.3：两块战绩并成左右两个标签，各占一半，点一下切换内容 */
.rec-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.rec-tabs button {
  flex: 1 1 0; font-family: inherit; font-size: 13px; line-height: 1.5; padding: 8px 6px;
  border-radius: 10px; background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12); color: #9aa0a8; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
}
.rec-tabs button:active { background: rgba(255,255,255,.1); }
.rec-tabs button i { font-style: normal; font-size: 11px; color: #6d7278; }
.rec-tabs button.on { background: rgba(192,57,43,.2); border-color: #c0392b; color: #f0d8a0; }
.rec-tabs button.on i { color: #c9b98d; }
.rs-tip { font-size: 11.5px; color: #7d828a; line-height: 1.65; margin: 0 0 10px; }
.help-sec h3 .rs-tag {
  font-size: 10px; font-weight: 400; color: #7d828a;
  margin-left: 6px; padding: 1px 6px; border-radius: 8px; background: rgba(255,255,255,.06);
}
.rs-empty { text-align: center; color: #6d7278; font-size: 13px; padding: 16px 0; }

/* ---------- 设置 ---------- */
.set-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.06);
}
.set-label { font-size: 14px; }
.set-desc { font-size: 11px; color: #6d7278; margin-top: 2px; }
.switch { width: 46px; height: 26px; border-radius: 13px; background: #3a3f46; position: relative; transition: background .2s; flex: 0 0 auto; }
.switch.on { background: #c0392b; }
.switch::after {
  content: ''; position: absolute; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; top: 2px; left: 2px; transition: left .2s;
}
.switch.on::after { left: 22px; }
.seg { display: flex; gap: 4px; flex: 0 0 auto; }
.seg button { font-size: 12px; padding: 5px 10px; border-radius: 6px; background: rgba(255,255,255,.06); color: #9aa0a8; }
.seg button.on { background: #c0392b; color: #fff; }
.set-num {
  width: 78px; padding: 6px 8px; border-radius: 6px; text-align: center;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  color: #e8c87a; font-size: 13px;
}

/* ---------- 交接遮罩 ---------- */
.handoff {
  position: fixed; inset: 0; background: #16181c; z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.handoff-inner { text-align: center; padding: 24px; }
.handoff-title { font-size: 14px; color: #8b8f96; }
.handoff-name { font-size: 32px; font-weight: 700; color: #e8c87a; margin: 14px 0 6px; }
.handoff-sub { font-size: 12px; color: #6d7278; margin-bottom: 30px; }
.handoff-inner .btn-primary { max-width: 260px; }

/* ---------- 选将 ---------- */
.select-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.select-head .back-btn { margin: 0; }
.select-actions { display: flex; gap: 8px; margin-left: auto; }
.select-actions .btn-mini { flex: 0 0 auto; }
.pick-slots { display: flex; gap: 10px; margin-bottom: 12px; }
.pick-slot {
  flex: 1; background: rgba(255,255,255,.05); border-radius: 8px; padding: 8px 10px; text-align: center;
  border: 1.5px solid transparent; cursor: pointer;
}
.pick-slot.target { border-color: rgba(232,200,122,.65); background: rgba(232,200,122,.08); }
.ps-label { font-size: 11px; color: #8b8f96; }
.pick-slot.target .ps-label { color: #e8c87a; }
.ps-name { font-size: 14px; font-weight: 600; color: #e8c87a; margin-top: 2px; }
/* 槽位里的势力徽标（V1.6.0）：势力色底 + 白字，紧跟在武将名后面 */
.ps-fac {
  display: inline-block; margin-left: 6px; padding: 0 5px;
  font-size: 12px; font-weight: 800; line-height: 17px; border-radius: 3px;
  color: #fff; background: var(--fc, #666);
  vertical-align: 2px; text-shadow: 0 1px 1px rgba(0,0,0,.35);
}
/* 选将页卡片与图鉴同宽（#47：把空间留给武将图，三列会把竖排名字挤断） */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 10px; }
.pick-item {
  background: rgba(255,255,255,.05); border: 1.5px solid transparent; border-radius: 8px;
  padding: 10px 6px; text-align: center; cursor: pointer;
}
.pick-item.on { border-color: #e8c87a; background: rgba(232,200,122,.12); }
.pick-item .pi-name { font-size: 14px; font-weight: 600; }
.pick-item .pi-hero { font-size: 11px; color: #8b8f96; margin-top: 3px; }
.pick-item .pi-hp { font-size: 10px; color: #e07a5f; margin-top: 2px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; top: 22%; transform: translateX(-50%);
  background: rgba(0,0,0,.85); color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 200; max-width: 80%;
  text-align: center;
}
.toast.on { opacity: 1; }

.result-panel { text-align: center; padding: 30px 20px; }
.result-title { font-size: 26px; font-weight: 700; color: #e8c87a; margin-bottom: 8px; }
.result-sub { font-size: 13px; color: #9aa0a8; margin-bottom: 24px; }

.card-table { font-size: 12px; width: 100%; border-collapse: collapse; }
.card-table td { padding: 7px 6px; border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: top; }
.card-table td:first-child { color: #e8c87a; white-space: nowrap; width: 92px; }
.card-table td:last-child { color: #b9bec6; line-height: 1.55; }

.help-sec { margin-bottom: 18px; }
.help-sec h3 { font-size: 14px; color: #e8c87a; margin: 0 0 8px; font-weight: 600; }
.help-sec p { font-size: 12.5px; color: #b9bec6; line-height: 1.75; margin: 0 0 6px; }
.help-sec ol, .help-sec ul { font-size: 12.5px; color: #b9bec6; line-height: 1.75; padding-left: 20px; margin: 0; }


/* ---------- 手机端战报抽屉 ---------- */
/* 默认桌面：底部工具栏；战报按钮只在窄屏显示 */
.g-tools {
  flex: 0 0 36px; width: 100%; min-height: 36px;
  display: flex; gap: 8px; align-items: center;
  justify-content: flex-end; padding: 4px 8px;
  background: #191c21; border-top: 1px solid rgba(255,255,255,.06);
  overflow: hidden;
}
.g-tools .btn-mini { flex: 0 0 auto; }
.g-tools .btn-mini.danger { color: #e79a90; border: 1px solid rgba(224,138,128,.4); }
.g-tools #btn-log { margin-right: auto; }
/* 手机端右下角常驻按钮（返回 / 结束本局），桌面端由 .g-tools 承担 */
.game-corner { display: none; }
/* 通用右下角返回键：页面有左上角返回时显示（手机端），点击等同左上角返回 */
.corner-back { display: none; }
.only-mobile, .log-head-mobile { display: none; }
.log-head-actions { display: flex; gap: 6px; align-items: center; }

@media (max-width: 760px) {
  /* 手机不再把战报固定在右侧，避免挤占牌桌宽度 */
  .g-side {
    display: none;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    height: 42vh; max-height: 360px;
    border-left: none; border-top: 1px solid rgba(232,200,122,.35);
    background: #171a1f;
    box-shadow: 0 -12px 28px rgba(0,0,0,.65);
    padding-top: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .g-side.open { display: flex; }
  /* 弹窗期间看战报：抽屉盖在弹窗（z-index 500）之上，收起即退回弹窗 */
  .g-side.over-modal { z-index: 520; height: 56vh; max-height: 440px; }
  .log-head-mobile {
    display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between;
    padding: 8px 12px; background: #20242a;
    border-bottom: 1px solid rgba(255,255,255,.08);
    color: #e8c87a; font-size: 13px; font-weight: 600;
  }
  .log-head-mobile button {
    background: rgba(255,255,255,.08); color: #cfd3d9;
    border: 1px solid rgba(255,255,255,.14); border-radius: 6px;
    padding: 4px 10px; font-size: 12px;
  }
  .g-side .log-box { font-size: 12px; padding: 6px 12px; }
  .only-mobile { display: inline-flex; }
  /* 手机上隐藏底部工具栏；战报入口放在回合记录标题栏 */
  .g-tools { display: none; }
  /* 手机端：右下角常驻「返回 / 结束本局」，落在右手拇指区，不挡手牌 */
  .game-corner {
    display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
    position: fixed; right: 8px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 238px);
    z-index: 88;
  }
  .game-corner .gc-btn {
    background: rgba(22,25,30,.92); color: #e8c87a;
    border: 1px solid rgba(232,200,122,.42); border-radius: 999px;
    padding: 8px 14px; font-size: 13px; font-weight: 600; line-height: 1;
    box-shadow: 0 2px 10px rgba(0,0,0,.45); white-space: nowrap;
  }
  .game-corner .gc-btn.danger { color: #f0a49a; border-color: rgba(224,120,110,.5); }
  .game-corner .gc-btn:active { transform: translateY(1px); background: rgba(40,45,52,.96); }
  /* 通用右下角返回圆钮：左手留内容、右手点返回 */
  .corner-back {
    display: flex; align-items: center; justify-content: center;
    position: fixed; right: 10px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(22,25,30,.9); color: #e8c87a;
    border: 1px solid rgba(232,200,122,.42);
    font-size: 20px; line-height: 1; font-weight: 600;
    box-shadow: 0 2px 10px rgba(0,0,0,.45);
    z-index: 300;
  }
  .corner-back:active { transform: translateY(1px); background: rgba(40,45,52,.96); }
  /* 显示浮动返回键的页面给底部留白，避免遮住页面底部的按钮（如反馈提交） */
  .page.corner-pad { padding-bottom: 104px; }
  /* 「我的历史反馈」每条右下角的「回复」按钮贴最右；反馈页顶部有「← 返回」，所以不再显示右下角圆钮（data-nocorner） */
  .th-log-btn { display: inline-flex; align-items: center; justify-content: center; }
  .th-deck { display: inline-block; }
  .turn-history { width: 220px; }
  .th-list { max-height: 96px; }
}


/* ---------- 电脑难度 ---------- */
.ai-level-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin: 8px 0 10px; font-size: 12px; color: #8b8f96;
}
.ai-level-row .seg button { font-size: 12px; }
.seg button.reserved { opacity: .45; cursor: not-allowed; }


/* ---------- 规则帮助：快捷跳转 + 卡牌一览折叠 ---------- */
.help-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.help-chip {
  background: rgba(255,255,255,.10); color: #e8e2d6; border: none;
  border-radius: 20px; padding: 6px 12px; font-size: 12px; font-family: inherit;
}
.help-chip:active { background: rgba(255,255,255,.20); }
.card-fold {
  border: 1px solid rgba(255,255,255,.10); border-radius: 8px;
  margin-bottom: 8px; background: rgba(255,255,255,.03);
}
.card-fold > summary {
  cursor: pointer; padding: 9px 12px; font-size: 13px; color: #e8c87a; list-style: none;
}
.card-fold > summary::-webkit-details-marker { display: none; }
.card-fold > summary::before { content: '▸ '; color: #8b8f96; }
.card-fold[open] > summary::before { content: '▾ '; }
.card-fold > table { margin: 0; }
.card-fold[open] > summary { border-bottom: 1px solid rgba(255,255,255,.08); }

/* ---------- 聊天广场 ---------- */
/* 布局：标题行（← 左 / 标题居中 / 刷新右）→ 看板（吃满剩余高度）→ 底部昵称 + 输入框与发送键同一行 */
.page.square-page {
  display: flex; flex-direction: column; overflow: hidden;
  padding: 12px 14px 10px;
}
/* 页面标题行（V1.2.2 起各页统一，规格与聊天广场第一行一致）：返回键在左、标题严格居中、右侧可放按钮 */
.page-head, .sq-head {
  position: relative; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; min-height: 32px;
}
.page-head-back, .sq-head-back {
  margin: 0; padding: 6px 12px; font-size: 14px; line-height: 1;
  background: rgba(255,255,255,.06); color: #cfd3d9;
  border: 1px solid rgba(255,255,255,.14); border-radius: 8px;
}
.page-head-back:active, .sq-head-back:active { background: rgba(255,255,255,.18); }
.page-head .page-head-title, .sq-head .sq-title {
  position: absolute; left: 0; right: 0; top: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  margin: 0; font-size: 18px; pointer-events: none;
}
.sq-refresh {
  background: rgba(232,200,122,.16); color: #f0c870;
  border: 1px solid rgba(232,200,122,.45); border-radius: 8px;
  padding: 6px 14px; font-size: 13px; font-weight: 500; font-family: inherit;
}
.sq-refresh:active { background: rgba(232,200,122,.28); }
.sq-board-head {
  display: flex; justify-content: space-between; align-items: center; flex: 0 0 auto;
  font-size: 11px; color: #8b8f96; margin-bottom: 6px;
}
.sq-board { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
/* 公告条（V1.7.2）：小喇叭 + 文字慢慢横滚 + 轻微闪烁，放在「留言看板」下一行 */
.sq-notice {
  flex: 0 0 auto; height: 30px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
  border-radius: 8px; overflow: hidden;
  background: linear-gradient(90deg, rgba(232,200,122,.10), rgba(192,57,43,.12));
  border: 1px solid rgba(232,200,122,.26);
}
.sq-notice-ico { flex: 0 0 auto; color: #f0c870; display: flex; align-items: center; padding-left: 9px; }
.sq-notice-view { flex: 1 1 auto; min-width: 0; overflow: hidden; height: 100%; display: flex; align-items: center; }
/* 双份文本首尾相接，位移 -50% 正好等于「一份」的宽度：滚动无缝、且进页第一眼就有字（不是从屏外飘进来） */
.sq-notice-track {
  display: flex; width: max-content;
  will-change: transform; animation: sqMarquee 24s linear infinite;
}
@keyframes sqMarquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.sq-notice-txt { font-size: 12px; color: #f0c870; white-space: nowrap; padding-right: 48px; animation: sqBlink 2.4s ease-in-out infinite; }
@keyframes sqBlink {
  0%, 100% { color: #d8b46a; text-shadow: none; }
  50% { color: #ffe6a6; text-shadow: 0 0 10px rgba(240,200,112,.85); }
}
@media (prefers-reduced-motion: reduce) {
  .sq-notice-track { animation: none; }
  .sq-notice-txt { animation: none; }
}
.sq-msg {
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px; padding: 9px 11px; margin-bottom: 8px;
}
.sq-msg.mine { border-color: rgba(240,200,112,.42); border-left: 3px solid #f0c870; background: rgba(240,200,112,.07); }
.sq-meta { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.sq-ava {
  width: 20px; height: 20px; border-radius: 50%; flex: 0 0 auto;
  background: rgba(232,200,122,.18); color: #f0c870; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.sq-name { font-size: 12px; color: #e8e2d6; }
.sq-me { font-size: 10px; color: #f0c870; border: 1px solid rgba(240,200,112,.5); border-radius: 4px; padding: 0 4px; }
.sq-pend { font-size: 10px; color: #e0a95c; border: 1px dashed rgba(224,169,92,.6); border-radius: 4px; padding: 0 4px; }
.sq-time { margin-left: auto; font-size: 11px; color: #6f7278; }
.sq-body { font-size: 13.5px; color: #cfd3d9; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.sq-empty { text-align: center; color: #7c8090; font-size: 13px; padding: 26px 0; }
.sq-compose { flex: 0 0 auto; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.12); }
.sq-nick-row { display: flex; gap: 8px; align-items: stretch; margin-bottom: 8px; }
.sq-input {
  flex: 1 1 auto; min-width: 0; box-sizing: border-box;
  padding: 9px 10px; border: 1px solid #3a3f4a; border-radius: 8px;
  background: #1c212b; color: #e8e8e8; font-size: 13px; font-family: inherit;
}
/* 昵称行最右侧的返回键：手机右手拇指自然落点，比顶部更好按 */
.sq-back {
  flex: 0 0 auto; width: 46px; border-radius: 8px; font-size: 17px; font-family: inherit;
  border: 1px solid rgba(232,200,122,.5); background: rgba(232,200,122,.12); color: #f0c870;
}
.sq-back:active { background: rgba(232,200,122,.3); }
.sq-text-row { display: flex; gap: 8px; align-items: stretch; }
.sq-text {
  flex: 1 1 auto; min-width: 0; box-sizing: border-box; padding: 9px 10px;
  border: 1px solid #3a3f4a; border-radius: 8px; background: #1c212b;
  color: #e8e8e8; font-size: 13.5px; line-height: 1.5; resize: none; font-family: inherit;
}
.sq-send {
  flex: 0 0 auto; width: 56px; padding: 0;
  background: linear-gradient(#c0392b, #96281b); color: #fff;
  border: none; border-radius: 8px; font-size: 14px; font-weight: 500; font-family: inherit;
}
.sq-send:active { transform: translateY(1px); }
.sq-send:disabled { opacity: .6; }

/* 本版更新（版权隐私页，V1.3.2） */
.memo-block {
  margin-top: 12px; padding: 10px 12px; border-radius: 8px;
  background: rgba(232,200,122,.06); border: 1px solid rgba(232,200,122,.22);
}
.memo-title { color: #e8c87a; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.memo-list { margin: 0; padding-left: 18px; }
.memo-list li { font-size: 13px; line-height: 1.7; color: #c9ccd2; }

/* ---------- 武将详情：卡牌欣赏（V1.4.1） ---------- */
.card-gallery {
  margin-top: 16px; padding: 12px; border-radius: 10px;
  background: rgba(232,200,122,.05); border: 1px solid rgba(232,200,122,.22);
}
.card-gallery .cg-title {
  font-size: 13px; font-weight: 600; color: #e8c87a; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.card-gallery .cg-title::before {
  content: ''; width: 3px; height: 12px; border-radius: 2px;
  background: #e8c87a; display: inline-block;
}
.card-gallery .cg-body { display: flex; justify-content: center; }
.card-gallery .cg-item { width: 240px; max-width: 78%; cursor: zoom-in; }
.card-gallery .cg-item img {
  width: 100%; display: block; border-radius: 8px;
  box-shadow: 0 8px 22px rgba(0,0,0,.45);
  border: 1px solid rgba(232,200,122,.18);
}
.card-gallery .cg-cap { margin-top: 7px; text-align: center; font-size: 11px; color: #8b8f96; }

/* 卡牌 / 原图大图 */
.cardview {
  position: fixed; inset: 0; z-index: 900; display: none;
  background: rgba(0,0,0,.93); align-items: center; justify-content: center;
  padding: 14px; flex-direction: column; overflow: auto;
}
.cardview.on { display: flex; }
.cardview img {
  margin: auto; flex: 0 0 auto; cursor: zoom-in;
  max-width: 100%; max-height: 86vh; border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,.6);
}
/* 提示固定在屏幕底部（图片在容器里垂直居中，用 margin:auto 才不会因溢出裁掉左边） */
.cardview .cv-hint {
  position: fixed; left: 0; right: 0; bottom: 18px; z-index: 1;
  font-size: 12px; color: #9aa0a8; text-align: center; pointer-events: none;
}
/* 点图切成 1:1 实际像素（可拖动查看细节），再点切回适合屏幕 */
.cardview img.actual { max-width: none; max-height: none; cursor: zoom-out; }

/* 手机端保持 240px 宽的卡面；电脑端放大到 300px 便于欣赏 */
@media (max-width: 420px) {
  .card-gallery .cg-item { width: 240px; max-width: 76%; }
}
@media (min-width: 720px) {
  .card-gallery .cg-item { width: 300px; max-width: 46%; }
}
