/* ===== 稀有跑马灯公告 ===== */
.marquee-banner-content {
    position: relative;
    padding: 6px 16px;
    background: linear-gradient(90deg, rgba(201, 153, 58, 0.15) 0%, rgba(201, 153, 58, 0.3) 50%, rgba(201, 153, 58, 0.15) 100%);
    border-bottom: 1px solid rgba(201, 153, 58, 0.3);
    color: var(--text-gold);
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
    flex-shrink: 0;
    overflow: hidden;
    white-space: nowrap;
    text-shadow: 0 0 5px rgba(201, 153, 58, 0.4);
}

.marquee-text {
    display: inline-block;
    padding-left: 100%;
    animation: marquee-scroll 20s linear infinite;
}

@keyframes marquee-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* ===== 版本更新提示条 ===== */
.update-banner {
    position: relative;
    text-align: center;
    padding: 8px 16px;
    background: linear-gradient(90deg, rgba(61, 171, 151, 0.12) 0%, rgba(61, 171, 151, 0.22) 50%, rgba(61, 171, 151, 0.12) 100%);
    border-bottom: 1px solid rgba(61, 171, 151, 0.25);
    color: var(--text-jade);
    font-size: 13px;
    letter-spacing: 1px;
    flex-shrink: 0;
    animation: updateBannerGlow 2.5s ease-in-out infinite;
}

.update-banner a {
    color: #fff;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
}

.update-banner a:hover {
    color: var(--text-gold);
}

@keyframes updateBannerGlow {
    0%, 100% { background: linear-gradient(90deg, rgba(61, 171, 151, 0.12) 0%, rgba(61, 171, 151, 0.22) 50%, rgba(61, 171, 151, 0.12) 100%); }
    50% { background: linear-gradient(90deg, rgba(61, 171, 151, 0.20) 0%, rgba(61, 171, 151, 0.35) 50%, rgba(61, 171, 151, 0.20) 100%); }
}

/* ===== 游戏页 ===== */
.game-page {
    overflow: hidden;
}

.game-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* --- Header --- */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 52px;
    background: var(--bg-secondary);
    border-bottom: none;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--text-gold);
    letter-spacing: 4px;
}

.header-realm {
    font-size: 13px;
    color: var(--text-jade);
    padding: 3px 10px;
    background: rgba(61, 171, 151, 0.1);
    border: 1px solid rgba(61, 171, 151, 0.2);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    flex-shrink: 0;
}

.header-gametime {
    font-size: 11px;
    color: var(--text-gold);
    padding: 2px 8px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.header-gametime.is-night {
    color: #a8b4ff;
    background: rgba(100, 120, 220, 0.15);
    border-color: rgba(100, 120, 220, 0.2);
}

.header-wb-status {
    font-size: 11px;
    padding: 2px 6px;
    background: rgba(220, 53, 69, 0.15);
    color: var(--danger-color);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.header-wb-status:hover {
    background: rgba(220, 53, 69, 0.25);
}

.header-wb-status.hidden {
    display: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-btn-group {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px 4px;
    background: rgba(139, 115, 85, 0.06);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.header-btn-group:last-of-type {
    border-right: none;
}

.header-btn-group .btn-icon {
    border: none;
    padding: 4px 10px;
    background: transparent;
}

.header-btn-group .btn-icon:hover {
    background: rgba(201, 153, 58, 0.12);
    border: none;
}

.header-btn-group .btn-icon.active {
    background: rgba(201, 153, 58, 0.18);
    border: none;
    box-shadow: none;
}

.header-player-name {
    font-size: 14px;
    color: var(--text-secondary);
    margin-right: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-icon {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-serif);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    border-color: var(--accent-gold);
    color: var(--text-gold);
}

.btn-icon.active {
    background: rgba(201, 153, 58, 0.12);
    border-color: var(--accent-gold);
    color: var(--text-gold);
    box-shadow: 0 0 8px rgba(201, 153, 58, 0.1);
}

.btn-logout {
    border-color: rgba(185, 48, 48, 0.3);
    color: var(--text-red);
}

.btn-logout:hover {
    border-color: var(--accent-crimson);
    background: rgba(185, 48, 48, 0.1);
    color: var(--text-red);
}

/* --- Body --- */
.game-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* --- Player Panel --- */
.player-panel {
    width: 240px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    padding: 16px;
    overflow-y: auto;
    flex-shrink: 0;
}

.player-panel .panel-title {
    display: flex;
    align-items: center;
}

.panel-title-action {
    margin-left: auto;
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--accent-orange);
    padding: 2px 8px;
    border: 1px solid rgba(255, 140, 0, 0.4);
    border-radius: 4px;
    cursor: pointer;
    background: rgba(255, 140, 0, 0.08);
    transition: background 0.15s;
}

.panel-title-action:hover {
    background: rgba(255, 140, 0, 0.18);
}



.panel-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.panel-section:last-child {
    border-bottom: none;
}

.panel-server-credit {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    padding: 12px 0 4px;
    margin-top: 8px;
    border-top: 1px solid var(--border-color);
    opacity: 0.6;
    transition: opacity 0.2s;
}

.panel-server-credit:hover {
    opacity: 1;
}

.panel-server-credit a {
    color: var(--text-jade);
    text-decoration: none;
}

.panel-server-credit a:hover {
    text-decoration: underline;
    color: var(--text-gold);
}

.panel-title {
    font-size: 13px;
    color: var(--text-gold);
    letter-spacing: 2px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(201, 153, 58, 0.15);
    position: sticky;
    top: -16px;
    background: var(--bg-panel);
    z-index: 10;
    margin-top: -16px;
    margin-left: -16px;
    margin-right: -16px;
    padding-top: 16px;
    padding-left: 16px;
    padding-right: 16px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 13px;
}

.stat-label {
    color: var(--text-muted);
}

.stat-value {
    color: var(--text-primary);
    font-weight: 600;
}

.stat-bonus {
    font-size: 11px;
    opacity: 0.85;
    margin-left: 2px;
}

.realm-text {
    color: var(--text-jade);
}

.hp-text {
    color: #e06060;
}

.atk-text {
    color: #e0a040;
}

.def-text {
    color: #60a0e0;
}

.spirit-text {
    color: var(--accent-purple);
}

.luck-text {
    color: var(--accent-jade);
}

.gold-text {
    color: var(--text-gold);
}

.mp-text {
    color: #6090e0;
}

.btn-heal-mp {
    font-size: 10px;
    padding: 1px 6px;
    margin-left: 6px;
    background: rgba(96, 144, 224, 0.1);
    color: #6090e0;
    border: 1px solid rgba(96, 144, 224, 0.3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    line-height: 1.4;
}

.btn-heal-mp:hover {
    background: rgba(96, 144, 224, 0.25);
}

.btn-absorb-mp {
    font-size: 10px;
    padding: 1px 6px;
    margin-left: 4px;
    background: rgba(201, 164, 72, 0.1);
    color: var(--accent-gold);
    border: 1px solid rgba(201, 164, 72, 0.3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    line-height: 1.4;
}

.btn-absorb-mp:hover {
    background: rgba(201, 164, 72, 0.25);
}

.btn-condense-stone {
    font-size: 10px;
    padding: 1px 6px;
    margin-left: 4px;
    background: rgba(138, 96, 224, 0.1);
    color: #a87eff;
    border: 1px solid rgba(138, 96, 224, 0.3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    line-height: 1.4;
}

.btn-condense-stone:hover {
    background: rgba(138, 96, 224, 0.25);
}

.btn-purge-toxin {
    font-size: 10px;
    padding: 1px 6px;
    margin-left: 6px;
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    line-height: 1.4;
}

.btn-purge-toxin:hover {
    background: rgba(76, 175, 80, 0.25);
}

.btn-refresh-luck {
    font-size: 10px;
    padding: 1px 6px;
    margin-left: 6px;
    background: rgba(156, 39, 176, 0.1); /* 紫色系 */
    color: #9C27B0;
    border: 1px solid rgba(156, 39, 176, 0.3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    line-height: 1.4;
}

.btn-refresh-luck:hover {
    background: rgba(156, 39, 176, 0.25);
}

.stone-lower {
    color: var(--accent-gold);
    font-weight: 600;
}

.progress-bar-container {
    position: relative;
    height: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-top: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-bar {
    height: 100%;
    background: var(--gradient-jade);
    border-radius: 8px;
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    color: var(--text-primary);
    font-weight: 600;
}

/* --- Main Panel --- */
.main-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.log-area {
    display: flex;
    flex-direction: row;
    flex: 1;
    overflow: hidden;
}

.log-panel {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
    min-width: 0;
}

/* PC端常驻聊天 */
.inline-chat {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
    min-width: 0;
    background: var(--bg-panel);
    position: relative;
    z-index: 810;
}

.inline-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: none;
    flex-shrink: 0;
}

.inline-chat-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-gold);
    font-family: var(--font-serif);
    letter-spacing: 1px;
}

.inline-chat-tabs {
    gap: 4px;
    margin: 0;
    padding: 0;
}

.inline-chat .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
}

.inline-chat .chat-input-bar {
    padding: 8px 12px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

/* 气泡点击高亮提示 */
.inline-chat.chat-highlight {
    animation: chatHighlight 0.5s ease 3;
}

@keyframes chatHighlight {
    0%, 100% { border-left-color: var(--border-color); }
    50% { border-left: 2px solid var(--accent-gold); box-shadow: inset 0 0 12px rgba(201, 153, 58, 0.1); }
}

/* PC端隐藏聊天按钮 (聊天已常驻) */
#chatBtn {
    display: none;
}

/* 桌面端隐藏移动导航和移动状态栏 */
.mobile-nav {
    display: none;
}

.mobile-status-bar {
    display: none;
}

.log-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.log-content p {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
    padding: 5px 12px;
    border-left: 3px solid currentColor;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transition: background 0.15s;
}

.log-content p:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* --- 日志类别: 系统/欢迎 --- */
.log-content p.log-welcome {
    color: var(--text-gold);
    font-size: 15px;
    margin-bottom: 6px;
    border-left-color: currentColor;
    background: rgba(201, 153, 58, 0.04);
}

.log-content p.log-system,
.log-content p.log-salary,
.log-content p.log-promotion {
    color: var(--text-muted);
    font-style: italic;
    border-left-color: currentColor;
}

/* --- 日志类别: 修炼相关 (翠色) --- */
.log-content p.log-cultivation,
.log-content p.log-meditate,
.log-content p.log-absorb,
.log-content p.log-technique,
.log-content p.log-awaken,
.log-content p.log-natal {
    color: var(--text-jade);
    border-left-color: currentColor;
}

/* --- 日志类别: 突破/提升 (金色, 加强) --- */
.log-content p.log-breakthrough {
    color: var(--text-gold);
    font-weight: 600;
    font-size: 15px;
    border-left-color: currentColor;
    background: rgba(201, 153, 58, 0.06);
    text-shadow: 0 0 8px rgba(201, 153, 58, 0.2);
    padding: 6px 10px;
}

/* --- 日志类别: 战斗相关 (红色) --- */
.log-content p.log-battle,
.log-content p.log-flee {
    color: var(--text-red);
    border-left-color: currentColor;
}

.log-content p.log-pvp,
.log-content p.log-pvp_victory {
    color: #e07050;
    border-left-color: currentColor;
    background: rgba(185, 48, 48, 0.04);
}

.log-content p.log-pvp_death,
.log-content p.log-death,
.log-content p.log-trial_fail {
    color: #e06060;
    font-weight: 600;
    border-left-color: currentColor;
    background: rgba(185, 48, 48, 0.06);
}

.log-content p.log-heal,
.log-content p.log-revive,
.log-content p.log-rescue {
    color: #60c080;
    border-left-color: currentColor;
}

/* --- 日志类别: 探索/冒险 (紫色) --- */
.log-content p.log-explore,
.log-content p.log-adventure,
.log-content p.log-move,
.log-content p.log-dungeon {
    color: var(--accent-purple);
    border-left-color: currentColor;
}

.log-content p.log-loot,
.log-content p.log-reward,
.log-content p.log-item {
    color: #c090e0;
    border-left-color: currentColor;
}

/* --- 日志类别: 经济/交易 (蓝色) --- */
.log-content p.log-trade,
.log-content p.log-market,
.log-content p.log-exchange,
.log-content p.log-stone,
.log-content p.log-storage {
    color: var(--text-blue);
    border-left-color: currentColor;
}

/* --- 日志类别: 制造 (橙色) --- */
.log-content p.log-alchemy,
.log-content p.log-forge,
.log-content p.log-refine,
.log-content p.log-salvage {
    color: #d4a060;
    border-left-color: currentColor;
}

/* --- 日志类别: 社交 (青色) --- */
.log-content p.log-sect,
.log-content p.log-friend,
.log-content p.log-task {
    color: #60b0c0;
    border-left-color: currentColor;
}

/* --- Action Bar --- */
.action-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    justify-content: center;
}

.action-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.action-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    flex-shrink: 0;
    margin: 0 4px;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-serif);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 1px;
}

.btn-action:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-gold);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-action:active {
    transform: translateY(0);
}

.btn-meditate {
    border-color: rgba(61, 171, 151, 0.3);
}

.btn-meditate:hover {
    border-color: var(--accent-jade);
}

.btn-breakthrough {
    border-color: rgba(201, 153, 58, 0.3);
}

.btn-breakthrough:hover {
    border-color: var(--accent-gold);
}

/* 修为条下方突破信息区 */
.bt-area-btn {
    width: 100%;
    padding: 6px 0;
    font-size: 13px;
    cursor: pointer;
}

.bt-area-material {
    font-size: 12px;
    color: var(--accent-orange);
    text-align: center;
    padding: 4px 8px;
    border: 1px dashed rgba(201, 153, 58, 0.3);
    border-radius: 6px;
    background: rgba(201, 153, 58, 0.05);
}

.btn-explore {
    border-color: rgba(138, 107, 191, 0.3);
}

.btn-explore:hover {
    border-color: var(--accent-purple);
}

/* 功能组按钮差异化颜色 */
.btn-inventory {
    border-color: rgba(90, 159, 212, 0.3);
}
.btn-inventory:hover {
    border-color: var(--accent-blue);
}

.btn-alchemy {
    border-color: rgba(212, 160, 96, 0.3);
}
.btn-alchemy:hover {
    border-color: #d4a060;
}

.btn-technique {
    border-color: rgba(130, 100, 200, 0.3);
}
.btn-technique:hover {
    border-color: #8264c8;
}

.btn-friend {
    border-color: rgba(100, 180, 140, 0.3);
    position: relative;
}
.btn-friend:hover {
    border-color: #64b48c;
}

.btn-shop {
    border-color: rgba(201, 153, 58, 0.25);
}
.btn-shop:hover {
    border-color: var(--accent-gold);
}

.btn-pvp {
    border-color: rgba(185, 48, 48, 0.25);
}
.btn-pvp:hover {
    border-color: var(--accent-crimson);
    background: rgba(185, 48, 48, 0.06);
}

.adventure-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 11px;
    color: var(--text-dim);
    user-select: none;
    margin-left: -4px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.2s;
}

.adventure-toggle:hover {
    color: var(--accent-purple);
}

.adventure-toggle input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--accent-purple);
    cursor: pointer;
    margin: 0;
}

.adventure-toggle-label {
    line-height: 1;
}

/* 自动探索 toggle */
.auto-explore-toggle:hover {
    color: var(--accent-jade);
}

.auto-explore-toggle input[type="checkbox"] {
    accent-color: var(--accent-jade);
}

.auto-explore-toggle.auto-active {
    color: var(--text-jade);
    background: rgba(61, 171, 151, 0.1);
    border-radius: 4px;
}

/* 自动探索时探索按钮的呼吸灯效果 */
.btn-explore.auto-exploring {
    border-color: var(--accent-jade);
    animation: autoExplorePulse 1.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes autoExplorePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(61, 171, 151, 0.3);
        background: var(--bg-card);
    }
    50% {
        box-shadow: 0 0 12px 2px rgba(61, 171, 151, 0.2);
        background: rgba(61, 171, 151, 0.08);
    }
}

/* 自动探索计数徽标 */
.auto-explore-count {
    font-size: 10px;
    color: var(--text-jade);
    margin-left: 2px;
    font-weight: 600;
    min-width: 14px;
    text-align: center;
}

.btn-meditate.meditating {
    background: rgba(61, 171, 151, 0.15);
    border-color: var(--accent-jade);
    color: var(--text-jade);
    pointer-events: none;
}

/* --- Meditation Bar --- */
.meditation-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: rgba(61, 171, 151, 0.08);
    border-top: 1px solid rgba(61, 171, 151, 0.2);
}

.meditation-anim {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.meditation-pulse {
    width: 16px;
    height: 16px;
    background: var(--accent-jade);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
        box-shadow: 0 0 0 0 rgba(61, 171, 151, 0.4);
    }

    50% {
        transform: scale(1.3);
        opacity: 1;
        box-shadow: 0 0 20px 5px rgba(61, 171, 151, 0.2);
    }
}

.meditation-info {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: var(--text-jade);
    flex: 1;
}

.meditation-info em {
    font-style: normal;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-stop-meditate {
    padding: 8px 24px;
    background: rgba(185, 48, 48, 0.15);
    border: 1px solid rgba(185, 48, 48, 0.3);
    border-radius: var(--radius-sm);
    color: var(--text-red);
    font-family: var(--font-serif);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-stop-meditate:hover {
    background: rgba(185, 48, 48, 0.25);
    border-color: var(--accent-crimson);
}

/* --- Side Panel --- */
.side-panel {
    width: 360px;
    min-width: 260px;
    max-width: 70vw;
    background: var(--bg-panel);
    border-left: 1px solid var(--border-color);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, opacity 0.25s ease;
    position: relative;
    z-index: 1001;
}

.side-panel-resize-handle {
    position: absolute;
    left: -3px;
    top: 0;
    bottom: 0;
    width: 6px;
    cursor: col-resize;
    z-index: 10;
    transition: background 0.15s ease;
}

.side-panel-resize-handle:hover,
.side-panel-resize-handle.dragging {
    background: rgba(100, 160, 255, 0.4);
}

.side-panel.hidden {
    display: flex !important;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: -1;
}

/* 子面板淡入效果 */
.side-content > :not(.hidden) {
    animation: panelFadeIn 0.2s ease;
}

@keyframes panelFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.side-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 16px;
}

.side-content .panel-title {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-panel-close {
    margin-left: auto;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-panel-close:hover {
    color: var(--accent-gold);
    border-color: var(--accent-gold);
}

.inv-batch-menu {
    display: inline-block;
}

.inv-batch-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1100;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    min-width: 120px;
    padding: 4px 0;
    margin-top: 2px;
}

.inv-batch-dropdown.open {
    display: block;
}

.inv-batch-item {
    padding: 7px 14px;
    font-size: 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    text-align: center;
    font-family: var(--font-serif);
}

.inv-batch-item:hover {
    background: var(--bg-card-hover);
    color: var(--accent-gold);
}

.inv-batch-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 8px;
}

/* Ranking */
.ranking-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin: 0 0 10px;
    letter-spacing: 2px;
    font-style: italic;
}

.ranking-my-rank {
    font-size: 12px;
    color: var(--text-gold);
    text-align: center;
    margin: 0 0 8px;
    padding: 4px 8px;
    background: rgba(201, 153, 58, 0.08);
    border: 1px solid rgba(201, 153, 58, 0.2);
    border-radius: 4px;
}

.ranking-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}

.ranking-tab {
    flex: 1 1 auto;
    min-width: 0;
    padding: 5px 0;
    font-size: 12px;
    font-family: var(--font-serif);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.ranking-tab:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.ranking-tab.active {
    background: var(--gradient-gold);
    border-color: var(--accent-gold);
    color: var(--text-on-gold);
    font-weight: 600;
}

.ranking-list {
    flex: 1;
    overflow-y: auto;
}

.ranking-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.ranking-rank {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 50%;
    font-size: 12px;
    color: var(--text-gold);
    font-weight: 700;
    flex-shrink: 0;
}

.ranking-rank.top-1 {
    background: var(--accent-gold);
    color: var(--text-on-gold);
}

.ranking-rank.top-2 {
    background: #8a8a8a;
    color: var(--text-on-gold);
}

.ranking-rank.top-3 {
    background: #a0603a;
    color: var(--text-on-gold);
}

.ranking-name {
    flex: 1;
    color: var(--text-primary);
}

.ranking-name-link {
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
}

.ranking-name-link:hover {
    color: var(--text-gold);
    text-decoration: underline;
}

.ranking-realm {
    color: var(--text-jade);
    font-size: 12px;
}

.ranking-detail {
    width: 100%;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    padding-left: 32px;
}

.ranking-guest {
    display: inline-block;
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0 4px;
    margin-left: 4px;
    vertical-align: middle;
}

.ranking-root {
    display: inline-block;
    font-size: 10px;
    border: 1px solid;
    border-radius: var(--radius-sm);
    padding: 0 4px;
    margin-left: 4px;
    vertical-align: middle;
    font-weight: 600;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

.ranking-title {
    display: inline-block;
    font-size: 10px;
    border: 1px solid;
    border-radius: var(--radius-sm);
    padding: 0 4px;
    margin-left: 4px;
    vertical-align: middle;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.ranking-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 0 4px;
}

.pager-btn {
    padding: 5px 14px;
    font-size: 12px;
    font-family: var(--font-serif);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.pager-btn:hover:not(:disabled) {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.pager-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pager-info {
    font-size: 12px;
    color: var(--text-muted);
}

.ranking-empty {
    text-align: center;
    padding: 30px 0;
    color: var(--text-muted);
    font-size: 13px;
}

/* 骨架屏动画 */
.ranking-skeleton {
    pointer-events: none;
}

.skeleton-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-card);
    animation: skeletonPulse 1.2s ease-in-out infinite;
    flex-shrink: 0;
}

.skeleton-bar {
    height: 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    animation: skeletonPulse 1.2s ease-in-out infinite;
}

@keyframes skeletonPulse {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 0.8;
    }
}

/* Chat */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-anchor: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 8px;
}

.chat-msg {
    font-size: 13px;
    line-height: 1.6;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    border-left: 2px solid var(--accent-jade);
    transition: background 0.2s;
}

.chat-msg:hover {
    background: rgba(255, 255, 255, 0.12);
}

.chat-msg-name {
    color: var(--accent-jade);
    font-weight: 600;
    margin-right: 6px;
}

.chat-msg-text {
    color: var(--text-primary);
}

.chat-msg-realm {
    font-size: 11px;
    color: var(--text-gold);
    opacity: 0.7;
    margin-left: 4px;
    font-weight: 400;
}

.chat-msg-separator {
    color: var(--text-muted);
    margin-right: 2px;
}

.chat-system {
    background: rgba(201, 153, 58, 0.06);
    border-left-color: var(--accent-gold);
}

.chat-system .chat-msg-text {
    color: var(--text-gold);
    font-style: italic;
}

.chat-input-bar {
    display: flex;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    overflow: hidden; /* Safari 防溢出 */
}

.chat-input-bar input {
    flex: 1;
    min-width: 0; /* Safari flex 子项防溢出 */
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-serif);
    font-size: 13px;
    outline: none;
}

.chat-input-bar input:focus {
    border-color: var(--accent-gold);
}

.btn-send {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-sm);
    color: var(--text-gold);
    font-family: var(--font-serif);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-send:hover {
    background: rgba(201, 153, 58, 0.15);
}

/* 招募按钮 */
.btn-recruit {
    padding: 8px 12px;
    background: rgba(147, 112, 219, 0.12);
    border: 1px solid rgba(147, 112, 219, 0.4);
    border-radius: var(--radius-sm);
    color: #b88de8;
    font-family: var(--font-serif);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-recruit:hover {
    background: rgba(147, 112, 219, 0.25);
    border-color: #b88de8;
}

/* 招募卡片 */
.chat-msg-recruit {
    border-left-color: #b88de8;
    background: rgba(147, 112, 219, 0.06);
    padding: 4px 10px;
}

.chat-msg-recruit:hover {
    background: rgba(147, 112, 219, 0.12);
}

.chat-recruit-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 0 2px;
}

.chat-recruit-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.chat-recruit-label {
    color: #b88de8;
    font-weight: 600;
    font-size: 12px;
}

.chat-recruit-name {
    color: var(--accent-jade);
    font-weight: 600;
}

.chat-recruit-body {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.chat-recruit-dungeon {
    color: var(--text-gold);
    font-weight: 600;
    font-size: 13px;
}

.chat-recruit-info {
    font-size: 12px;
    color: var(--text-muted);
}

.chat-recruit-action {
    display: flex;
    align-items: center;
    padding-top: 2px;
}

.btn-recruit-join {
    padding: 4px 14px;
    background: rgba(147, 112, 219, 0.15);
    border: 1px solid rgba(147, 112, 219, 0.4);
    border-radius: var(--radius-sm);
    color: #b88de8;
    font-family: var(--font-serif);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 28px;
}

.btn-recruit-join:hover {
    background: rgba(147, 112, 219, 0.3);
    border-color: #b88de8;
    color: #d4b8f0;
}

.btn-recruit-join:active {
    transform: scale(0.97);
}

.recruit-self-tag {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}

/* 上架通知卡片 - 青翠色调，区分于召集的紫色 */
.chat-listing-card .chat-recruit-label {
    color: #5ec4a0;
}

.chat-listing-card .chat-recruit-info {
    color: #7ab8a3;
}

.chat-listing-card .btn-recruit-join {
    background: rgba(94, 196, 160, 0.12);
    border-color: rgba(94, 196, 160, 0.35);
    color: #5ec4a0;
}

.chat-listing-card .btn-recruit-join:hover {
    background: rgba(94, 196, 160, 0.25);
    border-color: #5ec4a0;
    color: #8edcc0;
}

.chat-msg-assist {
    border-left-color: var(--accent-gold);
    background: rgba(201, 153, 58, 0.08);
}

.chat-msg-assist:hover {
    background: rgba(201, 153, 58, 0.14);
}

.chat-assist-card .chat-recruit-label {
    color: var(--text-gold);
}

.chat-assist-card .chat-recruit-name {
    color: var(--text-primary);
}

.chat-assist-card .chat-recruit-dungeon {
    color: var(--text-gold);
}

.chat-assist-card .chat-recruit-info {
    color: var(--text-secondary);
}

.chat-assist-realm {
    color: var(--text-jade) !important;
    font-weight: 600;
    font-size: 11px !important;
}

.chat-assist-card .btn-recruit-join {
    background: rgba(201, 153, 58, 0.12);
    border-color: rgba(201, 153, 58, 0.35);
    color: var(--text-gold);
    box-shadow: inset 0 0 0 1px rgba(201, 153, 58, 0.08);
}

.chat-assist-card .btn-recruit-join:hover {
    background: rgba(201, 153, 58, 0.22);
    border-color: rgba(201, 153, 58, 0.5);
    color: var(--text-primary);
}

.chat-msg-assist-report {
    padding-bottom: 8px;
}

.chat-assist-report-card {
    gap: 8px;
}

/* ==== 聊天过滤 Tab ==== */
.chat-filter-tabs {
    display: flex;
    gap: 2px;
    padding: 4px 8px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}
.chat-filter-tab {
    flex: 1;
    padding: 3px 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-align: center;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    background: transparent;
    transition: all 0.2s;
}
.chat-filter-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}
.chat-filter-tab.active {
    color: var(--text-gold);
    background: rgba(201, 153, 58, 0.12);
}
/* 过滤模式: 隐藏不匹配的消息 */
.chat-messages.filter-chat-only .chat-card-msg { display: none !important; }
.chat-messages.filter-card-only .chat-msg:not(.chat-card-msg) { display: none !important; }

.chat-assist-report-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: 1px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.chat-assist-report-status-victory {
    color: #8ee0b8;
    background: rgba(94, 196, 160, 0.14);
    border-color: rgba(94, 196, 160, 0.28);
}

.chat-assist-report-status-danger {
    color: #f1a29a;
    background: rgba(185, 72, 72, 0.14);
    border-color: rgba(185, 72, 72, 0.32);
}

.chat-assist-report-status-neutral {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
}

.chat-assist-report-summary {
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.6;
}

.chat-assist-report-logs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 184px;
    overflow-y: auto;
    padding: 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-assist-report-line {
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-secondary);
    padding-left: 10px;
    position: relative;
}

.chat-assist-report-line::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.72em;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(201, 153, 58, 0.6);
}

.chat-assist-report-line.is-intro {
    color: var(--text-gold);
}

.chat-assist-report-line.is-round {
    color: #d7d1c0;
}

.chat-assist-report-line.is-reward {
    color: #8fd9b4;
}

.chat-assist-report-line.is-danger {
    color: #e7a39a;
}

.chat-assist-report-round-tag {
    color: var(--text-gold);
    font-weight: 600;
    margin-right: 4px;
}

.chat-assist-report-emphasis {
    color: var(--text-primary);
    font-weight: 600;
}

.chat-listing-item {
    font-weight: 600;
    font-size: 13px;
}

/* 上架弹窗通知勾选行 */
.market-notify-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 12px;
}

.market-notify-label {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    cursor: pointer;
}

.market-notify-label input[type="checkbox"] {
    accent-color: var(--accent-jade);
}

.market-notify-remain {
    color: var(--text-muted);
    font-size: 11px;
}

/* 悬浮聊天气泡 */
.chat-bubble {
    position: fixed;
    bottom: 140px;
    left: 20px;
    max-width: 320px;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid rgba(71, 189, 149, 0.3);
    border-left: 3px solid var(--accent-jade);
    border-radius: 8px;
    cursor: pointer;
    z-index: 900;
    animation: chatBubbleIn 0.3s ease;
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.chat-bubble:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-jade);
    transform: translateY(-2px);
}

.chat-bubble.hidden {
    display: none;
}

.chat-bubble.fade-out {
    opacity: 0;
    transform: translateY(10px);
}

.chat-bubble-name {
    color: var(--accent-jade);
    font-weight: 600;
    font-size: 12px;
    margin-right: 6px;
}

.chat-bubble-text {
    color: var(--text-primary);
    font-size: 12px;
    line-height: 1.5;
}

@keyframes chatBubbleIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}



/* ===== 打字机效果 ===== */
.typing-cursor::after {
    content: '|';
    animation: blink 1s step-end infinite;
    color: var(--text-gold);
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== 响应式 ===== */

/* 角色面板切换按钮 (仅移动端可见) */
.btn-toggle-player {
    display: none;
}

/* 角色面板关闭按钮(仅移动端显示) */
.player-panel-close {
    display: none;
}

/* 移动端遮罩 */
.mobile-overlay {
    display: none;
}

/* --- 当横向空间不足时 (1400px及以下) 收起顶部按钮，改用侧边栏导航 --- */
@media (max-width: 1400px) {
    .header-btn-group {
        display: none;
    }

    .header-right .btn-icon:not(.btn-logout) {
        display: none;
    }

    .header-right .btn-logout {
        display: none;
    }

    .mobile-nav {
        display: flex;
        flex-direction: column;
        gap: 2px;
        padding: 6px 4px;
        background: var(--bg-card);
        border-left: 1px solid var(--border-color);
        overflow-y: auto;
        position: relative;
        z-index: 790;
    }

    .log-area {
        flex-direction: row;
    }

    .mobile-nav-btn {
        padding: 8px 6px;
        font-size: 11px;
        background: transparent;
        color: var(--text-muted);
        border: 1px solid var(--border-color);
        border-radius: 4px;
        cursor: pointer;
        font-family: inherit;
        white-space: nowrap;
        transition: all 0.2s;
        writing-mode: horizontal-tb;
    }

    .mobile-nav-btn:hover,
    .mobile-nav-btn:active {
        color: var(--accent-gold);
        border-color: var(--accent-gold);
        background: rgba(201, 164, 72, 0.1);
    }

    .mobile-nav-logout {
        color: #e06060;
        border-color: rgba(224, 96, 96, 0.3);
        margin-top: 4px;
    }

    .mobile-nav-logout:hover,
    .mobile-nav-logout:active {
        color: #ff6b6b;
        border-color: #ff6b6b;
        background: rgba(255, 107, 107, 0.1);
    }
}


/* 中小屏隐藏常驻聊天 (inline-chat仅PC大屏显示，避免与侧边栏聊天重复) */
@media (max-width: 1024px) {
    .inline-chat {
        display: none !important;
    }
}

@media (max-width: 768px) {
    body {
        overflow: hidden;
    }

    /* --- Header 紧凑化 --- */
    .game-header {
        padding: 0 10px;
        height: 44px;
    }

    .header-left {
        gap: 8px;
        overflow-x: auto;
        -ms-overflow-style: none;
        scrollbar-width: none;
        flex: 1;
    }

    .header-left::-webkit-scrollbar {
        display: none;
    }

    .header-left > * {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .header-logo {
        font-size: 18px;
        letter-spacing: 2px;
    }

    .header-realm {
        font-size: 11px;
        padding: 2px 6px;
    }


    .header-player-name {
        display: none;
    }

    .btn-icon {
        padding: 4px 8px;
        font-size: 12px;
    }

    /* --- 移动端角色状态栏 --- */
    .mobile-status-bar {
        display: flex;
        align-items: center;
        justify-content: space-around;
        padding: 6px 12px;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border-color);
        flex-shrink: 0;
        cursor: pointer;
        transition: background 0.2s;
    }

    .mobile-status-bar:active {
        background: var(--bg-card-hover);
    }

    .msb-item {
        font-size: 12px;
        color: var(--text-secondary);
        font-family: var(--font-serif);
        white-space: nowrap;
    }

    .msb-label {
        color: var(--text-muted);
        font-size: 11px;
        margin-right: 2px;
    }

    .msb-hp {
        color: #e06060;
    }

    .msb-hp.msb-warn {
        color: #ff9f43;
    }

    .msb-hp.msb-danger {
        color: #ff6b6b;
        font-weight: 600;
    }

    .msb-mp {
        color: #6090e0;
    }

    .msb-atk {
        color: #e0a040;
    }

    .msb-def {
        color: #60a0e0;
    }

    .msb-spirit {
        color: var(--accent-purple);
    }


    /* --- 角色面板切换按钮 --- */
    .btn-toggle-player {
        display: flex;
    }

    .player-panel-close {
        display: inline-block;
    }

    /* --- 角色面板变为左侧抽屉 --- */
    .player-panel {
        position: fixed;
        top: 44px;
        left: 0;
        bottom: 0;
        width: 220px;
        z-index: 1100;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        border-right: 1px solid var(--border-color);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0);
    }

    .player-panel.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    }

    /* --- 遮罩层 --- */
    .mobile-overlay {
        display: block;
        position: fixed;
        inset: 0;
        top: 44px;
        background: rgba(0, 0, 0, 0);
        backdrop-filter: blur(0px);
        z-index: 1099;
        pointer-events: none;
        transition: background 0.3s ease, backdrop-filter 0.3s ease;
    }

    .mobile-overlay.active {
        background: rgba(0, 0, 0, 0.45);
        backdrop-filter: blur(2px);
        pointer-events: auto;
    }

    /* --- 主面板全宽 --- */
    .game-body {
        flex-direction: column;
        overflow: hidden;
        min-height: 0;
    }

    .main-panel {
        flex: 1;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    /* --- 身份码标签 (header 内移动端显示) --- */
    .header-identity-code {
        display: inline-block;
        font-size: 11px;
        color: var(--text-gold);
        background: rgba(201, 153, 58, 0.12);
        border: 1px solid rgba(201, 153, 58, 0.25);
        border-radius: var(--radius-sm);
        padding: 2px 6px;
        font-family: monospace;
        letter-spacing: 2px;
    }

    .log-panel {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding: 10px 12px;
    }

    .log-content p {
        font-size: 13px;
        line-height: 1.6;
        padding: 3px 8px;
    }

    /* --- 操作栏紧凑化 --- */
    .action-bar {
        flex-shrink: 0;
        padding: 6px 8px;
        gap: 4px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .action-group {
        gap: 4px;
        justify-content: center;
    }

    .action-divider {
        width: 100%;
        height: 1px;
        margin: 2px 0;
    }

    .btn-action {
        padding: 7px 10px;
        font-size: 12px;
        gap: 3px;
        flex: 0 0 auto;
    }

    /* --- 冥想栏紧凑化 --- */
    .meditation-bar {
        padding: 6px 10px;
        gap: 8px;
        flex-direction: row;
        align-items: center;
    }

    .meditation-info {
        gap: 2px 8px;
        font-size: 11px;
        flex: 1;
        min-width: 0;
        flex-wrap: wrap;
        justify-content: flex-start;
        text-align: left;
    }

    .meditation-anim {
        width: 20px;
        height: 20px;
        align-self: center;
        flex-shrink: 0;
    }

    .meditation-pulse {
        width: 10px;
        height: 10px;
    }

    .btn-stop-meditate {
        padding: 6px 12px;
        font-size: 12px;
        width: auto;
        flex-shrink: 0;
    }

    /* --- 右侧面板变为全屏覆盖 --- */
    .side-panel {
        position: fixed;
        top: 44px;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        z-index: 1001;
        border-left: none;
        transition: transform 0.3s ease, opacity 0.25s ease;
    }

    .side-panel.hidden {
        transform: translateY(100%);
        opacity: 0;
        position: fixed;
    }

    .side-panel-resize-handle {
        display: none;
    }

    .side-content {
        padding: 12px;
    }

    /* --- 登录页自适应 --- */
    .login-hero {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 16px;
    }

    .hero-branding {
        order: -2;
        text-align: center;
        align-items: center;
    }

    .hero-right {
        position: static;
        display: flex;
        justify-content: center;
        order: -1;
        grid-column: 1;
        grid-row: auto;
    }

    .hero-left {
        order: 0;
        align-items: center;
        text-align: center;
    }

    .login-logo {
        text-align: center;
    }

    .login-features {
        text-align: center;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .feature-item {
        text-align: left;
    }

    .login-card {
        width: calc(100vw - 32px);
        max-width: 380px;
        padding: 24px 20px;
    }

    .logo-title {
        font-size: 42px;
        letter-spacing: 8px;
    }

    .logo-subtitle {
        font-size: 14px;
        letter-spacing: 4px;
    }

    .logo-tagline {
        font-size: 12px;
    }

    .logo-intro {
        font-size: 14px;
        line-height: 1.8;
    }

    .landing-content {
        padding-top: 18px;
        padding-bottom: 32px;
    }

    .landing-section {
        padding: 20px 16px;
        border-radius: 16px;
    }

    .landing-section h2 {
        font-size: 20px;
    }

    .hero-banner {
        gap: 10px;
        flex-wrap: wrap;
    }

    .hero-title {
        font-size: 28px;
        line-height: 1.32;
    }

    .hero-stage {
        grid-template-columns: 1fr;
    }

    .highlight-grid,
    .world-stage,
    .ai-fact-list,
    .region-grid,
    .faction-row,
    .realm-grid,
    .play-loop {
        grid-template-columns: 1fr;
    }

    .anchor-chip {
        min-height: 36px;
        font-size: 13px;
    }

    /* --- Toast --- */
    .toast-container {
        top: 100px;
        right: 10px;
        left: auto;
    }

    .toast {
        max-width: 60vw;
        font-size: 13px;
        padding: 10px 14px;
    }

    /* --- 储物/商店/兑换弹窗 --- */
    .exchange-modal-overlay {
        padding: 10px;
    }

    .exchange-modal {
        width: 100%;
        max-width: 340px;
    }

    .inventory-item {
        padding: 8px;
    }

    .shop-item {
        padding: 8px;
    }

    /* --- 死亡/逮捕覆盖层 --- */
    .death-overlay,
    .arrest-overlay {
        padding: 20px;
    }

    .death-content,
    .arrest-content {
        max-width: 100%;
    }
}


/* ===== 图鉴系统 ===== */
.encyclopedia-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    padding: 8px 4px;
}

.encyclopedia-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.encyclopedia-card:hover {
    border-color: rgba(201, 153, 58, 0.3);
}

.encyclopedia-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.encyclopedia-card-name {
    font-size: 13px;
    font-weight: 600;
}

.encyclopedia-card-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    white-space: nowrap;
}

.encyclopedia-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    white-space: pre-wrap;
}

.encyclopedia-card-meta {
    margin-top: auto;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 6px;
    border-top: 1px solid var(--border-color);
}

.encyclopedia-card-meta-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.encyclopedia-card-meta-label {
    color: var(--text-muted);
    min-width: 36px;
    flex-shrink: 0;
    font-size: 11px;
}

.encyclopedia-card-meta-value {
    color: var(--text-secondary);
    flex: 1;
    font-size: 12px;
}

.encyclopedia-card-recipe {
    color: var(--text-gold) !important;
}

.encyclopedia-filter-btn {
    padding: 4px 10px;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-gray);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.encyclopedia-filter-btn.active {
    background: rgba(201, 153, 58, 0.2);
    border-color: var(--text-gold);
    color: var(--text-gold);
}

.encyclopedia-sort-btn {
    padding: 3px 8px;
    font-size: 11px;
    opacity: 0.8;
}
.encyclopedia-order-btn {
    border-color: var(--text-muted);
    color: var(--text-muted);
    margin-left: 4px;
}
.encyclopedia-order-btn.active {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    opacity: 1;
}


@media (max-width: 768px) {
    body.mobile-no-scroll {
        overflow: hidden !important;
        touch-action: none;
    }
    .side-panel {
        overscroll-behavior: contain;
    }
    #playerPanel.mobile-open {
        overscroll-behavior: contain;
    }
}
