/* ============================================================
   棋聚堂 · 全站样式（无图片素材，全部 CSS 绘制）
   ============================================================ */
:root {
  --cell: 56px;
  --margin: 34px;
  --bg: #16211c;
  --panel: #1f2f28;
  --panel-2: #27382f;
  --ink: #e8e2d0;
  --ink-dim: #9aa79d;
  --accent: #c8452c;
  --accent-2: #e0684a;
  --gold: #d8b46a;
  --board-face: linear-gradient(135deg, #e9c583 0%, #ddb26e 55%, #d0a25c 100%);
  --board-line: #7a4a1e;
  --radius: 14px;
}

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

html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(1200px 600px at 20% -10%, #24382e 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 110%, #243330 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
}
.hidden { display: none !important; }

/* ---------- 头部 ---------- */
.site-header { text-align: center; padding: 34px 16px 10px; }
.site-header-slim { padding: 14px 16px 4px; text-align: left; }
.site-title {
  font-size: 42px; letter-spacing: 10px; font-weight: 700;
  color: var(--gold);
  text-shadow: 0 2px 12px rgba(216, 180, 106, .25);
}
.site-sub { color: var(--ink-dim); margin-top: 8px; font-size: 14px; letter-spacing: 2px; }
.back-home { color: var(--gold); text-decoration: none; font-size: 15px; }
.back-home:hover { text-decoration: underline; }

/* ---------- 大厅 ---------- */
.lobby-main { max-width: 760px; margin: 18px auto 40px; padding: 0 16px; display: flex; flex-direction: column; gap: 18px; }
.card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid rgba(216, 180, 106, .18);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
}
.card h2 { font-size: 17px; color: var(--gold); margin-bottom: 14px; letter-spacing: 2px; }
.hint { color: var(--ink-dim); font-size: 12.5px; margin-top: 8px; }

.input {
  width: 100%; padding: 12px 14px; font-size: 16px;
  border-radius: 10px; border: 1px solid #3d5147;
  background: #182420; color: var(--ink); outline: none;
  transition: border-color .2s;
}
.input:focus { border-color: var(--gold); }
.input.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.join-row { display: flex; gap: 10px; margin-top: 12px; }
.join-row .input { flex: 1; width: auto; }
.input-code { letter-spacing: 6px; text-transform: uppercase; font-weight: 700; }

.btn {
  border: none; cursor: pointer; border-radius: 10px;
  padding: 13px 22px; font-size: 15.5px; color: var(--ink);
  background: #34493f; transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn-primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #fff; font-weight: 600; }
.btn-big { font-size: 17px; padding: 16px; }
.btn-small { padding: 10px 16px; font-size: 14.5px; border-radius: 9px; }

/* 触屏设备：保证最小 44px 触摸目标（Apple/Google 无障碍建议值） */
@media (pointer: coarse) {
  .btn, .chip { min-height: 44px; }
}

.room-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.room-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(0, 0, 0, .18); border-radius: 10px; padding: 10px 14px;
}
.room-list li.empty { justify-content: center; color: var(--ink-dim); }
.room-info { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.room-code { font-weight: 800; letter-spacing: 3px; color: var(--gold); }
.room-names { color: var(--ink-dim); font-size: 14px; }
.room-status { font-size: 12.5px; padding: 3px 10px; border-radius: 99px; }
.st-wait { background: rgba(200, 69, 44, .2); color: var(--accent-2); }
.st-play { background: rgba(154, 167, 157, .18); color: var(--ink-dim); }

.tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  font-size: 13px; padding: 7px 14px; border-radius: 99px;
  background: rgba(255, 255, 255, .05); color: var(--ink-dim);
  border: 1px solid rgba(255, 255, 255, .07);
}
.tag-on { background: rgba(216, 180, 106, .15); color: var(--gold); border-color: rgba(216, 180, 106, .3); }

/* ---------- 大厅棋种选择 ---------- */
.pick-label { color: var(--ink-dim); font-size: 13.5px; margin-bottom: 8px; }
.game-chips { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.chip {
  cursor: pointer; border-radius: 99px; padding: 11px 20px;
  font-size: 15px; color: var(--ink-dim);
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  transition: all .15s;
}
.chip:hover { filter: brightness(1.2); }
.chip-on {
  background: rgba(216, 180, 106, .18); color: var(--gold);
  border-color: rgba(216, 180, 106, .55); font-weight: 600;
}
.chip-small { padding: 9px 16px; font-size: 14px; }
.weiqi-size-row { display: flex; align-items: center; gap: 8px; }
.weiqi-size-row .game-chips { margin-bottom: 10px; }

.room-game {
  font-size: 12.5px; padding: 3px 9px; border-radius: 99px;
  background: rgba(216, 180, 106, .12); color: var(--gold);
  border: 1px solid rgba(216, 180, 106, .25);
}

.site-footer { text-align: center; color: var(--ink-dim); font-size: 12.5px; padding: 18px 16px 34px; }

/* ---------- 站点署名与公告（五期：内容由后台「站点设置」下发） ---------- */
.site-credit { display: block; margin-top: 6px; }
.site-credit a {
  color: var(--gold); text-decoration: none;
  border-bottom: 1px dotted rgba(216, 180, 106, .5);
  transition: color .15s ease, border-color .15s ease;
}
.site-credit a:hover { color: var(--accent-2); border-bottom-color: var(--accent-2); }

.site-announce {
  display: flex; align-items: flex-start; gap: 8px;
  background: rgba(216, 180, 106, .10);
  border: 1px solid rgba(216, 180, 106, .28);
  color: var(--ink); border-radius: var(--radius);
  padding: 10px 14px; margin: 0 0 14px; font-size: 13.5px; line-height: 1.6;
  white-space: pre-wrap;
}
.site-announce::before { content: '📢'; flex: none; }

/* 对局页（全屏布局无 page footer）中的署名，放在右侧 dock 底部 */
.game-credit {
  margin-top: 12px; padding-top: 10px;
  border-top: 1px dashed rgba(154, 167, 157, .22);
  text-align: center; font-size: 11.5px; color: var(--ink-dim);
}
.game-credit a {
  color: var(--gold); text-decoration: none;
  border-bottom: 1px dotted rgba(216, 180, 106, .5);
}
.game-credit a:hover { color: var(--accent-2); border-bottom-color: var(--accent-2); }

/* ---------- 对局页：顶部信息条 + 回合条 + 棋盘 + 侧边 dock ---------- */
/* 游戏式全屏锁屏（桌面/移动统一架构）：整页零滚动，棋盘区弹性适配 */
body.game-page { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px 6px; flex-shrink: 0;
}
.back-home { color: var(--gold); text-decoration: none; font-size: 15px; white-space: nowrap; }
.back-home:hover { text-decoration: underline; }
.topbar .game-badge { margin-left: 0; }
.topbar .players {
  flex: 1; justify-content: center; gap: 10px;
  min-width: 0; overflow: hidden;
}
.move-count {
  font-size: 12.5px; color: var(--ink-dim); white-space: nowrap;
  padding: 3px 10px; border-radius: 99px;
  background: rgba(216, 180, 106, .1); border: 1px solid rgba(216, 180, 106, .22);
}

.game-badge {
  display: inline-block; padding: 3px 12px;
  border-radius: 99px; font-size: 13px; font-weight: 600;
  background: rgba(216, 180, 106, .15); color: var(--gold);
  border: 1px solid rgba(216, 180, 106, .3); vertical-align: middle;
  white-space: nowrap;
}
.turn-strip { text-align: center; padding: 2px 12px 4px; flex-shrink: 0; }

.game-layout {
  display: flex; gap: 18px; justify-content: center; align-items: stretch;
  padding: 4px 16px 14px; min-height: 0; flex: 1;
}
.dock {
  width: 264px; flex: none; display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid rgba(216, 180, 106, .18);
  border-radius: var(--radius); padding: 16px;
  overflow-y: auto;
}
.players { display: flex; align-items: center; justify-content: space-between; }
.player { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; opacity: .6; }
.player.active { opacity: 1; background: rgba(216, 180, 106, .12); outline: 1px solid rgba(216, 180, 106, .35); }
.pname { font-size: 14px; max-width: 118px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs { color: var(--gold); font-weight: 700; font-size: 13px; }
.stone { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex: none; }
.red-dot { background: radial-gradient(circle at 35% 35%, #ff8a70, #b5300f); }
.black-dot { background: radial-gradient(circle at 35% 35%, #666, #111); }
.white-dot { background: radial-gradient(circle at 35% 35%, #fff, #b9b9ad); }

.turn-bar { font-size: 18px; font-weight: 700; text-align: center; min-height: 26px; color: var(--gold); }
.sub-bar { font-size: 13px; color: var(--ink-dim); text-align: center; min-height: 18px; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* 军棋阵亡统计（dock 内，JS 填充） */
.dead-note { font-size: 12.5px; color: var(--ink-dim); line-height: 1.9; }
.dead-note h3 { color: var(--gold); font-size: 13.5px; margin-bottom: 6px; }
.dead-row { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; }
.dead-side { flex: none; padding: 2px 8px; border-radius: 8px; font-weight: 700; }
.dead-side.red { background: rgba(181, 48, 15, .18); color: #ff9a80; }
.dead-side.blue { background: rgba(40, 90, 160, .2); color: #9ecbff; }
.dead-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 6px; font-size: 13px; font-weight: 700;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(216, 180, 106, .25);
}
.dead-empty { opacity: .55; }

.rules-note { font-size: 12.5px; color: var(--ink-dim); line-height: 1.8; border-top: 1px dashed rgba(216, 180, 106, .25); padding-top: 12px; }
.rules-note h3 { color: var(--gold); font-size: 13.5px; margin-bottom: 6px; }
.rules-note ul { padding-left: 18px; }
.move-note { font-size: 12.5px; color: var(--ink-dim); }
.move-note h3 { color: var(--gold); font-size: 13.5px; margin: 4px 0 6px; }
.move-note ol { padding-left: 34px; max-height: 180px; overflow-y: auto; line-height: 1.9; }
.move-note li { list-style: decimal; }

/* ---------- 棋盘 ---------- */
.board-wrap { display: flex; justify-content: center; align-items: flex-start; flex: 1; min-width: 0; min-height: 0; overflow: hidden; }
.board {
  position: relative;
  background: var(--board-face);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45), inset 0 0 60px rgba(122, 74, 30, .18);
  flex: none;
}
.board svg.grid { position: absolute; inset: 0; }
.grid line { stroke: var(--board-line); stroke-width: 1.6; }
.grid line.thin { stroke-width: 1.2; }
.grid line.frame { stroke-width: 3; }
.pos-mark { fill: none; stroke: var(--board-line); stroke-width: 1.4; }
.river-text {
  fill: rgba(122, 74, 30, .75); font-size: 30px; font-weight: 600;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", serif; letter-spacing: 8px;
}

.mark-layer, .piece-layer, .hot-layer { position: absolute; inset: 0; }
.hot-layer { z-index: 30; }
.mark-layer { z-index: 10; }
.piece-layer { z-index: 20; }

.hotspot {
  position: absolute; width: calc(var(--cell) * 1); height: calc(var(--cell) * 1);
  transform: translate(-50%, -50%); cursor: pointer;
}

.mark { position: absolute; transform: translate(-50%, -50%); pointer-events: none; }
.mark-selected {
  width: calc(var(--cell) * .98); height: calc(var(--cell) * .98);
  border-radius: 50%; border: 3px solid var(--accent);
  box-shadow: 0 0 12px rgba(200, 69, 44, .55);
  animation: pulse 1.2s infinite;
}
.mark-target {
  width: calc(var(--cell) * .3); height: calc(var(--cell) * .3);
  border-radius: 50%; background: rgba(48, 122, 60, .85);
  box-shadow: 0 0 6px rgba(0, 0, 0, .35);
}
.mark-capture {
  width: calc(var(--cell) * .96); height: calc(var(--cell) * .96);
  border-radius: 50%; border: 4px dashed rgba(48, 122, 60, .9);
  animation: spin 6s linear infinite;
}
.mark-from {
  width: calc(var(--cell) * .32); height: calc(var(--cell) * .32);
  border-radius: 50%; border: 2px solid rgba(122, 74, 30, .7);
}
.mark-to {
  width: calc(var(--cell) * .38); height: calc(var(--cell) * .38);
  border-radius: 50%; border: 2.5px solid rgba(122, 74, 30, .8);
}
.mark-check {
  width: calc(var(--cell) * 1.04); height: calc(var(--cell) * 1.04);
  border-radius: 50%; border: 3px solid #ff2b2b;
  animation: pulse .55s infinite;
}
@keyframes pulse { 50% { transform: translate(-50%, -50%) scale(1.12); opacity: .75; } }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* ---------- 棋子（中国象棋专用圆片） ---------- */
.piece {
  position: absolute; z-index: 20;
  width: calc(var(--cell) * .9); height: calc(var(--cell) * .9);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--cell) * .5);
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "SimSun", serif;
  font-weight: 700; user-select: none; pointer-events: none;
  transition: left .22s ease, top .22s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .35), inset 0 -3px 6px rgba(0, 0, 0, .12);
}
.piece.red {
  background: radial-gradient(circle at 34% 30%, #fdf3dc 0%, #f3ddb0 55%, #d9bd85 100%);
  color: #b5300f; border: 2.5px solid #b5300f;
}
.piece.black {
  background: radial-gradient(circle at 34% 30%, #fdf3dc 0%, #f3ddb0 55%, #d9bd85 100%);
  color: #2c2620; border: 2.5px solid #2c2620;
}
.piece.drop { animation: drop .28s ease; }
.piece.captured { transition: opacity .3s, transform .3s; opacity: 0; transform: translate(-50%, -50%) scale(.5); }
@keyframes drop { 0% { transform: translate(-50%, -60%) scale(1.15); opacity: .2; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; } }

/* ---------- 围棋 / 五子棋 棋子 ---------- */
.stone-piece {
  position: absolute; z-index: 20;
  width: calc(var(--stone-cell) * .96); height: calc(var(--stone-cell) * .96);
  transform: translate(-50%, -50%);
  border-radius: 50%; user-select: none; pointer-events: none;
  transition: left .22s ease, top .22s ease;
  box-shadow: 1.5px 2.5px 4px rgba(0, 0, 0, .4);
}
.stone-piece.go-black {
  background: radial-gradient(circle at 35% 30%, #6a6a6a 0%, #2e2e2e 45%, #0c0c0c 100%);
}
.stone-piece.go-white {
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #f2f2ec 55%, #cfcfc4 100%);
}
.stone-piece.drop { animation: drop .28s ease; }
.stone-piece.captured { transition: opacity .3s, transform .3s; opacity: 0; transform: translate(-50%, -50%) scale(.4); }

/* 最后一手标记（棋子中央小圆点） */
.mark-last {
  width: calc(var(--stone-cell) * .3); height: calc(var(--stone-cell) * .3);
  border-radius: 50%; pointer-events: none;
  z-index: 30;
}
.mark-last.on-black { background: #f3ddb0; }
.mark-last.on-white { background: #b5300f; }

/* ---------- 国际象棋 棋子与格子标记 ---------- */
.chess-piece {
  position: absolute; z-index: 20;
  width: calc(var(--chess-cell) * 1); height: calc(var(--chess-cell) * 1);
  transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--chess-cell) * .78);
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "DejaVu Sans", sans-serif;
  line-height: 1; user-select: none; pointer-events: none;
  transition: left .22s ease, top .22s ease;
  filter: drop-shadow(1.5px 2.5px 2px rgba(0, 0, 0, .45));
}
.chess-piece.cp-white { color: #fafafa; text-shadow: 0 0 2px #3a3a3a, 1px 1px 0 #2c2c2c, -1px -1px 0 #2c2c2c, 1px -1px 0 #2c2c2c, -1px 1px 0 #2c2c2c; }
.chess-piece.cp-black { color: #262626; text-shadow: 0 0 2px #d8d8d8, 1px 1px 0 rgba(255,255,255,.5), -1px -1px 0 rgba(255,255,255,.35); }
.chess-piece.drop { animation: drop .28s ease; }
.chess-piece.captured { transition: opacity .3s, transform .3s; opacity: 0; transform: translate(-50%, -50%) scale(.5); }

.sq-mark {
  position: absolute; transform: translate(-50%, -50%);
  width: calc(var(--chess-cell) * 1); height: calc(var(--chess-cell) * 1);
  pointer-events: none; border-radius: 4px;
}
.sqm-from { background: rgba(246, 202, 76, .45); }
.sqm-to { background: rgba(246, 202, 76, .55); }
.sqm-selected { box-shadow: inset 0 0 0 4px rgba(246, 202, 76, .9); }
.sqm-target::after {
  content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 30%; height: 30%; border-radius: 50%; background: rgba(20, 20, 20, .35);
}
.sqm-capture::after {
  content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 82%; height: 82%; border-radius: 50%;
  border: calc(var(--chess-cell) * .08) solid rgba(181, 48, 15, .75);
}
.sqm-check { box-shadow: inset 0 0 0 4px #ff2b2b; animation: pulse .55s infinite; border-radius: 6px; }

/* ---------- 新增棋种：坐标标签 / 星位 / 格盘 ---------- */
svg.grid .coord-label {
  fill: rgba(70, 55, 30, .75); font-size: 12px;
  font-family: "Segoe UI", Arial, sans-serif; text-anchor: middle;
}
.board-chess svg.grid .sq-light { fill: #f0d9b5; }
.board-chess svg.grid .sq-dark { fill: #b58863; }

/* ---------- 模态 / toast ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.modal-card {
  position: relative; width: min(92vw, 400px);
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid rgba(216, 180, 106, .3);
  border-radius: var(--radius); padding: 26px; text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.modal-title { color: var(--gold); font-size: 20px; margin-bottom: 12px; letter-spacing: 2px; }
.modal-body { font-size: 15px; line-height: 1.8; color: var(--ink); }
.room-code-big {
  font-size: 44px; letter-spacing: 10px; font-weight: 800;
  color: var(--accent-2); margin: 6px 0 10px;
}
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

.toast {
  position: fixed; left: 50%; bottom: 42px; transform: translateX(-50%) translateY(20px);
  background: rgba(0, 0, 0, .82); color: #fff; padding: 10px 22px;
  border-radius: 99px; font-size: 14px; opacity: 0; pointer-events: none;
  transition: all .25s; z-index: 120; max-width: 86vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 响应式 ---------- */
@media (max-width: 700px) {
  :root { --cell: 34px; --margin: 22px; }
  /* —— 大厅：卡片流 —— */
  .site-header { padding: 22px 12px 8px; }
  .site-title { font-size: 30px; letter-spacing: 6px; }
  .site-sub { font-size: 12px; letter-spacing: 1px; }
  .lobby-main { margin-top: 12px; padding: 0 10px; gap: 14px; }
  .card { padding: 16px 14px; }
  .entry-grid { grid-template-columns: 1fr; }
  .join-row { flex-wrap: wrap; }
  .join-row .btn { flex: 1; }
  .river-text { font-size: 18px; letter-spacing: 4px; }
  .room-names { font-size: 13px; }
  .room-list li { padding: 10px 10px; }
  .site-footer { font-size: 11.5px; padding: 14px 12px 28px; }

  /* —— 对局页：游戏式全屏布局（仿主流棋牌手游架构）——
     整屏锁定零滚动：顶部信息条 → 回合条 → 棋盘独占主区（宽×高双向适配、
     整盘完整可见）→ 底部操作区；规则/棋谱收进弹层（#btn-info）。 */
  .topbar { padding: 6px 10px 2px; gap: 8px; }
  .back-home { font-size: 17px; }
  .back-home .back-text { display: none; }
  .game-badge { font-size: 12px; padding: 2px 10px; }
  .move-count { font-size: 11px; padding: 2px 8px; }
  .turn-strip { padding: 0 10px; }
  .game-layout {
    flex: 1; min-height: 0; display: flex; flex-direction: column;
    padding: 6px 8px calc(10px + env(safe-area-inset-bottom));
    gap: 6px; overflow: hidden; justify-content: flex-start;
  }
  .board-wrap { flex: 1; min-height: 0; width: 100%; align-items: center; justify-content: center; }
  .dock { order: 2; width: 100%; padding: 10px 12px; gap: 7px; flex: none; overflow: visible; }
  .panel-actions { justify-content: center; }
  .rules-note, .move-note { display: none; }
  .dead-note { display: none; } /* 移动端阵亡统计收进棋谱弹层 */
  .turn-bar { font-size: 16px; min-height: 22px; }
  .sub-bar { min-height: 16px; font-size: 12px; }
  .players { gap: 6px; }
  .pname { font-size: 13px; max-width: 80px; }
  .vs { font-size: 12px; }
  .player { padding: 4px 7px; }
}

/* 棋谱/规则浮层按钮：仅窄屏（侧栏收起后）显示 */
#btn-info { display: none; }
@media (max-width: 700px) { #btn-info { display: inline-block; } }

/* 弹层内规则与棋谱排版 */
.info-modal { text-align: left; max-height: 62vh; overflow-y: auto; }
.info-modal .rules-note, .info-modal .move-note { display: block; }

/* 触屏体验：禁双击缩放误触、棋盘不可选中 */
body.game-page, body.lobby-page { touch-action: manipulation; }
.board { user-select: none; -webkit-user-select: none; }

/* 可动飞机触摸热区扩大（点击容错，不需要精确点中机身） */
.ap-plane::before { content: ''; position: absolute; inset: -12px; border-radius: 50%; }

/* ============================================================
   三期：军棋翻棋 & 飞行棋
   ============================================================ */

/* ---------- 军棋 ---------- */
.board-junqi { background: linear-gradient(160deg, #f7ecd2, #eeddb8); border-radius: 14px; }
.board-junqi .road { stroke: #9a7b4f; stroke-width: 2; }
.board-junqi .rail { stroke: #4d3a24; stroke-width: 5; stroke-linecap: round; }
.board-junqi .camp-circle { fill: #fdf6e3; stroke: #b5300f; stroke-width: 2.5; stroke-dasharray: 5 4; }
.board-junqi .hq-rect { fill: rgba(181, 48, 15, .14); stroke: #b5300f; stroke-width: 2.5; }
.board-junqi .hq-label, .board-junqi .mountain-label {
  font-size: 14px; fill: rgba(122, 74, 30, .85); text-anchor: middle;
  font-family: KaiTi, "Kaiti SC", serif; font-weight: bold;
}
.board-junqi .mountain-label { font-size: 18px; letter-spacing: 4px; fill: rgba(122, 74, 30, .6); }

.jpiece {
  position: absolute; transform: translate(-50%, -50%);
  width: calc(var(--jw, 54px)); height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px; font-size: 24px; font-weight: 800;
  letter-spacing: 1px;
  font-family: KaiTi, "Kaiti SC", serif;
  box-shadow:
    0 3px 5px rgba(0, 0, 0, .4),
    inset 0 2px 0 rgba(255, 255, 255, .55),
    inset 0 -3px 0 rgba(0, 0, 0, .18);
  cursor: default; transition: left .18s ease, top .18s ease; z-index: 3;
}
.jpiece-hidden {
  background:
    linear-gradient(160deg, #f5f5f2 0%, #c9c9c4 45%, #a9a9a2 100%);
  color: #26262b;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .8), 0 -1px 1px rgba(0, 0, 0, .25);
  border: 2px solid #6f6f68;
  font-size: 24px;
}
.jpiece-red {
  background: linear-gradient(165deg, #fdf3dd 0%, #f3ddb0 55%, #e2c488 100%);
  color: #c22a12; border: 2px solid #b98a1e;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .65);
}
.jpiece-blue {
  background: linear-gradient(165deg, #eef4fa 0%, #d3e0ec 55%, #b9cadb 100%);
  color: #1f4e8c; border: 2px solid #47698f;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .65);
}
.jpiece.drop { animation: jdrop .25s ease-out; }
@keyframes jdrop { from { transform: translate(-50%, -80%) scale(1.2); opacity: .3; } }

/* ---------- 飞行棋（十字形棋盘） ---------- */
.board-aeroplane { background: linear-gradient(160deg, #fffdf6, #f3e9d2); border-radius: 14px; }
.board-aeroplane .ap-cell { stroke-width: 2; }
.board-aeroplane .ap-c-red { fill: #f7c6ba; stroke: #c22a12; }
.board-aeroplane .ap-c-yellow { fill: #f9ecb8; stroke: #b08a12; }
.board-aeroplane .ap-c-blue { fill: #c3d8ee; stroke: #1f4e8c; }
.board-aeroplane .ap-c-green { fill: #c8e6c9; stroke: #2e7d32; }
.board-aeroplane .ap-flyline { stroke-width: 2.5; stroke-dasharray: 6 6; opacity: .55; fill: none; pointer-events: none; }
.board-aeroplane .ap-fly-red { stroke: #c22a12; }
.board-aeroplane .ap-fly-yellow { stroke: #b08a12; }
.board-aeroplane .ap-fly-blue { stroke: #1f4e8c; }
.board-aeroplane .ap-fly-green { stroke: #2e7d32; }
.board-aeroplane .ap-runway { stroke-width: 1.5; opacity: .92; }
.board-aeroplane .ap-entry {
  font-size: 17px; font-weight: bold; text-anchor: middle; pointer-events: none;
  font-family: KaiTi, serif;
}
.board-aeroplane .ap-entry-red { fill: #c22a12; }
.board-aeroplane .ap-entry-yellow { fill: #b08a12; }
.board-aeroplane .ap-entry-blue { fill: #1f4e8c; }
.board-aeroplane .ap-entry-green { fill: #2e7d32; }
/* 中心 3×3 到达区：四色三角 */
.board-aeroplane .ap-center { fill: #fdf3da; stroke: #d9c9a3; stroke-width: 2; }
.board-aeroplane .ap-goal { stroke: rgba(122, 74, 30, .35); stroke-width: 1; opacity: .8; }
.board-aeroplane .ap-goal-red { fill: rgba(214, 69, 44, .5); }
.board-aeroplane .ap-goal-yellow { fill: rgba(232, 184, 32, .5); }
.board-aeroplane .ap-goal-blue { fill: rgba(47, 109, 177, .5); }
.board-aeroplane .ap-goal-green { fill: rgba(67, 160, 71, .5); }
/* 四角基地 */
.board-aeroplane .ap-base { stroke-width: 3; }
.board-aeroplane .ap-base-red { fill: #fbe3dc; stroke: #c22a12; }
.board-aeroplane .ap-base-yellow { fill: #faf0c6; stroke: #b08a12; }
.board-aeroplane .ap-base-blue { fill: #dde9f6; stroke: #1f4e8c; }
.board-aeroplane .ap-base-green { fill: #dceedd; stroke: #2e7d32; }
.board-aeroplane .ap-base-slot { stroke-width: 2; stroke-dasharray: 4 3; fill: rgba(255, 255, 255, .55); }
.board-aeroplane .ap-base-label { font-size: 15.5px; text-anchor: middle; font-weight: bold; font-family: KaiTi, serif; }

.ap-plane {
  position: absolute; width: 34px; height: 34px;
  transform: translate(-50%, -50%); cursor: pointer; z-index: 4;
  transition: left .3s ease, top .3s ease;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .4));
}
.ap-plane svg { width: 100%; height: 100%; }
.ap-plane-red path { fill: #d6452c; stroke: #7d1d0d; stroke-width: 1.2; }
.ap-plane-yellow path { fill: #e8b820; stroke: #7a5c07; stroke-width: 1.2; }
.ap-plane-blue path { fill: #2f6db1; stroke: #12385e; stroke-width: 1.2; }
.ap-plane-green path { fill: #43a047; stroke: #1b5e20; stroke-width: 1.2; }
.ap-plane.movable { animation: apPulse .9s infinite; }
.ap-plane.movable::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 2.5px dashed rgba(255, 255, 255, .95);
  box-shadow: 0 0 10px rgba(255, 255, 255, .6);
}
.ap-plane.arrived { opacity: .85; }
@keyframes apPulse { 50% { transform: translate(-50%, -50%) scale(1.14); } }

.ap-dice {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 16px;
  background: rgba(255, 253, 246, .95); border: 2.5px solid #b5300f;
  font-size: 36px; font-weight: bold; color: #b5300f; pointer-events: none; z-index: 5;
  font-family: KaiTi, serif;
  box-shadow: 0 4px 14px rgba(122, 74, 30, .35);
}

/* ============================================================
   四期：账号 / 排行榜 / 连胜 / 成就徽章
   ============================================================ */

/* ---------- 涨红跌绿（国内习惯） ---------- */
.up   { color: #ff7a5c; font-weight: 700; }
.down { color: #5fd18a; font-weight: 700; }
.flat { color: var(--ink-dim); }
.delta { display: inline-block; margin-left: 6px; font-size: 13px; }
.delta.up::before   { content: '▲ '; font-size: 10px; }
.delta.down::before { content: '▼ '; font-size: 10px; }

/* ---------- 页面导航（榜单页 / 战绩页） ---------- */
.page-nav {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px 6px; text-align: left;
}
.page-nav-title {
  font-size: 20px; color: var(--gold); letter-spacing: 3px;
  font-weight: 700; flex: 1; margin: 0;
}
.page-nav .acct-slot { flex: none; }

/* ---------- 账号状态胶囊 ---------- */
.acct-slot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acct-chip {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border-radius: 99px; padding: 7px 14px 7px 8px; font-size: 14px;
  background: rgba(216, 180, 106, .14); color: var(--gold);
  border: 1px solid rgba(216, 180, 106, .35);
  transition: filter .15s;
}
.acct-chip:hover { filter: brightness(1.18); }
.acct-chip.ghost { padding: 7px 16px; background: rgba(255,255,255,.05); color: var(--ink); border-color: rgba(255,255,255,.16); }
.acct-chip.primary { padding: 7px 16px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #fff; border-color: transparent; font-weight: 600; }
.acct-avatar { font-size: 19px; line-height: 1; }
.acct-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.acct-rating { font-size: 12.5px; opacity: .85; padding-left: 7px; border-left: 1px solid rgba(216,180,106,.35); }
.acct-streak { font-size: 12px; }
.acct-link { background: none; border: none; color: var(--ink-dim); font-size: 12.5px; cursor: pointer; padding: 4px 6px; }
.acct-link:hover { color: var(--ink); text-decoration: underline; }

.lobby-acct { justify-content: center; margin-top: 14px; }

/* ---------- 大厅"我的"卡片 ---------- */
.me-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.me-brief { display: flex; align-items: center; gap: 14px; min-width: 0; }
.me-avatar {
  width: 52px; height: 52px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
  background: rgba(216, 180, 106, .13);
  border: 2px solid rgba(216, 180, 106, .4);
}
.me-text { min-width: 0; }
.me-name { font-size: 18px; font-weight: 700; color: var(--gold); }
.me-sub { font-size: 12.5px; color: var(--ink-dim); margin-top: 3px; }
.me-actions { display: flex; gap: 10px; flex: none; }
.me-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.quick-item {
  background: rgba(0, 0, 0, .2); border-radius: 10px; padding: 12px 8px; text-align: center;
}
.quick-item b { display: block; font-size: 22px; color: var(--gold); font-weight: 800; }
.quick-item b.up { color: #ff7a5c; }
.quick-item b.down { color: #5fd18a; }
.quick-item span { font-size: 12px; color: var(--ink-dim); }
.me-links { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.me-link {
  flex: 1 1 auto; text-align: center; text-decoration: none;
  padding: 11px 16px; border-radius: 10px; font-size: 14.5px;
  background: rgba(216, 180, 106, .1); color: var(--gold);
  border: 1px solid rgba(216, 180, 106, .3);
}
.me-link:hover { filter: brightness(1.2); }

/* ---------- 排行榜 ---------- */
.rank-main { max-width: 900px; }
.rank-games .chip { font-size: 14px; }
.rank-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.rank-head h2 { margin-bottom: 0; }
.rank-scroll { overflow-x: auto; }
.rank-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.rank-table th {
  text-align: left; padding: 9px 10px; font-size: 12.5px; font-weight: 600;
  color: var(--ink-dim); border-bottom: 1px solid rgba(216, 180, 106, .22);
  white-space: nowrap;
}
.rank-table td { padding: 10px; border-bottom: 1px solid rgba(255, 255, 255, .05); white-space: nowrap; }
.rank-table tr.rk-row { cursor: pointer; transition: background .12s; }
.rank-table tr.rk-row:hover { background: rgba(216, 180, 106, .08); }
.rank-table .rk-no { width: 56px; text-align: center; font-weight: 700; color: var(--gold); }
.rank-table .rk-top .rk-no { font-size: 17px; }
.rank-table .rk-user { display: flex; align-items: center; gap: 8px; }
.rk-avatar { font-size: 20px; }
.rk-name { font-weight: 600; }
.rank-table .rk-rating { font-weight: 700; color: var(--gold); }
.rank-table .rk-col { text-align: center; }
.rank-table .rk-hl { color: #ffcf6b; font-weight: 700; }
.rank-table.compact { font-size: 13.5px; }
.rank-table.compact th, .rank-table.compact td { padding: 7px 8px; }
.rank-table .gname { color: var(--gold); }
.loading-note { color: var(--ink-dim); font-size: 13.5px; text-align: center; padding: 18px 0; }

.streak { font-size: 13px; }
.streak.hot { color: #ff9a3c; font-weight: 700; }
.streak.cold { color: #5fd18a; }
.streak.hot::after { content: ''; }

.myrank-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 16px 0 10px; padding: 11px 14px; border-radius: 10px;
  background: rgba(216, 180, 106, .1);
  border: 1px dashed rgba(216, 180, 106, .35);
  font-size: 13.5px;
}
.myrank-tag { color: var(--gold); font-weight: 700; }
.myrank-no { font-weight: 800; color: var(--gold); font-size: 15px; }
.myrank-name { font-weight: 600; }
.myrank-stats { color: var(--ink-dim); font-size: 13px; }
.myrank-tip { color: var(--ink-dim); }

/* ---------- 战绩面板（弹层 / 整页共用） ---------- */
.profile-panel { text-align: left; }
.profile-main { max-width: 720px; }
.prof-head { display: flex; align-items: center; gap: 16px; position: relative; }
.prof-avatar {
  width: 64px; height: 64px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 34px;
  background: rgba(216, 180, 106, .13); border: 2px solid rgba(216, 180, 106, .4);
}
.prof-id { flex: 1; min-width: 0; }
.prof-name { font-size: 21px; font-weight: 700; color: var(--gold); }
.prof-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; font-size: 12.5px; color: var(--ink-dim); }
.prof-badge {
  padding: 2px 9px; border-radius: 99px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
}
.prof-rating { text-align: right; flex: none; }
.prof-rating-num { font-size: 30px; font-weight: 800; color: var(--gold); line-height: 1.05; }
.prof-rating-lbl { font-size: 11.5px; color: var(--ink-dim); }
.prof-avatar-btn { padding: 4px 12px; font-size: 12.5px; }

.prof-stats {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
  margin: 20px 0 4px;
}
.prof-stats > div {
  background: rgba(0, 0, 0, .2); border-radius: 10px; padding: 11px 6px; text-align: center;
}
.prof-stats b { display: block; font-size: 19px; color: var(--ink); }
.prof-stats span { font-size: 11.5px; color: var(--ink-dim); }
.prof-h {
  font-size: 14px; color: var(--gold); margin: 20px 0 10px;
  border-bottom: 1px dashed rgba(216, 180, 106, .25); padding-bottom: 7px;
  display: flex; align-items: center; justify-content: space-between;
}
.ach-count { font-size: 12.5px; color: var(--ink-dim); font-weight: 400; }

.recent-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.recent-list li {
  display: flex; align-items: center; gap: 10px; font-size: 13.5px;
  background: rgba(0, 0, 0, .18); border-radius: 8px; padding: 8px 12px;
  flex-wrap: wrap;
}
.rc-res { width: 26px; height: 26px; flex: none; border-radius: 50%; text-align: center; line-height: 26px; font-size: 13px; }
.rc-res.up { background: rgba(200, 69, 44, .25); color: #ff9a80; }
.rc-res.down { background: rgba(45, 140, 90, .22); color: #7fe0ab; }
.rc-res.flat { background: rgba(255, 255, 255, .1); color: var(--ink-dim); }
.rc-game { color: var(--gold); flex: none; }
.rc-opp { color: var(--ink-dim); flex: 1; min-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-at { color: var(--ink-dim); font-size: 12px; }

/* 成就徽章墙 */
.ach-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.ach {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 12px 6px; border-radius: 12px; text-align: center;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .07);
  filter: grayscale(1) opacity(.45);
}
.ach.on {
  filter: none;
  background: linear-gradient(180deg, rgba(216, 180, 106, .2), rgba(216, 180, 106, .07));
  border-color: rgba(216, 180, 106, .5);
  box-shadow: 0 4px 16px rgba(216, 180, 106, .14);
}
.ach-icon { font-size: 26px; line-height: 1.15; }
.ach-name { font-size: 12.5px; font-weight: 700; color: var(--gold); }
.ach-desc { font-size: 10.5px; color: var(--ink-dim); line-height: 1.35; }

.prof-guest { text-align: center; padding: 22px 8px; }
.prof-guest-icon { font-size: 52px; }
.prof-guest h2 { color: var(--gold); margin: 12px 0 8px; font-size: 19px; }

/* ---------- 注册 / 登录弹层 ---------- */
.auth-panel { text-align: left; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.auth-tab {
  flex: 1; cursor: pointer; border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .04); color: var(--ink-dim);
  border-radius: 9px; padding: 10px; font-size: 15px; transition: all .15s;
}
.auth-tab.tab-on {
  background: rgba(216, 180, 106, .18); color: var(--gold);
  border-color: rgba(216, 180, 106, .5); font-weight: 700;
}
.auth-fields { display: flex; flex-direction: column; gap: 11px; }
.avatar-pick { display: flex; gap: 7px; justify-content: space-between; flex-wrap: wrap; }
.avatar-opt {
  width: 42px; height: 42px; flex: none; cursor: pointer; border-radius: 50%;
  font-size: 22px; line-height: 1;
  background: rgba(255, 255, 255, .05);
  border: 2px solid rgba(255, 255, 255, .12);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.avatar-opt:hover { transform: scale(1.08); }
.avatar-opt.on {
  border-color: var(--gold); background: rgba(216, 180, 106, .2);
  box-shadow: 0 0 12px rgba(216, 180, 106, .45);
}
.avatar-pick.big .avatar-opt { width: 52px; height: 52px; font-size: 27px; }
.auth-tip { font-size: 12.5px; color: var(--ink-dim); line-height: 1.6; min-height: 34px; }
.auth-tip.auth-err { color: #ff9a80; }

/* ---------- 对局页：连胜徽章 ---------- */
.streak-badge {
  font-size: 12.5px; white-space: nowrap; padding: 3px 10px; border-radius: 99px;
  border: 1px solid transparent;
}
.streak-badge.hot {
  color: #ffb066; background: rgba(255, 154, 60, .16);
  border-color: rgba(255, 154, 60, .45);
  animation: streakGlow 2.2s ease-in-out infinite;
}
.streak-badge.cold { color: #7fe0ab; background: rgba(45, 140, 90, .16); border-color: rgba(45, 140, 90, .4); }
.streak-badge.login-hint {
  color: var(--gold); background: rgba(216, 180, 106, .12);
  border-color: rgba(216, 180, 106, .35); cursor: pointer;
}
.streak-badge.login-hint:hover { filter: brightness(1.2); }
@keyframes streakGlow {
  50% { box-shadow: 0 0 12px rgba(255, 154, 60, .55); }
}

/* ---------- 终局结算面板 ---------- */
.res-reason { color: var(--ink-dim); font-size: 13.5px; margin-bottom: 12px; }
.res-note { font-size: 12.5px; color: var(--ink-dim); margin-top: 10px; line-height: 1.6; }
.res-settle {
  text-align: left; background: rgba(0, 0, 0, .22);
  border-radius: 10px; padding: 12px 14px; margin-top: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.res-row { display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.res-lbl { color: var(--ink-dim); }
.res-val b { font-size: 20px; color: var(--gold); }
.res-ach { text-align: left; margin-top: 14px; }
.res-ach h4 { color: var(--gold); font-size: 13.5px; margin-bottom: 8px; }
.res-ach-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 9px;
  background: linear-gradient(90deg, rgba(216, 180, 106, .2), rgba(216, 180, 106, .05));
  border: 1px solid rgba(216, 180, 106, .4);
  animation: achPop .45s cubic-bezier(.2, 1.5, .4, 1);
}
.res-ach-item + .res-ach-item { margin-top: 7px; }
.res-ach-icon { font-size: 24px; flex: none; }
.res-ach-name { font-weight: 700; color: var(--gold); font-size: 14px; flex: none; }
.res-ach-desc { font-size: 12px; color: var(--ink-dim); }
@keyframes achPop { 0% { transform: scale(.85); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* ---------- 窄屏适配 ---------- */
@media (max-width: 700px) {
  .page-nav { padding: 10px 12px 4px; gap: 8px; }
  .page-nav-title { font-size: 16px; letter-spacing: 1px; }
  .acct-name { max-width: 68px; }
  .acct-rating { display: none; }
  .lobby-acct { margin-top: 10px; }
  .me-quick { grid-template-columns: repeat(2, 1fr); }
  .me-actions { width: 100%; }
  .me-actions .btn { flex: 1; }
  .prof-stats { grid-template-columns: repeat(3, 1fr); }
  .prof-head { flex-wrap: wrap; }
  .prof-rating { width: 100%; text-align: left; }

  .ach-wall { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .rank-table { font-size: 13px; }
  .rank-table th, .rank-table td { padding: 8px 6px; }
  .streak-badge { font-size: 11px; padding: 2px 8px; }
  .rank-scroll { margin: 0 -6px; }
  .res-ach-item { flex-wrap: wrap; }
  .res-ach-desc { width: 100%; }
}

/* ---------- 朋友圈动态（六期） ---------- */
.feed-main { max-width: 720px; }

/* 发帖框 */
.feed-composer { display: flex; flex-direction: column; gap: 10px; }
.feed-composer.need-login .feed-input { opacity: .62; }
.composer-row { display: flex; gap: 10px; align-items: flex-start; }
.composer-avatar { font-size: 26px; line-height: 1.25; flex: none; width: 34px; text-align: center; }
.feed-input {
  width: 100%; resize: vertical; min-height: 68px; line-height: 1.7;
  font-family: inherit; font-size: 14.5px;
}
.composer-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.emoji-bar { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; min-width: 0; }
.emoji-btn {
  border: none; background: rgba(255,255,255,.05); border-radius: 8px;
  font-size: 18px; line-height: 1; padding: 5px 6px; cursor: pointer;
  transition: background .12s, transform .12s;
}
.emoji-btn:hover { background: rgba(216,180,106,.18); transform: translateY(-1px); }
.composer-count { font-size: 12px; color: var(--ink-dim); flex: none; }

/* 信息流 */
.feed-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.feed-h2 { font-size: 18px; color: var(--gold); margin: 0 0 4px; letter-spacing: 2px; }
.feed-list { display: flex; flex-direction: column; }
.feed-card { display: flex; gap: 10px; padding: 14px 0; border-bottom: 1px solid rgba(154,167,157,.14); }
.feed-card:last-child { border-bottom: none; }
.feed-avatar { font-size: 26px; line-height: 1; flex: none; width: 34px; text-align: center; }
.feed-body { flex: 1; min-width: 0; }   /* min-width:0 防 flex 子项被内容撑开 */
.feed-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.feed-author { font-weight: 600; color: var(--gold); }
.feed-time { font-size: 12px; color: var(--ink-dim); margin-left: auto; }
.feed-badge { font-size: 11px; padding: 1px 7px; border-radius: 99px; white-space: nowrap; }
.feed-badge.pin { background: rgba(200,69,44,.18); color: var(--accent-2); border: 1px solid rgba(200,69,44,.4); }
.feed-badge.feat { background: rgba(216,180,106,.16); color: var(--gold); border: 1px solid rgba(216,180,106,.4); }
.feed-content {
  white-space: pre-wrap; word-break: break-word;
  line-height: 1.72; font-size: 15px; color: var(--ink);
}

/* 点赞 / 删除 */
.feed-actions { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.feed-like {
  border: none; background: none; cursor: pointer; color: var(--ink-dim);
  font-size: 14px; padding: 3px 9px; border-radius: 99px;
  display: inline-flex; align-items: center; gap: 5px;
  transition: color .15s, background .15s;
}
.feed-like:hover { background: rgba(200,69,44,.12); color: var(--accent-2); }
.feed-like .like-ico { filter: grayscale(1); opacity: .55; transition: filter .15s, opacity .15s; }
/* 计数为 0 时元素留空，用 :empty 折叠掉多余间距 */
.feed-like .like-num { font-variant-numeric: tabular-nums; }
.feed-like .like-num:empty { display: none; }
.feed-like.is-liked { color: var(--accent-2); font-weight: 600; }
.feed-like.is-liked .like-ico { filter: none; opacity: 1; }
.feed-del { border: none; background: none; cursor: pointer; color: var(--ink-dim); font-size: 13px; padding: 3px 6px; }
.feed-del:hover { color: var(--accent-2); text-decoration: underline; }

.feed-sentinel { height: 1px; }
.feed-end { text-align: center; color: var(--ink-dim); font-size: 13px; margin: 14px 0 0; letter-spacing: 2px; }
.feed-empty { text-align: center; color: var(--ink-dim); padding: 32px 0; margin: 0; }

/* 大厅"最新动态"预告块 */
.feed-preview-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.feed-preview-head h2 { margin: 0; }
.feed-preview-more {
  font-size: 13.5px; color: var(--accent-2); text-decoration: none; flex: none;
}
.feed-preview-more:hover { text-decoration: underline; }
.feed-preview-compose {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 10px;
}
.feed-preview-compose .hint { margin: 0; }
.feed-preview-list { list-style: none; padding: 0; margin: 0; }
.feed-preview-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border-bottom: 1px solid rgba(154,167,157,.12);
}
.feed-preview-item:last-child { border-bottom: none; }
.fp-avatar { font-size: 20px; flex: none; }
.fp-name {
  flex: none; max-width: 8em; color: var(--gold); font-size: 13.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fp-content {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; color: var(--ink);
}
.fp-like { font-size: 12.5px; color: var(--ink-dim); flex: none; }

@media (max-width: 700px) {
  .feed-main { padding-left: 10px; padding-right: 10px; }
  .feed-content { font-size: 14.5px; }
  .feed-time { width: 100%; margin-left: 0; }   /* 时间换行，避免挤压作者名 */
  .composer-foot { gap: 8px; }
  .emoji-btn { font-size: 17px; padding: 4px 5px; }
  .composer-count { margin-left: auto; }
  .fp-name { max-width: 6em; }
}

/* ============================================================
   对局内消息（七期）
   桌面：作为 dock 内的一个区块（dock 本身可滚动，无需固定高度）
   窄屏：dock 变为底部横向区，消息面板折叠为抽屉以节省竖向空间
   ============================================================ */
.game-chat {
  display: flex; flex-direction: column; gap: 8px;
  border-top: 1px dashed rgba(216, 180, 106, .25); padding-top: 12px;
  min-width: 0;                     /* flex 子项防横向溢出 */
}
.chat-disabled { display: none; }

.chat-head {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
}
.chat-head h3 { color: var(--gold); font-size: 13.5px; margin: 0; flex: 1; }
.chat-unread {
  flex: none; min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; font-size: 11px; font-weight: 700;
  background: var(--accent); color: #fff;
}
.chat-toggle {
  flex: none; width: 22px; height: 22px; padding: 0; line-height: 1;
  background: transparent; border: 1px solid rgba(216, 180, 106, .3);
  border-radius: 6px; color: var(--gold); cursor: pointer; font-size: 12px;
}

.chat-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.game-chat.collapsed .chat-body { display: none; }

.chat-list {
  list-style: none; margin: 0; padding: 4px 2px;
  max-height: 200px; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 7px;
}
.chat-empty { font-size: 12px; color: var(--ink-dim); opacity: .7; text-align: center; padding: 10px 0; }

.chat-item {
  display: flex; gap: 7px; align-items: flex-start;
  min-width: 0;                      /* 关键：允许内部文本收缩，避免撑破面板 */
}
.ci-avatar { flex: none; font-size: 15px; line-height: 1.4; }
.ci-main { min-width: 0; flex: 1; }
.ci-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-bottom: 2px; }
.ci-name {
  font-size: 11.5px; color: var(--gold);
  max-width: 7em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ci-seat {
  flex: none; font-size: 10px; padding: 0 5px; border-radius: 5px;
  background: rgba(255, 255, 255, .08); color: var(--ink-dim);
}
.ci-seat-red    { background: rgba(181, 48, 15, .2);   color: #ff9a80; }
.ci-seat-black  { background: rgba(120, 120, 120, .2); color: #d0d0c8; }
.ci-seat-white  { background: rgba(255, 255, 255, .16); color: #f0f0e6; }
.ci-seat-blue   { background: rgba(40, 90, 160, .22);  color: #9ecbff; }
.ci-seat-yellow { background: rgba(200, 160, 30, .22); color: #f0d878; }
.ci-seat-green  { background: rgba(40, 140, 90, .22);  color: #90e0b0; }
.ci-seat-spectator { background: rgba(154, 167, 157, .16); }
.ci-tag {
  flex: none; font-size: 9.5px; padding: 0 4px; border-radius: 4px;
  background: rgba(216, 180, 106, .16); color: var(--gold); border: 1px solid rgba(216, 180, 106, .3);
}
.ci-text {
  font-size: 13px; line-height: 1.6; color: var(--ink);
  word-break: break-word; overflow-wrap: anywhere;   /* 长串/长英文不撑破 */
}
.chat-item.mine .ci-text {
  background: rgba(200, 69, 44, .16); border-radius: 8px; padding: 4px 8px;
}
.chat-item.by-spectator .ci-text { color: var(--ink-dim); }

.chat-quicks { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.quick-chip {
  font-size: 11.5px; padding: 3px 9px; border-radius: 12px; cursor: pointer;
  background: rgba(216, 180, 106, .1); border: 1px solid rgba(216, 180, 106, .28);
  color: var(--gold); transition: background .15s;
}
.quick-chip:hover { background: rgba(216, 180, 106, .22); }
.quick-none { font-size: 11.5px; color: var(--ink-dim); opacity: .7; }

.chat-compose { display: flex; gap: 6px; min-width: 0; }
.chat-compose.readonly { opacity: .55; }
.chat-input {
  flex: 1; min-width: 0;               /* 关键：输入框不撑破面板 */
  font-size: 13px; padding: 6px 9px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid rgba(216, 180, 106, .22);
  color: var(--ink); font-family: inherit;
}
.chat-input:focus { outline: none; border-color: rgba(216, 180, 106, .5); }
.chat-input:disabled { cursor: not-allowed; }
.chat-hint { font-size: 11px; color: var(--ink-dim); margin: 0; line-height: 1.5; }

/* ---------- 窄屏（对局页 ≤700px） ---------- */
@media (max-width: 700px) {
  .game-chat {
    border-top: 1px solid rgba(216, 180, 106, .18);
    padding-top: 8px;
  }
  .chat-list { max-height: 132px; }     /* 底部抽屉，别把棋盘挤没了 */
  .chat-head h3 { font-size: 12.5px; }
  .ci-text { font-size: 12.5px; }
  .quick-chip { font-size: 11px; padding: 3px 8px; }
  .chat-input { font-size: 12.5px; padding: 5px 8px; }
}
@media (max-width: 420px) {
  .chat-list { max-height: 108px; }
  .ci-name { max-width: 5.5em; }
}
