#distance-bar-container {
    position: absolute;
    top: 60px; /* 下移距离条 */
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 12px;
    background: rgba(0, 20, 30, 0.8);
    border: 1px solid rgba(168, 240, 255, 0.3);
    z-index: 20;
    padding: 2px;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    overflow: visible; /* 允许标记显示在容器外 */
}

#distance-markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 25;
    overflow: visible; /* 允许标记显示在容器外 */
}

#boss-hp-container {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 36px; /* 增加高度以容纳3条 */
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 20;
}

.boss-hp-bar {
    height: 10px;
    background: rgba(0, 20, 30, 0.8);
    border: 1px solid var(--ds-red);
    width: 100%;
    transition: width 0.3s;
    box-shadow: 0 0 10px var(--ds-red);
    background: linear-gradient(90deg, #ff3e3e, #990000);
}

#boss-name {
    position: absolute;
    top: -18px;
    left: 0;
    font-size: 9px;
    color: var(--ds-red);
    letter-spacing: 2px;
    font-weight: bold;
}

#distance-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4deeea, #a8f0ff);
    width: 0%;
    transition: width 0.3s;
    box-shadow: 0 0 10px var(--ds-cyan);
}

.dist-dot {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    box-shadow: 0 0 5px currentColor;
    z-index: 25;
}

#courage-label {
    font-size: 9px;
    color: var(--ds-cyan);
    letter-spacing: 2px;
    text-transform: uppercase;
}

#xp-bar-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0,0,0,0.5);
    z-index: 30;
}

#xp-bar-fill {
    height: 100%;
    background: #ffaa00;
    width: 0%;
    transition: width 0.3s;
    box-shadow: 0 0 10px #ffaa00;
}

#ui-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 20;
    pointer-events: none;
}

#hud-top-left, #nav-system, #shop-menu, #equipment-menu, #upgrade-menu, #level-up-modal, #map-panel, #backpack-panel, #ship-panel, #item-tooltip, #equipment-hud, #backpack-trigger, #ship-trigger, #deep-space-container, #hud-bottom-right, .ds-btn, .ds-item, .grid-cell, .ship-content, .ship-equip-col, .equip-lower, #ship-warehouse-list {
    pointer-events: auto;
}

#hud-bottom-right {
    position: absolute;
    top: 250px;
    left: 40px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

/* --- 饰品展示 --- */
#trinket-display {
    position: absolute;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0;
    pointer-events: auto;
}

.trinket-slot, .trinket-icon {
    pointer-events: auto;
}

.trinket-slot {
    width: 50px;
    height: 22px;
    background: rgba(0, 20, 30, 0.6);
    border: 1px solid rgba(168, 240, 255, 0.2);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    position: relative;
}

.trinket-icon {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trinket-icon svg {
    width: 100%;
    height: 100%;
}

.trinket-slot:hover {
    border-color: var(--ds-cyan);
    background: rgba(168, 240, 255, 0.1);
}

.trinket-slot.common { border-color: #aaa; }
.trinket-slot.rare { border-color: #4deeea; box-shadow: 0 0 10px #4deeea; }
.trinket-slot.epic { border-color: #ff00ff; box-shadow: 0 0 15px #ff00ff; }

.trinket-icon {
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 0 5px currentColor);
}

/* 隐藏状态 */
.hidden { display: none !important; }

/* --- 升级模态框 (Level Up) - 极简紧凑版 --- */
#level-up-modal {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: auto; height: auto;
    background: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 3000;
    pointer-events: auto;
}

.level-up-title {
    font-size: 10px;
    color: var(--ds-cyan);
    margin-bottom: 8px;
    letter-spacing: 1px;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(0, 10, 20, 0.9) !important; /* 恢复标题背景 */
    padding: 2px 10px;
    border: 1px solid rgba(0, 240, 255, 0.2);
}

#affix-choices {
    display: flex;
    gap: 10px;
}

.affix-card {
    width: 110px; /* 进一步缩小宽度 */
    height: 140px; /* 进一步缩小高度 */
    background: rgba(0, 10, 20, 0.9) !important; /* 恢复卡片背景 */
    border: 1px solid rgba(0, 240, 255, 0.3);
    padding: 8px;
    cursor: pointer;
    transition: 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: none !important; /* 移除阴影 */
}

.affix-card:hover {
    background: rgba(0, 240, 255, 0.2) !important;
    border-color: var(--ds-cyan);
    transform: translateY(-3px);
}

.affix-card .affix-icon {
    font-size: 24px;
    margin-bottom: 6px;
    filter: drop-shadow(0 0 5px var(--ds-cyan));
}

.affix-card .affix-name-cn {
    font-size: 12px;
    color: #fff;
    margin-bottom: 1px;
    font-weight: 600;
}

.affix-card .affix-name-en {
    font-size: 6px;
    color: var(--ds-cyan);
    opacity: 0.6;
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.affix-card .affix-desc {
    font-size: 9px;
    color: #bbb;
    line-height: 1.3;
    font-weight: 300;
}

/* --- Buff Bar (Bottom Right) --- */
#buff-bar {
    position: absolute;
    bottom: 40px;
    right: 40px;
    display: flex;
    gap: 10px;
    pointer-events: auto;
}

.buff-icon {
    width: 36px;
    height: 36px;
    background: rgba(0, 20, 30, 0.8);
    border: 1px solid rgba(0, 240, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    position: relative;
    cursor: help;
    transition: 0.2s;
}

.buff-icon:hover {
    border-color: var(--ds-cyan);
    background: rgba(0, 240, 255, 0.1);
    transform: scale(1.1);
}

.buff-icon::after {
    content: attr(data-name);
    position: absolute;
    bottom: 100%;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: var(--ds-cyan);
    padding: 4px 8px;
    font-size: 10px;
    white-space: nowrap;
    border: 1px solid var(--ds-cyan);
    margin-bottom: 8px;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s;
}

.buff-icon:hover::after {
    opacity: 1;
}

/* --- 通用面板样式 --- */
.panel-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: transparent !important; /* 完全透明 */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2500;
}

/* 针对背包面板不再强制透明，恢复标准遮罩 */
#backpack-panel.panel-overlay {
    background: transparent !important;
}

.panel-inner {
    width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    background: rgba(5, 5, 10, 0.98) !important; /* 恢复窗口背景，确保可读性 */
    background-image: linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px) !important; /* 恢复条纹 */
    background-size: 100% 3px !important;
    border: 1px solid var(--ds-cyan);
    padding: 20px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.9) !important;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(168, 240, 255, 0.3);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* --- 层级显示 --- */
#layer-display {
    position: absolute;
    top: 40px;
    right: 40px;
    z-index: 20;
    text-align: right;
}

.layer-tag {
    font-size: 10px;
    color: var(--ds-cyan);
    opacity: 0.6;
}

.layer-val {
    font-size: 24px;
    font-weight: 300;
    color: #fff;
    letter-spacing: 2px;
}

.affix-name {
    font-size: 18px;
    color: var(--ds-cyan);
    font-weight: bold;
}

.affix-desc {
    font-size: 12px;
    color: #ccc;
    line-height: 1.6;
}

/* --- 1. 核心视觉定义 --- */
:root {
    --ds-cyan: #a8f0ff;       /* 标志性青色 */
    --ds-red: #ff3e3e;        /* 警报红 */
    --ds-energy: #4deeea;     /* 能量条颜色 */
    --ds-bg-glass: rgba(0, 20, 30, 0.4); /* 按钮半透明背景 */
    --font-main: 'Segoe UI', 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    user-select: none;
    -webkit-user-drag: none;
    outline: none;
}

body, html {
    margin: 0; padding: 0; width: 100%; height: 100%;
    background: #000; overflow: hidden;
    font-family: var(--font-main);
    color: #fff;
    letter-spacing: 1px;
}

/* 游戏容器 */
#game-container {
    position: fixed; top: 50%; left: 50%;
    width: 1356px; height: 768px;
    transform: translate(-50%, -50%);
    background: #000; overflow: hidden;
}


#battle-layer { position: absolute; z-index: 5; width: 100%; height: 100%; }
#cockpit-layer {
    position: absolute; z-index: 10;
    width: 100%; height: 100%;
    pointer-events: none;
}
#cockpit-img {
    position: absolute; bottom: 0; left: 0; width: 100%;
    transform: translateY(5%); /* 稍微压低一点，防止遮挡视野 */
    pointer-events: none;
}

/* --- 3. 左上角 HUD (回归参照版风格) --- */
#hud-top-left {
    position: absolute; top: 30px; left: 40px; z-index: 20;
    display: flex; flex-direction: column; gap: 8px;
}

.stat-group { width: 300px; }
.stat-header { font-size: 10px; color: var(--ds-cyan); margin-bottom: 2px; opacity: 0.8; }

/* 恢复钩边效果 */
.bar-frame {
    width: 100%; height: 6px; background: rgba(0,0,0,0.5);
    border: 1px solid rgba(168, 240, 255, 0.3);
    position: relative;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    overflow: hidden;
}
/* 钩边装饰 */
.bar-frame::before, .bar-frame::after {
    content: ''; position: absolute; width: 4px; height: 10px;
    border: 1px solid var(--ds-cyan); top: -3px;
}
.bar-frame::before { left: -1px; border-right: none; }
.bar-frame::after { right: -1px; border-left: none; }

#hp-bar-fill { height: 100%; background: #00ffaa; width: 100%; transition: width 0.3s; box-shadow: 0 0 10px #00ffaa; }
#shield-bar-fill { height: 100%; background: #0088ff; width: 100%; transition: width 0.3s; box-shadow: 0 0 10px #0088ff; }
#en-bar-fill { height: 100%; background: var(--ds-energy); width: 100%; transition: width 0.1s; box-shadow: 0 0 10px var(--ds-energy); }

/* 地名扫描线 (回归味儿所在) */
#location-tag {
    margin-top: 0px; position: relative; padding-top: 10px;
}
.scan-line {
    position: absolute; top: 0; left: 0; width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--ds-cyan), transparent);
    animation: scan-move 3s infinite linear;
}
@keyframes scan-move {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
#zone-display { font-size: 18px; font-weight: 300; letter-spacing: 4px; }

/* --- 4. 迁跃终端 (迁跃终端) --- */
#nav-system {
    position: absolute; right: 20px; bottom: 40px; z-index: 20;
    width: 220px; display: flex; flex-direction: column; gap: 10px;
}

/* 按钮外部框架 */
.nav-frame {
    border-right: 3px solid var(--ds-cyan);
    padding: 10px; background: rgba(0,0,0,0.2);
}

.nav-btn {
    width: 100%; background: var(--ds-bg-glass);
    border: 1px solid rgba(168, 240, 255, 0.2);
    color: #fff; padding: 8px 15px; text-align: left;
    font-size: 10px; cursor: pointer; transition: 0.3s;
    margin-bottom: 5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.btn-main {
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 2px;
}

.btn-sub {
    font-size: 9px;
    opacity: 0.7;
    text-transform: uppercase;
}

.panel-title {
    display: flex;
    flex-direction: column;
}

.title-main {
    font-size: 18px;
    color: var(--ds-cyan);
    letter-spacing: 2px;
}

.title-sub {
    font-size: 10px;
    color: var(--ds-cyan);
    opacity: 0.6;
    text-transform: uppercase;
}

.nav-btn:hover {
    background: rgba(168, 240, 255, 0.2);
    border-color: var(--ds-cyan);
    padding-left: 25px;
}

/* --- 5. 怪物与粒子 --- */
.game-obj {
    position: absolute; pointer-events: none; /* 改为 none，确保不遮挡 canvas 事件 */
    display: flex; flex-direction: column; align-items: center;
    transition: opacity 0.5s;
    z-index: 10;
}

.game-obj.boss {
    z-index: 11;
}

.projectile {
    position: absolute;
    background: radial-gradient(circle, #ff3e3e, transparent);
    border-radius: 50%;
    box-shadow: 0 0 15px #ff3e3e;
    z-index: 15;
    pointer-events: none;
}
.relic-object {
    pointer-events: auto !important;
    transition: transform 0.2s, filter 0.2s;
    user-select: none;
    z-index: 1000;
}
.relic-object:hover {
    transform: scale(1.3);
    filter: drop-shadow(0 0 15px #ffaa00) brightness(1.3);
}

/* 解决血条空的问题：这里必须定义宽度高度 */
.obj-hp-wrapper { 
    height: 4px; 
    background: rgba(0,0,0,0.8); 
    border: 1px solid rgba(168, 240, 255, 0.4); 
    position: absolute;
    top: -15px;
    overflow: hidden;
    pointer-events: none;
}
.obj-hp-inner { 
    height: 100%; 
    background: var(--ds-cyan); 
    width: 100%; 
    box-shadow: 0 0 5px var(--ds-cyan);
    transition: width 0.1s;
}

.range-indicator {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: #ff3e3e;
    font-size: 24px;
    text-shadow: 0 0 10px #ff3e3e;
    animation: bounce-indicator 0.6s infinite alternate;
    z-index: 20;
    pointer-events: none;
}

@keyframes bounce-indicator {
    from { transform: translateX(-50%) translateY(0); }
    to { transform: translateX(-50%) translateY(-10px); }
}

#blade-canvas { position: absolute; top: 0; left: 0; z-index: 8; pointer-events: none; }



/* --- 2. 场景层级 (优化合并版) --- */
#bg-layer {
    position: absolute;
    z-index: 1;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    /* 基础缩放 1.05 能够消除滤镜产生的白边 */
    transform: scale(1.05); 
    /* 关键：增加 transform 的过渡效果，实现风景放大 */
    transition: transform 0.8s cubic-bezier(0.2, 0, 0.2, 1), 
                filter 0.8s ease, 
                opacity 0.8s ease;
    /* 新增：轻微上下晃动效果 */
    animation: bg-bob 6s infinite ease-in-out;
}

@keyframes bg-bob {
    0%, 100% { transform: scale(1.05) translateY(0); }
    50% { transform: scale(1.05) translateY(-10px); }
}

/* 迁跃激活状态：风景进一步放大，产生冲入感 */
.warping-bg { 
    transform: scale(2.5) !important; /* 强制覆盖基础缩放 */
    /* filter: blur(8px) brightness(2); */
    background: rgba(0, 240, 255, 0.1);
    opacity: 0.7;
}

/* --- 爆血粒子：大号圆形血滴 --- */
.particle {
    position: absolute;
    border-radius: 50%; /* 强制圆形 */
    pointer-events: none;
    z-index: 999;
    /* 使用更长的动画时间，让血滴飞得更远 */
    animation: particle-fly 1.2s cubic-bezier(0.1, 0.5, 0.2, 1) forwards;
}

.flight-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    z-index: 999;
    animation: flight-fly 1s linear forwards;
}

@keyframes flight-fly {
    0% { transform: translate(0, 0) scale(0.5); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(2); opacity: 0; }
}

.particle.spark {
    animation: spark-fly 0.6s cubic-bezier(0.1, 0.5, 0.2, 1) forwards;
}

@keyframes particle-fly {
    0% { 
        transform: translate(0, 0) scale(1.5); 
        opacity: 1; 
        filter: brightness(2);
    }
    100% { 
        /* var(--tx/ty) 由JS控制，这里增加 y 轴偏移模拟重力下坠 */
        transform: translate(var(--tx), calc(var(--ty) + 80px)) scale(0); 
        opacity: 0; 
    }
}

@keyframes spark-fly {
    0% { 
        transform: translate(0, 0) scale(1.5); 
        opacity: 1; 
        filter: brightness(2);
    }
    100% { 
        /* 没有 downward gravity */
        transform: translate(var(--tx), var(--ty)) scale(0); 
        opacity: 0; 
    }
}

/* --- 系统通知：优化层级与动画 --- */
#system-notifier {
    position: absolute;
    top: 15%;            /* 向上微调，避免挡住屏幕中央的怪物 */
    left: 50%;
    transform: translateX(-50%) translateY(-20px); /* 初始位置稍微偏上 */
    color: var(--ds-cyan);
    background: rgba(0, 20, 30, 0.9); /* 稍微加深背景，提高文字辨识度 */
    padding: 12px 40px;
    border-left: 4px solid var(--ds-cyan);
    font-size: 15px;      /* 字号稍微加大 */
    letter-spacing: 3px;
    pointer-events: none;
    opacity: 0;
    /* 增加位移过渡，让弹出更有动感 */
    transition: opacity 0.4s, transform 0.4s cubic-bezier(0.2, 0, 0.2, 1);
    z-index: 9999;        /* 关键：必须大于 2000 (商店) 和 20 (HUD)，确保永远在最顶层 */
}

/* 激活状态：透明度变为1，同时向下位移还原 */
#system-notifier.active { 
    opacity: 1; 
    transform: translateX(-50%) translateY(0); 
}

.close-btn {
    background: rgba(255, 62, 62, 0.2);
    border: 1px solid #ff3e3e;
    color: #ff3e3e;
    padding: 5px 15px;
    font-size: 11px;
    cursor: pointer;
    transition: 0.3s;
    pointer-events: auto;
}

.close-btn:hover {
    background: #ff3e3e;
    color: #fff;
}

/* --- 商店容器：半透明遮罩 --- */
#shop-menu, #upgrade-menu, #equipment-menu {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2500;
    pointer-events: auto;
}

.shop-inner {
    width: 90%;
    max-width: 1150px;
    max-height: 85vh;
    background: rgba(5, 5, 5, 0.98) !important; /* 恢复窗口背景 */
    background-image: linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px) !important; /* 恢复条纹 */
    background-size: 100% 3px !important;
    padding: 15px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9) !important;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.1);
}

#shop-list, #equipment-list, #upgrade-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    padding-right: 5px;
}

.shop-section {
    margin-bottom: 15px;
}

.shop-section h4 {
    font-size: 10px;
    letter-spacing: 1px;
    margin-bottom: 10px;
    opacity: 0.8;
}

.shop-item {
    background: rgba(0, 20, 30, 0.6) !important; /* 恢复物品卡片背景 */
    border-left: 2px solid rgba(0, 240, 255, 0.3);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    transition: all 0.2s ease;
    min-width: 0;
    overflow: hidden;
}

.shop-item:hover {
    background: rgba(0, 240, 255, 0.15) !important;
    border-left-color: var(--ds-cyan);
    transform: translateX(2px);
}

.shop-item .item-header {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
}

.shop-item .item-icon {
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(0, 240, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    color: var(--ds-cyan);
}

.shop-item .item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
}

.shop-item .item-name-cn {
    font-size: 12px; /* 稍微增大字体 */
    font-weight: 400;
    color: #fff;
    white-space: normal; /* 允许换行 */
    line-height: 1.2;
}

.shop-item .item-name-en {
    font-size: 7px;
    color: var(--ds-cyan);
    opacity: 0.6;
    text-transform: uppercase;
    margin-top: -1px;
}

.shop-item .item-cost {
    font-size: 9px;
    color: #aaa;
    margin-top: 2px;
    font-family: var(--ds-font-mono);
}

.shop-item .item-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    margin-top: auto;
}

/* --- 8. 仓库面板样式优化 --- */
/* 采集材料移动到右上角 */
#material-list {
    position: absolute;
    top: 20px;
    right: 20px;
    text-align: right;
    font-size: 12px;
    color: var(--ds-cyan);
}

#inventory-container {
    display: flex;
    gap: 20px;
    flex: 1;
    overflow: hidden;
}

.inventory-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.inventory-grid {
    display: grid;
    gap: 5px;
    overflow-y: auto;
    padding-right: 5px;
    /* 游戏风格滚动条 */
    scrollbar-width: thin;
    scrollbar-color: var(--ds-cyan) rgba(0, 20, 30, 0.5);
}

/* 隐藏 Webkit 滚动条 */
.inventory-grid::-webkit-scrollbar {
    width: 6px;
}
.inventory-grid::-webkit-scrollbar-track {
    background: rgba(0, 20, 30, 0.5);
}
.inventory-grid::-webkit-scrollbar-thumb {
    background-color: var(--ds-cyan);
    border-radius: 3px;
}

.shop-item {
    background: rgba(168, 240, 255, 0.05);
    border: 1px solid rgba(168, 240, 255, 0.2);
    padding: 8px; /* 增加内边距 */
    font-size: 10px;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    gap: 8px; /* 增加间距 */
}

.shop-item:hover {
    background: rgba(168, 240, 255, 0.1);
    border-color: var(--ds-cyan);
}

/* --- 6. 迁跃光束特效 --- */
#hyperspace-effect {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 3; /* 位于背景之上，驾驶舱之下 */
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s;
}

#hyperspace-effect.active { opacity: 1; }

.hyper-beam {
    position: absolute;
    top: 50%; left: 50%;
    width: 150%; height: 2px;
    /* 极细的渐变光束 */
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(168, 240, 255, 0) 20%, 
        rgba(168, 240, 255, 1) 50%, 
        rgba(255, 255, 255, 0) 100%
    );
    transform-origin: left center;
    /* filter: blur(1px); */
    opacity: 0.8;
    box-shadow: 0 0 10px var(--ds-cyan);
    /* 散开动画 */
    animation: beam-out 1.7s cubic-bezier(0.5, 0, 0.5, 1) forwards;
}

@keyframes beam-out {
    0% {
        transform: rotate(var(--angle)) translateX(0) scaleX(0.1);
        opacity: 0;
    }
    30% { opacity: 1; }
    100% {
        transform: rotate(var(--angle)) translateX(1000px) scaleX(3);
        opacity: 0;
    }
}

/* --- 7. 装备槽系统样式 --- */
#equipment-hud {
    position: absolute;
    bottom: 40px;
    left: 40px;
    display: flex;
    gap: 15px;
    z-index: 25;
}

#backpack-trigger {
    position: absolute;
    bottom: 40px;
    left: 350px;
    width: 60px;
    height: 60px;
    background: transparent;
    border: 1px solid rgba(168, 240, 255, 0.3);
    cursor: pointer;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

#backpack-trigger:hover {
    border-color: var(--ds-cyan);
    background: rgba(168, 240, 255, 0.1);
}

#ship-trigger {
    position: absolute;
    bottom: 40px;
    left: 420px;
    width: 60px;
    height: 60px;
    background: transparent;
    border: 1px solid rgba(168, 240, 255, 0.3);
    cursor: pointer;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

#ship-trigger:hover {
    border-color: var(--ds-cyan);
    background: rgba(168, 240, 255, 0.1);
}

.ship-icon {
    width: 30px;
    height: 30px;
    color: var(--ds-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- 飞船属性面板样式 (D3 Style) --- */
/* --- 飞船属性面板样式 (D3 Style) --- */
.ship-stats-col {
    width: 240px;
    border-right: 1px solid rgba(168, 240, 255, 0.2);
    padding: 5px;
    background: rgba(0, 10, 15, 0.4);
    overflow-y: auto;
    scrollbar-width: none;
}

.ship-stats-col::-webkit-scrollbar {
    display: none;
}

.ship-equip-col {
    width: calc(100% - 250px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.equip-upper {
    flex: 1.2;
    padding: 5px;
    border-bottom: 1px solid rgba(168, 240, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.equip-lower {
    flex: 1;
    padding: 5px;
    overflow-y: auto;
    scrollbar-width: none;
}

.equip-lower::-webkit-scrollbar {
    display: none;
}

.stats-group-title {
    width: 100%;
    color: var(--ds-cyan);
    font-size: 13px;
    margin-bottom: 5px;
    border-bottom: 1px solid rgba(168, 240, 255, 0.3);
    padding-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.compact-stats-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1px 0;
}

.stat-row.group-gap {
    padding-top: 6px;
}

.stat-name-container {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.stat-name-cn {
    font-size: 12px; /* 扩大10% */
    color: #fff;
    font-weight: 500;
}

.stat-name-en {
    font-size: 8px; /* 扩大15% */
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    margin-top: 2px; /* 调远一点点 */
}

.slot-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 9px;
    color: rgba(168, 240, 255, 0.15);
    pointer-events: none;
    text-align: center;
    white-space: nowrap;
}

.stat-value {
    font-size: 12px;
    color: var(--ds-cyan);
    font-family: 'JetBrains Mono', monospace;
    font-weight: bold;
    text-align: right;
    padding-top: 1px;
}

/* 渔帆暗涌风格网格 */
.dredge-grid {
    display: grid;
    grid-template-columns: repeat(3, 60px);
    grid-template-rows: repeat(2, 60px);
    gap: 2px;
    background: rgba(168, 240, 255, 0.05);
    padding: 5px;
    border: 1px solid rgba(168, 240, 255, 0.1);
    width: fit-content;
    margin: 0 auto;
}

.grid-cell {
    width: 60px;
    height: 60px;
    background: rgba(0, 20, 30, 0.6);
    border: 1px solid rgba(168, 240, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: 0.2s;
}

.grid-cell.ship-core {
    background: rgba(168, 240, 255, 0.15);
    border-color: var(--ds-cyan);
    cursor: default;
}

.grid-cell.ship-core svg {
    width: 40px;
    height: 40px;
    color: var(--ds-cyan);
    opacity: 0.8;
}

.grid-cell.locked {
    background: rgba(20, 0, 0, 0.4);
    border-color: rgba(255, 0, 0, 0.2);
    cursor: not-allowed;
}

.grid-cell.locked::after {
    content: '×';
    color: rgba(255, 0, 0, 0.3);
    font-size: 24px;
}

.grid-cell:not(.ship-core):not(.locked):hover {
    background: rgba(168, 240, 255, 0.1);
    border-color: var(--ds-cyan);
}

.grid-item-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

/* 紧凑仓库列表 */
.compact-warehouse-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.ds-item {
    background: rgba(0, 20, 30, 0.6);
    border: 1px solid rgba(168, 240, 255, 0.2);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 10px;
}

.ds-item:hover {
    background: rgba(168, 240, 255, 0.1);
    border-color: var(--ds-cyan);
}

.ds-item-tag {
    font-size: 7px;
    color: #666;
    text-transform: uppercase;
}

.ds-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ds-item-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(168, 240, 255, 0.2);
}

.ds-item-info {
    flex: 1;
    overflow: hidden;
}

.ds-item-name-cn {
    color: #fff;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ds-item-name-en {
    color: #888;
    font-size: 8px;
    text-transform: uppercase;
}

.ds-item-actions {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.ds-btn {
    background: rgba(0, 40, 60, 0.6);
    border: 1px solid rgba(168, 240, 255, 0.3);
    color: #fff;
    padding: 2px 5px;
    cursor: pointer;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ds-btn:hover {
    background: var(--ds-cyan);
    color: #000;
}

.btn-sub {
    font-size: 7px;
    margin-left: 3px;
    opacity: 0.7;
}

.backpack-icon {
    width: 30px;
    height: 30px;
    border: 2px solid var(--ds-cyan);
    position: relative;
}

.backpack-icon::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 6px;
    border: 2px solid var(--ds-cyan);
    border-bottom: none;
}

#deep-space-container {
    position: absolute;
    left: 50%;
    bottom: 300px; /* 移到更高位置 */
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 25;
    align-items: center;
}

#retreat-space-container {
    position: absolute;
    left: 50%;
    bottom: 220px; /* 移到更高位置 */
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 25;
    align-items: center;
}

#deep-space-trigger, #retreat-space-trigger {
    width: 180px;
    height: 50px;
    background: rgba(0, 40, 60, 0.8);
    border: 1px solid var(--ds-cyan);
    color: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    box-shadow: none; /* 移除发光 */
}

#retreat-space-trigger {
    border-color: #ff3e3e;
    box-shadow: none; /* 移除发光 */
}

#deep-space-trigger:hover {
    background: rgba(168, 240, 255, 0.2);
    box-shadow: none;
}

#retreat-space-trigger:hover {
    background: rgba(255, 62, 62, 0.2);
    box-shadow: none;
}

.ds-label { font-size: 14px; font-weight: bold; letter-spacing: 2px; }
.ds-sub { font-size: 9px; opacity: 0.7; margin-top: 2px; }

.slot {
    width: 60px;
    height: 60px;
    background: rgba(0, 20, 30, 0.6);
    border: 1px solid rgba(168, 240, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.slot:hover {
    background: rgba(168, 240, 255, 0.1);
    border-color: var(--ds-cyan);
}

.slot.active {
    border-color: var(--ds-cyan);
    box-shadow: 0 0 15px rgba(168, 240, 255, 0.4);
    background: rgba(168, 240, 255, 0.15);
}

.slot-key {
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 8px;
    color: var(--ds-cyan);
    opacity: 0.6;
}

.slot-icon {
    font-size: 18px;
    margin-bottom: 2px;
}

.slot-name {
    font-size: 8px;
    text-align: center;
    padding: 0 5px;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

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

.nav-btn.small {
    padding: 4px 8px;
    font-size: 9px;
    height: auto;
}

/* --- 简介 Tooltip --- */
#item-tooltip {
    position: fixed;
    z-index: 9999;
    pointer-events: auto;
    background: rgba(5, 5, 10, 0.98) !important; /* 恢复背景 */
    background-image: linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px) !important; /* 恢复条纹 */
    background-size: 100% 3px !important;
    border: 1px solid var(--ds-cyan);
    padding: 15px;
    width: 240px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.9) !important; /* 恢复阴影 */
    transition: opacity 0.2s;
    border-radius: 4px;
}

#item-tooltip.hidden {
    display: none;
}

.tooltip-content h4 {
    margin: 0 0 10px 0;
    color: var(--ds-cyan);
    font-size: 14px;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(168, 240, 255, 0.3);
    padding-bottom: 5px;
}

.tooltip-content p {
    margin: 0 0 10px 0;
    font-size: 11px;
    color: #ccc;
    line-height: 1.4;
}

#tooltip-stats {
    font-size: 10px;
    color: #a8f0ff;
    margin-bottom: 15px;
}

.tooltip-actions {
    display: flex;
    gap: 10px;
}

/* --- 8. 仓库面板样式优化 --- */
.storage-container {
    display: flex;
    flex-direction: row;
    gap: 15px;
    padding: 15px;
    overflow: hidden;
    height: 500px;
}

.storage-section {
    flex: 1;
    border: 1px solid rgba(0, 240, 255, 0.1);
    background: rgba(0, 20, 30, 0.5);
    padding: 12px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.section-header {
    border-left: 3px solid var(--ds-cyan);
    padding-left: 10px;
    margin-bottom: 12px;
    font-size: 11px;
    color: var(--ds-cyan);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.storage-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding-right: 5px;
}

.storage-item {
    background: rgba(168, 240, 255, 0.05);
    border: 1px solid rgba(168, 240, 255, 0.2);
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    transition: 0.3s;
    min-height: 80px;
    position: relative;
}

.storage-item:hover {
    background: rgba(168, 240, 255, 0.1);
    border-color: rgba(168, 240, 255, 0.5);
}

.storage-item .item-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.storage-item .item-icon {
    font-size: 28px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.item-name-cn {
    font-size: 14px;
    color: #fff;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-name-en {
    font-size: 10px;
    color: var(--ds-cyan);
    opacity: 0.8;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-desc {
    font-size: 10px;
    color: #aaa;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}

.storage-item .item-info {
    flex: 1;
    overflow: hidden;
}

.storage-item .item-name-cn {
    font-size: 12px;
    color: #fff;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.storage-item .item-name-en {
    font-size: 8px;
    color: #aaa;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.storage-item .item-actions {
    display: flex;
    gap: 5px;
}

.storage-item .nav-btn.small {
    padding: 4px 8px;
    font-size: 10px;
}

/* 快速更换菜单项 */
.quick-swap-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: 0.2s;
    width: 180px;
}

.quick-swap-item:hover {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--ds-cyan);
}

.quick-swap-item .icon {
    font-size: 18px;
}


.quick-swap-item .name {
    font-size: 11px;
    color: #fff;
}

/* --- Death Stranding Style Storage Panel --- */
.ds-panel {
    position: relative;
    background: rgba(5, 5, 5, 0.98) !important; /* 恢复窗口背景 */
    background-image: linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px) !important; /* 恢复条纹 */
    background-size: 100% 3px !important;
    border: 1px solid rgba(0, 240, 255, 0.4) !important;
    outline: none !important;
    padding: 12px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8) !important;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 95vw;
    box-sizing: border-box;
}

/* --- Shop Container with NPC Area --- */
.shop-container {
    flex-direction: row !important;
    width: 1100px; /* 增加宽度 */
    max-width: 95vw;
    height: 700px; /* 增加高度 */
    padding: 0 !important;
    overflow: hidden;
    border: 1px solid rgba(0, 240, 255, 0.2) !important;
    background: rgba(2, 5, 8, 0.95) !important;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.9), inset 0 0 100px rgba(0, 240, 255, 0.05) !important;
}

.shop-main {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    overflow-y: auto;
    background: transparent !important;
    position: relative;
}

.shop-main::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: repeating-linear-gradient(0deg, rgba(0, 240, 255, 0.03) 0px, rgba(0, 240, 255, 0.03) 1px, transparent 1px, transparent 2px);
    pointer-events: none;
    z-index: 0;
}

.shop-npc-area {
    width: 320px;
    background: rgba(0, 15, 25, 0.8) !important;
    display: flex;
    flex-direction: column;
    padding: 25px;
    position: relative;
    border-left: 1px solid rgba(0, 240, 255, 0.1);
    z-index: 1;
}

.npc-portrait-placeholder {
    width: 100%;
    height: 400px;
    background: linear-gradient(180deg, rgba(0, 240, 255, 0.05), rgba(0, 240, 255, 0.15)) !important;
    border: 1px solid rgba(0, 240, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(0, 240, 255, 0.3);
    font-size: 11px;
    letter-spacing: 3px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.npc-portrait-placeholder::after {
    content: 'SCANNING...';
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: 8px;
    opacity: 0.5;
}

.npc-dialogue-box {
    flex: 1;
    background: rgba(0, 20, 30, 0.6) !important;
    border: 1px solid rgba(0, 240, 255, 0.1);
    padding: 18px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.npc-name {
    font-size: 11px;
    color: var(--ds-cyan);
    letter-spacing: 2px;
    font-weight: 800;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
    padding-bottom: 5px;
}

.npc-text {
    font-size: 13px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
    font-style: italic;
}

/* --- Improved Shop Item Card --- */
.shop-item {
    background: rgba(0, 30, 45, 0.4) !important;
    border: 1px solid rgba(0, 240, 255, 0.1) !important;
    border-left: 3px solid rgba(0, 240, 255, 0.3) !important;
    padding: 20px !important;
    display: flex;
    flex-direction: column;
    gap: 15px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
}

.shop-item:hover {
    background: rgba(0, 240, 255, 0.08) !important;
    border-color: rgba(0, 240, 255, 0.4) !important;
    border-left-color: var(--ds-cyan) !important;
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.shop-item .ds-item-tag {
    position: absolute;
    top: 0; right: 0;
    background: rgba(0, 240, 255, 0.1);
    color: var(--ds-cyan);
    font-size: 8px;
    padding: 2px 8px;
    letter-spacing: 1px;
    opacity: 0.6;
}

.shop-item .ds-item-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.shop-item .ds-item-icon {
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 240, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: inset 0 0 15px rgba(0, 240, 255, 0.05);
}

.shop-item .ds-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.shop-item .ds-item-name-cn {
    font-size: 16px !important;
    font-weight: 700;
    letter-spacing: 1px;
}

.shop-item .ds-item-name-en {
    font-size: 9px;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.shop-item .ds-item-desc {
    display: block !important;
    font-size: 11px !important;
    line-height: 1.6 !important;
    color: rgba(255, 255, 255, 0.6) !important;
    margin: 0 !important;
    flex: 1;
}

.shop-item .item-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid rgba(0, 240, 255, 0.05);
    border-bottom: 1px solid rgba(0, 240, 255, 0.05);
}

.shop-item .stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.shop-item .stat-label {
    font-size: 8px;
    text-transform: uppercase;
    opacity: 0.4;
    letter-spacing: 1px;
}

.shop-item .stat-value {
    font-size: 12px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.shop-item .ds-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 5px !important;
}

.shop-item .ds-item-cost {
    display: flex;
    flex-direction: column;
}

.shop-item .cost-label {
    font-size: 8px;
    opacity: 0.5;
    text-transform: uppercase;
}

.shop-item .cost-value {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1px;
}

.shop-item .ds-btn.equip {
    height: 36px;
    padding: 0 20px;
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.2);
    transition: all 0.2s;
}

.shop-item .ds-btn.equip:hover {
    background: var(--ds-cyan);
    color: #000 !important;
}

.ds-panel-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

.ds-panel-title {
    display: flex;
    align-items: baseline;
    gap: 15px;
}

.ds-title-main {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #fff;
}

.ds-title-sub {
    font-size: 10px;
    color: var(--ds-cyan);
    letter-spacing: 3px;
    opacity: 0.8;
}

.ds-header-line {
    height: 1px;
    background: linear-gradient(to right, var(--ds-cyan), transparent);
    width: 100%;
    opacity: 0.5;
}

.ds-close-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: var(--ds-cyan);
    padding: 5px 15px;
    font-size: 10px;
    letter-spacing: 2px;
    cursor: pointer;
    transition: 0.2s;
}

.ds-close-btn:hover {
    background: var(--ds-cyan);
    color: #000;
}

.ds-storage-container {
    display: grid;
    grid-template-columns: 3fr 4fr; /* 精确匹配 3列/4列 的比例，保证卡片等宽 */
    gap: 30px;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
}

.ds-storage-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 0;
}

.ds-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 3px solid var(--ds-cyan);
    padding-left: 10px;
    margin-bottom: 5px;
}

.ds-section-tag {
    font-size: 10px;
    color: var(--ds-cyan);
    font-weight: bold;
    opacity: 0.6;
}

.ds-section-title {
    font-size: 12px;
    letter-spacing: 1px;
    color: #fff;
    font-weight: 600;
}

.ds-grid-weapons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

/* 商店专用网格：恢复 3 列布局以提高空间利用率 */
.shop-main .ds-grid-weapons {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 15px;
}

.ds-grid-trinkets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

/* Corner Brackets */
.ds-corner {
    position: absolute;
    width: 10px; /* 缩小支架 */
    height: 10px;
    border: 1.5px solid var(--ds-cyan);
    pointer-events: none;
    opacity: 0.8;
}

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

/* DS Item Card */
.ds-item {
    background: rgba(0, 20, 30, 0.6) !important; /* 恢复仓库物品背景 */
    border: none;
    border-left: 2px solid rgba(0, 240, 255, 0.3);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    transition: all 0.2s ease;
    min-width: 0;
    overflow: hidden;
}

.shop-item {
    padding: 10px !important;
    gap: 8px !important;
    min-height: 180px;
    background: rgba(0, 240, 255, 0.03) !important;
    border-left: 3px solid rgba(0, 240, 255, 0.2) !important;
}

.shop-item .ds-item-header {
    gap: 8px !important;
    align-items: center !important;
}

.ds-item:hover {
    background: rgba(0, 240, 255, 0.15) !important;
    border-left-color: var(--ds-cyan);
    transform: translateX(2px);
}

.ds-item-header {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    text-align: left;
}

.ds-item-icon {
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(0, 240, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    color: var(--ds-cyan);
}

.shop-item .ds-item-icon {
    width: 44px;
    height: 44px;
    font-size: 22px;
}

.ds-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.shop-item .ds-item-info {
    gap: 4px !important;
}

.ds-item-name-cn {
    font-size: 11px;
    font-weight: 300; /* 使用更细的字重，增加高级感 */
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.5px;
    width: 100%;
}

.shop-item .ds-item-name-cn {
    font-size: 14px !important;
}

.ds-item-name-en {
    font-size: 7px;
    color: var(--ds-cyan);
    letter-spacing: 0.5px;
    opacity: 0.6;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    margin-top: -1px;
}

.ds-item-desc {
    display: none; /* 隐藏描述以保持UI整洁 */
}

.shop-item .item-stats-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0;
    padding: 4px 8px;
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: 2px;
}

.shop-item .stat-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px;
    white-space: nowrap;
}

.shop-item .stat-label {
    font-size: 8px !important;
    opacity: 0.6;
    letter-spacing: 0.5px;
}

.shop-item .stat-value {
    font-size: 12px !important;
    font-weight: bold;
}

.ds-item-actions {
    display: flex; /* 改为 flex 布局 */
    gap: 4px;
    margin-top: auto;
}

.shop-item .ds-item-actions {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 240, 255, 0.1);
}

.ds-btn.equip {
    flex: 1; /* 装备按钮占满剩余空间 */
}

.shop-item .ds-btn.equip {
    padding: 10px 15px !important;
    max-width: 100%;
    width: 100%;
}

.ds-btn.upgrade, .ds-btn.drop {
    flex: 0 0 35px; /* 固定宽度 */
    padding: 0 !important;
}

.ds-btn {
    background: transparent !important; /* 完全透明 */
    border: 1px solid rgba(0, 240, 255, 0.15);
    color: var(--ds-cyan);
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2px 0;
    min-height: 24px;
}

.ds-btn .btn-main {
    font-size: 10px;
    line-height: 1;
}

.ds-btn .btn-sub {
    font-size: 6px;
    opacity: 0.6;
    transform: scale(0.85);
    margin-top: 1px;
}

.ds-btn.drop {
    font-size: 12px;
    color: #ff3e3e;
    border-color: rgba(255, 62, 62, 0.2);
}

.ds-btn.talent {
    color: #ffaa00;
    border-color: rgba(255, 170, 0, 0.2);
}

.ds-btn.equip:hover {
    background: var(--ds-cyan);
    color: #000;
    border-color: var(--ds-cyan);
}

.ds-btn.equip:hover .btn-sub {
    color: #000;
    opacity: 1;
}

.ds-btn.talent:hover {
    background: #ffaa00;
    color: #000;
    border-color: #ffaa00;
}

.ds-btn.talent:hover .btn-sub {
    color: #000;
    opacity: 1;
}

.ds-btn.drop:hover {
    background: #ff3e3e;
    color: #fff;
    border-color: #ff3e3e;
}

.ds-panel::-webkit-scrollbar {
    width: 4px;
}

.ds-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.ds-panel::-webkit-scrollbar-thumb {
    background: var(--ds-cyan);
    border-radius: 0;
}

.ds-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: var(--ds-cyan);
    opacity: 0;
    transition: 0.2s;
}

/* --- Weapon Talent Tree (System Reconstruction) --- */
#upgrade-menu.panel-overlay {
    z-index: 3500; /* 确保在背包之上 */
}

#upgrade-menu .shop-inner {
    width: 420px; /* 进一步缩小宽度 */
    height: 650px; /* 调整高度 */
    max-height: 90vh;
}

#upgrade-list {
    position: relative;
    flex: 1;
    overflow: hidden;
    background: rgba(0, 10, 20, 0.4);
    border: 1px solid rgba(0, 240, 255, 0.1);
    margin-top: 10px;
    display: flex;
    flex-direction: column;
}

.talent-tree-container {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 0 auto;
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
    background: radial-gradient(circle at center, rgba(0, 40, 60, 0.2) 0%, transparent 70%);
}

/* 象限虚线 - 已在 JS 中手动添加以确保坐标一致 */
.talent-tree-container::before, .talent-tree-container::after {
    display: none;
}

/* 象限标签 */
.quadrant-label {
    position: absolute;
    font-size: 8px;
    color: rgba(0, 240, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
    pointer-events: none;
}

.talent-node {
    position: absolute;
    width: 50px; /* 缩小节点 */
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 15, 25, 0.9);
    border: 1px solid rgba(0, 240, 255, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
}

.talent-node.affinity-vanguard { border-color: rgba(255, 62, 62, 0.4); }
.talent-node.affinity-overload { border-color: rgba(255, 170, 0, 0.4); }
.talent-node.affinity-guardian { border-color: rgba(0, 255, 136, 0.4); }
.talent-node.affinity-flux { border-color: rgba(0, 240, 255, 0.4); }

.talent-node.resonating {
    animation: resonance-pulse 2s infinite ease-in-out;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

@keyframes resonance-pulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.05); filter: brightness(1.3); box-shadow: 0 0 25px rgba(0, 255, 136, 0.5); }
}

.talent-node:hover {
    border-color: var(--ds-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
    transform: scale(1.1);
    z-index: 10;
}

.talent-node.locked {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
}

.talent-node.maxed {
    border-color: #ffaa00;
    box-shadow: 0 0 15px rgba(255, 170, 0, 0.4);
}

.talent-node.active {
    border-color: var(--ds-cyan);
    background: rgba(0, 40, 60, 0.9);
}

.talent-node-icon {
    font-size: 18px;
    margin-bottom: 2px;
}

.talent-node-level {
    font-size: 9px;
    color: var(--ds-cyan);
    font-weight: bold;
}

.talent-connection {
    position: absolute;
    background: rgba(0, 240, 255, 0.15);
    height: 2px;
    transform-origin: left center;
    z-index: 1;
    pointer-events: none;
}

.talent-connection.active {
    background: rgba(0, 240, 255, 0.6);
    box-shadow: 0 0 5px rgba(0, 240, 255, 0.4);
}

.talent-info-panel {
    position: absolute;
    bottom: 15px;
    left: 15px;
    right: 15px;
    background: rgba(0, 15, 25, 0.98);
    border: 1px solid var(--ds-cyan);
    padding: 10px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease-out;
    z-index: 10;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.8);
}

.talent-info-panel.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.talent-info-title {
    color: var(--ds-cyan);
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    text-shadow: 0 0 5px var(--ds-cyan);
}

.talent-info-desc {
    font-size: 10px;
    color: #aaa;
    margin-bottom: 10px;
    line-height: 1.5;
}

.talent-info-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(0, 240, 255, 0.2);
    padding-top: 8px;
}

.talent-info-cost {
    font-size: 11px;
    color: #ffaa00;
}

.ds-item:hover::before {
    opacity: 1;
}

.ds-item-tag {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 7px;
    color: rgba(0, 240, 255, 0.3);
    padding: 2px 5px;
    font-family: var(--f-mono);
    pointer-events: none;
}

/* --- 浮动文字 --- */
.floating-text {
    position: absolute;
    pointer-events: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    font-weight: 400;
    /* 移除黑影背景 */
    text-shadow: none;
    animation: floatUp 1.6s ease-out forwards;
    z-index: 1000;
    white-space: nowrap;
}

.floating-text.crit {
    font-size: 20px;
    font-weight: 500;
    animation: floatUpCrit 1.6s ease-out forwards;
    text-shadow: none;
}

.floating-text.small {
    font-size: 11px;
    opacity: 0.8;
}

@keyframes floatUp {
    0% { transform: translate(-50%, 0); opacity: 1; }
    100% { transform: translate(-50%, -120px); opacity: 0; }
}

@keyframes floatUpCrit {
    0% { transform: translate(-50%, 0) scale(1); opacity: 1; }
    20% { transform: translate(-50%, -20px) scale(1.4); opacity: 1; }
    100% { transform: translate(-50%, -120px) scale(1.2); opacity: 0; }
}

/* --- Hologram Map --- */
.hologram-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    color: #00f0ff;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
    pointer-events: none;
    background: radial-gradient(circle at center, rgba(0, 240, 255, 0.05) 0%, transparent 70%);
}

.hologram-container::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
    z-index: -1;
}

.hologram-header {
    position: absolute;
    top: 10%;
    text-align: center;
    animation: holo-flicker 3s infinite;
}

.hologram-title {
    font-size: 42px;
    font-weight: 900;
    letter-spacing: 15px;
    margin-bottom: 5px;
}

.hologram-subtitle {
    font-size: 14px;
    opacity: 0.6;
    letter-spacing: 4px;
}

.hologram-map {
    position: relative;
    width: 800px;
    height: 600px;
    pointer-events: auto;
    perspective: 1000px;
}

.orbit-plane {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transform: rotateX(60deg);
    pointer-events: none;
}

.hologram-orbit {
    position: absolute;
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbit-rotate 60s linear infinite;
}

.hologram-node {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s;
    /* Remove all 3D transforms */
    transform: translate(-50%, -50%) scale(0.6);
    z-index: 1000;
    padding: 10px;
}

.hologram-icon-wrapper {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hologram-label {
    margin-top: 2px;
    font-size: 16px;
    font-weight: normal;
    white-space: nowrap;
    text-shadow: 0 0 5px #000;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hologram-name-cn {
    font-size: 16px;
}

.hologram-name-en {
    font-size: 12px;
    opacity: 0.7;
}

.hologram-planet {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(0, 240, 255, 0.8);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
    top: 50%;
    left: 50%;
    transform-origin: 0 0;
    animation: planet-orbit var(--planet-duration) linear infinite;
}

.zone-details-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 10, 20, 0.9);
    border: 1px solid #00f2ff;
    padding: 25px;
    color: #00f2ff;
    z-index: 1000;
    width: 350px;
    text-align: center;
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.3);
    font-family: 'Courier New', Courier, monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.zone-details-popup h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: normal;
    border-bottom: 1px solid #00f2ff;
    padding-bottom: 10px;
}

.zone-name-en {
    display: block;
    font-size: 14px;
    color: #00f2ff;
    margin-top: 5px;
    opacity: 0.7;
}

.popup-body p {
    font-size: 14px;
    margin: 20px 0;
    line-height: 1.5;
    color: #ccc;
}

.layer-selector {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
}

.popup-footer {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
}

.zone-details-popup button {
    padding: 10px 25px;
    background: transparent;
    border: 1px solid #00f2ff;
    color: #00f2ff;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    text-transform: uppercase;
}

.zone-details-popup button:hover {
    background: #00f2ff;
    color: #000;
}

@keyframes planet-orbit {
    from { transform: rotate(0deg) translateX(var(--radius)) rotate(0deg); }
    to { transform: rotate(360deg) translateX(var(--radius)) rotate(-360deg); }
}

.hologram-node:hover {
    transform: rotateX(-60deg) scale(1.2);
}

@keyframes orbit-rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.hologram-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.hologram-node:hover {
    transform: scale(1.15);
}

.hologram-icon {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px rgba(0, 240, 255, 0.8));
    animation: holo-float 4s ease-in-out infinite;
}

.hologram-node:nth-child(2n) .hologram-icon {
    animation-delay: -1s;
}

.hologram-node:nth-child(3n) .hologram-icon {
    animation-delay: -2s;
}

.hologram-label {
    text-align: center;
}

.hologram-name-cn {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 4px;
}

.hologram-name-en {
    font-size: 10px;
    opacity: 0.7;
    letter-spacing: 1px;
}

.hologram-close {
    position: absolute;
    bottom: 10%;
    background: none;
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: #00f0ff;
    padding: 10px 30px;
    font-size: 12px;
    letter-spacing: 2px;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.3s;
}

.hologram-close:hover {
    background: rgba(0, 240, 255, 0.1);
    border-color: #00f0ff;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

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

@keyframes holo-flicker {
    0%, 100% { opacity: 1; }
    92% { opacity: 1; }
    93% { opacity: 0.6; }
    94% { opacity: 1; }
    95% { opacity: 0.8; }
    96% { opacity: 1; }
}

