/* ================= 状态与日志 ================= */
.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;
}
.status-box.challenge-boss-panel {
    border-width: 2px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16);
    overflow: visible;
}
.status-box.challenge-boss-panel::before {
    content: none;
}
.status-box.challenge-boss-panel .role-name-display {
    color: #aaa;
}
.status-box.challenge-boss-panel #ai-role-name {
    display: inline-block;
    margin-top: 4px;
    padding: 0;
    border-radius: 0;
    border: none;
    font-size: 13px;
    letter-spacing: 0;
    color: #aaa;
    background: transparent;
}
.status-box.challenge-boss-panel #ai-name-display {
    color: rgba(185, 28, 28, 0.92) !important;
}
.status-box.challenge-boss-panel .blacklist {
    color: #9f1239;
}

.status-box.challenge-boss-panel.boss-mode-s5 {
    border-color: rgba(181, 83, 9, 0.56);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(146, 64, 14, 0.08)), var(--panel-bg);
}
.status-box.challenge-boss-panel.boss-mode-s6 {
    border-color: rgba(30, 64, 175, 0.52);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(14, 116, 144, 0.08)), var(--panel-bg);
}
.status-box.challenge-boss-panel.boss-mode-s7 {
    border-color: rgba(185, 28, 28, 0.58);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.14), rgba(127, 29, 29, 0.1)), var(--panel-bg);
}
.status-box.challenge-boss-panel.boss-mode-nightmarket {
    border-color: rgba(67, 56, 202, 0.5);
    background: linear-gradient(135deg, rgba(49, 46, 129, 0.14), rgba(79, 70, 229, 0.09)), var(--panel-bg);
}
.status-box.challenge-boss-panel.boss-mode-premade {
    border-color: rgba(217, 119, 6, 0.52);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(217, 119, 6, 0.08)), var(--panel-bg);
}
.status-box.challenge-boss-panel.boss-mode-northeast {
    border-color: rgba(22, 163, 74, 0.48);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(34, 197, 94, 0.08)), var(--panel-bg);
}
.status-box.challenge-boss-panel.boss-mode-highschool {
    border-color: rgba(234, 88, 12, 0.56);
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.14), rgba(245, 158, 11, 0.1)), var(--panel-bg);
}
.status-box.challenge-boss-panel.boss-mode-herbal {
    border-color: rgba(5, 150, 105, 0.52);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.13), rgba(20, 184, 166, 0.08)), var(--panel-bg);
}
.status-box.challenge-boss-panel.boss-mode-fireice {
    border-color: rgba(239, 68, 68, 0.52);
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.12), rgba(96, 165, 250, 0.1)), var(--panel-bg);
}
.status-box.challenge-boss-panel.boss-mode-techsnack {
    border-color: rgba(79, 70, 229, 0.5);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(6, 182, 212, 0.1)), var(--panel-bg);
}
.status-box.challenge-boss-panel.boss-mode-skewer {
    border-color: rgba(180, 83, 9, 0.5);
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.14), rgba(180, 83, 9, 0.1)), var(--panel-bg);
}
.status-box.challenge-boss-panel.boss-mode-ghostseafood {
    border-color: rgba(30, 64, 175, 0.5);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.13), rgba(67, 56, 202, 0.1)), var(--panel-bg);
}
.hp-bar { font-size: 22px; color: var(--accent-color); letter-spacing: 2px; display: inline-block; }
.player-title-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    padding: 0 8px;
    margin-right: 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
    vertical-align: middle;
    border: 1px solid transparent;
    color: #1f2937;
    background: linear-gradient(135deg, rgba(203, 213, 225, 0.66), rgba(148, 163, 184, 0.54));
    max-width: 116px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.player-title-tag.is-guest {
    color: #4b5563;
    border-color: rgba(107, 114, 128, 0.35);
    background: linear-gradient(135deg, rgba(229, 231, 235, 0.95), rgba(209, 213, 219, 0.88));
}
.player-title-tag.tier-0,
.player-title-tag.tier-1 {
    color: #0f3d30;
    border-color: rgba(37, 158, 120, 0.35);
    background: linear-gradient(135deg, rgba(134, 239, 172, 0.94), rgba(110, 231, 183, 0.9));
}
.player-title-tag.tier-2,
.player-title-tag.tier-3 {
    color: #0e375b;
    border-color: rgba(56, 122, 201, 0.38);
    background: linear-gradient(135deg, rgba(147, 197, 253, 0.95), rgba(125, 211, 252, 0.9));
}
.player-title-tag.tier-4,
.player-title-tag.tier-5 {
    color: #4b2d07;
    border-color: rgba(224, 150, 38, 0.42);
    background: linear-gradient(135deg, rgba(253, 224, 71, 0.95), rgba(251, 191, 36, 0.9));
}
.player-title-tag.tier-6,
.player-title-tag.tier-7,
.player-title-tag.tier-8 {
    color: #4a1f12;
    border-color: rgba(225, 93, 67, 0.45);
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.95), rgba(248, 113, 113, 0.9));
}
@keyframes titleTagBreathLow {
    0% { transform: translateY(0) scale(1); filter: saturate(1); }
    50% { transform: translateY(-0.4px) scale(1.008); filter: saturate(1.03); }
    100% { transform: translateY(0) scale(1); filter: saturate(1); }
}
@keyframes titleTagBreathMid {
    0% { transform: translateY(0) scale(1); filter: saturate(1); }
    50% { transform: translateY(-0.6px) scale(1.012); filter: saturate(1.06); }
    100% { transform: translateY(0) scale(1); filter: saturate(1); }
}
@keyframes titleTagBreathHigh {
    0% { transform: translateY(0) scale(1); filter: saturate(1); }
    50% { transform: translateY(-0.8px) scale(1.016); filter: saturate(1.1); }
    100% { transform: translateY(0) scale(1); filter: saturate(1); }
}
.player-title-tag.is-breathing-low {
    animation: titleTagBreathLow 3.4s ease-in-out infinite;
}
.player-title-tag.is-breathing-mid {
    animation: titleTagBreathMid 2.9s ease-in-out infinite;
}
.player-title-tag.is-breathing-high {
    animation: titleTagBreathHigh 2.4s ease-in-out infinite;
}
.player-role-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 4px;
}
.role-icon { font-size: 18px; margin-right: 5px; }
.role-name-display { font-size: 13px; color: #aaa; margin-top: 4px; font-weight: bold; }
.player-role-row .role-name-display { margin-top: 0; }
.tooltip-role { cursor: pointer; border-bottom: none; display: inline-block; padding-bottom: 0; transition: color 0.2s; }
.tooltip-role:hover { 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); }
.buff-ice { color: #74b9ff; }

.blacklist { color: #8b1e1e; font-size: 14px; margin-top: 8px; opacity: 0.9;}
.collection-progress {
    margin-top: 10px;
    padding: 9px 10px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.08), rgba(10, 189, 227, 0.06));
    border: 1px solid rgba(46, 204, 113, 0.18);
}
.collection-progress.is-collapsible,
.mobile-progress-card.is-collapsible {
    cursor: pointer;
}
.collection-progress.is-complete {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.2), rgba(241, 196, 15, 0.12));
    border-color: rgba(46, 204, 113, 0.32);
}
.collection-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.collection-progress-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-color);
}
.collection-progress-chevron {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    white-space: nowrap;
}
.collection-progress-count {
    font-size: 12px;
    font-weight: 700;
    color: var(--safe-color);
}
.collection-progress-bar,
.mobile-progress-bar {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(0, 0, 0, 0.05);
}
.collection-progress-fill,
.mobile-progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2ecc71 0%, #1abc9c 55%, #0abde3 100%);
    transition: width 0.28s ease;
}
.collection-progress-missing {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.55;
    color: #6b7280;
}
.collection-progress-missing[hidden],
.mobile-intel-meta[hidden] {
    display: none;
}
.collection-progress.is-collapsible:focus-visible,
.mobile-progress-card.is-collapsible:focus-visible {
    outline: 2px solid rgba(10, 189, 227, 0.48);
    outline-offset: 2px;
}
.collection-progress.is-collapsible .collection-progress-chevron::before,
.mobile-progress-card.is-collapsible .collection-progress-chevron::before {
    content: '▾ ';
}
.collection-progress.is-collapsible.is-expanded .collection-progress-chevron::before,
.mobile-progress-card.is-collapsible.is-expanded .collection-progress-chevron::before {
    content: '▴ ';
}
.collection-progress.is-collapsible.is-expanded .collection-progress-chevron,
.mobile-progress-card.is-collapsible.is-expanded .collection-progress-chevron {
    color: var(--player-color);
}
.collection-progress-opponent {
    cursor: default;
}
.collection-progress-opponent .collection-progress-head {
    margin-bottom: 6px;
}
.collection-progress-warning {
    color: #b45309;
    font-weight: 700;
}
[data-theme="dark"] .collection-progress-warning {
    color: #fbbf24;
}
.intel-strip {
    margin-top: 8px;
    padding: 6px 8px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.5;
    background: rgba(10, 189, 227, 0.08);
    border: 1px dashed rgba(10, 189, 227, 0.26);
    color: var(--text-color);
}
.intel-safe {
    color: var(--player-color);
}
.intel-threat {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.28);
    font-weight: 700;
}
.intel-label {
    display: inline-block;
    margin-right: 6px;
    font-weight: bold;
    opacity: 0.78;
}
.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; }
[data-theme="dark"] .intel-strip {
    background: rgba(10, 189, 227, 0.12);
    border-color: rgba(10, 189, 227, 0.3);
}
[data-theme="dark"] .intel-threat {
    color: #ffb4b4;
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(248, 113, 113, 0.32);
}
[data-theme="dark"] .status-box {
    background: rgba(39, 41, 53, 0.9);
}
[data-theme="dark"] .status-box.challenge-boss-panel {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.36);
}
[data-theme="dark"] .status-box.challenge-boss-panel .role-name-display {
    color: #aaa;
}
[data-theme="dark"] .status-box.challenge-boss-panel #ai-role-name {
    color: #aaa;
    background: transparent;
    border: none;
}
[data-theme="dark"] .status-box.challenge-boss-panel #ai-name-display {
    color: rgba(185, 28, 28, 0.92) !important;
}
[data-theme="dark"] .status-box.challenge-boss-panel .blacklist {
    color: #fda4af;
}
[data-theme="dark"] .player-title-tag {
    color: #0f1c28;
}
[data-theme="dark"] .player-title-tag.is-guest {
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.4);
    background: linear-gradient(135deg, rgba(71, 85, 105, 0.9), rgba(51, 65, 85, 0.86));
}
[data-theme="dark"] .collection-progress {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.14), rgba(10, 189, 227, 0.08));
    border-color: rgba(46, 204, 113, 0.24);
}
[data-theme="dark"] .collection-progress.is-complete {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.2), rgba(241, 196, 15, 0.12));
    border-color: rgba(123, 237, 159, 0.34);
}
[data-theme="dark"] .blacklist {
    color: #e1b12c;
}
[data-theme="dark"] .collection-progress-label,
[data-theme="dark"] .mobile-intel-meta {
    color: #e5ebf5;
}
[data-theme="dark"] .collection-progress-chevron {
    color: #b7c0d2;
}
[data-theme="dark"] .collection-progress-missing {
    color: #b7c0d2;
}
[data-theme="dark"] .collection-progress-bar,
[data-theme="dark"] .mobile-progress-bar {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(255, 255, 255, 0.06);
}
.opening-turn-box {
    max-width: 420px;
    text-align: center;
}
.restaurant-story-box {
    max-width: 500px;
    text-align: left;
    padding: 22px 22px 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.06)), var(--panel-bg);
    overflow: hidden;
}
.restaurant-story-box::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, rgba(225, 95, 65, 0.25), rgba(10, 189, 227, 0.28));
    pointer-events: none;
}
.restaurant-story-box[data-scene="s5"]::before { background: linear-gradient(90deg, rgba(230, 126, 34, 0.72), rgba(241, 196, 15, 0.5)); }
.restaurant-story-box[data-scene="s6"]::before { background: linear-gradient(90deg, rgba(52, 152, 219, 0.68), rgba(26, 188, 156, 0.48)); }
.restaurant-story-box[data-scene="s7"]::before { background: linear-gradient(90deg, rgba(192, 57, 43, 0.78), rgba(142, 68, 173, 0.5)); }
.restaurant-story-box[data-scene="nightmarket"]::before { background: linear-gradient(90deg, rgba(44, 62, 80, 0.82), rgba(108, 92, 231, 0.55)); }
.restaurant-story-box[data-scene="premade"]::before { background: linear-gradient(90deg, rgba(241, 196, 15, 0.82), rgba(230, 126, 34, 0.55)); }
.restaurant-story-box[data-scene="northeast"]::before { background: linear-gradient(90deg, rgba(41, 128, 185, 0.7), rgba(39, 174, 96, 0.5)); }
.restaurant-story-box[data-scene="highschool"]::before { background: linear-gradient(90deg, rgba(231, 76, 60, 0.78), rgba(241, 196, 15, 0.55)); }
.restaurant-story-box[data-scene="herbal"]::before { background: linear-gradient(90deg, rgba(39, 174, 96, 0.78), rgba(22, 160, 133, 0.52)); }
.restaurant-story-box[data-scene="fireice"]::before { background: linear-gradient(90deg, rgba(237, 94, 66, 0.82), rgba(87, 183, 255, 0.56)); }
.restaurant-story-box[data-scene="skewer"]::before { background: linear-gradient(90deg, rgba(205, 129, 44, 0.82), rgba(247, 196, 92, 0.56)); }
.restaurant-story-box[data-scene="ghostseafood"]::before { background: linear-gradient(90deg, rgba(63, 152, 196, 0.82), rgba(123, 110, 255, 0.56)); }
.restaurant-story-box[data-scene="fireice"] {
    background: linear-gradient(135deg, rgba(255, 130, 91, 0.12), rgba(104, 189, 255, 0.14)), linear-gradient(180deg, rgba(255,255,255,0.2), rgba(255,255,255,0.06)), var(--panel-bg);
}
.restaurant-story-box[data-scene="skewer"] {
    background: linear-gradient(135deg, rgba(233, 164, 74, 0.14), rgba(142, 89, 33, 0.08)), linear-gradient(180deg, rgba(255,255,255,0.2), rgba(255,255,255,0.06)), var(--panel-bg);
}
.restaurant-story-box[data-scene="ghostseafood"] {
    background: linear-gradient(135deg, rgba(95, 201, 230, 0.14), rgba(126, 111, 255, 0.1)), linear-gradient(180deg, rgba(255,255,255,0.2), rgba(255,255,255,0.06)), var(--panel-bg);
}
.restaurant-story-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(225, 95, 65, 0.12);
    color: var(--accent-color);
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 10px;
}
.restaurant-story-scene {
    margin-top: 12px;
}
.restaurant-story-speaker {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.4px;
    color: var(--accent-color);
}
.restaurant-story-bubble {
    position: relative;
    padding: 14px 16px;
    border-radius: 16px 16px 16px 6px;
    background: rgba(225, 95, 65, 0.08);
    border: 1px solid rgba(225, 95, 65, 0.18);
    line-height: 1.8;
    font-size: 14px;
}
.restaurant-story-bubble::before {
    content: '';
    position: absolute;
    left: 14px;
    top: -8px;
    width: 16px;
    height: 16px;
    transform: rotate(45deg);
    background: rgba(225, 95, 65, 0.08);
    border-left: 1px solid rgba(225, 95, 65, 0.18);
    border-top: 1px solid rgba(225, 95, 65, 0.18);
}
.restaurant-story-rule-card {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(10, 189, 227, 0.08);
    border: 1px dashed rgba(10, 189, 227, 0.28);
}
.restaurant-story-rule-label {
    font-size: 12px;
    font-weight: bold;
    color: var(--player-color);
    margin-bottom: 6px;
}
.restaurant-story-rule-text {
    font-size: 13px;
    line-height: 1.75;
}
.restaurant-story-footer {
    margin-top: 14px;
    font-size: 12px;
    color: #888;
    text-align: center;
}
.restaurant-story-actions {
    margin-top: 12px;
}
[data-theme="dark"] .restaurant-story-box {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.015)), var(--panel-bg);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .restaurant-story-box[data-scene="fireice"] {
    background: linear-gradient(135deg, rgba(235, 103, 76, 0.12), rgba(83, 164, 247, 0.14)), linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015)), var(--panel-bg);
}
[data-theme="dark"] .restaurant-story-box[data-scene="skewer"] {
    background: linear-gradient(135deg, rgba(214, 145, 51, 0.12), rgba(105, 64, 29, 0.12)), linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015)), var(--panel-bg);
}
[data-theme="dark"] .restaurant-story-box[data-scene="ghostseafood"] {
    background: linear-gradient(135deg, rgba(64, 170, 206, 0.12), rgba(101, 89, 218, 0.12)), linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015)), var(--panel-bg);
}
[data-theme="dark"] .restaurant-story-badge {
    background: rgba(255, 107, 129, 0.16);
    color: #ffb0c0;
}
[data-theme="dark"] .restaurant-story-footer {
    color: #afb5c8;
}
[data-theme="dark"] .restaurant-story-bubble {
    background: rgba(225, 95, 65, 0.12);
    border-color: rgba(225, 95, 65, 0.24);
}
[data-theme="dark"] .restaurant-story-bubble::before {
    background: rgba(225, 95, 65, 0.12);
    border-left-color: rgba(225, 95, 65, 0.24);
    border-top-color: rgba(225, 95, 65, 0.24);
}
[data-theme="dark"] .restaurant-story-rule-card {
    background: rgba(10, 189, 227, 0.12);
    border-color: rgba(10, 189, 227, 0.3);
}
[data-theme="dark"] .opening-turn-box {
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015)), var(--panel-bg);
}
[data-theme="dark"] .opening-turn-badge {
    background: rgba(255, 107, 129, 0.16);
    color: #ffb0c0;
}
.opening-turn-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(225, 95, 65, 0.12);
    color: var(--accent-color);
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 12px;
}
.opening-turn-text {
    margin: 12px 0 8px;
    line-height: 1.7;
    font-size: 14px;
}
.opening-turn-countdown {
    font-size: 12px;
    color: #888;
    margin-bottom: 16px;
}
.opening-turn-actions {
    display: flex;
    gap: 12px;
}
.opening-turn-actions .btn {
    flex: 1;
}
[data-theme="dark"] .opening-turn-countdown {
    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-panel {
    background: var(--panel-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}
.log-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.06));
}
.log-panel-title {
    font-size: 14px;
    font-weight: bold;
    color: var(--accent-color);
}
.log-toggle-btn {
    border: none;
    background: rgba(225, 95, 65, 0.12);
    color: var(--accent-color);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
}
.mobile-battle-hud,
.mobile-intel-strip {
    display: none;
}
.mobile-battle-hud {
    position: sticky;
    top: 10px;
    z-index: 70;
    width: 100%;
    max-width: 950px;
    box-sizing: border-box;
    margin-bottom: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(225, 95, 65, 0.18);
    background: rgba(250, 248, 245, 0.92);
    backdrop-filter: blur(12px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.12);
}
.mobile-hud-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mobile-hud-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 10px;
}
.mobile-hud-hp {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-wrap: nowrap;
    white-space: nowrap;
}
.mobile-turn-badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    flex: 0 0 auto;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.3px;
}
.mobile-turn-badge.neutral { background: rgba(127, 140, 141, 0.16); color: #5b666b; }
.mobile-turn-badge.player { background: rgba(10, 189, 227, 0.16); color: var(--player-color); }
.mobile-turn-badge.enemy { background: rgba(225, 95, 65, 0.16); color: var(--accent-color); }
.mobile-turn-badge.warn { background: rgba(243, 156, 18, 0.18); color: #b9770e; }
.mobile-hp-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: bold;
    border: 1px solid transparent;
}
.mobile-hp-chip.player {
    color: var(--player-color);
    background: rgba(10, 189, 227, 0.12);
    border-color: rgba(10, 189, 227, 0.22);
}
.mobile-hp-chip.enemy {
    color: var(--accent-color);
    background: rgba(225, 95, 65, 0.12);
    border-color: rgba(225, 95, 65, 0.22);
}
.mobile-hp-chip.collection {
    color: #7a5c15;
    background: rgba(241, 196, 15, 0.16);
    border-color: rgba(241, 196, 15, 0.32);
}
.mobile-hp-chip.collection.is-complete {
    color: #16673b;
    background: rgba(46, 213, 115, 0.18);
    border-color: rgba(46, 213, 115, 0.34);
}
.mobile-hp-chip strong {
    font-size: 12px;
}
.mobile-turn-text {
    font-size: 12px;
    line-height: 1.35;
    text-align: left;
    opacity: 0.88;
}
.mobile-hud-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.mobile-hud-btn {
    flex: 1;
    border: 1px solid var(--border-color);
    background: var(--panel-bg);
    color: var(--text-color);
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
}
.side-action-stack {
    position: fixed;
    right: 14px;
    bottom: 104px;
    z-index: 86;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.side-action-fab {
    position: relative;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(10, 189, 227, 0.3);
    border-radius: 999px;
    background: rgba(250, 248, 245, 0.96);
    color: var(--player-color);
    box-shadow: 0 14px 28px rgba(0,0,0,0.18);
    font-size: 22px;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.side-action-fab:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(0,0,0,0.22);
}
.side-action-fab:disabled {
    color: #8b867f;
    background: linear-gradient(180deg, rgba(176, 170, 161, 0.2), rgba(176, 170, 161, 0.1));
    border-color: rgba(176, 170, 161, 0.35);
    box-shadow: none;
    cursor: not-allowed;
}
.side-action-fab.is-pending {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(225, 95, 65, 0.14), 0 16px 30px rgba(0,0,0,0.24);
    color: var(--accent-color);
}
.side-action-fab-icon {
    line-height: 1;
}
.side-action-fab-count {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent-color), #f39c12);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    box-sizing: border-box;
    border: 2px solid var(--panel-bg);
}
body.game-started .side-action-stack {
    display: flex;
}

/* Keep note/log FAB mobile-only; desktop keeps the skill entry visible when available. */
#mobile-log-fab,
#mobile-note-fab {
    display: none;
}
.mobile-intel-strip {
    width: 100%;
    max-width: 950px;
    box-sizing: border-box;
    gap: 8px;
    margin-bottom: 10px;
}
.mobile-intel-card {
    flex: 1;
    min-width: 0;
    background: rgba(250, 248, 245, 0.92);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: var(--card-shadow);
}
.mobile-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}
.mobile-intel-label {
    display: block;
    margin-bottom: 0;
    font-size: 11px;
    opacity: 0.72;
}
.mobile-intel-card strong {
    display: block;
    font-size: 12px;
    line-height: 1.5;
    word-break: break-word;
}
.mobile-intel-meta {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.45;
    color: #6b7280;
}
.mobile-progress-card strong {
    margin-bottom: 6px;
}
[data-theme="dark"] .log-panel-header,
[data-theme="dark"] .mobile-battle-hud,
[data-theme="dark"] .mobile-intel-card {
    background: rgba(39, 41, 53, 0.92);
}
[data-theme="dark"] .log-panel-header {
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
}
[data-theme="dark"] .log-panel-header {
    border-bottom-color: rgba(255,255,255,0.05);
}
[data-theme="dark"] #log-panel {
    background: rgba(39, 41, 53, 0.9);
}
[data-theme="dark"] .mobile-battle-hud,
[data-theme="dark"] .mobile-intel-card {
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 14px 28px rgba(0,0,0,0.28);
}
[data-theme="dark"] .mobile-hp-chip.collection {
    color: #f6dc8b;
    background: rgba(241, 196, 15, 0.16);
    border-color: rgba(241, 196, 15, 0.3);
}
[data-theme="dark"] .mobile-hp-chip.collection.is-complete {
    color: #9af0b7;
    background: rgba(46, 213, 115, 0.16);
    border-color: rgba(123, 237, 159, 0.32);
}
[data-theme="dark"] .side-action-fab {
    background: rgba(39, 41, 53, 0.96);
    border-color: rgba(72, 219, 251, 0.26);
    box-shadow: 0 16px 30px rgba(0,0,0,0.34);
}
[data-theme="dark"] .side-action-fab:disabled {
    color: #a9a7b7;
    background: linear-gradient(180deg, rgba(98, 103, 122, 0.22), rgba(76, 81, 101, 0.16));
    border-color: rgba(125, 134, 161, 0.28);
    box-shadow: none;
}
[data-theme="dark"] .side-action-fab-count {
    border-color: rgba(39, 41, 53, 0.96);
}
#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: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.05)), var(--panel-bg); padding: 15px; border-radius: 16px;
    width: 100%; box-sizing: border-box; box-shadow: var(--card-shadow), 0 0 38px var(--restaurant-glow);
    perspective: 1000px; border: 1px solid var(--border-color);
    transition: box-shadow 0.4s ease;
}
[data-theme="dark"] #board {
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015)), var(--panel-bg);
}

.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;
    will-change: transform;
    transform: translateZ(0);
}
.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);
    display: inline-block;
    max-width: 100%;
    padding: 1px 5px;
    border-radius: 6px; text-shadow: none !important;
    font-weight: 900; line-height: 1.1;
    white-space: nowrap;
}
.eat-content .ing-danger {
    font-size: 1em !important;
    padding: 2px 6px;
}

.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; }
.card.damage-poison .card-back::before {
    content: '💔';
    position: absolute;
    left: 2px;
    bottom: 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;
    display: inline-flex; align-items: center; justify-content: center; text-align: center;
}
.btn:hover:not(:disabled) { background: var(--border-color); transform: translateY(-1px); }
.btn:disabled {
    opacity: 1;
    cursor: not-allowed;
    color: #8b867f;
    background: linear-gradient(180deg, rgba(176, 170, 161, 0.18), rgba(176, 170, 161, 0.08));
    border-color: rgba(176, 170, 161, 0.35);
    box-shadow: none;
    filter: grayscale(0.25);
}
.daily-setup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 148px;
    position: relative;
}
.btn.is-completed {
    border-color: rgba(46, 213, 115, 0.5);
    color: #16673b;
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.2), rgba(46, 213, 115, 0.08));
    box-shadow: 0 8px 18px rgba(46, 213, 115, 0.12);
}
[data-theme="dark"] .btn.is-completed {
    color: #9af0b7;
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.18), rgba(46, 213, 115, 0.07));
    border-color: rgba(123, 237, 159, 0.38);
}
.btn.is-completed:disabled {
    opacity: 1;
    cursor: default;
}
.btn.is-completed .daily-tool-btn-badge {
    display: inline-flex;
}
.btn-note-link {
    white-space: nowrap;
    line-height: 1.3;
}
.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);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 24px 16px;
    box-sizing: border-box;
}

#game-over {
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: none;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.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, box-shadow 0.2s; font-weight:bold;
    box-shadow: 0 12px 28px rgba(46, 213, 115, 0.24);
}
.restart-btn:hover {
    box-shadow: 0 16px 34px rgba(46, 213, 115, 0.3);
}
.play-again-btn {
    background: linear-gradient(135deg, #76f2a5, #2ed573);
    color: #113320;
    box-shadow: 0 12px 28px rgba(46, 213, 115, 0.24);
}
.play-again-btn:hover {
    box-shadow: 0 0 0 2px rgba(46, 213, 115, 0.22), 0 18px 40px rgba(46, 213, 115, 0.36);
}
.game-over-actions {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}
.game-over-actions .restart-btn {
    margin-top: 30px;
}
.view-log-btn {
    background: linear-gradient(135deg, #8ad6ff, #36a7f6);
    color: #05325c;
    box-shadow: 0 12px 28px rgba(54, 167, 246, 0.28);
}
.view-log-btn:hover {
    box-shadow: 0 0 0 2px rgba(54, 167, 246, 0.2), 0 18px 40px rgba(54, 167, 246, 0.32);
}
.game-over-log-preview {
    display: block;
    width: min(820px, calc(100vw - 32px));
    max-height: 42vh;
    overflow-y: auto;
    margin-top: 14px;
    padding: 12px 10px 12px 8px;
    border-radius: 12px;
    border: none;
    background: transparent;
    box-shadow: none;
    text-align: left;
    font-size: 14px;
    line-height: 1.65;
}
.game-over-log-empty {
    color: rgba(255, 255, 255, 0.72);
    text-align: center;
    padding: 8px 0;
}
.game-over-log-modal-box {
    width: min(92vw, 860px);
    max-height: 88vh;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}
.game-over-log-modal-box h2 {
    margin: 0;
    text-align: center;
}
.game-over-log-modal-box .game-over-log-preview {
    width: 100%;
    max-height: min(58vh, 560px);
    margin-top: 0;
}
.game-over-log-actions {
    display: flex;
    justify-content: center;
    margin-top: 4px;
}
#game-over-log-modal {
    background: transparent !important;
    backdrop-filter: none !important;
}
.share-battle-btn {
    background: linear-gradient(135deg, #f8d56b, #f39c12);
    color: #3c2600;
    box-shadow: 0 12px 28px rgba(243, 156, 18, 0.28);
}
.share-battle-btn:hover {
    box-shadow: 0 0 0 2px rgba(243, 156, 18, 0.18), 0 18px 40px rgba(243, 156, 18, 0.34);
}
.share-card-modal-box {
    width: min(92vw, 760px);
    max-height: 92vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    box-sizing: border-box;
    padding: 22px 22px 18px;
    background:
        radial-gradient(circle at top right, rgba(241, 196, 15, 0.16), transparent 22%),
        radial-gradient(circle at left 20%, rgba(46, 204, 113, 0.12), transparent 24%),
        var(--panel-bg);
}
#share-card-modal {
    z-index: 160;
}
.share-card-hint {
    margin: -6px 0 14px;
    font-size: 13px;
    line-height: 1.7;
    color: #7a6d5d;
    text-align: center;
}
.share-card-loading {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    padding: 24px 20px;
    border-radius: 18px;
    border: 1px dashed rgba(127, 99, 65, 0.26);
    background: rgba(255, 248, 238, 0.84);
    color: #7f5d39;
    font-weight: bold;
    text-align: center;
    overflow: hidden;
    position: relative;
}
.share-card-loading::before {
    content: '';
    position: absolute;
    inset: auto -30% -55% -30%;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 215, 140, 0.18), transparent 68%);
    pointer-events: none;
}
.share-card-loading-core {
    position: relative;
    z-index: 1;
    width: min(100%, 360px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.share-card-loading-spinner {
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    min-height: 34px;
}
.share-card-loading-spinner span {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(180deg, #f7be63, #f08f36);
    box-shadow: 0 8px 18px rgba(240, 143, 54, 0.28);
    animation: share-card-loading-bob 0.95s var(--ease-out-quart, cubic-bezier(0.25, 1, 0.5, 1)) infinite;
}
.share-card-loading-spinner span:nth-child(2) {
    animation-delay: 0.14s;
}
.share-card-loading-spinner span:nth-child(3) {
    animation-delay: 0.28s;
}
.share-card-loading-text,
.share-card-loading-subtext {
    margin: 0;
}
.share-card-loading-text {
    font-size: 16px;
    line-height: 1.7;
}
.share-card-loading-subtext {
    font-size: 12px;
    line-height: 1.6;
    color: rgba(127, 93, 57, 0.82);
    font-weight: 600;
}
.share-card-loading.is-static .share-card-loading-spinner {
    display: none;
}
.share-card-loading.is-error {
    border-style: solid;
    border-color: rgba(192, 57, 43, 0.24);
    background: linear-gradient(180deg, rgba(255, 243, 240, 0.94), rgba(255, 250, 247, 0.9));
    color: #a8432f;
}
.share-card-loading.is-error .share-card-loading-subtext {
    color: rgba(168, 67, 47, 0.76);
}
@keyframes share-card-loading-bob {
    0%,
    100% {
        transform: translateY(0) scale(0.9);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-8px) scale(1);
        opacity: 1;
    }
}
.share-card-loading[hidden],
.share-card-preview[hidden] {
    display: none !important;
}
.share-card-preview {
    width: 100%;
    display: block;
    border-radius: 20px;
    border: 1px solid rgba(127, 99, 65, 0.18);
    box-shadow: 0 22px 50px rgba(57, 37, 17, 0.2);
    background: #fff;
}
.share-card-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 16px;
}
.share-card-actions .btn {
    min-width: 126px;
}
[data-theme="dark"] .share-card-modal-box {
    background:
        radial-gradient(circle at top right, rgba(241, 196, 15, 0.14), transparent 22%),
        radial-gradient(circle at left 20%, rgba(46, 204, 113, 0.1), transparent 24%),
        linear-gradient(180deg, rgba(19, 24, 33, 0.98), rgba(24, 31, 43, 0.98));
}
[data-theme="dark"] .share-card-hint {
    color: rgba(226, 232, 240, 0.78);
}
[data-theme="dark"] .share-card-loading {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(148, 163, 184, 0.28);
    color: #f8d56b;
}
[data-theme="dark"] .share-card-loading::before {
    background: radial-gradient(circle, rgba(248, 213, 107, 0.16), transparent 68%);
}
[data-theme="dark"] .share-card-loading-subtext {
    color: rgba(248, 250, 252, 0.72);
}
[data-theme="dark"] .share-card-loading.is-error {
    background: linear-gradient(180deg, rgba(68, 24, 18, 0.72), rgba(30, 20, 19, 0.88));
    border-color: rgba(248, 113, 113, 0.26);
    color: #ffd0c7;
}
[data-theme="dark"] .share-card-loading.is-error .share-card-loading-subtext {
    color: rgba(255, 208, 199, 0.78);
}

@media (prefers-reduced-motion: reduce) {
    .share-card-loading-spinner span {
        animation: none;
        opacity: 0.88;
        transform: none;
    }
}

.tool-btn.is-locked {
    color: #6f6a62;
    background: linear-gradient(180deg, rgba(130, 127, 120, 0.14), rgba(130, 127, 120, 0.06));
    border-color: rgba(130, 127, 120, 0.2);
}
.tool-btn.is-locked:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--card-shadow);
}

#developer-mode-entry-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
}

.account-panel {
    margin-bottom: 14px;
    padding: 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(10, 189, 227, 0.08), rgba(46, 204, 113, 0.08));
    border: 1px solid rgba(10, 189, 227, 0.18);
}
.account-panel-summary {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-color);
    text-align: center;
    white-space: pre-line;
}
.account-panel-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.account-panel-actions .btn {
    min-width: 120px;
    margin: 0;
}
.career-latest-list {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.career-latest-item,
.career-latest-empty {
    padding: 9px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 12px;
    line-height: 1.6;
}
.career-latest-item span,
.career-latest-item small {
    display: block;
}
.career-latest-item small {
    margin-top: 2px;
    color: #6b7280;
}

.account-modal-box {
    width: min(92vw, 520px);
    position: relative;
}
.account-auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}
.account-auth-tab {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-color);
    color: var(--text-color);
    padding: 9px 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
}
.account-auth-tab.active {
    color: #fff;
    border-color: var(--accent-color);
    background: linear-gradient(135deg, var(--accent-color), #f39c12);
}
.account-modal-status {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.7;
    color: #7a6d5d;
    text-align: center;
    white-space: pre-line;
}
.account-auth-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
#account-nickname-row {
    text-align: left;
}
#account-nickname-row .account-auth-label {
    display: block;
    width: 100%;
    text-align: left;
}
.account-auth-label {
    text-align: left;
    font-size: 12px;
    font-weight: bold;
    color: var(--accent-color);
}
.account-auth-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 14px;
    font-family: inherit;
    background: var(--card-front-bg);
    color: var(--text-color);
}
.account-password-field {
    position: relative;
}
.account-password-field .account-auth-input {
    padding-right: 44px;
}
.account-password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: 1px solid rgba(122, 109, 93, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #7a6d5d;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.account-password-toggle:hover {
    border-color: rgba(225, 95, 65, 0.42);
    color: var(--accent-color);
}
.account-password-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(225, 95, 65, 0.18);
}
.account-auth-input.is-invalid {
    border-color: rgba(225, 95, 65, 0.52);
    box-shadow: 0 0 0 3px rgba(225, 95, 65, 0.12);
}
.account-captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.account-captcha-preview {
    flex: 0 0 108px;
    height: 44px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(122, 109, 93, 0.18);
    background: linear-gradient(135deg, rgba(255, 250, 242, 0.95), rgba(243, 251, 255, 0.92));
    display: flex;
    align-items: center;
    justify-content: center;
}
.account-captcha-preview svg {
    display: block;
    width: 108px;
    height: 44px;
}
.account-captcha-refresh {
    min-width: 92px;
    margin: 0;
}
.account-auth-feedback {
    min-height: 20px;
    margin: 2px 0 6px;
    font-size: 12px;
    line-height: 1.7;
    color: #7a6d5d;
    text-align: left;
}
.account-auth-feedback.is-error {
    color: var(--accent-color);
}
.account-auth-feedback.is-success {
    color: #1f8f62;
}
.account-submit-btn {
    margin: 0;
}
.account-auth-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}
.account-auth-actions .btn {
    margin: 0;
    min-width: 136px;
}

.developer-mode-modal-box {
    width: min(98vw, 1240px);
    max-width: 1240px;
    max-height: 88vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}
.developer-mode-status {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.7;
    color: #7a6d5d;
    text-align: center;
}
.developer-mode-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.developer-mode-actions .account-auth-input {
    flex: 1;
}
.developer-mode-actions .btn {
    min-width: 110px;
    margin: 0;
}
.developer-users-meta {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
}
.developer-users-content {
    flex: 1;
    min-height: 180px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    overflow: auto;
}
.developer-users-table-wrap {
    overflow: auto;
}
.developer-users-table {
    width: 100%;
    min-width: 1140px;
    border-collapse: collapse;
    font-size: 12px;
}
.developer-users-table th,
.developer-users-table td {
    padding: 9px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    text-align: center;
    vertical-align: top;
}
.developer-users-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(255, 255, 255, 0.94);
}
.developer-user-email {
    text-align: left !important;
    font-weight: bold;
    color: var(--accent-color);
}
.developer-user-snapshot {
    text-align: left !important;
    line-height: 1.6;
    min-width: 260px;
}
.developer-user-json {
    max-width: 360px;
    max-height: 200px;
    overflow: auto;
    text-align: left;
    white-space: pre;
    margin-top: 8px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.achievement-modal-box {
    width: min(98vw, 1320px);
    max-width: 1320px;
    max-height: 88vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.stats-modal-box {
    position: relative;
}

.modal-title-gold {
    color: #e1b12c;
    margin-top: 0;
}

.stats-content {
    text-align: left;
    line-height: 2;
    font-size: 15px;
    margin-bottom: 15px;
    background: var(--bg-color);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.stats-storage-note {
    font-size: 12px;
    color: #e1b12c;
    text-align: center;
    border-top: 1px dashed var(--border-color);
    padding-top: 10px;
}

.stats-modal-actions {
    text-align: center;
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.stats-close-btn {
    padding: 8px 30px;
}

.stats-clear-btn {
    padding: 8px 15px;
    font-size: 12px;
    color: #ff4757;
    border-color: #ff4757;
}

.career-stat-meta {
    opacity: 0.6;
    font-size: 12px;
}

.career-stat-highlight-danger {
    font-size: 13px;
    color: var(--accent-color);
}

.career-stat-highlight-safe {
    font-size: 13px;
    color: #2ed573;
}

.career-stat-section-title {
    margin-top: 12px;
}

.achievement-content {
    text-align: left;
    line-height: 1.7;
    font-size: 14px;
    margin-bottom: 12px;
    background: var(--bg-color);
    padding: 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    overflow-y: auto;
}

.achievement-summary {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(10, 189, 227, 0.2);
    background: linear-gradient(135deg, rgba(10, 189, 227, 0.08), rgba(46, 204, 113, 0.08));
    margin-bottom: 12px;
}

.achievement-summary-flavor {
    margin-top: 6px;
    color: #7a6d5d;
    font-size: 12px;
}

.achievement-summary-next {
    margin-top: 4px;
    font-size: 12px;
    color: var(--player-color);
}

.achievement-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(10, 189, 227, 0.18);
    background: linear-gradient(135deg, rgba(10, 189, 227, 0.06), rgba(46, 204, 113, 0.06));
}

.achievement-filter-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--player-color);
}

.achievement-filter-select {
    min-width: 170px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 13px;
    font-family: inherit;
    background: var(--card-front-bg);
    color: var(--text-color);
}

.achievement-filter-search {
    min-width: 220px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 13px;
    font-family: inherit;
    background: var(--card-front-bg);
    color: var(--text-color);
}

.achievement-filter-count {
    margin-left: auto;
    font-size: 12px;
    color: #7a6d5d;
}

.achievement-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}
@media (min-width: 1200px) {
    .achievement-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.achievement-card {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.62);
    padding: 10px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.achievement-card.is-locked {
    border-color: rgba(100, 108, 118, 0.32);
    background:
        linear-gradient(135deg, rgba(148, 163, 184, 0.14), rgba(148, 163, 184, 0.06)),
        rgba(245, 246, 248, 0.78);
}

.achievement-card.is-complete {
    border-color: rgba(46, 204, 113, 0.38);
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.1), rgba(241, 196, 15, 0.08));
}

.achievement-card.is-complete.toast-achievement-tier-12 {
    border-color: rgba(67, 184, 203, 0.45);
    background: linear-gradient(135deg, rgba(124, 206, 255, 0.22), rgba(117, 226, 178, 0.18));
}

.achievement-card.is-complete.toast-achievement-tier-34 {
    border-color: rgba(231, 161, 55, 0.48);
    background: linear-gradient(135deg, rgba(255, 235, 152, 0.26), rgba(255, 186, 74, 0.2));
}

.achievement-card.is-complete.toast-achievement-tier-5 {
    border-color: rgba(230, 102, 74, 0.52);
    background: linear-gradient(135deg, rgba(255, 170, 100, 0.28), rgba(245, 86, 86, 0.2));
}

.achievement-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.achievement-card-title-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.achievement-card-title {
    font-size: 13px;
    font-weight: 700;
    min-width: 0;
    overflow-wrap: anywhere;
}

.achievement-hidden-tag {
    position: relative;
    overflow: hidden;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 209, 102, 0.58);
    background: linear-gradient(135deg, rgba(253, 235, 179, 0.28), rgba(255, 198, 89, 0.2));
    color: #8a5a00;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.achievement-hidden-tag::after {
    content: '';
    position: absolute;
    top: -30%;
    left: -70%;
    width: 44%;
    height: 160%;
    transform: rotate(20deg);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0));
    animation: hiddenTagShine 2.2s ease-in-out infinite;
}

@keyframes hiddenTagShine {
    0% { left: -70%; }
    45% { left: 125%; }
    100% { left: 125%; }
}

.achievement-card-stars {
    font-size: 12px;
    color: #e1b12c;
    white-space: nowrap;
}

.achievement-card-requirement {
    margin-top: 3px;
    font-size: 11px;
    color: #6b7280;
}

.achievement-card-condition {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-color);
    font-weight: 600;
}

.achievement-progress {
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.08);
    flex: 1;
}

.achievement-progress-row {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.achievement-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2ecc71, #0abde3);
}

.achievement-progress span.toast-achievement-tier-12 {
    background: linear-gradient(90deg, #7cceff, #75e2b2);
}

.achievement-progress span.toast-achievement-tier-34 {
    background: linear-gradient(90deg, #ffe178, #ffbb4a);
}

.achievement-progress span.toast-achievement-tier-5 {
    background: linear-gradient(90deg, #ffa664, #f55656);
}

.achievement-missing-toggle {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #8f8578;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.18s ease;
}

.achievement-missing-toggle:hover {
    color: var(--accent-color);
}

.achievement-missing-toggle:focus-visible {
    outline: 2px solid rgba(10, 189, 227, 0.44);
    outline-offset: 1px;
}

.achievement-missing-toggle-icon {
    font-size: 12px;
    line-height: 1;
}

.achievement-missing-toggle.is-open {
    color: var(--accent-color);
}

.achievement-missing-body {
    margin-top: 6px;
    padding: 8px 9px;
    border-radius: 8px;
    border: 1px solid rgba(122, 109, 93, 0.2);
    background: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    line-height: 1.6;
    color: #4f443a;
}

.achievement-card-flavor {
    margin-top: 7px;
    font-size: 12px;
    color: #7a6d5d;
}

.account-dialog-box {
    width: min(92vw, 420px);
    text-align: left;
    position: relative;
    padding: 22px 22px 18px;
}
.account-dialog-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(225, 95, 65, 0.12);
    color: var(--accent-color);
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 10px;
}
.account-dialog-title {
    margin: 0 0 10px;
    font-size: 22px;
}
.account-dialog-message {
    margin: 0;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-color);
}
.account-dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
}
.system-dialog-box {
    width: min(92vw, 440px);
    position: relative;
    padding: 22px 22px 18px;
    text-align: left;
}
.system-dialog-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(10, 189, 227, 0.12);
    color: var(--player-color);
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 10px;
}
.system-dialog-title {
    margin: 0 0 10px;
    font-size: 22px;
}
.system-dialog-message {
    margin: 0;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-color);
}
.system-dialog-input-label {
    display: block;
    margin-top: 14px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: bold;
    color: var(--player-color);
}
.system-dialog-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 14px;
    font-family: inherit;
    background: var(--card-front-bg);
    color: var(--text-color);
}
.system-dialog-input[readonly] {
    cursor: text;
}
.system-dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
}
[data-theme="dark"] .account-captcha-preview {
    background: linear-gradient(135deg, rgba(28, 36, 49, 0.96), rgba(21, 31, 43, 0.92));
    border-color: rgba(148, 163, 184, 0.2);
}
[data-theme="dark"] .tool-btn.is-locked {
    color: #b7b7c9;
    background: linear-gradient(180deg, rgba(130, 127, 120, 0.1), rgba(130, 127, 120, 0.04));
    border-color: rgba(148, 163, 184, 0.18);
}
[data-theme="dark"] .btn:disabled {
    color: #a9a7b7;
    background: linear-gradient(180deg, rgba(98, 103, 122, 0.22), rgba(76, 81, 101, 0.16));
    border-color: rgba(125, 134, 161, 0.28);
}
[data-theme="dark"] .account-panel {
    background: linear-gradient(135deg, rgba(10, 189, 227, 0.12), rgba(46, 204, 113, 0.08));
    border-color: rgba(10, 189, 227, 0.24);
}
[data-theme="dark"] .developer-mode-status,
[data-theme="dark"] .developer-users-meta {
    color: #b7c0d2;
}
[data-theme="dark"] .developer-users-content {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .developer-users-table th,
[data-theme="dark"] .developer-users-table td {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .developer-users-table thead th {
    background: rgba(17, 24, 39, 0.92);
}
[data-theme="dark"] .developer-user-json {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(148, 163, 184, 0.3);
}
[data-theme="dark"] .career-latest-item,
[data-theme="dark"] .career-latest-empty {
    background: rgba(15, 23, 42, 0.38);
    border-color: rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .stats-storage-note {
    color: #f3d27a;
}
[data-theme="dark"] .stats-clear-btn {
    color: #ff8c96;
    border-color: #ff8c96;
}
[data-theme="dark"] .career-latest-item small,
[data-theme="dark"] .account-modal-status,
[data-theme="dark"] .account-auth-feedback {
    color: #b7c0d2;
}
[data-theme="dark"] .account-auth-input {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(148, 163, 184, 0.2);
    color: #e5ebf5;
}
[data-theme="dark"] .account-password-toggle {
    background: rgba(52, 54, 65, 0.92);
    border-color: rgba(255, 255, 255, 0.16);
    color: #d9d2c8;
}
[data-theme="dark"] .account-dialog-badge {
    background: rgba(255, 107, 129, 0.16);
    color: #ffb0c0;
}
[data-theme="dark"] .system-dialog-badge {
    background: rgba(10, 189, 227, 0.16);
    color: #8be9ff;
}
[data-theme="dark"] .system-dialog-input {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(148, 163, 184, 0.2);
    color: #e5ebf5;
}
[data-theme="dark"] .achievement-content {
    background: rgba(15, 23, 42, 0.45);
    border-color: rgba(148, 163, 184, 0.22);
}
[data-theme="dark"] .achievement-summary {
    background: linear-gradient(135deg, rgba(10, 189, 227, 0.15), rgba(46, 204, 113, 0.1));
    border-color: rgba(10, 189, 227, 0.28);
}
[data-theme="dark"] .achievement-filter-bar {
    background: linear-gradient(135deg, rgba(10, 189, 227, 0.14), rgba(46, 204, 113, 0.1));
    border-color: rgba(10, 189, 227, 0.24);
}
[data-theme="dark"] .achievement-filter-count {
    color: #b7c0d2;
}
[data-theme="dark"] .achievement-filter-select {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(148, 163, 184, 0.2);
    color: #e5ebf5;
}
[data-theme="dark"] .achievement-filter-search {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(148, 163, 184, 0.2);
    color: #e5ebf5;
}
[data-theme="dark"] .achievement-summary-flavor,
[data-theme="dark"] .achievement-card-flavor,
[data-theme="dark"] .achievement-card-requirement {
    color: #b7c0d2;
}
[data-theme="dark"] .achievement-card {
    background: rgba(15, 23, 42, 0.48);
    border-color: rgba(148, 163, 184, 0.2);
}
[data-theme="dark"] .achievement-card.is-complete {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.18), rgba(241, 196, 15, 0.08));
    border-color: rgba(123, 237, 159, 0.34);
}
[data-theme="dark"] .achievement-card.is-complete.toast-achievement-tier-12 {
    border-color: rgba(97, 186, 220, 0.48);
    background: linear-gradient(135deg, rgba(114, 192, 255, 0.24), rgba(99, 209, 160, 0.18));
}
[data-theme="dark"] .achievement-card.is-complete.toast-achievement-tier-34 {
    border-color: rgba(238, 178, 80, 0.52);
    background: linear-gradient(135deg, rgba(255, 226, 131, 0.26), rgba(246, 163, 54, 0.2));
}
[data-theme="dark"] .achievement-card.is-complete.toast-achievement-tier-5 {
    border-color: rgba(241, 121, 99, 0.54);
    background: linear-gradient(135deg, rgba(255, 156, 96, 0.28), rgba(234, 79, 79, 0.2));
}
[data-theme="dark"] .achievement-hidden-tag {
    border-color: rgba(255, 215, 120, 0.5);
    background: linear-gradient(135deg, rgba(255, 224, 130, 0.2), rgba(191, 138, 31, 0.2));
    color: #ffd56f;
}
[data-theme="dark"] .achievement-missing-toggle {
    color: #c4cfdf;
}
[data-theme="dark"] .achievement-missing-toggle.is-open {
    color: #ffb9ab;
}
[data-theme="dark"] .achievement-missing-body {
    border-color: rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.52);
    color: #c8d3e5;
}
[data-theme="dark"] .game-over-log-preview {
    background: transparent;
}

.game-over-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: min(100%, 760px);
    max-width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.game-over-title {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.game-over-highlight {
    font-size: 24px;
    line-height: 1.45;
    color: #f5f7fb;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}

.game-over-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 560px;
}

.result-tag {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(8px);
}

.result-tag.victory {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.34), rgba(123, 237, 159, 0.18));
    border-color: rgba(123, 237, 159, 0.58);
}

.result-tag.danger {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.34), rgba(225, 95, 65, 0.18));
    border-color: rgba(255, 127, 143, 0.58);
}

.result-tag.special {
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.34), rgba(243, 156, 18, 0.18));
    border-color: rgba(255, 214, 102, 0.58);
    color: #fff5c2;
}

.result-tag.neutral {
    background: linear-gradient(135deg, rgba(116, 185, 255, 0.28), rgba(9, 132, 227, 0.14));
    border-color: rgba(116, 185, 255, 0.52);
}

.game-over-remark {
    max-width: 620px;
    padding: 12px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.92);
}

.game-over-blacklist {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.72);
}

#game-over-text,
#game-over-stats {
    width: 100%;
    max-width: min(100%, 760px);
    flex: 0 0 auto;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* ================= 推理笔记标签 ================= */
.drawer-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); z-index: 300; 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: 305; 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);
    will-change: right;
}
.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;}
.note-drawer-tip {
    font-size: 13px;
    color: #888;
    margin-top: -10px;
    line-height: 1.6;
}
.note-drawer-tip-safe {
    color: var(--safe-color);
}
.note-drawer-tip-danger {
    color: var(--accent-color);
}

.ai-poison-history {
    margin-top: 25px;
    border-top: 1px dashed var(--border-color);
    padding-top: 15px;
}

.ai-poison-title {
    margin: 0 0 10px;
    color: var(--accent-color);
    font-size: 14px;
}

.ai-poison-list {
    font-size: 13px;
    color: #888;
    line-height: 1.6;
}

.ai-poison-entry {
    color: var(--accent-color);
    margin-bottom: 6px;
    font-weight: 700;
}

[data-theme="dark"] .note-drawer-tip,
[data-theme="dark"] .ai-poison-list {
    color: #a9b0bf;
}

#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-warning {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.45;
    text-align: left;
}
.eat-warning-chili {
    color: #fff7f3;
    background: linear-gradient(135deg, rgba(225, 95, 65, 0.96), rgba(192, 57, 43, 0.96));
    box-shadow: 0 8px 16px rgba(192, 57, 43, 0.18);
}
.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; }

.settings-modal-box {
    max-width: 440px;
    padding-top: 54px;
}

.settings-ios-group {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--card-front-bg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    margin-bottom: 14px;
}

.settings-ios-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
}

.settings-ios-meta {
    min-width: 0;
    text-align: left;
}

.settings-ios-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-color);
}

.settings-ios-subtitle {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.35;
    color: #8f867d;
}

.settings-ios-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 52px;
    height: 32px;
    flex: 0 0 auto;
}

.settings-ios-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.settings-ios-slider {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: #cfd2d9;
    transition: background-color 0.25s ease;
    position: relative;
}

.settings-ios-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s ease;
}

.settings-ios-switch input:checked + .settings-ios-slider {
    background: #34c759;
}

.settings-ios-switch input:checked + .settings-ios-slider::before {
    transform: translateX(20px);
}

.settings-ios-link-btn {
    border: none;
    background: rgba(0, 122, 255, 0.12);
    color: #0069d9;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    flex: 0 0 auto;
}

.settings-ios-link-btn:hover {
    background: rgba(0, 122, 255, 0.2);
}

[data-theme="dark"] .settings-ios-group {
    background: rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .settings-ios-subtitle {
    color: #a4a0b1;
}

[data-theme="dark"] .settings-ios-slider {
    background: #595b65;
}

[data-theme="dark"] .settings-ios-link-btn {
    background: rgba(10, 132, 255, 0.2);
    color: #74b9ff;
}

/* 啤酒盖牌模式下的发光动画 (修复了当前卡牌闪烁的问题) */
#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; }

/* ================= 视觉特效层 ================= */
.fx-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 140;
    overflow: hidden;
    contain: layout paint;
}

.event-banner {
    position: fixed;
    left: 50%;
    top: 34px;
    transform: translateX(-50%) translateY(-18px) scale(0.95);
    min-width: 260px;
    max-width: min(82vw, 620px);
    padding: 14px 24px 16px;
    border-radius: 20px;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, rgba(45, 52, 54, 0.92), rgba(99, 110, 114, 0.82));
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.16);
    z-index: 150;
    pointer-events: none;
    opacity: 0;
    will-change: transform, opacity;
}

.event-banner.show { animation: eventBannerIn 1.45s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.event-banner.bingo { background: linear-gradient(135deg, rgba(241, 196, 15, 0.96), rgba(243, 156, 18, 0.88)); color: #2d1f00; }
.event-banner.skill { background: linear-gradient(135deg, rgba(108, 92, 231, 0.95), rgba(162, 155, 254, 0.84)); }
.event-banner.restaurant { background: linear-gradient(135deg, rgba(22, 160, 133, 0.94), rgba(46, 204, 113, 0.86)); }
.event-banner.victory { background: linear-gradient(135deg, rgba(46, 213, 115, 0.96), rgba(0, 184, 148, 0.86)); color: #082d1f; }
.event-banner.danger { background: linear-gradient(135deg, rgba(214, 48, 49, 0.96), rgba(232, 67, 147, 0.86)); }

.event-banner-title { font-size: 24px; font-weight: bold; letter-spacing: 2px; }
.event-banner-detail { margin-top: 4px; font-size: 13px; opacity: 0.9; line-height: 1.5; }

.fx-number {
    position: fixed;
    left: 0;
    top: 0;
    transform: translate(-50%, -50%);
    font-size: 28px;
    font-weight: bold;
    text-shadow: 0 4px 12px rgba(0,0,0,0.18);
    white-space: nowrap;
    z-index: 145;
    animation: fxNumberFloat 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity;
}

.fx-number.damage { color: #ff4757; }
.fx-number.heal { color: #2ed573; }
.fx-number.shield { color: #f39c12; font-size: 22px; }

.fx-particle {
    position: fixed;
    left: 0;
    top: 0;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    opacity: 0.95;
    transform: translate(-50%, -50%);
    animation: fxParticleBurst 0.9s ease-out forwards;
    will-change: transform, opacity;
}

.fx-particle.gold { background: linear-gradient(135deg, #ffe66d, #f39c12); }
.fx-particle.accent { background: linear-gradient(135deg, #a29bfe, #6c5ce7); }
.fx-particle.danger { background: linear-gradient(135deg, #ff6b81, #c0392b); }
.fx-particle.victory { background: linear-gradient(135deg, #7bed9f, #00b894); }

.board-flash-gold,
.board-flash-skill,
.board-flash-danger,
.board-flash-victory { animation: boardFlash 0.7s ease; }

.board-flash-gold { box-shadow: var(--card-shadow), 0 0 0 2px rgba(241, 196, 15, 0.45), 0 0 44px rgba(241, 196, 15, 0.35) !important; }
.board-flash-skill { box-shadow: var(--card-shadow), 0 0 0 2px rgba(162, 155, 254, 0.38), 0 0 44px rgba(108, 92, 231, 0.28) !important; }
.board-flash-danger { box-shadow: var(--card-shadow), 0 0 0 2px rgba(255, 71, 87, 0.38), 0 0 44px rgba(214, 48, 49, 0.28) !important; }
.board-flash-victory { box-shadow: var(--card-shadow), 0 0 0 2px rgba(46, 213, 115, 0.36), 0 0 50px rgba(0, 184, 148, 0.32) !important; }

@keyframes fxNumberFloat {
    0% { opacity: 0; transform: translate(-50%, -48%) scale(0.65); }
    15% { opacity: 1; transform: translate(-50%, -58%) scale(1.05); }
    100% { opacity: 0; transform: translate(calc(-50% + var(--drift-x, 0px)), calc(-50% - 58px)) scale(1.08); }
}

@keyframes fxParticleBurst {
    0% { opacity: 0.95; transform: translate(-50%, -50%) scale(0.3); }
    100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px))) scale(var(--scale, 1.4)) rotate(var(--rot, 0deg)); }
}

@keyframes eventBannerIn {
    0% { opacity: 0; transform: translateX(-50%) translateY(-18px) scale(0.92); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
    78% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px) scale(0.98); }
}

@keyframes boardFlash {
    0% { transform: translateY(0) scale(1); }
    35% { transform: translateY(-3px) scale(1.01); }
    100% { transform: translateY(0) scale(1); }
}

/* ================= 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(30, 34, 45, 0.94);
    color: #f3f5fb;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 10px 24px rgba(0,0,0,0.36);
}

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

.toast.toast-info-blue {
    background: linear-gradient(135deg, rgba(124, 206, 255, 0.96), rgba(117, 226, 178, 0.94));
    color: #10303a;
    border: 1px solid rgba(35, 149, 190, 0.4);
    box-shadow: 0 10px 24px rgba(72, 186, 207, 0.32);
}
[data-theme="dark"] .toast.toast-info-blue {
    background: linear-gradient(135deg, rgba(114, 192, 255, 0.94), rgba(99, 209, 160, 0.9));
    color: #0f1e25;
    border-color: rgba(103, 197, 224, 0.44);
    box-shadow: 0 12px 28px rgba(69, 172, 201, 0.36);
}

.toast.toast-achievement {
    color: #10303a;
    border: 1px solid rgba(35, 149, 190, 0.4);
}

[data-theme="dark"] .toast.toast-achievement {
    color: #0f1e25;
    border-color: rgba(103, 197, 224, 0.44);
}

.toast.toast-achievement.toast-achievement-tier-12 {
    background: linear-gradient(135deg, rgba(124, 206, 255, 0.96), rgba(117, 226, 178, 0.94));
    box-shadow: 0 10px 24px rgba(72, 186, 207, 0.32);
}

.toast.toast-achievement.toast-achievement-tier-34 {
    background: linear-gradient(135deg, rgba(255, 235, 152, 0.96), rgba(255, 186, 74, 0.94));
    color: #4c3000;
    border-color: rgba(255, 170, 49, 0.55);
    box-shadow: 0 10px 24px rgba(238, 168, 50, 0.34);
}

.toast.toast-achievement.toast-achievement-tier-5 {
    background: linear-gradient(135deg, rgba(255, 170, 100, 0.96), rgba(245, 86, 86, 0.94));
    color: #4f1a12;
    border-color: rgba(239, 97, 84, 0.56);
    box-shadow: 0 10px 24px rgba(224, 84, 68, 0.35);
}

[data-theme="dark"] .toast.toast-achievement.toast-achievement-tier-12 {
    background: linear-gradient(135deg, rgba(114, 192, 255, 0.94), rgba(99, 209, 160, 0.9));
    box-shadow: 0 12px 28px rgba(69, 172, 201, 0.36);
}

[data-theme="dark"] .toast.toast-achievement.toast-achievement-tier-34 {
    background: linear-gradient(135deg, rgba(255, 226, 131, 0.94), rgba(246, 163, 54, 0.9));
    color: #402500;
    border-color: rgba(255, 179, 79, 0.6);
    box-shadow: 0 12px 28px rgba(232, 150, 44, 0.36);
}

[data-theme="dark"] .toast.toast-achievement.toast-achievement-tier-5 {
    background: linear-gradient(135deg, rgba(255, 156, 96, 0.94), rgba(234, 79, 79, 0.9));
    color: #451713;
    border-color: rgba(245, 111, 94, 0.62);
    box-shadow: 0 12px 28px rgba(215, 78, 68, 0.38);
}

/* ================= 动态新手引导 ================= */
.tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
}
.tutorial-backdrop {
    position: absolute;
    inset: 0;
    background: transparent;
    pointer-events: none;
}
.tutorial-card {
    position: absolute;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%);
    z-index: 130;
    width: min(460px, calc(100vw - 24px));
    background: var(--panel-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
    padding: 18px 18px 16px;
    box-sizing: border-box;
    pointer-events: auto;
}
.tutorial-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.tutorial-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(225, 95, 65, 0.12);
    color: var(--accent-color);
    font-size: 12px;
    font-weight: bold;
}
.tutorial-skip-btn {
    border: none;
    background: transparent;
    color: #888;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    padding: 4px 0;
}
.tutorial-skip-btn:hover {
    color: var(--accent-color);
}
#tutorial-title {
    margin: 0 0 8px;
    font-size: 20px;
    color: var(--accent-color);
    text-align: left;
}
#tutorial-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.8;
    text-align: left;
    white-space: pre-line;
}
.tutorial-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}
.tutorial-actions .btn {
    min-width: 118px;
    flex: 0 0 auto;
    margin: 0;
}
.tutorial-focus {
    position: relative;
    z-index: 190 !important;
    border-radius: 14px;
    outline: 3px solid rgba(225, 95, 65, 0.95);
    outline-offset: 4px;
    animation: tutorialPulse 1.2s ease-in-out infinite alternate;
}
@keyframes tutorialPulse {
    0% { box-shadow: 0 0 0 0 rgba(225, 95, 65, 0.18); }
    100% { box-shadow: 0 0 0 10px rgba(225, 95, 65, 0.04); }
}
[data-theme="dark"] .tutorial-tag {
    background: rgba(255, 107, 129, 0.16);
}
[data-theme="dark"] .tutorial-skip-btn {
    color: #b2b5c4;
}
[data-theme="dark"] .tutorial-skip-btn:hover {
    color: #ff9fb3;
}

/* ================= Bingo 提示横幅 ================= */
.title-row {
    width: 100%;
    max-width: 950px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.title-row h1 {
    margin-bottom: 20px;
}
.mobile-bingo-info-btn {
    display: none;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid rgba(10, 189, 227, 0.35);
    background: rgba(10, 189, 227, 0.14);
    color: var(--player-color);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
}
.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;
}
[data-theme="dark"] .mobile-bingo-info-btn {
    border-color: rgba(72, 219, 251, 0.32);
    background: rgba(72, 219, 251, 0.12);
    color: #8be9ff;
}

/* ================= 进度条(滚动条)全局样式适配 ================= */
::-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;
    width: min(100%, 680px);
    max-width: min(100%, 680px);
    font-size: 14px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    box-sizing: border-box;
    overflow: hidden;
}

.game-over-trend-card {
    margin-bottom: 18px;
    padding: 16px 16px 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.game-over-trend-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.game-over-trend-title {
    color: #f8d56b;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.game-over-trend-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.game-over-trend-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.08);
}

.game-over-trend-pill::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.game-over-trend-pill.player {
    color: #6ee7f0;
}

.game-over-trend-pill.ai {
    color: #ff8da1;
}

.game-over-trend-svg {
    width: 100%;
    overflow: hidden;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(9, 18, 30, 0.34), rgba(10, 15, 26, 0.18));
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.game-over-trend-svg svg {
    width: 100%;
    height: auto;
    display: block;
}

.game-over-trend-grid-line {
    stroke: rgba(255, 255, 255, 0.1);
}

.game-over-trend-axis-text {
    fill: rgba(255, 255, 255, 0.48);
    font-size: 11px;
}

.game-over-trend-area {
    opacity: 0;
    animation: trend-fade-up 0.8s ease forwards;
}

.game-over-trend-line {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: trend-line-draw 1.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.game-over-trend-line.player {
    stroke: #6ee7f0;
    filter: drop-shadow(0 0 8px rgba(110, 231, 240, 0.35));
}

.game-over-trend-line.ai {
    stroke: #ff8da1;
    filter: drop-shadow(0 0 8px rgba(255, 141, 161, 0.32));
    animation-delay: 0.18s;
}

.game-over-trend-node-glow {
    opacity: 0;
    animation: trend-node-pop 0.44s ease forwards;
}

.game-over-trend-node-ring,
.game-over-trend-node-core {
    opacity: 0;
    animation: trend-node-pop 0.44s ease forwards;
}

.game-over-trend-node-ring {
    fill: rgba(10, 16, 28, 0.9);
    stroke-width: 2.5;
}

.game-over-trend-node-core {
    fill: rgba(255, 255, 255, 0.92);
}

.game-over-trend-marker-pulse {
    opacity: 0;
    animation: trend-pulse 1.9s ease-in-out infinite, trend-node-pop 0.5s ease forwards;
}

.game-over-trend-marker-chip,
.game-over-trend-marker-text,
.game-over-trend-marker-icon {
    opacity: 0;
    animation: trend-marker-rise 0.5s ease forwards;
}

.game-over-trend-marker-chip.player {
    fill: rgba(39, 124, 133, 0.9);
    stroke: rgba(110, 231, 240, 0.55);
}

.game-over-trend-marker-chip.ai {
    fill: rgba(132, 44, 69, 0.92);
    stroke: rgba(255, 141, 161, 0.52);
}

.game-over-trend-marker-chip.both {
    fill: rgba(116, 82, 23, 0.94);
    stroke: rgba(248, 213, 107, 0.42);
}

.game-over-trend-marker-text {
    fill: rgba(255, 255, 255, 0.92);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.game-over-trend-marker-icon {
    fill: rgba(255, 255, 255, 0.96);
    font-size: 11px;
}

@keyframes trend-line-draw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes trend-fade-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes trend-node-pop {
    from {
        opacity: 0;
        transform: scale(0.68);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes trend-marker-rise {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes trend-pulse {
    0%, 100% {
        opacity: 0.16;
    }
    50% {
        opacity: 0.36;
    }
}

.game-over-trend-summary {
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    text-align: right;
}

.game-over-trend-empty {
    padding: 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    text-align: center;
}

[data-theme="dark"] .game-over-remark {
    background: rgba(8, 12, 21, 0.74);
    border-color: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .game-over-blacklist {
    color: rgba(226, 232, 240, 0.78);
}
.stat-title { color: #f1c40f; margin-bottom: 10px; text-align: center; font-weight: bold; font-size: 16px;}
.stat-section { margin-bottom: 10px; }
.stat-section { word-break: break-word; }
.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);
}
.status-box.challenge-boss-panel .chat-bubble {
    top: -56px;
    left: 8px;
    right: auto;
    max-width: 210px;
    border-color: #b91c1c;
    background: #fff7f8;
}
.status-box.challenge-boss-panel .chat-bubble::after {
    left: 28px;
    border-top-color: #b91c1c;
}
[data-theme="dark"] .status-box.challenge-boss-panel .chat-bubble {
    background: #3a2430;
    border-color: #f87171;
}
[data-theme="dark"] .status-box.challenge-boss-panel .chat-bubble::after {
    border-top-color: #f87171;
}
.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: #2b3040;
    color: #f6f8ff;
    box-shadow: 0 10px 24px rgba(0,0,0,0.34);
}
[data-theme="dark"] .chat-bubble::after {
    border-top-color: #ff6b81;
}
.chat-bubble.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.chat-bubble-player {
    left: -10px;
    right: auto;
    border-color: var(--player-color);
}

.chat-bubble-player::after {
    left: 24px;
    border-top-color: var(--player-color);
}

[data-theme="dark"] .chat-bubble-player::after {
    border-top-color: #5bcaf0;
}

/* ================= 餐厅选择网格 ================= */
.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; }
}
