/* === 暗影地牢 Web版 - 样式 === */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Noto+Sans+SC:wght@400;700;900&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

/* === 地图词缀选择面板 === */
.map-affix-title { color: #c8a8e0; }
.map-affix-info { text-align: center; color: #a0a0a0; font-size: 14px; margin-bottom: 12px; }
.map-affix-current { margin-bottom: 12px; }
.map-affix-stack {
    text-align: center;
    padding: 6px 10px;
    background: rgba(30, 20, 40, 0.6);
    border: 1px solid #3a2a4a;
    border-radius: 4px;
}
.map-affix-stack .stack-label { font-size: 12px; color: #8870a0; }
.map-affix-stack .stack-affix { font-size: 11px; margin: 0 4px; }
.map-affix-stack .stack-affix .pos { color: #4c4; }
.map-affix-stack .stack-affix .neg { color: #c44; }

.map-affix-choices {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    justify-content: center;
}
.map-affix-column { flex: 1; max-width: 320px; }
.map-affix-col-title { text-align: center; font-size: 14px; margin-bottom: 8px; padding-bottom: 4px; }
.map-affix-col-title.positive { color: #44c85c; border-bottom: 2px solid #44c85c44; }
.map-affix-col-title.negative { color: #e8323c; border-bottom: 2px solid #e8323c44; }

/* 当列表里有 ≥2 张卡片（噩梦模式 2 正 2 负）时，让卡片并排显示 */
#map-affix-positive-list.multi,
#map-affix-negative-list.multi {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
#map-affix-positive-list.multi .map-affix-card,
#map-affix-negative-list.multi .map-affix-card {
    flex: 1;
    min-width: 130px;
    margin-bottom: 0;
}

.map-affix-card {
    background: rgba(20, 16, 24, 0.9);
    border: 2px solid #3a2a3a;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.map-affix-card.positive { border-color: #2a4a2a; }
.map-affix-card.positive:hover { border-color: #44c85c; background: rgba(20, 40, 20, 0.9); }
.map-affix-card.positive.selected { border-color: #44c85c; background: rgba(30, 60, 30, 0.95); box-shadow: 0 0 8px #44c85c44; }
.map-affix-card.negative { border-color: #4a2a2a; }
.map-affix-card.negative:hover { border-color: #e8323c; background: rgba(40, 20, 20, 0.9); }
.map-affix-card.negative.selected { border-color: #e8323c; background: rgba(60, 30, 30, 0.95); box-shadow: 0 0 8px #e8323c44; }
.map-affix-card .card-name { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.map-affix-card.positive .card-name { color: #6ce86c; }
.map-affix-card.negative .card-name { color: #e87878; }
.map-affix-card .card-desc { font-size: 11px; color: #8870a0; }

.map-affix-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.map-affix-actions .menu-btn { min-width: 140px; }
.reroll-btn { border-color: #c8a040 !important; color: #f0c040 !important; }
.reroll-btn:hover { background: rgba(200, 160, 64, 0.2) !important; }
.reroll-btn.disabled { opacity: 0.4; cursor: not-allowed; }

.endless-btn { border-color: #c8a8e0 !important; color: #c8a8e0 !important; }
.endless-btn:hover { background: rgba(200, 168, 224, 0.15) !important; }

:root {
    --gold: #f0c040;
    --gold-dark: #b8902f;
    --hp-color: #e8323c;
    --mp-color: #3278e8;
    --xp-color: #5cc844;
    --panel-bg: rgba(16, 12, 8, 0.92);
    --panel-border: #8a6a2a;
    --text-light: #f0e8d0;
    --danger: #e8323c;
    --success: #44c85c;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0a0806;
    font-family: 'Noto Sans SC', sans-serif;
    color: var(--text-light);
    user-select: none;
}

#game-container {
    position: relative;
    width: 640px;
    height: 480px;
    margin: 20px auto;
    border: 3px solid var(--panel-border);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(240, 192, 64, 0.15);
    image-rendering: pixelated;
    background: #111;
    transform-origin: top center;
}

/* Responsive scaling for larger screens */
@media (min-height: 600px) {
    #game-container { transform: scale(1.1); margin-top: 30px; }
}
@media (min-height: 720px) {
    #game-container { transform: scale(1.3); margin-top: 40px; }
}
@media (min-height: 900px) {
    #game-container { transform: scale(1.5); margin-top: 60px; }
}
@media (min-height: 1080px) {
    #game-container { transform: scale(1.7); margin-top: 80px; }
}

/* === 移动端适配（由 JS 动态控制，不依赖媒体查询） === */

/* Hub 在小屏幕下更紧凑 */
@media (max-height: 520px) {
    .hub-left { width: 180px; padding: 4px; }
    .equip-slot { padding: 2px 5px; font-size: 9px; min-height: 20px; }
    .equip-slot-label, .equip-slot-item { font-size: 9px; }
    .hub-stats-panel { font-size: 9px; }
    .hub-stat-row { font-size: 9px; padding: 2px 4px; }
    .hub-stat-row .stat-total { font-size: 12px; }
    .hub-stats-header { font-size: 10px; padding: 4px 6px; }
    .stat-chips { margin-left: 4px; }
    .hub-right { padding: 6px 8px; gap: 4px; }
    .hub-menu-btn { padding: 4px 8px; gap: 6px; }
    .hub-btn-icon { font-size: 18px; width: 24px; }
    .hub-btn-text { font-size: 13px; }
    .hub-btn-sub { font-size: 9px; }
}

/* === 旋转提示遮罩 === */
.rotate-prompt {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: #0a0e1a;
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #a0a8c0;
    gap: 20px;
}
.rotate-prompt.show { display: flex; }
.rotate-prompt .rotate-icon {
    font-size: 56px;
    animation: rotateHint 2s ease-in-out infinite;
}
.rotate-prompt .rotate-text {
    font-size: 18px;
    font-weight: 600;
    color: #6c8ce8;
}
.rotate-prompt .rotate-sub {
    font-size: 14px;
    color: #5a647a;
    max-width: 280px;
    line-height: 1.6;
}
@keyframes rotateHint {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

.hidden { display: none !important; }

/* === Screen Overlays === */
.screen-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(20, 15, 10, 0.95), rgba(5, 3, 1, 0.98));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 20px;
}

/* === Title Screen - 暗黑奇幻风 === */
#title-screen {
    background: radial-gradient(ellipse at center, #1a0a08 0%, #050202 70%);
}

/* 背景多层渐变 + 紫色光晕 */
.title-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(160, 64, 224, 0.18) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(232, 50, 60, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(240, 192, 64, 0.08) 0%, transparent 70%);
    animation: title-bg-pulse 8s ease-in-out infinite;
}

@keyframes title-bg-pulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* 漂浮粒子（火星/灰烬效果） */
.title-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 8px rgba(240, 192, 64, 0.8);
    opacity: 0;
    animation: particle-rise 6s ease-in infinite;
}

.particle.p1 { left: 10%; animation-delay: 0s; background: #f0c040; }
.particle.p2 { left: 25%; animation-delay: 1s; background: #ff6830; }
.particle.p3 { left: 40%; animation-delay: 2s; background: #a040e0; }
.particle.p4 { left: 55%; animation-delay: 3s; background: #f0c040; }
.particle.p5 { left: 75%; animation-delay: 1.5s; background: #ff6830; }
.particle.p6 { left: 90%; animation-delay: 4s; background: #60a0ff; }

@keyframes particle-rise {
    0% {
        bottom: -10px;
        opacity: 0;
        transform: translateX(0) scale(0.5);
    }
    10% {
        opacity: 1;
        transform: translateX(-10px) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translateX(10px) scale(1.2);
    }
    90% {
        opacity: 0.4;
    }
    100% {
        bottom: 110%;
        opacity: 0;
        transform: translateX(-20px) scale(0.3);
    }
}

/* 标题框（带四角装饰） */
.title-frame {
    position: relative;
    padding: 16px 80px 14px;
    margin-bottom: 22px;
    z-index: 2;
}

.title-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid var(--gold);
    z-index: 3;
}

.title-corner.tl { top: 0; left: 0; border-right: none; border-bottom: none; }
.title-corner.tr { top: 0; right: 0; border-left: none; border-bottom: none; }
.title-corner.bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.title-corner.br { bottom: 0; right: 0; border-left: none; border-top: none; }

/* 大标题（横向） */
.game-title {
    font-family: 'Noto Sans SC', sans-serif;
    font-weight: 900;
    margin: 0 0 8px;
    font-size: 56px;
    line-height: 1;
    letter-spacing: 14px;
    color: var(--gold);
    text-shadow:
        0 0 10px rgba(240, 192, 64, 0.6),
        0 0 25px rgba(240, 192, 64, 0.4),
        0 0 50px rgba(240, 192, 64, 0.2),
        5px 5px 0 #6a3010;
    animation: title-glow 3s ease-in-out infinite;
    display: inline-block;
    transform: translateX(7px); /* 平衡 letter-spacing 偏移 */
}

@keyframes title-glow {
    0%, 100% {
        text-shadow:
            0 0 10px rgba(240, 192, 64, 0.6),
            0 0 25px rgba(240, 192, 64, 0.4),
            0 0 50px rgba(240, 192, 64, 0.2),
            5px 5px 0 #6a3010;
    }
    50% {
        text-shadow:
            0 0 20px rgba(240, 192, 64, 0.9),
            0 0 50px rgba(240, 192, 64, 0.6),
            0 0 100px rgba(240, 192, 64, 0.3),
            5px 5px 0 #6a3010;
    }
}

/* 副标题 */
.game-subtitle {
    margin: 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: var(--gold-dark);
    letter-spacing: 4px;
}

.sub-line { color: #8a7a4a; }
.sub-divider { color: #5a4a2a; font-size: 14px; }

/* 副标语 */
.title-tagline {
    margin: 6px 0 0;
    font-size: 11px;
    color: #a09068;
    letter-spacing: 4px;
    font-style: italic;
    opacity: 0.85;
}

/* 菜单 */
.title-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    position: relative;
    z-index: 2;
    margin-top: -8px;
}

/* 标题页菜单按钮 */
.title-menu-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 240px;
    padding: 12px 20px;
    background: linear-gradient(180deg, rgba(40, 24, 8, 0.95), rgba(20, 12, 4, 0.98));
    border: 2px solid rgba(138, 106, 42, 0.5);
    color: var(--text-light);
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border-radius: 4px;
    text-decoration: none;
}

.title-menu-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(240, 192, 64, 0.15), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s;
    pointer-events: none;
}

.title-menu-btn:hover {
    background: linear-gradient(180deg, rgba(80, 48, 16, 0.95), rgba(40, 24, 8, 0.98));
    border-color: var(--gold);
    color: var(--gold);
    box-shadow:
        0 0 24px rgba(240, 192, 64, 0.4),
        inset 0 0 12px rgba(240, 192, 64, 0.1);
    transform: translateX(4px);
}

.title-menu-btn:hover::before {
    transform: translateX(100%);
}

.title-menu-btn:active {
    transform: translateX(4px) translateY(1px);
}

.btn-icon {
    flex: 0 0 24px;
    font-size: 18px;
    color: var(--gold);
    text-shadow: 0 0 8px rgba(240, 192, 64, 0.6);
    transition: transform 0.25s;
}

.title-menu-btn:hover .btn-icon {
    transform: scale(1.3) rotate(5deg);
}

.btn-text {
    flex: 1;
    text-align: left;
    letter-spacing: 2px;
}

.btn-hotkey {
    /* 已移除快捷键数字显示 */
    display: none;
}

/* 页脚 */
.title-footer {
    position: absolute;
    bottom: 14px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
    color: #555;
    letter-spacing: 2px;
    z-index: 2;
}

.footer-divider {
    color: #4a3a1a;
    margin: 0 8px;
}

.footer-tip {
    color: #6a5a2a;
}

/* === Buttons === */
.menu-btn {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-light);
    background: linear-gradient(180deg, #3a2818, #1e1408);
    border: 2px solid var(--gold-dark);
    padding: 10px 36px;
    cursor: pointer;
    transition: all 0.15s;
    border-radius: 2px;
    min-width: 200px;
    text-align: center;
}

.menu-btn:hover {
    background: linear-gradient(180deg, #5a3818, #2e1c0c);
    border-color: var(--gold);
    color: var(--gold);
    box-shadow: 0 0 12px rgba(240, 192, 64, 0.3);
    transform: translateY(-1px);
}

.menu-btn:active { transform: translateY(1px); }

.back-btn {
    margin-top: 24px;
    font-size: 14px;
    padding: 8px 28px;
    min-width: 120px;
}

/* === Character Select - 暗黑奇幻风 === */
#char-select {
    background: radial-gradient(ellipse at center, #0a0612 0%, #000 70%);
}

.char-select-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 30%, rgba(72, 120, 208, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(208, 72, 144, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(240, 192, 64, 0.08) 0%, transparent 60%);
    pointer-events: none;
    animation: bg-pulse 6s ease-in-out infinite;
}

@keyframes bg-pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.char-title {
    margin-bottom: 28px;
    text-align: center;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.char-title .title-glow {
    font-size: 36px;
    font-weight: 900;
    letter-spacing: 6px;
    color: var(--gold);
    text-shadow:
        0 0 10px rgba(240, 192, 64, 0.6),
        0 0 20px rgba(240, 192, 64, 0.4),
        0 0 40px rgba(240, 192, 64, 0.2),
        3px 3px 0 #4a2800;
    animation: title-glow 3s ease-in-out infinite;
}

@keyframes title-glow {
    0%, 100% {
        text-shadow:
            0 0 10px rgba(240, 192, 64, 0.6),
            0 0 20px rgba(240, 192, 64, 0.4),
            0 0 40px rgba(240, 192, 64, 0.2),
            3px 3px 0 #4a2800;
    }
    50% {
        text-shadow:
            0 0 20px rgba(240, 192, 64, 0.9),
            0 0 40px rgba(240, 192, 64, 0.6),
            0 0 80px rgba(240, 192, 64, 0.3),
            3px 3px 0 #4a2800;
    }
}

.char-title .title-sub {
    font-size: 12px;
    letter-spacing: 8px;
    color: #8a7a4a;
    font-weight: 600;
    text-transform: uppercase;
}

.char-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-bottom: 18px;
    position: relative;
    z-index: 2;
}

.char-card {
    width: 280px;
    background: linear-gradient(180deg, rgba(20, 14, 28, 0.92), rgba(8, 4, 12, 0.96));
    border: 2px solid rgba(138, 106, 42, 0.4);
    border-radius: 6px;
    padding: 16px 14px 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.char-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 6px;
    padding: 2px;
    background: linear-gradient(135deg, transparent, transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    transition: background 0.3s;
    z-index: 3;
}

.char-card-char-card-boy::before {
    background: linear-gradient(135deg, transparent 30%, #4878d0 50%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
}

.char-card-char-card-girl::before {
    background: linear-gradient(135deg, transparent 30%, #d04890 50%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
}

.char-card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: rgba(240, 192, 64, 0.6);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.6),
        0 0 24px rgba(240, 192, 64, 0.2);
}

.char-card-boy:hover {
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.6),
        0 0 32px rgba(72, 120, 208, 0.5),
        inset 0 0 20px rgba(72, 120, 208, 0.1);
    border-color: rgba(72, 120, 208, 0.8);
}

.char-card-girl:hover {
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.6),
        0 0 32px rgba(208, 72, 144, 0.5),
        inset 0 0 20px rgba(208, 72, 144, 0.1);
    border-color: rgba(208, 72, 144, 0.8);
}

.char-card:hover::before { opacity: 1; }

/* 角色框（带四角装饰） */
.char-frame {
    position: relative;
    width: 128px;
    height: 128px;
    margin: 0 auto 16px;
}

.char-portrait {
    width: 128px;
    height: 128px;
    border-radius: 4px;
    position: relative;
    z-index: 2;
    image-rendering: pixelated;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    background-color: #0a0612;
    /* 让 sprite 居中且放大 2x */
    background-repeat: no-repeat;
}

.boy-portrait {
    background-image: url('../assets/spritesheet.png');
    background-size: 1588px 1456px;
    /* char_boy_idle 在原图 (2, 398)，放大 2x 后位于 (4, 796) */
    background-position: -4px -796px;
}

.girl-portrait {
    background-image: url('../assets/spritesheet.png');
    background-size: 1588px 1456px;
    /* char_girl_idle 在原图 (200, 398)，放大 2x 后位于 (400, 796) */
    background-position: -400px -796px;
}

/* 四角装饰 */
.char-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid var(--gold);
    z-index: 4;
}

.char-corner.tl { top: -4px; left: -4px; border-right: none; border-bottom: none; }
.char-corner.tr { top: -4px; right: -4px; border-left: none; border-bottom: none; }
.char-corner.bl { bottom: -4px; left: -4px; border-right: none; border-top: none; }
.char-corner.br { bottom: -4px; right: -4px; border-left: none; border-top: none; }

.char-card-boy .char-corner { border-color: #6098e8; }
.char-card-girl .char-corner { border-color: #f080b0; }

/* 角色背后光晕 */
.char-aura {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
}

.boy-aura {
    background: radial-gradient(circle, rgba(72, 120, 208, 0.5) 0%, transparent 70%);
    animation: aura-rotate 4s linear infinite, aura-pulse 2.5s ease-in-out infinite;
}

.girl-aura {
    background: radial-gradient(circle, rgba(208, 72, 144, 0.5) 0%, transparent 70%);
    animation: aura-rotate 5s linear infinite reverse, aura-pulse 2.5s ease-in-out infinite;
}

@keyframes aura-rotate {
    from { transform: rotate(0deg) scale(1); }
    to { transform: rotate(360deg) scale(1.1); }
}

@keyframes aura-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.9; }
}

/* 元素装饰（剑/法球） */
.char-element-sword,
.char-element-orb {
    position: absolute;
    z-index: 3;
    pointer-events: none;
}

.char-element-sword {
    top: -8px;
    right: -16px;
    font-size: 28px;
    color: #e0e0e0;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
    transform: rotate(-25deg);
    animation: float 3s ease-in-out infinite;
}

.char-element-orb {
    top: -10px;
    left: -16px;
    font-size: 24px;
    color: #c080ff;
    text-shadow: 0 0 12px rgba(192, 128, 255, 0.8);
    animation: float 3s ease-in-out infinite, orb-glow 1.5s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(-25deg); }
    50% { transform: translateY(-6px) rotate(-15deg); }
}

.char-element-orb { animation-name: float-orb, orb-glow; }

@keyframes float-orb {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-6px) rotate(15deg); }
}

@keyframes orb-glow {
    0%, 100% { text-shadow: 0 0 12px rgba(192, 128, 255, 0.8); }
    50% { text-shadow: 0 0 24px rgba(208, 128, 255, 1), 0 0 36px rgba(160, 64, 224, 0.6); }
}

.char-class-tag {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, #2a1a08, #4a2810, #2a1a08);
    border: 1px solid var(--gold-dark);
    padding: 2px 12px;
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--gold);
    z-index: 4;
    white-space: nowrap;
}

.char-card-boy .char-class-tag { border-color: rgba(72, 120, 208, 0.6); color: #8ab8e8; }
.char-card-girl .char-class-tag { border-color: rgba(208, 72, 144, 0.6); color: #f0a0c0; }

/* 角色名字 */
.char-name {
    font-size: 22px;
    margin: 12px 0 4px;
    font-weight: 900;
    letter-spacing: 2px;
}

.boy-name {
    color: #6098e8;
    text-shadow: 0 0 10px rgba(72, 120, 208, 0.6), 2px 2px 0 #1a2a4a;
}

.girl-name {
    color: #f080b0;
    text-shadow: 0 0 10px rgba(208, 72, 144, 0.6), 2px 2px 0 #4a1a2a;
}

.char-desc {
    font-size: 12px;
    color: #b8a888;
    margin-bottom: 14px;
    line-height: 1.5;
    font-style: italic;
}

/* 属性条 */
.char-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    border: 1px solid rgba(138, 106, 42, 0.2);
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    flex: 0 0 36px;
    font-size: 11px;
    font-weight: 700;
    text-align: left;
}

.stat-label.hp { color: var(--hp-color); }
.stat-label.mp { color: var(--mp-color); }
.stat-label.atk { color: #ff8830; }
.stat-label.spd { color: #5cc844; }

.stat-bar {
    flex: 1;
    height: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(138, 106, 42, 0.3);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    position: relative;
}

.stat-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
}

.hp-fill { background: linear-gradient(90deg, #8a1020, #e8323c, #ff6850); }
.mp-fill { background: linear-gradient(90deg, #103878, #3278e8, #60a0ff); }
.atk-fill { background: linear-gradient(90deg, #884510, #ff8830, #ffc080); }
.spd-fill { background: linear-gradient(90deg, #2a7818, #5cc844, #80f060); }

.stat-val {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
    font-family: monospace;
}

/* 技能描述 */
.char-skill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: linear-gradient(90deg, rgba(60, 40, 20, 0.4), rgba(40, 28, 16, 0.6));
    border-left: 3px solid var(--gold);
    border-radius: 3px;
    margin-bottom: 12px;
    text-align: left;
}

.char-card-boy .char-skill { border-left-color: #6098e8; }
.char-card-girl .char-skill { border-left-color: #f080b0; }

.skill-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: radial-gradient(circle, #4a3818, #2a1a08);
    border: 2px solid var(--gold-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--gold);
    flex-shrink: 0;
}

.char-card-boy .skill-icon { border-color: rgba(72, 120, 208, 0.6); color: #8ab8e8; }
.char-card-girl .skill-icon { border-color: rgba(208, 72, 144, 0.6); color: #f0a0c0; }

.skill-info { flex: 1; }

.skill-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 2px;
    letter-spacing: 1px;
}

.char-card-boy .skill-name { color: #8ab8e8; }
.char-card-girl .skill-name { color: #f0a0c0; }

.skill-desc {
    font-size: 10px;
    color: #a89868;
    line-height: 1.3;
}

/* 选择提示 */
.char-select-hint {
    font-size: 11px;
    color: #6a5a2a;
    letter-spacing: 2px;
    opacity: 0;
    transition: opacity 0.3s, color 0.3s;
}

.char-card:hover .char-select-hint {
    opacity: 1;
    color: var(--gold);
}

.char-card-boy:hover .char-select-hint { color: #8ab8e8; }
.char-card-girl:hover .char-select-hint { color: #f0a0c0; }

.screen-title.danger { color: var(--danger); }
.screen-title.victory { color: var(--success); }

/* === Difficulty Select === */
.difficulty-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 10px;
}

.difficulty-card {
    width: auto;
    background: linear-gradient(180deg, rgba(58, 40, 24, 0.9), rgba(20, 14, 8, 0.95));
    border: 2px solid var(--gold-dark);
    border-radius: 4px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.difficulty-card:hover {
    border-color: var(--gold);
    transform: scale(1.03);
    box-shadow: 0 0 16px rgba(240, 192, 64, 0.3);
}

.difficulty-card .diff-icon {
    font-size: 32px;
    margin: 8px 0;
}

.difficulty-card h3 {
    font-size: 18px;
    color: var(--gold);
    margin: 6px 0;
}

.difficulty-card .diff-desc {
    font-size: 13px;
    color: #c0b090;
    margin: 4px 0;
}

.difficulty-card .diff-detail {
    font-size: 11px;
    color: #807060;
    margin: 2px 0;
}

/* 锁定状态 */
.difficulty-card.locked {
    opacity: 0.45;
    filter: grayscale(0.6);
    cursor: not-allowed;
}
.difficulty-card.locked:hover {
    border-color: var(--gold-dark);
    transform: none;
    box-shadow: none;
}

/* 当前进行中 */
.difficulty-card.current {
    border-color: var(--gold);
    box-shadow: 0 0 12px rgba(240, 192, 64, 0.25);
}

/* === 卡牌管理面板 === */
.card-slot-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.card-slot {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 2px solid #444;
    border-radius: 4px;
    background: rgba(20, 16, 10, 0.8);
}

.card-slot.equipped {
    background: rgba(40, 30, 16, 0.9);
}

.card-slot.empty {
    opacity: 0.5;
    border-style: dashed;
}

.card-slot-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.card-slot-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 2px;
}

.card-slot-btn {
    padding: 3px 10px;
    border: 1px solid var(--danger);
    background: rgba(120, 20, 20, 0.4);
    color: #e04040;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    font-family: inherit;
}

.card-slot-btn:hover {
    background: rgba(180, 30, 30, 0.5);
}

/* === How To === */
.howto-content {
    max-width: 480px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.howto-section h3 {
    color: var(--gold);
    font-size: 14px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--gold-dark);
    padding-bottom: 4px;
}

.howto-section p {
    font-size: 12px;
    color: #c8b888;
    margin-bottom: 6px;
    line-height: 1.5;
}

kbd {
    display: inline-block;
    background: #2a1c10;
    border: 1px solid var(--gold-dark);
    border-radius: 2px;
    padding: 1px 5px;
    font-size: 11px;
    font-family: monospace;
    color: var(--gold);
    margin: 0 1px;
}

/* === HUD === */
#hud {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}

.hud-top-left {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 3px;
    padding: 6px 8px;
    min-width: 160px;
}

.hud-top-right {
    position: absolute;
    top: 90px;  /* 位于小地图下方 */
    right: 6px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 3px;
    padding: 6px 8px;
    text-align: right;
    min-width: 100px;
}

.hud-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 3px;
    align-items: center;
}

.hud-label { color: var(--gold-dark); }
.hud-value { color: var(--text-light); font-weight: 700; }

.bar-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 3px;
}

.bar-label {
    font-size: 10px;
    width: 28px;
    color: var(--gold-dark);
    font-weight: 700;
}

.bar {
    flex: 1;
    height: 12px;
    background: #1a1208;
    border: 1px solid #4a3a1a;
    border-radius: 1px;
    position: relative;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    transition: width 0.2s;
    border-radius: 1px;
}

.hp-bar .bar-fill { background: linear-gradient(90deg, #c01020, #e8323c); }
.mp-bar .bar-fill { background: linear-gradient(90deg, #2060c8, #3278e8); }
.xp-bar .bar-fill { background: linear-gradient(90deg, #3ca030, #5cc844); }

.bar-text {
    position: absolute;
    inset: 0;
    text-align: center;
    font-size: 9px;
    line-height: 12px;
    color: #fff;
    text-shadow: 1px 1px 0 #000;
    font-family: monospace;
}

.hud-bottom-center {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
}

#potion-slots {
    display: flex;
    gap: 6px;
}

.potion-slot {
    width: 40px;
    height: 40px;
    background: var(--panel-bg);
    border: 2px solid var(--panel-border);
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.potion-icon { font-size: 18px; }
.potion-icon.mp { filter: hue-rotate(180deg); }

.potion-count {
    position: absolute;
    bottom: 0;
    right: 2px;
    font-size: 11px;
    font-weight: 700;
    color: var(--gold);
    text-shadow: 1px 1px 0 #000;
    font-family: monospace;
}

/* 技能槽 */
.skill-slot {
    width: 40px;
    height: 40px;
    background: var(--panel-bg);
    border: 2px solid var(--gold);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 6px rgba(208, 168, 80, 0.3);
    margin-right: 8px;
}

.skill-icon-display {
    font-size: 18px;
    line-height: 1;
    z-index: 2;
}

.skill-key {
    position: absolute;
    top: 1px;
    left: 3px;
    font-size: 9px;
    font-weight: 700;
    color: var(--gold);
    z-index: 3;
    font-family: monospace;
    text-shadow: 1px 1px 0 #000;
}

/* 冷却遮罩：从上往下覆盖 */
.skill-cd-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1;
    pointer-events: none;
    transition: height 0.1s linear;
}

.skill-cd-text {
    position: absolute;
    bottom: 1px;
    right: 3px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    z-index: 3;
    font-family: monospace;
    text-shadow: 1px 1px 0 #000;
}

.skill-slot.ready .skill-cd-overlay { height: 0% !important; }
.skill-slot.ready { box-shadow: 0 0 10px rgba(208, 168, 80, 0.8); }

.hud-bottom-left {
    position: absolute;
    bottom: 6px;
    left: 6px;
}

.control-hint {
    font-size: 10px;
    color: #88704a;
    background: rgba(16, 12, 8, 0.7);
    padding: 2px 6px;
    border-radius: 2px;
}

/* === Level Up Notification === */
#levelup-notify {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Press Start 2P', monospace;
    font-size: 24px;
    color: var(--gold);
    text-shadow: 0 0 16px rgba(240, 192, 64, 0.8), 3px 3px 0 #6a3010;
    z-index: 20;
    animation: levelup-pop 1.5s ease-out forwards;
    pointer-events: none;
}

@keyframes levelup-pop {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    20% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    40% { transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; }
    100% { transform: translate(-50%, -80%) scale(1); opacity: 0; }
}

/* === Result Stats === */
.result-stats {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 3px;
    padding: 16px 24px;
    margin-bottom: 20px;
    font-size: 14px;
    min-width: 260px;
}

.result-stats .stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    color: #c8b888;
}

.result-stats .stat-row .val { color: var(--gold); font-weight: 700; }

.victory-text {
    color: var(--text-light);
    margin-bottom: 16px;
    font-size: 14px;
}

/* === Damage Numbers === */
#damage-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 15;
    overflow: hidden;
}

.dmg-num {
    position: absolute;
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    font-weight: 700;
    text-shadow: 2px 2px 0 #000;
    animation: dmg-float 0.8s ease-out forwards;
    pointer-events: none;
}

.dmg-num.player-dmg { color: #ffe040; }
.dmg-num.enemy-dmg { color: #ff6040; }
.dmg-num.crit { color: #ff40ff; font-size: 16px; }
.dmg-num.heal { color: #40ff80; }

@keyframes dmg-float {
    0% { transform: translateY(0) scale(0.8); opacity: 0; }
    20% { transform: translateY(-6px) scale(1.1); opacity: 1; }
    100% { transform: translateY(-28px) scale(1); opacity: 0; }
}

/* === Floor transition === */
#floor-transition {
    position: absolute;
    inset: 0;
    background: #000;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s;
}

#floor-transition.show { opacity: 1; }

#floor-transition .floor-text {
    font-family: 'Press Start 2P', monospace;
    font-size: 22px;
    color: var(--gold);
    text-shadow: 0 0 16px rgba(240, 192, 64, 0.6);
}

/* === Toast notifications === */
#toast-container {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.toast {
    background: rgba(16, 12, 8, 0.95);
    border: 1px solid var(--gold-dark);
    border-radius: 3px;
    padding: 6px 16px;
    font-size: 13px;
    color: var(--text-light);
    animation: toast-slide 2s ease-out forwards;
    white-space: nowrap;
}

@keyframes toast-slide {
    0% { transform: translateY(-10px); opacity: 0; }
    10% { transform: translateY(0); opacity: 1; }
    85% { opacity: 1; }
    100% { opacity: 0; }
}

/* === HUB 主界面 === */
#hub-screen {
    padding: 0;
    background: linear-gradient(180deg, #1a1410 0%, #2a2018 40%, #1a1410 100%);
    overflow: hidden;
}

.hub-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 10px;
    background: rgba(10, 8, 6, 0.9);
    border-bottom: 2px solid var(--gold-dark);
    height: 24px;
    flex-shrink: 0;
}

.hub-player-info {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 12px;
}

.hub-info-name { color: var(--gold); font-weight: 700; }
.hub-info-lv { color: var(--text-light); }
.hub-info-gold { color: var(--gold); }
.hub-info-floor { color: #88a0c0; }

.hub-save-btn {
    background: linear-gradient(180deg, #3a2818, #1e1408);
    border: 1px solid var(--gold-dark);
    color: var(--text-light);
    font-size: 10px;
    padding: 2px 8px;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.15s;
}
.hub-save-btn:hover { border-color: var(--gold); color: var(--gold); }

.hub-main {
    display: flex;
    flex: 1;
    height: calc(100% - 24px);
    overflow: hidden;
}

.hub-left {
    width: 220px;
    display: flex;
    flex-direction: column;
    padding: 6px;
    gap: 5px;
    background: rgba(10, 8, 6, 0.5);
    border-right: 1px solid var(--gold-dark);
    flex-shrink: 0;
    overflow: hidden;
}

.hub-equip-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3px;
    width: 100%;
}

.equip-slot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 22, 14, 0.9);
    border: 1px solid #4a3a1a;
    border-radius: 3px;
    padding: 3px 6px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 32px;
}

.equip-slot-icon {
    width: 28px;
    height: 28px;
    margin-right: 6px;
    flex-shrink: 0;
    vertical-align: middle;
    image-rendering: pixelated;
    background: rgba(60, 40, 20, 0.5);
    border-radius: 3px;
    padding: 1px;
}

.equip-slot:hover { border-color: var(--gold-dark); background: rgba(40, 30, 18, 0.9); }
.equip-slot-label { color: var(--gold-dark); font-weight: 700; font-size: 10px; }
.equip-slot-item {
    color: var(--text-light);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 75px;
    font-size: 10px;
}

.hub-stats-panel {
    width: 100%;
    background: linear-gradient(180deg, rgba(40, 28, 14, 0.92), rgba(20, 14, 8, 0.92));
    border: 1px solid #5a3a1a;
    border-radius: 4px;
    padding: 0;
    font-size: 11px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    box-shadow: inset 0 1px 0 rgba(240, 192, 64, 0.15);
}

.hub-stats-header {
    background: linear-gradient(180deg, #5a3a1a, #3a2614);
    color: #f0c040;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    padding: 5px 8px;
    border-bottom: 1px solid #2a1a0a;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.hub-stats-body {
    padding: 6px 8px;
}

.hub-stat-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 4px 6px;
    margin-bottom: 4px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 3px;
    border-left: 2px solid transparent;
    transition: all 0.15s;
}
.hub-stat-row.has-bonus {
    border-left-color: #f0c040;
    background: rgba(60, 40, 16, 0.5);
    padding-bottom: 2px;
}

.hub-stat-label {
    color: #c8b888;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}
.hub-stat-label .stat-icon {
    font-size: 13px;
    filter: drop-shadow(0 0 3px rgba(240, 192, 64, 0.5));
}

.hub-stat-val-group {
    display: flex;
    align-items: baseline;
    gap: 5px;
}
.hub-stat-row .stat-total {
    color: var(--text-light);
    font-weight: 700;
    font-size: 14px;
    text-shadow: 0 0 4px rgba(255, 224, 160, 0.3);
}
.hub-stat-row .stat-base {
    color: #88704a;
    font-size: 9px;
    font-weight: 400;
}

.stat-chips {
    grid-column: 1 / -1;
    display: flex;
    gap: 4px;
    margin-top: 3px;
    flex-wrap: wrap;
}
.stat-chip {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid;
}
.chip-equip {
    background: rgba(68, 200, 92, 0.15);
    color: #88e898;
    border-color: rgba(68, 200, 92, 0.4);
}
.chip-talent {
    background: rgba(200, 168, 224, 0.15);
    color: #c8a8e0;
    border-color: rgba(200, 168, 224, 0.4);
}

.hub-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    overflow: hidden;
    min-height: 0;
}

.hub-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(180deg, rgba(50, 36, 22, 0.9), rgba(24, 18, 10, 0.95));
    border: 2px solid var(--gold-dark);
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    color: var(--text-light);
    flex-shrink: 0;
}

.hub-menu-btn:hover {
    border-color: var(--gold);
    background: linear-gradient(180deg, rgba(70, 50, 28, 0.9), rgba(34, 26, 14, 0.95));
    transform: translateX(4px);
    box-shadow: 0 0 12px rgba(240, 192, 64, 0.15);
}

.hub-btn-icon { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }
.hub-btn-icon img { width: 100%; height: 100%; image-rendering: pixelated; }
.hub-btn-icon-emoji {
    font-size: 22px;
    line-height: 28px;
    filter: drop-shadow(0 0 4px rgba(200, 168, 224, 0.6));
}
.hub-btn-content { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.hub-btn-text { font-size: 14px; font-weight: 700; line-height: 1.2; }
.hub-btn-sub { font-size: 10px; color: #88704a; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hub-btn-adventure { border-color: #c05030; }
.hub-btn-adventure:hover { border-color: #ff6040; box-shadow: 0 0 12px rgba(255,96,64,0.2); }

#hub-panel-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.hub-panel {
    width: 95%;
    max-width: 600px;
    height: calc(100% - 40px);
    max-height: 440px;
    background: linear-gradient(180deg, #1e1408, #120c06);
    border: 2px solid var(--gold-dark);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 0 32px rgba(0, 0, 0, 0.6);
}

/* 工艺台和天赋盘在横屏下使用更宽的面板 */
.hub-panel.hub-panel-wide {
    max-width: 720px;
    max-height: 450px;
}

.hub-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 14px;
    background: rgba(30, 20, 10, 0.95);
    border-bottom: 2px solid var(--gold-dark);
    flex-shrink: 0;
}

.hub-panel-header h3 {
    font-size: 14px;
    color: var(--gold);
}

.hub-panel-close {
    background: none;
    border: 1px solid #6a4020;
    color: var(--text-light);
    cursor: pointer;
    font-size: 14px;
    width: 24px;
    height: 24px;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hub-panel-close:hover { background: #6a2020; border-color: #e8323c; color: #fff; }

.hub-panel-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
}

.hub-panel-body::-webkit-scrollbar { width: 6px; }
.hub-panel-body::-webkit-scrollbar-track { background: #1a1208; }
.hub-panel-body::-webkit-scrollbar-thumb { background: #4a3a1a; border-radius: 3px; }

.inv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 6px;
}

.inv-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(30, 22, 14, 0.8);
    border: 1px solid #3a2a14;
    border-radius: 3px;
    padding: 6px 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.inv-item:hover { border-color: var(--gold-dark); background: rgba(40, 30, 18, 0.9); }

.inv-item-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.inv-item-icon img { width: 100%; height: 100%; image-rendering: pixelated; }
.inv-item-info { flex: 1; min-width: 0; }
.inv-item-name { font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-item-desc { font-size: 10px; color: #88704a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-item-count { font-size: 14px; font-weight: 700; color: var(--gold); font-family: monospace; flex-shrink: 0; }
.inv-item-stats { font-size: 10px; color: #88a0c0; margin-top: 2px; }

.craft-list { display: flex; flex-direction: column; gap: 6px; }

.craft-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(30, 22, 14, 0.8);
    border: 1px solid #3a2a14;
    border-radius: 3px;
    padding: 8px 10px;
    transition: all 0.15s;
}

.craft-item:hover { border-color: var(--gold-dark); }
.craft-item.can-craft { border-left: 3px solid #44c85c; }
.craft-item.cannot { opacity: 0.5; }

.craft-item-info { flex: 1; }
.craft-item-name { font-size: 13px; font-weight: 700; }
.craft-item-mats { font-size: 11px; color: #88704a; margin-top: 2px; }
.craft-item-mats .has { color: #44c85c; }
.craft-item-mats .need { color: #e8323c; }
.craft-item-cost { font-size: 11px; color: var(--gold); }
.craft-item-btn {
    background: linear-gradient(180deg, #2a4a20, #162810);
    border: 1px solid #4a8030;
    color: #c8e8a0;
    font-size: 12px;
    padding: 6px 16px;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.15s;
    flex-shrink: 0;
}
.craft-item-btn:hover:not(:disabled) { background: linear-gradient(180deg, #3a6a2a, #1e3414); border-color: #5ca040; }
.craft-item-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.equip-detail-actions { display: flex; gap: 6px; margin-top: 6px; }
.equip-action-btn { font-size: 11px; padding: 4px 12px; border-radius: 2px; border: 1px solid; cursor: pointer; transition: all 0.15s; }
.equip-btn-equip { background: #2a4a20; border-color: #4a8030; color: #c8e8a0; }
.equip-btn-equip:hover { background: #3a6a2a; }
.equip-btn-unequip { background: #4a2a10; border-color: #6a4020; color: #e0a060; }
.equip-btn-unequip:hover { background: #6a3a18; }
.equip-btn-equipped { background: #1a2a3a; border-color: #2a4a6a; color: #6090c0; cursor: default; }

.empty-inv { text-align: center; color: #555; font-size: 13px; padding: 40px 0; }

/* === 统一背包标签栏 === */
.inv-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 8px;
    align-items: center;
    border-bottom: 1px solid var(--gold-dark);
    padding-bottom: 6px;
}

.inv-tab {
    background: rgba(30, 22, 14, 0.8);
    border: 1px solid #3a2a14;
    color: #88704a;
    font-size: 11px;
    padding: 4px 10px;
    cursor: pointer;
    border-radius: 2px 2px 0 0;
    transition: all 0.15s;
    font-family: inherit;
}

.inv-tab:hover { border-color: var(--gold-dark); color: var(--text-light); }
.inv-tab.active { background: rgba(50, 38, 20, 0.9); border-color: var(--gold); color: var(--gold); }

.inv-essence {
    margin-left: auto;
    font-size: 12px;
    color: #88c8e0;
    font-weight: 700;
}

.inv-tab-content { min-height: 0; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }

/* === 分解按钮 === */
.equip-btn-decompose {
    background: #2a3a4a;
    border-color: #3a5060;
    color: #88a0b0;
}
.equip-btn-decompose:hover { background: #3a4a5a; }

/* === 分解重铸面板 === */
.decompose-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 22, 14, 0.8);
    border: 1px solid #3a2a14;
    border-radius: 3px;
    padding: 10px 14px;
    margin-bottom: 10px;
}

.decompose-essence { font-size: 13px; color: #88a0c0; }
.decompose-info { font-size: 11px; color: #666; }

.decompose-section {
    margin-bottom: 12px;
}

.decompose-section h4 {
    font-size: 13px;
    color: var(--gold-dark);
    margin-bottom: 6px;
    border-bottom: 1px solid #3a2a14;
    padding-bottom: 4px;
}

/* === 商人面板 === */
#merchant-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
}

.merchant-panel {
    max-width: 520px;
}

.merchant-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0;
}

.merchant-option-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(20, 14, 8, 0.85);
    border: 1px solid;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.merchant-option-card:hover {
    background: rgba(40, 28, 16, 0.9);
    transform: translateX(2px);
}

.merchant-option-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border-radius: 4px;
    flex-shrink: 0;
}

.merchant-option-info {
    flex: 1;
    min-width: 0;
}

.merchant-option-name {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.merchant-option-desc {
    color: #888;
}

.merchant-option-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 3px;
    color: #1a1a1a;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.merchant-option-btn:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* === 装备子标签栏 === */
.inv-subtabs {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
    padding: 0 0 6px 0;
    border-bottom: 1px solid #3a2a14;
}

.inv-subtab {
    background: rgba(30, 22, 14, 0.8);
    border: 1px solid #3a2a14;
    color: #88704a;
    font-size: 11px;
    padding: 3px 10px;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.15s;
    font-family: inherit;
}

.inv-subtab:hover { border-color: var(--gold-dark); color: var(--text-light); }
.inv-subtab.active { background: rgba(50, 38, 20, 0.9); border-color: var(--gold); color: var(--gold); }

/* === 背包：左右分栏布局（横屏） === */
.inv-split {
    display: flex;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.inv-list-col {
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
    flex-shrink: 0;
}

.inv-detail-col {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background: rgba(20, 14, 8, 0.4);
    border: 1px solid #3a2a14;
    border-radius: 3px;
    padding: 8px;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.inv-list-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    background: rgba(30, 22, 14, 0.6);
    border: 1px solid;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    min-height: 24px;
}

.inv-list-item:hover {
    background: rgba(50, 38, 22, 0.8);
    transform: translateX(2px);
}

.inv-list-item.selected {
    background: rgba(60, 40, 70, 0.6);
    border-color: #c8a8e0 !important;
    box-shadow: 0 0 6px rgba(200, 168, 224, 0.3);
}

.inv-list-item.equipped {
    background: linear-gradient(90deg, rgba(68, 200, 92, 0.18), rgba(30, 22, 14, 0.6));
    border-color: rgba(68, 200, 92, 0.6);
    box-shadow: inset 0 0 0 1px rgba(68, 200, 92, 0.2);
}
.inv-list-item.equipped.selected {
    background: linear-gradient(90deg, rgba(68, 200, 92, 0.25), rgba(60, 40, 70, 0.5));
}

.inv-list-equipped-badge {
    font-size: 9px;
    font-weight: 700;
    color: #44c85c;
    background: rgba(68, 200, 92, 0.2);
    border: 1px solid rgba(68, 200, 92, 0.5);
    padding: 1px 4px;
    border-radius: 3px;
    flex-shrink: 0;
}

.inv-list-icon {
    font-size: 14px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.inv-list-name {
    flex: 1;
    font-size: 10px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.inv-list-meta {
    font-size: 9px;
    color: #88704a;
    flex-shrink: 0;
    white-space: nowrap;
}

/* === 装备详情（右侧） === */
.inv-detail-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
}

.inv-detail-meta {
    display: flex;
    gap: 8px;
    font-size: 10px;
    color: #888;
    margin-bottom: 6px;
}

.inv-detail-diff {
    color: #88a0c0;
}

.inv-detail-desc {
    font-size: 10px;
    color: #88704a;
    margin-bottom: 6px;
    line-height: 1.4;
}

.inv-detail-weapon {
    font-size: 10px;
    color: #88a0c0;
    margin-bottom: 6px;
}

.inv-detail-section {
    font-size: 10px;
    color: var(--gold);
    font-weight: 700;
    margin-top: 6px;
    margin-bottom: 2px;
    padding-bottom: 2px;
    border-bottom: 1px solid #2a1f14;
}

.inv-detail-stat {
    font-size: 11px;
    color: #88a0c0;
    line-height: 1.5;
}

.inv-detail-affix {
    font-size: 10px;
    line-height: 1.5;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: baseline;
}

.inv-affix-tier {
    font-weight: 700;
    font-size: 9px;
    flex-shrink: 0;
}

.inv-affix-pos {
    color: #888;
    font-size: 9px;
    flex-shrink: 0;
}

.inv-affix-stat {
    color: #c8a8e0;
    flex: 1;
    min-width: 0;
}

.inv-detail-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #2a1f14;
}

/* 对比当前装备的小盒子 */
.inv-compare-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #3a2a14;
    border-radius: 3px;
    padding: 5px 8px;
    margin-bottom: 6px;
}
.inv-compare-current {
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 3px;
    opacity: 0.85;
}
.inv-compare-diffs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    font-size: 11px;
}
.inv-diff-row {
    display: flex;
    align-items: baseline;
    gap: 3px;
}
.inv-diff-label {
    color: #88704a;
    font-size: 10px;
}
.inv-diff-val {
    font-weight: 700;
    font-size: 11px;
}

/* 大号装备按钮 */
.equip-btn-equipped-large {
    flex: 1;
    text-align: center;
    background: linear-gradient(180deg, #2a4a30, #1a2a18);
    border: 1px solid #4a8030;
    color: #88e898;
    padding: 7px 12px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 700;
}
.equip-btn-unequip {
    background: linear-gradient(180deg, #4a3a20, #2a2010);
    border: 1px solid #806040;
    color: #e8c898;
    padding: 7px 12px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.equip-btn-unequip:hover {
    background: linear-gradient(180deg, #6a4a28, #3a2818);
    border-color: #c09060;
}

/* === 装备对比浮窗（鼠标悬停） === */
.equip-tooltip {
    position: absolute;
    z-index: 200;
    background: linear-gradient(180deg, rgba(20, 14, 8, 0.98), rgba(12, 8, 4, 0.98));
    border: 1px solid var(--gold-dark);
    border-radius: 4px;
    padding: 8px 10px;
    max-width: 200px;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    font-size: 11px;
    line-height: 1.5;
}

/* === 装备槽操作菜单（点击 hub 主页装备槽弹出的面板） === */
.slot-action-menu {
    position: absolute;
    z-index: 250;
    background: linear-gradient(180deg, rgba(30, 22, 14, 0.98), rgba(20, 14, 8, 0.98));
    border: 1px solid var(--gold-dark);
    border-radius: 5px;
    padding: 10px 12px;
    min-width: 220px;
    max-width: 320px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(240, 192, 64, 0.2);
    font-size: 11px;
    line-height: 1.5;
}
.slot-menu-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
    text-shadow: 0 0 4px rgba(240, 192, 64, 0.3);
}
.slot-menu-slot {
    font-size: 10px;
    color: #88704a;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #3a2a14;
}
.slot-menu-stats {
    margin-bottom: 4px;
}
.slot-menu-stat {
    color: #88c8e0;
    font-size: 11px;
    padding: 1px 0;
}
.slot-menu-affixes {
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #3a2a14;
}
.slot-menu-affix {
    font-size: 10px;
    line-height: 1.5;
}
.slot-menu-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}
.slot-menu-btn {
    flex: 1;
    background: linear-gradient(180deg, #3a2a14, #2a1a0a);
    border: 1px solid #806040;
    color: #f0c040;
    padding: 5px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.slot-menu-btn:hover {
    background: linear-gradient(180deg, #5a4020, #3a2810);
    border-color: #c09060;
    color: #ffe0a0;
}
.slot-btn-unequip {
    background: linear-gradient(180deg, #4a3a20, #2a2010);
    border-color: #a07040;
    color: #ffd898;
}
.slot-btn-unequip:hover {
    background: linear-gradient(180deg, #6a4a28, #3a2818);
    border-color: #d09060;
    color: #fff0c0;
}

.equip-tooltip .tt-main { }

.equip-tooltip .tt-name {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 1px;
    word-break: break-all;
}

.equip-tooltip .tt-crafted {
    font-size: 9px;
    color: #f0c040;
    background: rgba(240, 192, 64, 0.15);
    padding: 0 4px;
    border-radius: 2px;
}

.equip-tooltip .tt-slot {
    font-size: 10px;
    color: #666;
    margin-bottom: 3px;
}

.equip-tooltip .tt-stats {
    font-size: 10px;
    color: #88a0c0;
    margin-bottom: 2px;
}

.equip-tooltip .tt-affix {
    font-size: 10px;
    color: #c8a8e0;
    margin-bottom: 2px;
}

.equip-tooltip .tt-weapon {
    font-size: 9px;
    color: #88a0c0;
}

.equip-tooltip .tt-skill {
    font-size: 9px;
    color: #f0c040;
}

.equip-tooltip .tt-divider {
    height: 1px;
    background: #3a2a14;
    margin: 6px 0;
}

.equip-tooltip .tt-compare { }

.equip-tooltip .tt-compare-label {
    font-size: 9px;
    color: #88704a;
    margin-bottom: 2px;
}

.equip-tooltip .tt-compare-name {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 1px;
}

.equip-tooltip .tt-compare-stats {
    font-size: 10px;
    color: #88a0c0;
    margin-bottom: 3px;
}

.equip-tooltip .tt-diffs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
}

.equip-tooltip .tt-diff {
    padding: 0 3px;
    border-radius: 2px;
}

/* === 工艺系统面板 === */
.craft-sys-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--gold-dark);
    padding-bottom: 6px;
}

.craft-sys-tabs {
    display: flex;
    gap: 2px;
}

.craft-sys-tab {
    background: rgba(30, 22, 14, 0.8);
    border: 1px solid #3a2a14;
    color: #88704a;
    font-size: 12px;
    padding: 5px 12px;
    cursor: pointer;
    border-radius: 2px 2px 0 0;
    transition: all 0.15s;
    font-family: inherit;
}

.craft-sys-tab:hover { border-color: var(--gold-dark); color: var(--text-light); }
.craft-sys-tab.active {
    background: rgba(50, 38, 20, 0.9);
    border-color: var(--gold);
    color: var(--gold);
}

.craft-sys-res {
    display: flex;
    gap: 12px;
    font-size: 12px;
}

.craft-sys-essence { color: #88c8e0; }
.craft-sys-essence b { font-size: 15px; }
.craft-sys-gold { color: var(--gold); }

.craft-sys-content { min-height: 200px; }

.craft-sys-info {
    background: rgba(30, 22, 14, 0.6);
    border: 1px solid #3a2a14;
    border-radius: 3px;
    padding: 8px 12px;
    font-size: 11px;
    color: #88704a;
    margin-bottom: 8px;
    line-height: 1.6;
}

.craft-btn-decompose {
    background: #2a3a4a !important;
    border-color: #3a5060 !important;
    color: #88a0b0 !important;
}
.craft-btn-decompose:hover:not(:disabled) { background: #3a4a5a !important; }

.craft-btn-reforge {
    background: #2a2a4a !important;
    border-color: #3a3a60 !important;
    color: #a0a0c0 !important;
}
.craft-btn-reforge:hover:not(:disabled) { background: #3a3a5a !important; }

.crafted-badge {
    font-size: 9px;
    color: #f0c040;
    background: rgba(240, 192, 64, 0.15);
    padding: 1px 5px;
    border-radius: 2px;
    margin-left: 4px;
}

/* hub-btn-craft 更新（原合成+分解合并） */
.hub-btn-craft { border-color: #6a5020; }
.hub-btn-craft:hover { border-color: #f0c040; box-shadow: 0 0 12px rgba(240,192,64,0.2); }

/* === 通货工艺台面板 === */
.bench-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--gold-dark);
    padding-bottom: 8px;
    gap: 12px;
}
.bench-title { font-size: 13px; color: #c8a8e0; font-weight: 700; flex-shrink: 0; }
.bench-currency-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
}
.bench-cur-pill {
    font-size: 10px;
    border: 1px solid;
    border-radius: 10px;
    padding: 1px 6px;
    white-space: nowrap;
}
.bench-body {
    display: flex;
    gap: 8px;
    flex: 1;
    min-height: 0;
}

/* 工艺台3栏布局：[装备列表] [详情] [通货石] */
.bench-3col {
    display: grid;
    grid-template-columns: 180px 1fr 200px;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.bench-col {
    background: rgba(20, 16, 10, 0.5);
    border: 1px solid #3a2a14;
    border-radius: 3px;
    padding: 6px;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bench-col-list {
    overflow-y: auto;
    overflow-x: hidden;
    gap: 3px;
}

.bench-col-detail {
    overflow-y: auto;
    overflow-x: hidden;
}

.bench-detail-col {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bench-col-currency {
    overflow-y: auto;
    overflow-x: hidden;
}

/* 工艺台：装备列表项（紧凑） */
.bench-list-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    background: rgba(30, 22, 14, 0.6);
    border: 1px solid;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    min-height: 26px;
}

.bench-list-item:hover {
    background: rgba(50, 38, 22, 0.8);
}

.bench-list-item.equipped {
    opacity: 0.55;
    filter: grayscale(0.4);
}

.bench-list-item.selected {
    background: rgba(60, 40, 70, 0.6);
    border-color: #c8a8e0 !important;
    box-shadow: 0 0 6px rgba(200, 168, 224, 0.3);
}

.bench-list-icon {
    font-size: 14px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.bench-list-name {
    flex: 1;
    font-size: 10px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.bench-list-meta {
    font-size: 9px;
    color: #88704a;
    flex-shrink: 0;
    white-space: nowrap;
}

/* 工艺台：装备详情中的工艺上限提示 */
.bench-cap-info {
    font-size: 10px;
    color: #88a0c0;
    padding: 4px 6px;
    background: rgba(30, 22, 14, 0.6);
    border-radius: 3px;
    margin-bottom: 6px;
}

.bench-left, .bench-right {
    flex: 1;
    background: rgba(20, 16, 10, 0.5);
    border: 1px solid #3a2a14;
    border-radius: 3px;
    padding: 6px;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}
.bench-section-title {
    font-size: 11px;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #3a2a14;
    flex-shrink: 0;
}
.bench-equip-item {
    background: rgba(30, 22, 14, 0.8);
    border: 1px solid #3a2a14;
    border-radius: 3px;
    padding: 8px 10px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s;
}
.bench-equip-item:hover { border-color: var(--gold-dark); background: rgba(40, 30, 18, 0.9); }
.bench-equip-item.selected {
    border-color: #c8a8e0;
    background: rgba(60, 40, 70, 0.4);
    box-shadow: 0 0 8px rgba(200, 168, 224, 0.2);
}
.bench-equip-name { font-size: 12px; font-weight: 700; }
.bench-equip-stats { font-size: 10px; color: #88a0c0; margin-top: 2px; }
.bench-hint {
    text-align: center;
    color: #666;
    font-size: 12px;
    padding: 40px 12px;
}
.bench-currency-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.bench-currency-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(30, 22, 14, 0.8);
    border: 1px solid #3a2a14;
    border-radius: 3px;
    padding: 6px 8px;
    transition: all 0.15s;
}
.bench-currency-item:hover { border-color: var(--gold-dark); background: rgba(40, 30, 18, 0.9); }
.bench-cur-icon { font-size: 18px; flex-shrink: 0; width: 28px; height: 28px; text-align: center; line-height: 28px; }
.bench-cur-icon img { width: 100%; height: 100%; image-rendering: pixelated; vertical-align: top; }
.bench-cur-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bench-cur-info span:first-child { font-size: 12px; font-weight: 700; }
.bench-cur-desc { font-size: 9px; color: #88704a; line-height: 1.3; }
.bench-apply-btn {
    background: linear-gradient(180deg, #4a2a40, #2a1620);
    border: 1px solid #8040a0;
    color: #d0a8e0;
    font-size: 11px;
    padding: 4px 10px;
    cursor: pointer;
    border-radius: 2px;
    flex-shrink: 0;
    font-family: inherit;
    transition: all 0.15s;
}
.bench-apply-btn:hover { background: linear-gradient(180deg, #5a3a50, #3a2630); border-color: #a060c0; }
.bench-apply-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.bench-apply-btn:disabled:hover { background: linear-gradient(180deg, #4a2a40, #2a1620); border-color: #8040a0; }

/* 按稀有度分解按钮（透明背景 + 稀有度色边框） */
.bench-rarity-btn {
    transition: all 0.15s;
}
.bench-rarity-btn:hover {
    background: rgba(0,0,0,0.3) !important;
    filter: brightness(1.4);
}
.bench-cur-warn {
    margin-top: 2px;
    display: block;
    font-size: 9px;
    color: #e8323c;
    line-height: 1.2;
    animation: warnPulse 1.2s ease-in-out infinite;
}
.bench-currency-item.unusable { opacity: 0.65; }
@keyframes warnPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* 通货工艺台模式标签 */
.bench-mode-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 6px;
    border-bottom: 1px solid #3a2a14;
    padding-bottom: 4px;
    flex-shrink: 0;
}
.bench-mode-tab {
    background: rgba(30, 22, 14, 0.8);
    border: 1px solid #3a2a14;
    color: #88704a;
    font-size: 11px;
    padding: 3px 12px;
    cursor: pointer;
    border-radius: 2px 2px 0 0;
    transition: all 0.15s;
    font-family: inherit;
}
.bench-mode-tab:hover { border-color: var(--gold-dark); color: var(--text-light); }
.bench-mode-tab.active {
    background: rgba(50, 38, 20, 0.9);
    border-color: #c8a8e0;
    color: #c8a8e0;
}

/* 装备分解列表 */
.decompose-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}
.decompose-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(30, 22, 14, 0.8);
    border: 1px solid #3a2a14;
    border-radius: 3px;
    padding: 8px 10px;
    transition: all 0.15s;
}
.decompose-item:hover { border-color: var(--gold-dark); background: rgba(40, 30, 18, 0.9); }
.decompose-item-info { flex: 1; min-width: 0; }

/* === 天赋盘面板 === */
.hub-btn-talent { border-color: #4a3a6a; }
.hub-btn-talent:hover { border-color: #c8a8e0; box-shadow: 0 0 12px rgba(200,168,224,0.2); }

.talent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    border-bottom: 1px solid #3a2a4a;
    padding-bottom: 6px;
    flex-shrink: 0;
}
.talent-points-info {
    display: flex;
    gap: 12px;
    font-size: 11px;
    align-items: center;
}
.talent-available { font-weight: 700; font-size: 13px; }
.talent-used { color: #88704a; }
.talent-level { color: #88a0c0; }
.talent-reset-btn {
    background: rgba(60, 30, 30, 0.8);
    border: 1px solid #804040;
    color: #e87878;
    font-size: 10px;
    padding: 3px 10px;
    cursor: pointer;
    border-radius: 2px;
    font-family: inherit;
    transition: all 0.15s;
}
.talent-reset-btn:hover { background: rgba(80, 40, 40, 0.9); border-color: #c06060; }

.talent-branches {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}
.talent-branch {
    background: rgba(20, 16, 24, 0.6);
    border: 1px solid;
    border-radius: 4px;
    padding: 6px;
}
.talent-branch-header {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 3px;
}
.talent-branch-icon { font-size: 14px; }
.talent-branch-desc {
    font-size: 9px;
    color: #88704a;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #2a2030;
    line-height: 1.3;
}
.talent-nodes {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.talent-node {
    background: rgba(30, 22, 30, 0.6);
    border: 1px solid;
    border-radius: 3px;
    padding: 4px 6px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    position: relative;
    transition: all 0.15s;
}
.talent-node.available {
    border-color: #c8a8e0 !important;
    background: rgba(40, 30, 50, 0.7);
    cursor: pointer;
}
.talent-node.available:hover {
    background: rgba(50, 40, 60, 0.9);
    box-shadow: 0 0 6px rgba(200,168,224,0.2);
}
.talent-node.maxed {
    border-color: #f0c040 !important;
    background: rgba(50, 40, 20, 0.6);
}
.talent-node.locked {
    opacity: 0.4;
    filter: grayscale(0.6);
}
.talent-node.partial {
    border-color: #4a8c4c !important;
    background: rgba(30, 40, 30, 0.5);
}
.talent-node.unavailable {
    opacity: 0.6;
}
.talent-node-name {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-light);
    padding-right: 28px;
}
.talent-node-desc {
    font-size: 9px;
    color: #88704a;
    line-height: 1.2;
}
.talent-node-rank {
    font-size: 9px;
    font-weight: 700;
    font-family: monospace;
}
.talent-alloc-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(180deg, #4a3a6a, #2a2040);
    border: 1px solid #8060a0;
    color: #c8a8e0;
    font-size: 11px;
    font-weight: 700;
    width: 28px;
    height: 24px;
    cursor: pointer;
    border-radius: 2px;
    font-family: inherit;
    transition: all 0.15s;
}
.talent-alloc-btn:hover {
    background: linear-gradient(180deg, #5a4a7a, #3a3050);
    border-color: #a080c0;
    box-shadow: 0 0 6px rgba(200,168,224,0.3);
}
.talent-maxed-tag {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 9px;
    color: #f0c040;
    font-weight: 700;
}
.talent-locked-tag {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
}

/* === 移动端虚拟控制 === */
.vc-joystick {
    position: fixed;
    left: 20px;
    bottom: 20px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(20, 24, 40, 0.5);
    border: 2px solid rgba(108, 140, 232, 0.4);
    touch-action: none;
    z-index: 100;
    display: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.vc-knob {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(108, 140, 232, 0.5);
    border: 2px solid rgba(108, 140, 232, 0.8);
    transform: translate(-50%, -50%);
    transition: background 0.1s;
    pointer-events: none;
}
.vc-btn {
    position: fixed;
    border-radius: 50%;
    background: rgba(20, 24, 40, 0.5);
    border: 2px solid rgba(200, 168, 224, 0.4);
    color: #e0e0e0;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: 'Segoe UI', sans-serif;
    touch-action: none;
    z-index: 100;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.vc-btn-active {
    background: rgba(108, 140, 232, 0.4) !important;
    border-color: rgba(108, 140, 232, 1) !important;
    transform: scale(0.92);
}
.vc-btn-attack { border-color: rgba(232, 88, 88, 0.5); }
.vc-btn-attack.vc-btn-active { background: rgba(232, 88, 88, 0.4) !important; border-color: rgba(232, 88, 88, 1) !important; }
.vc-btn-skill { border-color: rgba(108, 200, 232, 0.5); }
.vc-btn-skill.vc-btn-active { background: rgba(108, 200, 232, 0.4) !important; border-color: rgba(108, 200, 232, 1) !important; }
.vc-btn-hp { border-color: rgba(88, 200, 88, 0.5); }
.vc-btn-mp { border-color: rgba(88, 120, 232, 0.5); }

/* 虚拟控件显示/隐藏由 JS _checkVisibility() 控制 */
