/* ===== single 页（H5 版，rpx→px）===== */
.page { padding: 12px 14px 140px; }

/* 顶部条（规则/重开/求助） */
.toprow { display: flex; gap: 8px; margin-bottom: 10px; }
.top-pill { flex: 1; padding: 8px 0; border-radius: 999px; background: var(--bg-2); color: var(--text); font-size: 14px; text-align: center; font-weight: 600; cursor: pointer; }
.top-pill.help-pill { color: var(--accent); border: 1px solid rgba(var(--accent-rgb), 0.3); }
.top-pill.restart-pill { color: var(--text-2); border: 1px solid var(--border); }
.top-pill.rule-pill { color: var(--text); border: 1px solid var(--border); }

/* 统计 */
.statbar { display: flex; justify-content: space-between; background: var(--bg-2); border-radius: 8px; padding: 10px 0; margin-bottom: 12px; }
.stat { flex: 1; text-align: center; display: flex; flex-direction: column; justify-content: center; }
.stat .v { font-size: 20px; font-weight: 700; color: var(--accent-soft); line-height: 1.1; }
.stat .l { font-size: 12px; color: var(--text-3); margin-top: 3px; }

/* 区块 */
.area { margin-bottom: 12px; }
.area-head { display: flex; justify-content: space-between; align-items: center; padding: 0 3px; margin-bottom: 6px; }
.area-title { color: var(--text-2); font-size: 14px; font-weight: 600; }
.area-tag { background: var(--bg-2); color: var(--text-3); padding: 2px 8px; border-radius: 999px; font-size: 12px; }

/* 手牌 */
.hand { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 7px; min-height: 110px; background: var(--bg-2); border-radius: 8px; box-sizing: border-box; }
.tile.sel { transform: translateY(-8px); box-shadow: 0 10px 0 var(--tile-shadow), 0 14px 18px rgba(0,0,0,.45), inset 0 1px 0 var(--card-hi); }
.tile-ring { position: absolute; top: -3px; right: -3px; bottom: -3px; left: -3px; border-radius: 8px; border: 2px solid var(--accent); box-shadow: 0 0 10px rgba(var(--accent-rgb), .75); pointer-events: none; }
.tile-ring.drawn-ring { border-color: var(--info); box-shadow: 0 0 11px rgba(90,169,255,.85); animation: ringPulse 1s ease-out 2; }
@keyframes ringPulse { 0%{opacity:1;transform:scale(1);} 60%{opacity:.55;transform:scale(1.06);} 100%{opacity:1;transform:scale(1);} }

/* 组句 */
.compose-box { background: var(--bg-2); border-radius: 8px; padding: 10px; }
.compose-hint { color: var(--text-3); font-size: 13px; margin-bottom: 7px; }
.compose-hint small { color: var(--text-3); }
.compose-preview { min-height: 30px; line-height: 30px; font-size: 18px; color: var(--accent-soft); padding: 0 3px; border-bottom: 1px dashed var(--border); margin-bottom: 7px; }
.compose-preview .placeholder { color: var(--border-2); font-style: italic; }
.compose-preview .highlight { color: var(--accent-soft); font-weight: 700; letter-spacing: 2px; }
.compose-actions { display: flex; gap: 7px; }
.compose-actions > div, .compose-actions > button { flex: 1; }
.compose-actions .sm { font-size: 14px; padding: 10px 0; border-radius: 8px; }

/* 记录 */
.log-item { background: var(--bg-2); border-radius: 6px; padding: 7px 9px; margin-bottom: 5px; }
.log-item.ok { border-left: 3px solid var(--success); }
.log-item.bad { border-left: 3px solid var(--danger-2); }
.log-item.warn { border-left: 3px solid var(--accent); background: linear-gradient(90deg, rgba(var(--accent-rgb),.1), var(--bg-2) 50%); }
/* B 档（AI 存疑放行）：虚线边框呼应「不太确定」——它既不是打回也不是明确通过 */
.log-item.soft { border-left: 3px dashed var(--accent-soft); }
.log-text { display: flex; justify-content: space-between; align-items: center; font-size: 15px; font-weight: 600; }
.log-text-main { color: var(--text); }
.log-tag { font-size: 12px; padding: 2px 7px; border-radius: 999px; }
.log-item.ok .log-tag { background: rgba(var(--success-rgb),.2); color: var(--success); }
.log-item.bad .log-tag { background: rgba(var(--danger-2-rgb),.2); color: var(--danger-2); }
.log-item.warn .log-tag { background: rgba(var(--accent-rgb),.18); color: var(--accent); }
.log-item.soft .log-tag { background: var(--bg); color: var(--text-2); }
.log-msg { color: var(--text-3); font-size: 12px; margin-top: 3px; line-height: 1.5; }

/* 摸牌 */
.bottom-bar { position: fixed; left: 0; right: 0; bottom: 12px; padding: 0 14px; box-sizing: border-box; }
.btn-draw { background: var(--accent-2); color: var(--accent-ink); text-align: center; padding: 12px 0; border-radius: 10px; font-weight: 700; font-size: 16px; box-shadow: 0 4px 14px rgba(var(--accent-rgb),.25); cursor: pointer; }
.btn-draw.disabled { background: var(--border); color: var(--text-3); box-shadow: none; font-weight: 500; }

/* 规则面板（z-index 与 css/theme.css 的层叠约定一致：必须高于主题悬浮球 90） */
.rules-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 100; display: flex; align-items: flex-end; }
.rules-panel { width: 100%; max-height: 82vh; background: var(--bg); border-radius: 16px 16px 0 0; padding: 16px 16px 24px; box-sizing: border-box; overflow-y: auto; }
.rules-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.rules-head .title { font-size: 18px; font-weight: 700; color: var(--accent-soft); }
.rules-head .close { color: var(--text-3); font-size: 14px; cursor: pointer; }
.r-h { color: var(--accent); font-size: 16px; font-weight: 700; margin: 10px 0 4px; }
.r-line { display: flex; gap: 8px; margin-bottom: 5px; }
.r-line .num { flex: 0 0 18px; width: 18px; height: 18px; line-height: 18px; text-align: center; background: var(--accent); color: var(--accent-ink); border-radius: 50%; font-size: 12px; }
.r-line .txt { flex: 1; font-size: 14px; color: var(--text); line-height: 1.6; }
.r-p { font-size: 14px; color: var(--text); line-height: 1.6; margin-bottom: 4px; }
.r-ul { margin: 0 0 4px; padding-left: 4px; }
.r-ul view, .r-ul div { font-size: 14px; color: var(--text-2); line-height: 1.7; }
.rank-tier { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-2); padding: 10px 12px; margin-bottom: 8px; }
.rank-tier .rt-emoji { font-size: 20px; line-height: 1.5; }
.rank-tier .rt-main { display: flex; flex-direction: column; gap: 2px; }
.rank-tier .rt-main .b { font-size: 15px; font-weight: 700; color: var(--accent-soft); }
.rank-tier .rt-main .i { font-size: 13px; color: var(--text-3); font-style: normal; }

/* 通用 modal 样式已统一到 css/theme.css */

/* 结算浮层（全屏结果页，层级要高于普通弹窗，但仍低于 toast 400） */
.overlay { position: fixed; inset: 0; background: rgba(15,17,30,0.95); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 16px 40px; box-sizing: border-box; overflow-y: auto; z-index: 150; }
.share-card { width: 100%; background: linear-gradient(160deg, var(--bg-2) 0%, var(--bg) 100%); border-radius: 12px; padding: 18px 14px; box-sizing: border-box; border: 1px solid var(--border); }
.result-emoji { font-size: 50px; text-align: center; line-height: 1; margin-bottom: 7px; }
.result-line { font-size: 20px; font-weight: 700; color: var(--accent-soft); text-align: center; }
.result-rank-name { font-size: 18px; font-weight: 700; color: var(--accent); text-align: center; margin-top: 5px; }
.result-rank-desc { font-size: 13px; color: var(--text-3); text-align: center; margin-top: 3px; margin-bottom: 12px; }
.grid3 { display: flex; flex-wrap: wrap; margin-top: 4px; }
.grid3 .cell { width: 33.33%; text-align: center; padding: 6px 0; box-sizing: border-box; }
.grid3 .cell .v { font-size: 17px; font-weight: 700; color: var(--accent-soft); }
.grid3 .cell .l { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.result-cta { color: var(--text-3); font-size: 13px; margin-top: 4px; }
.result-actions { width: 100%; display: flex; flex-direction: column; gap: 8px; margin: 4px 0 10px; }
.result-actions > div { width: 100%; }
.btn-result { text-align: center; padding: 12px 0; border-radius: 10px; font-weight: 700; font-size: 15px; box-sizing: border-box; cursor: pointer; }
.btn-share { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); }
.btn-history { background: linear-gradient(135deg, var(--info), var(--info)); color: var(--accent-ink); }
.btn-restart { background: linear-gradient(135deg, var(--success), var(--success)); color: var(--accent-ink); }
.btn-home { background: linear-gradient(135deg, var(--border-2), var(--border-2)); color: var(--text); }
.result-section { width: 100%; background: var(--bg); border-radius: 10px; padding: 12px; box-sizing: border-box; margin-top: 6px; border: 1px solid var(--bg-2); }
.section-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.section-title-text { font-size: 15px; font-weight: 700; }
.section-title-text.good { color: var(--success); }
.section-title-text.bad { color: var(--danger-2); }
.section-tag { font-size: 12px; padding: 2px 7px; border-radius: 999px; font-weight: 600; }
.section-tag.good { background: rgba(var(--success-rgb),.2); color: var(--success); }
.section-tag.bad { background: rgba(var(--danger-2-rgb),.2); color: var(--danger-2); }
.result-sent { display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 6px; margin-bottom: 4px; }
.result-sent.good { background: rgba(var(--success-rgb),.12); border-left: 3px solid var(--success); }
.result-sent.bad { background: rgba(var(--danger-2-rgb),.12); border-left: 3px solid var(--danger-2); }
.sent-num { color: var(--accent-soft); font-weight: 700; font-size: 14px; min-width: 18px; }
.sent-text { color: var(--text); font-size: 15px; font-weight: 600; }
.result-sent.bad .sent-num { color: var(--danger-2); }
.report-ok { font-size: 13px; color: var(--success); line-height: 1.7; padding: 3px 0; }
.report-subtitle { font-size: 13px; color: var(--accent-soft); line-height: 1.7; padding: 2px 0 7px; }
.report-advice { font-size: 13px; color: var(--text-3); line-height: 1.6; margin: 2px 0 10px; }
.report-sub { font-size: 14px; font-weight: 700; color: var(--danger-2); }
.section-title-row.sub { margin-top: 10px; }

/* AI 弹窗 */
.ai-modal-label { display: block; color: var(--text-3); font-size: 12px; letter-spacing: 1px; margin-bottom: 6px; }
.ai-modal-text { display: block; margin-bottom: 14px; font-size: 22px; font-weight: 700; color: var(--accent); letter-spacing: 3px; line-height: 1.3; word-break: break-all; }
.ai-modal-block { background: var(--bg); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; border-left: 3px solid var(--danger-2); }
.block-label { display: block; color: var(--text-3); font-size: 12px; margin-bottom: 3px; }
.block-text { display: block; color: var(--text); font-size: 14px; line-height: 1.7; word-break: break-all; }
.ai-modal-actions { display: flex; gap: 8px; margin-top: 12px; }
.ai-modal-actions .modal-btn { flex: 1; }

/* 辩论 */
.debate-modal { width: 86%; max-width: 340px; }
.debate-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.debate-title { font-size: 16px; font-weight: 700; color: var(--accent-soft); }
.debate-rounds { font-size: 12px; color: var(--accent); background: rgba(var(--accent-rgb),.14); padding: 3px 8px; border-radius: 999px; }
.debate-subject { display: block; font-size: 15px; font-weight: 700; color: var(--accent); letter-spacing: 2px; margin-bottom: 10px; word-break: break-all; }
.debate-chat { max-height: 46vh; min-height: 110px; background: var(--bg); border-radius: 8px; padding: 10px; margin-bottom: 10px; box-sizing: border-box; overflow-y: auto; }
.debate-bubble { margin-bottom: 10px; display: flex; flex-direction: column; }
.debate-bubble:last-child { margin-bottom: 0; }
.debate-who { font-size: 11px; color: var(--text-3); margin-bottom: 3px; letter-spacing: 1px; }
.debate-say { font-size: 14px; line-height: 1.65; color: var(--text); padding: 7px 9px; border-radius: 8px; background: var(--bg-1); word-break: break-all; align-self: flex-start; max-width: 92%; }
.debate-bubble.ai .debate-say { border-left: 2px solid var(--danger-2); }
.debate-bubble.me .debate-say { background: linear-gradient(135deg, rgba(var(--accent-rgb),.18), rgba(var(--accent-rgb),.08)); border-left: 2px solid var(--accent); align-self: flex-end; max-width: 92%; }
.debate-bubble.me { align-items: flex-end; }
.debate-input-row { display: flex; gap: 6px; margin-bottom: 8px; }
.debate-input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 14px; color: var(--text); height: 38px; box-sizing: border-box; }
.debate-send { flex: 0 0 auto; white-space: nowrap; padding: 0 16px; height: 38px; line-height: 38px; border-radius: 8px; font-size: 14px; font-weight: 700; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); cursor: pointer; }
.debate-send.busy, .debate-send.disabled { background: var(--border); color: var(--text-3); cursor: not-allowed; }
.debate-send.disabled { opacity: .65; pointer-events: none; }
.debate-actions { display: flex; }
.debate-actions .modal-btn { flex: 1; }

/* 确认 */
.confirm-modal { padding: 24px 18px 16px; text-align: center; }
.confirm-icon { font-size: 36px; line-height: 1; margin-bottom: 8px; }
.confirm-title { font-size: 17px; font-weight: 700; color: var(--accent-soft); margin-bottom: 7px; }
.confirm-message { font-size: 13px; color: var(--text-2); line-height: 1.7; margin-bottom: 16px; word-break: break-all; }
.confirm-actions { display: flex; gap: 8px; }

/* 顶部导航栏 / 主题悬浮球 / 弹窗 / toast 等全局样式统一在 css/theme.css */

/* ===== 首屏加载遮罩（引擎包解析完成前给玩家"发牌中"提示，发完由 JS 隐藏） ===== */
.boot-mask { position: fixed; inset: 0; z-index: 120; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; box-sizing: border-box; text-align: center; }
.boot-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: bootSpin .8s linear infinite; }
@keyframes bootSpin { to { transform: rotate(360deg); } }
.boot-text { font-size: 14px; color: var(--text-2); line-height: 1.7; max-width: 280px; }
