feat(game): 添加局间结算界面,对接后端settlement状态

- GameState新增currentRound/totalRounds字段
- 解析后端返回的current_round和total_rounds
- 新增结算弹窗:展示每位玩家得分、胡牌标记和排名
- 状态面板显示当前局数信息
- 新增next_round动作,结算后点击"下一局"继续游戏
- 最后一局结算后显示"返回大厅"按钮

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-01 11:34:40 +08:00
parent 941d878931
commit e435fa9d96
4 changed files with 276 additions and 0 deletions

View File

@@ -1616,3 +1616,157 @@
font-size: 18px;
}
}
/* ── Settlement Overlay ── */
.settlement-overlay {
position: absolute;
inset: 0;
z-index: 100;
display: flex;
align-items: center;
justify-content: center;
background: rgba(0, 0, 0, 0.65);
backdrop-filter: blur(4px);
animation: settlement-fade-in 300ms ease-out;
}
@keyframes settlement-fade-in {
from { opacity: 0; }
to { opacity: 1; }
}
.settlement-panel {
width: 380px;
max-width: 90vw;
padding: 28px 24px 20px;
border: 1px solid rgba(220, 191, 118, 0.3);
border-radius: 16px;
background:
linear-gradient(180deg, rgba(14, 55, 40, 0.96), rgba(8, 36, 27, 0.98)),
radial-gradient(circle at 20% 24%, rgba(237, 214, 157, 0.06), transparent 34%);
box-shadow:
inset 0 1px 0 rgba(255, 244, 214, 0.08),
0 24px 48px rgba(0, 0, 0, 0.4);
animation: settlement-panel-pop 300ms ease-out;
}
@keyframes settlement-panel-pop {
from { opacity: 0; transform: scale(0.92) translateY(12px); }
to { opacity: 1; transform: scale(1) translateY(0); }
}
.settlement-title {
margin: 0 0 4px;
color: #e5c472;
font-size: 20px;
font-weight: 800;
text-align: center;
letter-spacing: 1px;
text-shadow:
-1px 0 rgba(0, 0, 0, 0.38),
0 1px rgba(0, 0, 0, 0.38),
1px 0 rgba(0, 0, 0, 0.38),
0 -1px rgba(0, 0, 0, 0.38);
}
.settlement-round-info {
margin: 0 0 16px;
color: rgba(229, 196, 114, 0.6);
font-size: 13px;
text-align: center;
letter-spacing: 0.5px;
}
.settlement-list {
display: flex;
flex-direction: column;
gap: 6px;
margin-bottom: 20px;
}
.settlement-row {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 14px;
border-radius: 10px;
background: rgba(255, 255, 255, 0.04);
transition: background 150ms;
}
.settlement-row.is-winner {
background: rgba(229, 196, 114, 0.1);
border: 1px solid rgba(220, 191, 118, 0.2);
}
.settlement-row.is-self {
box-shadow: inset 0 0 0 1px rgba(229, 196, 114, 0.18);
}
.settlement-rank {
display: inline-flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.08);
color: rgba(255, 255, 255, 0.7);
font-size: 12px;
font-weight: 700;
flex-shrink: 0;
}
.settlement-row.is-winner .settlement-rank {
background: rgba(229, 196, 114, 0.2);
color: #e5c472;
}
.settlement-name {
flex: 1;
color: rgba(255, 255, 255, 0.88);
font-size: 15px;
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.settlement-winner-badge {
display: inline-block;
margin-left: 6px;
padding: 1px 6px;
border-radius: 4px;
background: rgba(229, 196, 114, 0.22);
color: #e5c472;
font-size: 11px;
font-weight: 800;
vertical-align: middle;
}
.settlement-score {
font-size: 18px;
font-weight: 800;
color: rgba(255, 255, 255, 0.7);
flex-shrink: 0;
min-width: 48px;
text-align: right;
}
.settlement-score.is-positive {
color: #5dda6e;
}
.settlement-score.is-negative {
color: #e85d5d;
}
.settlement-actions {
display: flex;
justify-content: center;
gap: 12px;
}
.settlement-btn {
min-width: 160px;
}