/* ================= 变量与主题 ================= */
:root {
    --bg-color: #f2efe9;
    --text-color: #3d3833;
    --panel-bg: #faf8f5;
    --card-front-bg: #ffffff;
    --card-back-bg: #fcfbf9;
    --card-shadow: 0 4px 12px rgba(138, 125, 113, 0.15);
    --card-hover-shadow: 0 8px 20px rgba(138, 125, 113, 0.25);
    --border-color: #d8d4cb;
    --log-bg: #ebe7e0;
    
    --accent-color: #e15f41; 
    --safe-color: #2ed573;
    --player-color: #0abde3;
    --special-soda: #0984e3;
    --special-spice: #d35400; 
    --special-chili: #c0392b;
    --role-bg: #fdfbf7;
}

[data-theme="dark"] {
    --bg-color: #1a1b22;
    --text-color: #e1e1e1;
    --panel-bg: #272935;
    --card-front-bg: #323646;
    --card-back-bg: #dfe4ea;
    --card-back-text: #2f3542;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    --card-hover-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
    --border-color: #404455;
    --log-bg: #1e2029;
    
    --accent-color: #ff6b81;
    --safe-color: #7bed9f;
    --player-color: #48dbfb;
    --special-soda: #0984e3; 
    --special-spice: #b35900; 
    --special-chili: #c0392b;
    --role-bg: #323646;
}

/* ================= 全局样式 ================= */
body {
    font-family: 'TsangerJinKai02', sans-serif;
    background-color: var(--bg-color); color: var(--text-color);
    text-align: center; margin: 0; padding: 20px;
    display: flex; flex-direction: column; align-items: center;
    transition: background-color 0.4s ease, color 0.4s ease;
    letter-spacing: 1px; box-sizing: border-box; min-height: 100vh;
    overflow-x: hidden;
}

h1 { color: var(--accent-color); margin-bottom: 20px; font-size: 32px; font-weight: normal; text-shadow: 1px 1px 2px rgba(0,0,0,0.1); }
[data-theme="dark"] h1 { text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }

.top-tools {
    position: absolute; top: 15px; right: 15px;
    display: flex; flex-direction: column; gap: 8px; z-index: 10;
}
.tool-btn {
    background: var(--panel-bg); color: var(--text-color); border: 1px solid var(--border-color);
    padding: 8px 16px; border-radius: 20px; cursor: pointer; font-family: inherit;
    box-shadow: var(--card-shadow); transition: all 0.3s ease; font-size: 14px;
}
.tool-btn:hover:not(:disabled) { transform: translateY(-2px); }
.tool-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.skill-btn { border-color: var(--player-color); color: var(--player-color); font-weight: bold;}

#game-container {
    display: flex; gap: 25px; max-width: 1000px; width: 100%; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.5s;
}
#game-container.started { opacity: 1; pointer-events: auto; }

#left-panel { flex: 1; display: flex; flex-direction: column; gap: 15px; max-width: 300px; }
#right-panel { flex: 2; display: flex; flex-direction: column; align-items: center; max-width: 550px;}

/* ================= 模态框 & 角色选择 ================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); z-index: 80; display: none;
    justify-content: center; align-items: center; padding: 20px; box-sizing: border-box;
    backdrop-filter: blur(5px);
}
.modal-box {
    background: var(--panel-bg); padding: 30px; border-radius: 16px;
    box-shadow: var(--card-shadow); max-width: 500px; width: 100%; border: 1px solid var(--border-color);
    max-height: 90vh; overflow-y: auto;
}
.setup-box-large { max-width: 700px; }
.modal-box h2 { margin-top: 0; color: var(--accent-color); text-align: center;}

.role-grid { display: flex; gap: 15px; justify-content: center; margin-bottom: 20px; flex-wrap: wrap;}
.role-card {
    flex: 1; min-width: 180px; background: var(--role-bg); border: 2px solid var(--border-color);
    border-radius: 12px; padding: 15px; cursor: pointer; transition: all 0.2s; text-align: left;
}
.role-card:hover { transform: translateY(-5px); box-shadow: var(--card-hover-shadow); }
.role-card.selected { border-color: var(--accent-color); background: rgba(225, 95, 65, 0.05); box-shadow: 0 0 15px rgba(225, 95, 65, 0.3); }
.role-icon-large { font-size: 30px; margin-bottom: 5px; display: block; text-align: center;}
.role-title { font-weight: bold; font-size: 16px; color: var(--accent-color); text-align: center; margin-bottom: 8px;}
.role-skill { font-size: 13px; color: var(--player-color); margin-bottom: 5px; line-height: 1.4; font-weight: bold;}
.role-desc { font-size: 12px; color: #888; line-height: 1.4;}

.setup-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 15px 0; }
.setup-chip {
    padding: 8px 16px; border-radius: 20px; border: 1px solid var(--border-color);
    cursor: pointer; transition: all 0.2s; user-select: none; font-weight: bold; font-size: 14px;
    background: var(--bg-color); color: var(--text-color);
}
.setup-chip.selected { background: var(--accent-color); color: #fff; border-color: var(--accent-color); transform: scale(1.05); }
.setup-actions { display: flex; gap: 15px; justify-content: center; margin-top: 20px;}
.setup-actions .btn { font-size: 16px; padding: 12px 24px; }
.setup-actions .btn-primary { background: var(--safe-color); color: #000; border: none; font-weight: bold;}
.setup-actions .btn-primary:disabled { background: #ccc; cursor: not-allowed; opacity: 0.5; }

.help-content { text-align: left; line-height: 1.6; font-size: 15px;}

/* ================= 状态与日志 ================= */
.status-box {
    background: var(--panel-bg); border-radius: 12px; padding: 15px;
    font-size: 16px; box-shadow: var(--card-shadow); border: 1px solid var(--border-color); position: relative;
}
.hp-bar { font-size: 22px; color: var(--accent-color); letter-spacing: 2px; display: inline-block; }
.role-icon { font-size: 18px; margin-right: 5px; }
.role-name-display { font-size: 13px; color: #aaa; margin-top: 4px; font-weight: bold; }
.tooltip-role { cursor: help; border-bottom: 1px dashed #aaa; display: inline-block; padding-bottom: 2px; transition: color 0.2s; }
.tooltip-role:hover { color: var(--player-color); border-bottom-color: var(--player-color); }

@keyframes hpShake {
    0% { transform: translate(0, 0); }
    20% { transform: translate(-4px, 2px) scale(1.1); color: #ff0000; }
    40% { transform: translate(4px, -2px) scale(1.1); }
    60% { transform: translate(-4px, -2px) scale(1.1); }
    80% { transform: translate(4px, 2px) scale(1.1); color: #ff0000; }
    100% { transform: translate(0, 0); }
}
.shake-anim { animation: hpShake 0.4s ease-in-out; }

.buff-bar { font-size: 13px; font-weight: bold; margin-top: 4px; min-height: 18px;}
.buff-spice { color: var(--special-spice); }
.buff-chili { color: var(--special-chili); }

.blacklist { color: #e1b12c; font-size: 14px; margin-top: 8px; opacity: 0.9;}
.name-edit {
    cursor: pointer; border-bottom: 1px dashed var(--text-color);
    display: inline-block; padding: 0 4px; transition: color 0.2s; outline: none; font-weight: bold;
}
.name-edit:hover, .name-edit:focus { color: var(--player-color); border-bottom-color: var(--player-color); }
.edit-icon { font-size: 12px; opacity: 0.5; margin-left: 2px; }

.role-desc-text { font-size: 12px; color: #888; margin-top: 6px; line-height: 1.4; }
[data-theme="dark"] .role-desc-text { color: #aaa; }

#log-box {
    background: var(--log-bg); border-radius: 12px; height: 380px; overflow-y: auto;
    text-align: left; padding: 15px; font-size: 13px; line-height: 1.8;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.05); border: 1px solid var(--border-color);
}
#log-box::-webkit-scrollbar { width: 6px; }
#log-box::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }

.log-turn { color: #16a085; font-weight: bold;} 
[data-theme="dark"] .log-turn { color: var(--safe-color); }
.log-danger { color: var(--accent-color); font-weight: bold; }
.log-safe { color: #0984e3; }
[data-theme="dark"] .log-safe { color: var(--player-color); }
.log-skill { color: #9b59b6; font-weight: bold;} 
[data-theme="dark"] .log-skill { color: #d980fa; }

/* ================= 3D 棋盘 ================= */
#board {
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px;
    background: var(--panel-bg); padding: 15px; border-radius: 16px;
    width: 100%; box-sizing: border-box; box-shadow: var(--card-shadow);
    perspective: 1000px; border: 1px solid var(--border-color);
}

.card { aspect-ratio: 1 / 1; cursor: pointer; position: relative; user-select: none; }
.card-inner {
    position: relative; width: 100%; height: 100%;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); transform-style: preserve-3d;
}
.card:hover:not(.flipped):not(.used):not(.cheat-peek) .card-inner { transform: scale(1.05) translateY(-2px); box-shadow: var(--card-hover-shadow); border-radius: 8px;}
.card.flipped .card-inner, .card.cheat-peek .card-inner { transform: rotateY(180deg); }

.card-front, .card-back {
    position: absolute; width: 100%; height: 100%; backface-visibility: hidden;
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    flex-direction: column; box-shadow: var(--card-shadow); box-sizing: border-box;
}

.card-front { background: var(--card-front-bg); color: var(--border-color); font-size: 20px; border: 1px solid var(--border-color); }
.card-back {
    background: var(--card-back-bg); color: var(--text-color); transform: rotateY(180deg); 
    font-size: 14px; font-weight: bold; padding: 4px; border: 2px solid #e1b12c;
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px;
}
[data-theme="dark"] .card-back { color: var(--card-back-text); border-color: #ffa502; }

.ing-danger {
    color: #fff !important; background: var(--accent-color);
    padding: 2px 6px; border-radius: 6px; text-shadow: none !important;
    font-weight: 900; line-height: 1.2;
}

.card.used .card-inner { transform: rotateY(180deg) scale(0.95); }
.card.used .card-back { border-color: transparent; box-shadow: none; opacity: 0.9; }
.card.discarded .card-back { background: #bdc3c7; border: 2px dashed #7f8c8d; color: #7f8c8d; opacity: 0.7; }

.card.eaten-player .card-back { background: rgba(10, 189, 227, 0.25); border: 2px solid var(--player-color); color: #000 !important; font-weight: 900; }
.card.eaten-player .card-back::after { content: '🧑'; position: absolute; bottom: 2px; right: 2px; font-size: 12px; }
.card.eaten-ai .card-back { background: rgba(225, 95, 65, 0.25); border: 2px solid var(--accent-color); color: #000 !important; font-weight: 900; }
.card.eaten-ai .card-back::after { content: '🤖'; position: absolute; bottom: 2px; right: 2px; font-size: 12px; }
[data-theme="dark"] .card.eaten-player .card-back, [data-theme="dark"] .card.eaten-ai .card-back { color: #ffffff !important; text-shadow: 1px 1px 3px rgba(0,0,0,0.8); }

/* ================= 交互按钮 ================= */
#action-area {
    margin-top: 15px; padding: 15px; background: var(--panel-bg); border-radius: 12px; width: 100%; box-sizing: border-box;
    box-shadow: var(--card-shadow); border: 1px solid var(--border-color); visibility: hidden; transition: all 0.3s ease; opacity: 0; transform: translateY(10px); min-height: 100px;
}
#action-area.show { visibility: visible; opacity: 1; transform: translateY(0); }

.btn {
    background: var(--bg-color); color: var(--text-color); border: 1px solid var(--border-color);
    padding: 12px; margin: 4px; border-radius: 8px; font-size: 14px; font-family: inherit;
    cursor: pointer; transition: all 0.2s ease; flex: 1; line-height: 1.6; font-weight: bold;
}
.btn:hover:not(:disabled) { background: var(--border-color); transform: translateY(-1px); }
.btn.skill-action { background: #f1c40f; color: #000; border-color: #f39c12; }
.btn.skill-action:hover { background: #f39c12; }

.btn-chili { background: transparent; border: 2px dashed var(--special-chili); color: var(--special-chili); width: 100%; margin-bottom: 10px; font-weight: bold;}
.btn-chili.active { background: var(--special-chili); color: #fff; border-style: solid; box-shadow: 0 0 10px rgba(225, 95, 65, 0.5); }

.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); display: none; flex-direction: column;
    justify-content: center; align-items: center; font-size: 32px; color: white; z-index: 100; backdrop-filter: blur(5px);
}
.restart-btn {
    margin-top: 30px; padding: 12px 30px; font-size: 18px; font-family: inherit;
    background: var(--safe-color); color: #1a1a1a; border: none; border-radius: 30px; cursor: pointer; transition: transform 0.2s; font-weight:bold;
}

/* ================= 推理笔记标签 ================= */
.drawer-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); z-index: 90; display: none; opacity: 0; transition: opacity 0.3s;
}
.drawer {
    position: fixed; right: -350px; top: 0; width: 340px; height: 100%; max-width: 85vw;
    background: var(--panel-bg); z-index: 95; transition: right 0.3s ease;
    box-shadow: -4px 0 15px rgba(0,0,0,0.1); overflow-y: auto; padding: 25px 20px; box-sizing: border-box; border-left: 1px solid var(--border-color);
}
.drawer.open { right: 0; }
.drawer h3 { color: var(--accent-color); margin-top: 0; border-bottom: 2px dashed var(--border-color); padding-bottom: 10px; margin-bottom: 20px;}

#mark-list { display: flex; flex-wrap: wrap; gap: 10px; }
.note-chip {
    padding: 8px 14px; border-radius: 8px; border: 2px solid var(--border-color);
    cursor: pointer; font-size: 14px; font-weight: bold; font-family: inherit;
    background: var(--bg-color); color: var(--text-color); transition: all 0.2s; user-select: none;
}
.note-chip.unknown { opacity: 0.8; }
.note-chip.safe { background: rgba(46, 213, 115, 0.2); border-color: var(--safe-color); color: var(--safe-color); }
.note-chip.danger { background: rgba(255, 71, 87, 0.2); border-color: var(--accent-color); color: var(--accent-color); }
[data-theme="dark"] .note-chip.safe { color: #7bed9f; }
[data-theme="dark"] .note-chip.danger { color: #ff6b81; }

.btn-action-choice { display: flex; flex-direction: column; gap: 8px; padding: 12px !important; }
.eat-row { display: flex; align-items: center; background: rgba(0, 0, 0, 0.04); padding: 8px 10px; border-radius: 6px; width: 100%; box-sizing: border-box; }
[data-theme="dark"] .eat-row { background: rgba(255, 255, 255, 0.05); }
.eat-badge-player { background-color: rgba(10, 189, 227, 0.15); color: var(--player-color); border: 1px solid var(--player-color); padding: 3px 8px; border-radius: 4px; font-size: 13px; font-weight: 900; white-space: nowrap; margin-right: 10px; flex-shrink: 0; }
.eat-badge-opponent { background-color: rgba(225, 95, 65, 0.15); color: var(--accent-color); border: 1px solid var(--accent-color); padding: 3px 8px; border-radius: 4px; font-size: 13px; font-weight: 900; white-space: nowrap; margin-right: 10px; flex-shrink: 0; }
.eat-content { font-size: 14px; line-height: 1.5; text-align: left; word-break: break-word; }

/* 移动端菜单与啤酒特效 */
.menu-toggle { display: none; width: 100%; margin-bottom: 5px; font-weight: bold;}
.tools-menu { display: flex; flex-direction: column; gap: 8px; }

/* 啤酒盖牌模式下的发光动画 (修复了当前卡牌闪烁的问题) */
#board.beer-mode .card.beer-target {
    cursor: crosshair;
    animation: pulseBeer 1.5s infinite;
    border-color: #f39c12;
}
@keyframes pulseBeer {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(243, 156, 18, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(243, 156, 18, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(243, 156, 18, 0); }
}

/* ================= 拍桌指认按钮 ================= */
.btn-accuse {
    background: linear-gradient(135deg, #ff4757, #c0392b);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 8px;
    margin-bottom: 4px;
    width: 100%;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(225, 95, 65, 0.3);
}
.btn-accuse:hover { transform: scale(1.02); }
.btn-accuse:disabled { background: #95a5a6; cursor: not-allowed; box-shadow: none; transform: none; }
#accuse-btn{ font-family: 'TsangerJinKai02', sans-serif !important; }

/* ================= Toast 胶囊通知 ================= */
#toast-container {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-family: inherit;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    white-space: pre-wrap;
    text-align: center;
    line-height: 1.5;
    backdrop-filter: blur(4px);
}
[data-theme="dark"] .toast {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ================= Bingo 提示横幅 ================= */
.bingo-hint {
    background: rgba(225, 95, 65, 0.1);
    border: 1px solid rgba(225, 95, 65, 0.3);
    color: var(--accent-color);
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 15px;
    text-align: center;
    width: 100%;
    max-width: 950px;
    box-sizing: border-box;
}
[data-theme="dark"] .bingo-hint {
    background: rgba(255, 107, 129, 0.15);
    border-color: rgba(255, 107, 129, 0.3);
    color: #ff9fb3;
}

/* ================= 进度条(滚动条)全局样式适配 ================= */
::-webkit-scrollbar { 
    width: 8px; 
    height: 8px; 
}
::-webkit-scrollbar-track { 
    background: rgba(0, 0, 0, 0.05); 
    border-radius: 4px; 
}
[data-theme="dark"] ::-webkit-scrollbar-track { 
    background: rgba(255, 255, 255, 0.05); 
}
::-webkit-scrollbar-thumb { 
    background: var(--border-color); 
    border-radius: 4px; 
}
::-webkit-scrollbar-thumb:hover { 
    background: var(--accent-color); 
}

/* 覆盖原有的日志框专属滚动条样式 */
#log-box::-webkit-scrollbar { width: 6px; }
#log-box::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }

/* ================= 结算进食报告样式 ================= */
#game-over-stats {
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.6);
    padding: 15px;
    border-radius: 12px;
    max-width: 90%;
    width: 450px;
    font-size: 14px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}
.stat-title { color: #f1c40f; margin-bottom: 10px; text-align: center; font-weight: bold; font-size: 16px;}
.stat-section { margin-bottom: 10px; }
.stat-chip {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    margin: 4px 4px 4px 0;
    font-size: 13px;
}
.stat-chip.danger {
    background: rgba(225, 95, 65, 0.8);
    color: white;
    font-weight: bold;
    border: 1px solid #ff4757;
}
.stat-chip.special {
    background: rgba(46, 213, 115, 0.2);
    color: #7bed9f;
    border: 1px solid #7bed9f;
    font-weight: bold;
}
.stat-count { opacity: 0.7; font-size: 11px; margin-left: 5px; }

/* ================= 濒死红框闪烁特效 ================= */
.low-hp-warning {
    animation: criticalPulse 1.2s infinite alternate;
    border-color: #ff4757 !important;
    background: rgba(255, 71, 87, 0.05) !important;
}

@keyframes criticalPulse {
    0% { box-shadow: 0 0 5px rgba(255, 71, 87, 0.2); }
    100% { box-shadow: 0 0 20px rgba(255, 71, 87, 0.8), inset 0 0 10px rgba(255, 71, 87, 0.2); }
}

/* ================= AI 动态聊天气泡 ================= */
.chat-bubble {
    position: absolute;
    top: -45px;
    right: -10px;
    background: #fff;
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 50;
    max-width: 180px;
    word-wrap: break-word;
    opacity: 0;
    transform: translateY(10px) scale(0.8);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    border: 2px solid var(--accent-color);
}
.chat-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--accent-color);
}
[data-theme="dark"] .chat-bubble {
    background: #2f3542;
    color: #fff;
}
.chat-bubble.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ================= 餐厅选择网格 ================= */
.restaurant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
    width: 100%;
}
.restaurant-card {
    text-align: left !important;
    padding: 15px !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: auto !important;
    max-width: none !important;
    box-sizing: border-box;
    white-space: normal; /* 防止被挤成一行 */
    align-items: flex-start !important;
}

/* 手机端恢复单列布局 */
@media (max-width: 768px) {
    .restaurant-grid { grid-template-columns: 1fr; }
}

/* ================= 手机端终极适配 (仅此部分生效于手机) ================= */
@media (max-width: 768px) {
    body { padding: 5px; }
    h1 { font-size: 22px; margin-top: 45px; margin-bottom: 5px; text-align: center; padding-left: 0; }
    
    /* 顶部折叠菜单机制 */
    .top-tools { right: 5px; top: 5px; width: auto; max-width: none; align-items: flex-end; z-index: 100;}
    .menu-toggle { display: block; padding: 8px 12px; font-size: 13px; box-shadow: var(--card-shadow); }
    .tools-menu { 
        display: none; background: var(--panel-bg); padding: 12px; 
        border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); 
        border: 1px solid var(--border-color); flex-direction: column; gap: 10px; 
    }
    .tools-menu.show { display: flex; }
    .tool-btn { padding: 10px 15px; font-size: 14px; text-align: center;}
    
    #game-container { flex-direction: column; gap: 8px; }
    
    /* 状态栏精简紧凑排版 */
    #left-panel { flex-direction: row; flex-wrap: wrap; max-width: 100%; gap: 6px; }
    .status-box { flex: 1; min-width: 45%; padding: 8px; font-size: 13px; }
    .hp-bar { font-size: 18px; margin-top: 2px;}
    .role-desc-text { display: none; } /* 隐藏过长的介绍文案 */
    .blacklist { font-size: 12px; margin-top: 4px; }
    
    #log-box { width: 100%; height: 110px; order: 3; margin-top: 5px; padding: 10px;}
    #right-panel { max-width: 100%; order: 2; width: 100%; }
    
    /* 榨干所有像素给卡牌网格 */
    #board { gap: 3px; padding: 5px; border-radius: 8px; width: 100%; }
    .card-front { font-size: 18px; }
    .card-back { font-size: 11px; padding: 1px; gap: 1px; line-height: 1.1; }
    
    /* 手机端内部标签极限缩放 */
    .card-back span { font-size: 10px !important; }
    .ing-danger { font-size: 10px !important; padding: 1px 2px; border-radius: 3px; }
    
    #action-area { padding: 10px; margin-top: 10px; min-height: 80px;}
    #action-buttons { flex-direction: column; gap: 8px; }
    .btn { width: 100%; margin: 0; padding: 8px; font-size: 13px; }
    
    .btn-action-choice { padding: 8px !important; }
    .eat-row { padding: 4px; }
    .eat-badge-player, .eat-badge-opponent { padding: 2px 4px; font-size: 11px; margin-right: 6px; }
    .eat-content { font-size: 11px; }
    
    .modal-box { padding: 15px; width: 95%; max-height: 90vh; box-sizing: border-box; overflow-x: hidden; }
    .role-grid { flex-direction: column; gap: 10px; width: 100%; }
    .role-card { width: 100%; min-width: 0; padding: 10px; box-sizing: border-box; }
    .setup-actions { flex-direction: column; gap: 10px;}
}

/* 针对非常小的手机屏幕兜底 */
@media (max-width: 380px) {
    .card-back { font-size: 9px; line-height: 1; }
    .card-back span { font-size: 9px !important; }
    .ing-danger { font-size: 9px !important; }
}