/* ============================================================
   小瑞 H5 首页 · 样式（app.css）
   冻结依据：IA v1.3.1 §3.6 / §3.7.4.1 / §3.8
   铁律：平台色值【只】在下面的 :root token 定义一处；
        组件一律 var(--platform-xxx)，绝不写死 hex（17 裁决 §一.2）。
   ============================================================ */

:root {
  /* 品牌色（IA 3.6.1） */
  --brand-1: #3F256F;
  --brand-2: #5B3A8E;
  --brand-gold: #B8892E;
  --link-blue: #2F6BFF;
  --page-bg: #FAF9FC;
  --card-bg: #FFFFFF;
  --card-tint: #F3EEFA;
  --text: #241B33;
  --text-sub: #6B6279;
  --text-mute: #9A93A6;
  --line: #ECE7F3;
  --danger: #C0392B;
  --ok: #2E9E6B;

  /* 平台色 token（IA 3.7.4.1 定稿，唯一定义处） */
  --platform-doubao:   #1E6FD9;
  --platform-deepseek: #6B4EFF;
  --platform-kimi:     #E07A2D;
  --platform-yuanbao:  #2E9E6B;
  --platform-wenxin:   #D94A4A;
  --platform-qianwen:  #2AA6A6;
  --platform-unknown:  #8A8397;   /* 未知平台兜底灰，必带平台名 */

  /* 尺寸 */
  --btn-h: 44px;
  --radius: 14px;
  --gap: 16px;
  --nav-h: 56px;
  --maxw: 1280px;
  --content-col: 720px;   /* 桌面 A 定稿：内容列 720 */
  --bubble-col: 520px;    /* 桌面 A 定稿：气泡 520 */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--page-bg);
  color: var(--text);
  font-size: clamp(15px, 1.1vw, 17px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
a { color: var(--link-blue); }
.hidden { display: none !important; }

/* 首屏不闪白：根容器先给背景 */
#app { min-height: 100vh; min-height: 100dvh; background: var(--page-bg); }

/* ============================ 登录 / 开号 ============================ */
.auth-wrap {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, var(--brand-1), var(--brand-2));
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--card-bg);
  border-radius: 20px; padding: 28px 24px;
  box-shadow: 0 18px 48px rgba(35, 18, 66, .28);
}
.auth-card h1 { font-size: 22px; margin: 0 0 4px; color: var(--brand-1); }
.auth-card .sub { color: var(--text-sub); font-size: 13px; margin-bottom: 22px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }
.field input {
  width: 100%; height: var(--btn-h); border: 1px solid var(--line);
  border-radius: 10px; padding: 0 12px; font-size: 16px; background: #fff;
}
.field input:focus { outline: 2px solid var(--brand-2); border-color: transparent; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--btn-h); padding: 0 18px; border: 0; border-radius: 10px;
  font-size: 15px; font-weight: 600;
}
.btn-primary { background: var(--brand-2); color: #fff; width: 100%; }
.btn-primary:active { background: var(--brand-1); }
.btn-ghost { background: var(--card-tint); color: var(--brand-1); }
.btn-mini { min-height: 36px; padding: 0 12px; font-size: 13px; }
.auth-switch { margin-top: 16px; text-align: center; font-size: 13px; color: var(--text-sub); }
.auth-switch span { color: var(--brand-2); cursor: pointer; font-weight: 600; }
.auth-msg { margin-top: 12px; font-size: 13px; min-height: 18px; color: var(--danger); }
.invite-box {
  margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line);
  font-size: 13px; color: var(--text-sub);
}
.invite-code {
  display: inline-block; margin-top: 6px; padding: 6px 10px;
  background: var(--card-tint); border-radius: 8px;
  font-family: monospace; font-size: 15px; color: var(--brand-1); letter-spacing: 1px;
}

/* ============================ 主框架 ============================ */
.shell {
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh;
  max-width: 100%; margin: 0 auto;
}
.topbar {
  flex: 0 0 auto; height: 52px; display: flex; align-items: center;
  gap: 10px; padding: 0 16px;
  background: linear-gradient(120deg, var(--brand-1), var(--brand-2));
  color: #fff;
}
.topbar .logo { font-weight: 700; font-size: 17px; cursor: pointer; }
.topbar .store {
  margin-left: auto; font-size: 13px; opacity: .95; cursor: pointer;
  max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar .who { font-size: 12px; opacity: .8; }

.main {
  flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 12px 12px calc(var(--nav-h) + 16px);
  scrollbar-width: thin;
}

/* 底部 4 Tab（手机 / 平板 P0） */
.tabbar {
  flex: 0 0 auto; height: var(--nav-h);
  display: flex; border-top: 1px solid var(--line); background: #fff;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tab {
  flex: 1 1 0; min-width: 0; min-height: var(--btn-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; border: 0; background: transparent; color: var(--text-mute);
  font-size: 12px; position: relative;
}
.tab .ic { font-size: 19px; line-height: 1; }
.tab.active { color: var(--brand-2); font-weight: 700; }
.tab .dot {
  position: absolute; top: 8px; right: 24%;
  width: 7px; height: 7px; border-radius: 50%; background: var(--danger);
}

/* 桌面左导航（P1，1025+） */
.sidebar { display: none; }

/* ============================ 今日搜索战况卡 ============================ */
.battle-card {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  border-radius: var(--radius); color: #fff; padding: 14px 16px 12px;
  box-shadow: 0 8px 22px rgba(63, 37, 111, .22);
  margin-bottom: 12px;
}
.battle-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.battle-head .title { font-size: 17px; font-weight: 700; cursor: pointer; }
.battle-head .all {
  margin-left: auto; font-size: 13px; opacity: .9; cursor: pointer;
  min-height: 32px; display: inline-flex; align-items: center;
}
.battle-head .date { font-size: 12px; opacity: .75; }

/* 轮播：一整块，卡内 5 条 */
.carousel { position: relative; }
.slide {
  display: none; cursor: pointer; min-height: 148px;
  border-left: 4px solid var(--platform-unknown);
  padding-left: 12px;
}
.slide.active { display: block; animation: fadein .28s ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.slide .plat {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; margin-bottom: 6px;
}
.slide .plat .chip {
  width: 10px; height: 10px; border-radius: 3px;
  background: var(--platform-unknown);
}
.slide .first-badge {
  display: inline-block; margin-left: 8px; padding: 1px 8px;
  background: var(--brand-gold); color: #fff; border-radius: 20px; font-size: 12px;
}
.slide .not-first {
  display: inline-block; margin-left: 8px; padding: 1px 8px;
  background: rgba(255,255,255,.16); border-radius: 20px; font-size: 12px;
}
/* P0-3：首推 N 次（不硬编码平台色，色值只在 :root 定义） */
.slide .first-count {
  display: inline-block; margin-left: 8px; padding: 1px 8px;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.20);
  border-radius: 20px; font-size: 12px; font-weight: 600;
}
.slide .term { font-size: 18px; font-weight: 700; line-height: 1.4; margin: 4px 0 6px; }
.slide .concl { font-size: 14px; opacity: .94; line-height: 1.5; }
.slide .source { font-size: 12px; opacity: .72; margin-top: 10px; }

.dots { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; }
.dots .dot {
  width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0;
  background: rgba(255,255,255,.4);
  /* 视觉 8px，热区扩到 44px（IA 3.7.3 / 3.8.4） */
  position: relative;
}
.dots .dot::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 44px; height: 44px; transform: translate(-50%, -50%);
}
.dots .dot.active { background: #fff; width: 18px; border-radius: 5px; }
.dots .page { font-size: 12px; opacity: .8; margin-left: 8px; }

.shortage {
  font-size: 12px; opacity: .85; text-align: center; margin-top: 8px;
}

/* ============================ 四态（空 / 错 / 加载 / 无权限） ============================ */
.state {
  background: var(--card-bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px 20px; text-align: center;
  margin-bottom: 12px;
}
.state .st-ic { font-size: 30px; }
.state .st-title { font-size: 16px; font-weight: 700; margin: 8px 0 4px; }
.state .st-desc { font-size: 13px; color: var(--text-sub); margin-bottom: 16px; }
.state .st-action {
  min-height: var(--btn-h); padding: 0 20px; border: 0; border-radius: 10px;
  background: var(--brand-2); color: #fff; font-weight: 600;
}
.skeleton { background: var(--card-bg); border-radius: var(--radius); padding: 18px; }
.sk-line {
  height: 14px; border-radius: 7px; margin-bottom: 12px;
  background: linear-gradient(90deg, #eee9f4 25%, #f7f4fb 50%, #eee9f4 75%);
  background-size: 200% 100%; animation: sk 1.3s infinite;
}
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-line.w60 { width: 60%; } .sk-line.w80 { width: 80%; } .sk-line.w40 { width: 40%; }

/* ============================ 战况详情列表 ============================ */
.page-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.page-head .back {
  min-height: 40px; padding: 0 12px; border: 0; border-radius: 8px;
  background: var(--card-tint); color: var(--brand-1); font-weight: 600;
}
.page-head h2 { font-size: 17px; margin: 0; }
.page-head .src { margin-left: auto; font-size: 12px; color: var(--text-mute); }

.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.legend .lg {
  min-height: 34px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 18px; background: #fff; font-size: 13px; color: var(--text-sub);
  display: inline-flex; align-items: center; gap: 6px;
}
.legend .lg.active { border-color: var(--brand-2); color: var(--brand-1); font-weight: 600; }
.legend .lg .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--platform-unknown); }

/* 行高 72–88px；最后一截半行靠容器高度 + 滚动实现 */
.battle-list {
  background: var(--card-bg); border: 1px solid var(--line);
  border-radius: var(--radius); overflow-y: auto;
  max-height: 60vh; max-height: 60dvh;
  scrollbar-width: auto;
}
.battle-list::-webkit-scrollbar { width: 8px; }
.battle-list::-webkit-scrollbar-thumb { background: #C9BEDD; border-radius: 4px; }
.bl-row {
  min-height: 80px; height: 80px;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-bottom: 1px solid var(--line);
  cursor: pointer;
  border-left: 4px solid var(--platform-unknown);
}
.bl-row:last-child { border-bottom: 0; }
.bl-row .bl-plat {
  flex: 0 0 auto; font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px;
}
.bl-row .bl-plat .sw { width: 9px; height: 9px; border-radius: 3px; background: var(--platform-unknown); }
.bl-row .bl-main { flex: 1 1 auto; min-width: 0; }
.bl-row .bl-term {
  font-size: 15px; font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.bl-row .bl-meta { font-size: 12px; color: var(--text-sub); }
.bl-row .bl-badge {
  flex: 0 0 auto; font-size: 12px; color: #fff;
  background: var(--brand-gold); border-radius: 16px; padding: 2px 8px;
}
.bl-row .bl-badge.no { background: var(--text-mute); }
.bl-row .bl-arrow { flex: 0 0 auto; color: var(--text-mute); font-size: 18px; }

/* ============================ 搜索词详情 ============================ */
.word-top {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: #fff; border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
}
.word-top .wt { font-size: 19px; font-weight: 700; }
.word-top .ws { font-size: 12px; opacity: .8; margin-top: 8px; }
.answer {
  background: var(--card-bg); border: 1px solid var(--line);
  border-left: 4px solid var(--platform-unknown);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
}
.answer.first { box-shadow: 0 0 0 2px var(--brand-gold) inset; }
.answer .a-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.answer .a-plat { font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.answer .a-plat .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--platform-unknown); }
.answer .a-first { font-size: 12px; color: #fff; background: var(--brand-gold); border-radius: 14px; padding: 1px 8px; }
.answer .a-rank { font-size: 12px; color: var(--text-sub); margin-left: auto; }
.answer .a-text { font-size: 14px; color: var(--text); line-height: 1.6; }
.answer .a-src { font-size: 12px; color: var(--text-mute); margin-top: 8px; }

/* ============================ AI 聊天 ============================ */
.chat-box {
  background: var(--card-bg); border: 1px solid var(--line);
  border-radius: var(--radius); display: flex; flex-direction: column;
  overflow: hidden;
}
.chat-scroll {
  flex: 1 1 auto; overflow-y: auto; padding: 14px;
  min-height: 220px; max-height: 46vh; max-height: 46dvh;
  scrollbar-width: thin;
}
.msg { display: flex; gap: 8px; margin-bottom: 12px; }
.msg .av {
  flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-2); color: #fff; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.msg .bubble {
  max-width: 78%; padding: 9px 12px; border-radius: 12px;
  font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
  background: var(--card-tint); color: var(--text);
}
.msg.me { flex-direction: row-reverse; }
.msg.me .av { background: #C9BEDD; }
.msg.me .bubble { background: var(--brand-2); color: #fff; }
.msg .bubble.link-card { border-left: 3px solid var(--link-blue); }
.msg .coach-tag { font-size: 12px; color: var(--brand-gold); font-weight: 700; }

/* ---------- 72 号：消息复制 / 多选 / 转发 ---------- */
.msg { position: relative; }
.msg .bubble { cursor: text; }
/* 勾选框只在多选态出现，常态零占位（不改变聊天布局） */
.msg .sel-box {
  display: none; flex: 0 0 20px; width: 20px; height: 20px;
  margin-top: 6px; border-radius: 50%;
  border: 2px solid var(--line); background: #fff;
}
.chat-box.sel-on .msg .sel-box { display: block; }
.msg.sel .sel-box { border-color: var(--brand-2); background: var(--brand-2); }
.msg.sel .sel-box::after {
  content: ""; display: block; width: 8px; height: 8px;
  margin: 4px auto 0; border-radius: 50%; background: #fff;
}
.msg.sel .bubble { box-shadow: 0 0 0 2px var(--brand-2); }
/* 多选操作条：内联在聊天卡内、输入框上方，绝不 fixed，不遮输入 */
.chat-selbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 12px; border-top: 1px solid var(--line);
  background: var(--card-tint);
}
.chat-selbar .sel-count { font-size: 13px; color: var(--text-sub); margin-right: auto; }
.chat-selbar .sel-act {
  min-height: var(--btn-h); padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--brand-1);
  font-size: 13px; font-weight: 600;
}
.chat-selbar .sel-act.ghost { color: var(--text-sub); font-weight: 400; }
.chat-selbar .sel-act[disabled] { opacity: .45; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 14px 10px; }
.chips .chip {
  min-height: 34px; padding: 0 12px; border-radius: 18px;
  border: 1px solid var(--line); background: #fff; color: var(--brand-1); font-size: 13px;
}
.chat-input {
  flex: 0 0 auto; border-top: 1px solid var(--line); padding: 10px 12px;
  display: flex; gap: 8px; align-items: flex-end; background: #fff;
}
.chat-input textarea {
  flex: 1 1 auto; resize: none; min-height: 44px; max-height: 96px;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px;
  font-size: 15px; line-height: 1.4; font-family: inherit;
}
.chat-input .send {
  min-height: var(--btn-h); padding: 0 16px; border: 0; border-radius: 10px;
  background: var(--brand-2); color: #fff; font-weight: 600;
}
.chat-tools { display: flex; gap: 8px; padding: 8px 12px 0; }
.chat-tools .t {
  min-height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--text-sub); font-size: 13px;
}
.chat-tools .t.on { background: var(--card-tint); color: var(--brand-1); font-weight: 600; }
.chat-tools .t.off { opacity: .5; cursor: not-allowed; }
/* AI 内测角标（24 号收口）：明确告知内测状态；没接上时不冒充 AI */
.ai-beta {
  margin-left: auto; align-self: center;
  font-size: 11px; line-height: 1; white-space: nowrap;
  padding: 5px 9px; border-radius: 999px;
  color: var(--brand-1); background: var(--card-tint);
  border: 1px solid var(--line);
}

/* 72 号：长按 / 右键唤出的消息操作面板（底部抽屉） */
.sheet-mask {
  position: fixed; left: 0; right: 0; top: 0; bottom: 0;
  background: rgba(0, 0, 0, .35); z-index: 80;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-body {
  width: 100%; max-width: 480px; background: #fff;
  border-radius: 14px 14px 0 0; padding: 10px 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}
.sheet-title {
  font-size: 12px; color: var(--text-sub);
  text-align: center; padding: 4px 0 8px;
}
.sheet-body .sheet-btn {
  display: block; width: 100%; min-height: var(--btn-h); margin-bottom: 8px;
  border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font-size: 15px;
}
.sheet-body .sheet-btn.sheet-cancel { color: var(--text-sub); margin-bottom: 0; }
/* 72 号：轻提示（已复制 / 去微信粘贴），不冒充已转发 */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  max-width: 78vw; padding: 10px 14px; border-radius: 10px;
  background: rgba(32, 32, 32, .92); color: #fff;
  font-size: 13px; line-height: 1.4; text-align: center; z-index: 90;
}
@media (min-width: 1025px) { .toast { bottom: 40px; } }

/* ============================ 上传 ============================ */
.up-box {
  margin-top: 12px; background: var(--card-bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px;
}
.up-box h3 { font-size: 15px; margin: 0 0 4px; }
.up-box .hint { font-size: 12px; color: var(--text-sub); margin-bottom: 12px; }
.up-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.up-btn {
  min-height: var(--btn-h); padding: 0 16px; border: 0; border-radius: 10px;
  background: var(--card-tint); color: var(--brand-1); font-weight: 600;
}
.up-progress { margin-top: 10px; }
.up-file {
  display: flex; align-items: center; gap: 8px; padding: 8px 0;
  border-bottom: 1px solid var(--line); font-size: 13px;
}
.up-file .nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-file .sz { color: var(--text-sub); }
.up-file .st { font-size: 12px; min-width: 66px; text-align: right; }
.up-file .st.done { color: var(--ok); }
.up-file .st.err { color: var(--danger); }
.up-file .op {
  min-height: 32px; padding: 0 10px; border: 0; border-radius: 8px;
  background: var(--card-tint); color: var(--brand-1); font-size: 12px;
}
.bar { height: 8px; border-radius: 4px; background: var(--card-tint); overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--brand-2); width: 0; transition: width .18s; }

/* ============================ 占位页（开始用/消息/我的，本版不做完整页） ============================ */
.placeholder { text-align: center; padding: 40px 20px; color: var(--text-sub); }
.placeholder .big { font-size: 36px; }
.placeholder h3 { color: var(--text); margin: 12px 0 6px; }
.placeholder p { font-size: 13px; max-width: 420px; margin: 0 auto; }

/* ============================ 响应式（IA 3.8） ============================ */
/* 手机 320–767：单列 + 底部 4 Tab（默认即此形态） */

/* 69 号 G1 P0 修复：窄屏（≤1024）底部 4 Tab 常驻视口底部。
   根因：微信内置浏览器 / 部分手机 WebView 的 100dvh 与实际可视区不一致，
   整页滚动会把作为普通 flex 子项的 .tabbar 推到内容末尾 → 上传多文件后需滚到底才看见。
   修法：.tabbar 改 fixed 钉底（脱离内容流），主区 .main 底部补留白防遮挡；
   桌面 ≥1025 由下方既有规则隐藏底部 Tab、改用左导航，本块不生效。 */
@media (max-width: 1024px) {
  .tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    max-width: 720px;       /* 平板与 .shell(720) 对齐居中 */
    margin: 0 auto;
    /* padding-bottom: env(safe-area-inset-bottom, 0) 已在基础 .tabbar 定义，保留 */
  }
  .main {
    /* Tab 脱离文档流后，主区末尾留白：Tab 高 + 底部安全区 + 余量，
       保证滚到底时上传列表 / 聊天输入框不被常驻 Tab 遮住 */
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 24px);
  }
}

/* 平板 768–1024：居中 720，仍底部 4 Tab */
@media (min-width: 768px) and (max-width: 1024px) {
  .shell { max-width: 720px; box-shadow: 0 0 30px rgba(63,37,111,.06); }
  body { background: #EFEBF6; }
  #app { background: #EFEBF6; }
}

/* 电脑 1025–1440：左导航 220 + 主区；底部 Tab 隐藏 */
@media (min-width: 1025px) {
  body { background: #EFEBF6; }
  #app { background: #EFEBF6; }
  .shell {
    flex-direction: row; max-width: var(--maxw);
    margin: 0 auto; background: var(--page-bg);
  }
  .sidebar {
    display: flex; flex: 0 0 220px; flex-direction: column;
    background: linear-gradient(170deg, var(--brand-1), var(--brand-2));
    color: #fff; padding: 18px 12px;
  }
  .sidebar .logo { font-size: 19px; font-weight: 700; margin-bottom: 24px; cursor: pointer; }
  .sidebar .s-tab {
    min-height: var(--btn-h); display: flex; align-items: center; gap: 10px;
    padding: 0 12px; border: 0; border-radius: 10px; margin-bottom: 6px;
    background: transparent; color: rgba(255,255,255,.82); font-size: 15px; text-align: left;
  }
  .sidebar .s-tab.active { background: rgba(255,255,255,.16); color: #fff; font-weight: 700; }
  .sidebar .s-store {
    margin-top: auto; font-size: 12px; opacity: .85;
    padding: 10px 12px; border-top: 1px solid rgba(255,255,255,.2); cursor: pointer;
  }
  .content-wrap { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
  .main { padding: 18px 24px 24px; }
  .main-inner { width: 100%; max-width: var(--content-col); margin: 0 auto; }
  .chat-scroll { max-height: 52vh; }
  .battle-list { max-height: 58vh; }
  .tabbar { display: none; }
  .topbar { height: 56px; }
  /* 气泡/输入 520 上限（桌面 A 定稿） */
  .msg .bubble { max-width: min(78%, var(--bubble-col)); }
}

/* 大屏 >1440：硬上限 1280，左右安全边距 >=120 */
@media (min-width: 1441px) {
  .shell { max-width: var(--maxw); }
  .content-wrap { padding: 0 24px; }
}

/* 键盘不遮输入：可视区变化时输入框贴底 */
@supports (height: 100dvh) {
  .shell { height: 100dvh; }
}

/* 减少动效：轮播不自转由 JS 判断，这里去掉 CSS 动画 */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
      transition-duration: .001ms !important; }
}

/* 图片/视频不横溢 */
img, video { max-width: 100%; height: auto; object-fit: contain; }
