/* === TORIYAMA CYBER - 鸟山明清新风格 === */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@400;600;700&display=swap');

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

body {
    background: #0d0d24;
    overflow: hidden;
    font-family: 'Rajdhani', sans-serif;
    color: #fff;
    user-select: none;
    -webkit-user-select: none;
}

#gameCanvas {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0d0d24;
    cursor: crosshair;
}

/* === Overlays === */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 8, 30, 0.88);
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.overlay.hidden { display: none; }
.hidden { display: none; }

/* === Menu (紧凑 + Toriyama 风格) === */
.menu-content, .levelup-content {
    text-align: center;
    padding: 20px 36px;
    border: 2px solid rgba(255, 136, 68, 0.35);
    background: rgba(12, 12, 35, 0.92);
    border-radius: 16px;
    box-shadow: 0 0 30px rgba(255, 136, 68, 0.08), inset 0 0 30px rgba(255, 136, 68, 0.03);
    max-width: 580px;
    width: 580px;
    max-height: 96vh;
    overflow-y: auto;
    position: relative;
}

.game-title {
    font-family: 'Orbitron', monospace;
    font-size: 2.0em;
    font-weight: 900;
    background: linear-gradient(135deg, #ff8833, #ffcc44, #4488ff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease-in-out infinite;
    text-shadow: none;
    margin-bottom: 2px;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.subtitle {
    font-size: 0.85em;
    color: rgba(255, 200, 100, 0.5);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

/* === Character Select (详情 + 图标网格) === */
.section-title {
    font-family: 'Orbitron', monospace;
    font-size: 0.75em;
    color: rgba(255, 200, 100, 0.7);
    margin-bottom: 8px;
    letter-spacing: 2px;
}

/* --- 顶部详情面板 --- */
.char-detail {
    display: flex;
    gap: 16px;
    align-items: center;
    background: rgba(20, 20, 50, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 14px;
    min-height: 100px;
    overflow: hidden;
}
.char-detail-radar {
    flex-shrink: 0;
    margin-left: auto;
    align-self: center;
}

.char-detail-avatar {
    flex-shrink: 0;
}
.char-detail-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    border: 2px solid #ff8833;
    object-fit: cover;
    display: block;
}
.char-detail-avatar.locked {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4em;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,0.15);
}

.char-detail-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.char-detail-name {
    font-family: 'Orbitron', monospace;
    font-size: 1em;
    font-weight: 700;
    color: #ff8833;
    margin-bottom: 4px;
}
.char-detail-name.locked {
    color: rgba(255,255,255,0.3);
}

.char-detail-desc {
    font-size: 0.72em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.char-detail-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 10px;
}
.stat-item {
    font-size: 0.65em;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 6px;
}
.char-detail-affinities {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(120, 200, 255, 0.15);
}
.char-affinity-item {
    font-size: 0.75em;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.char-detail-passives {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(120, 200, 255, 0.15);
}
.char-detail-section-title {
    font-size: 0.7em;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
    margin-bottom: 4px;
    text-transform: uppercase;
}
.char-passive-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.65em;
    padding: 3px 0;
    color: rgba(255, 255, 255, 0.7);
}
.char-passive-icon { font-size: 1.1em; }
.char-passive-name {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    white-space: nowrap;
}
.char-passive-desc {
    color: rgba(255, 255, 255, 0.5);
    margin-left: auto;
    font-size: 0.95em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stat-item b {
    color: #ff8833;
    margin-right: 2px;
}

/* --- 底部图标网格 --- */
.char-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}

.char-icon-card {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 20, 50, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}
.char-icon-card:hover {
    border-color: rgba(255, 136, 68, 0.6);
    background: rgba(255, 136, 68, 0.1);
    transform: translateY(-2px);
}
.char-icon-card.selected {
    border-color: #ff8833;
    background: rgba(255, 136, 68, 0.18);
    box-shadow: 0 0 12px rgba(255, 136, 68, 0.2);
}
.char-icon-card.locked {
    opacity: 0.3;
    cursor: not-allowed;
    filter: grayscale(0.7);
    border-color: rgba(255, 255, 255, 0.03);
}
.char-icon-card.locked:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.03);
    background: rgba(20, 20, 50, 0.4);
}
.char-icon-card.locked.selected {
    opacity: 0.6;
    border-color: #ff8833;
    background: rgba(255, 136, 68, 0.12);
    box-shadow: 0 0 8px rgba(255, 136, 68, 0.15);
    filter: grayscale(0.5);
}
.char-icon-card img {
    width: 88%;
    height: 88%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 6px;
    object-fit: cover;
}
.char-icon-card .icon-fallback,
.char-icon-card .char-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6em;
}

.char-icon {
    font-size: 1.4em;
    margin-bottom: 3px;
    display: flex;
    justify-content: center;
}
.char-icon img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.char-name {
    font-family: 'Orbitron', monospace;
    font-size: 0.65em;
    font-weight: 700;
    color: #ff8833;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.char-desc {
    font-size: 0.6em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 3px;
    line-height: 1.15;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.char-stats {
    display: flex;
    gap: 3px;
    justify-content: center;
    font-size: 0.5em;
    color: rgba(255, 255, 255, 0.5);
    flex-wrap: wrap;
}

.char-stats span {
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1.2;
}

/* === Cyber Button === */
.cyber-btn {
    font-family: 'Orbitron', monospace;
    font-size: 1em;
    font-weight: 700;
    padding: 12px 35px;
    border: 2px solid #00ffff;
    background: transparent;
    color: #00ffff;
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
}

.cyber-btn {
    border-color: #ff8833;
    color: #ff8833;
}
.cyber-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 136, 68, 0.2), transparent);
    transition: left 0.5s;
}
.cyber-btn:hover::before { left: 100%; }
.cyber-btn:hover {
    background: rgba(255, 136, 68, 0.15);
    box-shadow: 0 0 30px rgba(255, 136, 68, 0.25), inset 0 0 30px rgba(255, 136, 68, 0.08);
    transform: scale(1.04);
}
.cyber-btn:active { transform: scale(0.96); }
#startBtn {
    margin-top: 14px;
}

.controls-hint {
    margin-top: 10px;
    font-size: 0.7em;
    color: rgba(255, 200, 100, 0.35);
}
.controls-hint p { margin: 2px 0; }

.key {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid rgba(255, 136, 68, 0.3);
    border-radius: 4px;
    font-family: 'Orbitron', monospace;
    font-size: 0.85em;
    color: #ff8833;
    background: rgba(255, 136, 68, 0.06);
    margin: 0 2px;
}

/* === Weapon Select (初始武器选择) === */
.weapon-select-content {
    max-width: 720px;
    max-height: 92vh;
}
.weapon-select-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.4em;
    font-weight: 900;
    color: #ffcc44;
    text-shadow: 0 0 20px rgba(255, 204, 68, 0.3);
    margin-bottom: 2px;
}

/* --- 武器详情面板（类似 char-detail） --- */
.weapon-detail {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    align-items: flex-start;
}
.weapon-detail-avatar {
    flex-shrink: 0;
    border-radius: 8px;
    padding: 4px;
    border: 2px solid;
}
.weapon-detail-avatar img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    display: block;
    border-radius: 4px;
}
.weapon-detail-info {
    flex: 1;
    min-width: 0;
}
.weapon-detail-name {
    font-family: 'Orbitron', monospace;
    font-size: 1em;
    font-weight: 700;
    color: #00ffff;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ws-level-badge {
    display: inline-block;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 0.65em;
    line-height: 1.4;
    color: rgba(255,255,255,0.45);
    border: none;
}
.wpn-detail-btn {
    cursor: pointer;
    font-size: 0.7em;
    opacity: 0.5;
    transition: opacity 0.15s, transform 0.15s;
    line-height: 1;
    user-select: none;
}
.wpn-detail-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}
.weapon-detail-tag {
    font-size: 0.62em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 4px;
}

/* Bug2 修复: 武器不适配角色偏好时的警告徽章 */
.weapon-detail-tag .warn-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    background: linear-gradient(90deg, #ff8a3d, #ffb84d);
    color: #1a1a1a;
    font-size: 0.92em;
    font-weight: 700;
    border-radius: 6px;
    text-shadow: none;
    box-shadow: 0 0 6px rgba(255, 138, 61, 0.6);
}

/* Report 3: 武器适配度进度条 (从红到绿 3 档)
   0%  = 0/2 命中 (红)
   50% = 1/2 命中 (黄)
   100% = 2/2 命中 (绿)
   进度条作为 .stat-item 内第一个元素的背景, 宽度按 fit 比例 */
.weapon-detail-stats .stat-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.04);
}
.weapon-detail-stats .stat-item.fit-0::before,
.weapon-detail-stats .stat-item.fit-50::before,
.weapon-detail-stats .stat-item.fit-100::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 0;
    border-radius: 4px 0 0 4px;
    opacity: 0.55;
}
.weapon-detail-stats .stat-item.fit-0::before {
    width: 18%;
    background: linear-gradient(90deg, #ff3030 0%, #ff5040 100%);
}
.weapon-detail-stats .stat-item.fit-50::before {
    width: 50%;
    background: linear-gradient(90deg, #ffea00 0%, #ffae00 50%, #c0c000 100%);
}
.weapon-detail-stats .stat-item.fit-100::before {
    width: 100%;
    background: linear-gradient(90deg, #4dff4d 0%, #1ec81e 50%, #00a000 100%);
}
.weapon-detail-stats .stat-item > * {
    position: relative;
    z-index: 1;
}

/* 适配度专用 stat-item 头部标签 (伤害项加 💚/💛/❤️ hint) */
.weapon-detail-stats .stat-item .fit-hint {
    margin-left: 4px;
    font-size: 0.85em;
    opacity: 0.85;
}
.weapon-detail-desc {
    font-size: 0.72em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 6px;
    line-height: 1.3;
}
.weapon-detail-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px 10px;
}
.weapon-detail-stats .stat-item {
    font-size: 0.65em;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
}
.weapon-detail-stats .stat-item b {
    color: #00ffff;
    margin-right: 2px;
}
.weapon-detail-radar {
    flex-shrink: 0;
    margin-left: auto;
    align-self: center;
}

/* --- 底部武器图标网格（10列） --- */
.weapon-filter-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 8px 0 4px;
}
.weapon-filter-tab {
    font-size: 0.75em;
    padding: 3px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}
.weapon-filter-tab:hover {
    border-color: rgba(255, 136, 68, 0.4);
    color: rgba(255, 255, 255, 0.85);
}
.weapon-filter-tab.active {
    border-color: #ff8833;
    background: rgba(255, 136, 68, 0.2);
    color: #ff8833;
    font-weight: 600;
}
.weapon-select-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
    margin: 0 0 10px;
}
.weapon-select-card {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 20, 50, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-sizing: border-box;
}
.weapon-select-card .ws-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.weapon-select-card .ws-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ws-card-level {
    position: absolute;
    bottom: 1px;
    right: 3px;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 0.4em;
    line-height: 1.2;
    pointer-events: none;
    color: rgba(255,255,255,0.45);
    z-index: 1;
}
.weapon-select-card:hover {
    border-color: rgba(255, 136, 68, 0.6);
    transform: translateY(-2px);
}
.weapon-select-card.selected {
    border-color: #ff8833;
    background: transparent !important;
    box-shadow: 0 0 12px rgba(255, 136, 68, 0.2);
}

/* --- 选择界面的按钮行（返回 + 确认） --- */
.select-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 8px;
}

/* 左上角返回按钮 */
.back-btn-corner {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.7em;
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.35);
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    border-radius: 6px;
    font-family: 'Orbitron', monospace;
    transition: all 0.3s ease;
    z-index: 10;
    line-height: 1.4;
}
.back-btn-corner:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.08);
}

/* === Difficulty Select === */
.diff-content {
    max-width: 520px;
}

/* 顶部难度详情面板 */
.diff-detail {
    display: flex;
    gap: 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 136, 68, 0.15);
    border-radius: 10px;
    padding: 12px 14px;
    margin: 8px 0 12px;
    min-height: 64px;
    align-items: flex-start;
}
.diff-detail-badge {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 136, 68, 0.12);
    border: 2px solid rgba(255, 136, 68, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', monospace;
    font-size: 1.5em;
    font-weight: 700;
    color: #ffcc44;
}
.diff-detail-info {
    flex: 1;
    min-width: 0;
}
.diff-detail-name {
    font-size: 0.85em;
    font-weight: 700;
    color: #ffcc44;
    margin-bottom: 3px;
}
.diff-detail-desc {
    font-size: 0.6em;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.4;
    margin-bottom: 5px;
}
.diff-detail-bonuses {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.diff-detail-bonus {
    font-size: 0.5em;
    background: rgba(255, 136, 68, 0.08);
    border: 1px solid rgba(255, 136, 68, 0.12);
    border-radius: 4px;
    padding: 1px 6px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
}

/* 底部难度图标网格 */
.diff-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
    margin: 0 0 10px;
}
.diff-card {
    aspect-ratio: 1;
    background: rgba(20, 20, 50, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', monospace;
    font-size: 1.1em;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    transition: all 0.2s ease;
}
.diff-card:hover {
    border-color: rgba(255, 136, 68, 0.5);
    background: rgba(255, 136, 68, 0.08);
    color: #ffcc44;
    transform: translateY(-2px);
}
.diff-card.selected {
    border-color: #ff8833;
    background: rgba(255, 136, 68, 0.18);
    box-shadow: 0 0 12px rgba(255, 136, 68, 0.2);
    color: #ffcc44;
}
/* 开始战斗按钮 */
.diff-start-btn {
    display: inline-block;
    padding: 8px 22px;
    margin-top: 6px;
    font-family: 'Orbitron', monospace;
    font-size: 0.85em;
    font-weight: 700;
    color: #0a0a1a;
    background: linear-gradient(135deg, #ff8844, #ffcc44);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.2s ease;
}
.diff-start-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(255, 136, 68, 0.4);
}
.diff-start-btn:active {
    transform: translateY(0);
}
.cyber-btn-secondary {
    font-family: 'Orbitron', monospace;
    font-size: 0.75em;
    padding: 8px 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 6px;
}
.cyber-btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.35);
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.06);
}

/* === Game Over (可滚动修复) === */
.gameover-content {
    max-height: 92vh;
    overflow-y: auto;
}
.gameover-scroll {
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 4px;
}
.game-over-title {
    font-family: 'Orbitron', monospace;
    font-size: 2.2em;
    color: #ff0044;
    text-shadow: 0 0 40px rgba(255, 0, 68, 0.5);
    margin-bottom: 6px;
}

/* === Victory / 通关结算 (复用 gameover 布局 + 绿色胜利色) === */
.victory-content {
    max-height: 92vh;
    overflow-y: auto;
}
.victory-scroll {
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 4px;
}
.victory-title {
    font-family: 'Orbitron', monospace;
    font-size: 2.2em;
    color: #00ff88;
    text-shadow: 0 0 40px rgba(0, 255, 136, 0.6);
    margin-bottom: 6px;
}
.victory-info {
    font-size: 1.15em;
    color: rgba(0, 255, 136, 0.9);
    margin-bottom: 16px;
}
.victory-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 12px;
}

/* === Shop continue row (第 19 关显示无尽按钮) === */
.shop-continue-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin-top: 8px;
}
.shop-endless-btn {
    background: linear-gradient(135deg, #ff00ff 0%, #aa00ff 100%);
    border-color: #ff00ff;
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 0, 255, 0.6);
}
.shop-endless-btn:hover {
    background: linear-gradient(135deg, #ff44ff 0%, #cc44ff 100%);
}

.wave-reached {
    font-size: 1.2em;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 16px;
}

.final-stats p {
    font-size: 1em;
    color: rgba(255, 255, 255, 0.7);
    margin: 4px 0;
}
.final-stats span { color: #00ffff; font-weight: 700; }

.section-label {
    font-family: 'Orbitron', monospace;
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.4);
    margin: 10px 0 6px;
    letter-spacing: 1px;
}

.final-weapons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 8px;
}

.final-weapon {
    font-size: 0.8em;
    background: rgba(0, 255, 255, 0.08);
    border: 1px solid rgba(0, 255, 255, 0.2);
    padding: 3px 10px;
    border-radius: 4px;
    color: #00ffff;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.final-weapon .asset-icon {
    width: 24px;
    height: 24px;
}

.new-unlock-section {
    margin-top: 8px;
}

.new-unlock {
    font-size: 0.9em;
    color: #ffcc00;
    background: rgba(255, 204, 0, 0.1);
    border: 1px solid rgba(255, 204, 0, 0.3);
    padding: 6px 14px;
    border-radius: 6px;
    margin: 4px 0;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease;
}
.new-unlock.show {
    opacity: 1;
    transform: translateY(0);
}

/* === HUD === */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

.hud-top {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

/* 左上角 — 多属性统计（纵向排列） */
.hud-top-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: rgba(0, 0, 0, 0.55);
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    max-width: 55%;
    flex-shrink: 0;
}
/* 占一整行的统计项 */
.hud-stat-full {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    width: 100%;
}
/* 底部升级+宝箱行 */
.hud-stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.hud-stat {
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}
.hud-stat-icon {
    font-size: 0.7em;
    line-height: 1;
}
.hud-stat-value {
    font-family: 'Orbitron', monospace;
    font-size: 0.55em;
    color: rgba(255, 255, 255, 0.85);
}
.hud-stat.levelup-pending {
    animation: pulse-glow 0.6s ease-in-out infinite alternate;
}
.level-display {
    margin-left: 6px;
    color: #00ff88;
    font-weight: 700;
}
@keyframes pulse-glow {
    from { filter: brightness(1); }
    to   { filter: brightness(1.8); }
}

/* 居中区域：关卡 + 倒计时 */
.hud-center {
    display: flex;
    align-items: center;
    gap: 10px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* 右上区域：击杀 + 金币 */
.hud-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* 紧凑型 HP 区域（用于 HUD 内联 HP 条） */
.hud-health-compact {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.health-bar-bg {
    width: 70px;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.health-bar-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ff0044, #ff3366);
    border-radius: 3px;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(255, 0, 68, 0.3);
}

.hud-value {
    font-family: 'Orbitron', monospace;
    font-size: 0.55em;
    color: rgba(255, 255, 255, 0.8);
}
.hud-hp-text {
    color: #ff6666;
    min-width: 50px;
    font-size: 0.52em;
}

/* 紧凑型 XP 区域 */
.hud-xp-compact {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.xp-bar-bg {
    width: 80px;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.xp-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00ffff, #0088ff);
    border-radius: 3px;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.3);
}

.hud-materials {
    font-family: 'Orbitron', monospace;
    font-size: 0.75em;
    color: #ffcc00;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 204, 0, 0.2);
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.hud-timer {
    font-family: 'Orbitron', monospace;
    font-size: 1.2em;
    font-weight: 700;
    color: #00ffff;
    background: rgba(0, 0, 0, 0.7);
    padding: 3px 14px;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.1);
    letter-spacing: 2px;
    transition: all 0.3s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.hud-timer.urgent {
    color: #ffcc00;
    border-color: rgba(255, 204, 0, 0.4);
    text-shadow: 0 0 20px rgba(255, 204, 0, 0.4);
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.15);
    animation: timerPulse 1s ease-in-out infinite;
}
.hud-timer.critical {
    color: #ff0044;
    border-color: rgba(255, 0, 68, 0.5);
    text-shadow: 0 0 25px rgba(255, 0, 68, 0.5);
    box-shadow: 0 0 20px rgba(255, 0, 68, 0.2);
    animation: timerPulse 0.5s ease-in-out infinite;
}
@keyframes timerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 关卡标签（居中区域） */
.hud-level-tag {
    font-family: 'Orbitron', monospace;
    font-size: 0.7em;
    color: rgba(0, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 255, 0.2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    white-space: nowrap;
}

/* 击杀数（右上区域） */
.hud-kills {
    font-family: 'Orbitron', monospace;
    font-size: 0.7em;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    white-space: nowrap;
}

/* 调试信息 */
/* === Debug 调试窗口（可折叠） === */
.hud-debug {
    position: absolute;
    bottom: 4px;
    left: 10px;
    z-index: 100;
    font-family: 'Courier New', monospace;
    font-size: 0.55em;
    min-width: 220px;
    max-width: 320px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(0, 255, 255, 0.15);
    border-radius: 6px;
    overflow: hidden;
    backdrop-filter: blur(2px);
    pointer-events: auto;
    user-select: none;
}
.debug-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    background: rgba(0, 255, 255, 0.08);
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
    cursor: pointer;
}
.debug-title {
    color: rgba(0, 255, 255, 0.7);
    font-weight: 700;
    font-size: 1em;
    letter-spacing: 1px;
}
.debug-toggle {
    color: rgba(0, 255, 255, 0.5);
    font-size: 1.1em;
    line-height: 1;
    transition: transform 0.2s;
}
.hud-debug.collapsed .debug-toggle {
    transform: rotate(-90deg);
}
.debug-body {
    padding: 5px 8px;
    white-space: pre-wrap;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.7);
    max-height: 300px;
    overflow-y: auto;
}
.hud-debug.collapsed .debug-body {
    display: none;
}

/* === 商店（Brotato 风格） === */
.shop-content {
    max-width: 960px;
    width: 960px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px 28px;
    text-align: left;
}

/* 顶栏：角色名 + 标题 + 金币 */
.shop-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.shop-topbar .shop-char {
    font-size: 0.85em;
    color: #00ffff;
    display: flex;
    align-items: center;
    gap: 6px;
}
.shop-topbar .shop-char img { width: 28px; height: 28px; border-radius: 50%; }
.shop-topbar .shop-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.6em;
    color: #ffcc00;
    text-shadow: 0 0 20px rgba(255, 204, 0, 0.3);
    letter-spacing: 1px;
}
.shop-topbar .shop-wave {
    font-size: 0.5em;
    color: rgba(255,255,255,0.35);
    letter-spacing: 0;
    margin-left: 6px;
}
.shop-topbar .shop-mats {
    font-family: 'Orbitron', monospace;
    font-size: 1em;
    color: #ffcc00;
    font-weight: 700;
}

/* 装备武器条 */
.shop-weapon-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 8px 12px;
}
.strip-label {
    font-family: 'Orbitron', monospace;
    font-size: 0.6em;
    color: rgba(255, 255, 255, 0.35);
    white-space: nowrap;
    margin-right: 4px;
}
.equipped-weapons-row {
    display: flex;
    gap: 6px;
    flex: 1;
}
.equipped-weapon-slot {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.25s ease;
}
.equipped-weapon-slot.filled {
    border-color: rgba(255, 100, 0, 0.35);
    background: rgba(255, 100, 0, 0.08);
}
.equipped-weapon-slot.filled:hover {
    border-color: rgba(255, 100, 0, 0.6);
    box-shadow: 0 0 12px rgba(255, 100, 0, 0.15);
}
.equipped-weapon-slot img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    pointer-events: none;
}
.equipped-weapon-slot .slot-tag {
    position: absolute;
    bottom: -4px;
    right: -4px;
    font-size: 0.5em;
    background: rgba(0,0,0,0.8);
    padding: 0 3px;
    border-radius: 2px;
    border: 1px solid currentColor;
    color: rgba(255,255,255,0.5);
}
.equipped-weapon-slot .slot-level {
    position: absolute;
    bottom: -2px;
    left: -2px;
    font-size: 0.45em;
    font-family: 'Orbitron', monospace;
    background: rgba(0,0,0,0.85);
    color: #ffcc00;
    padding: 0 3px;
    border-radius: 2px;
    border: 1px solid rgba(255,204,0,0.3);
    font-weight: 700;
    pointer-events: none;
    z-index: 1;
}
.equipped-weapon-slot .slot-sell {
    position: absolute;
    top: -4px;
    right: -5px;
    font-size: 0.55em;
    color: rgba(255,68,68,0.5);
    cursor: pointer;
    pointer-events: all;
    background: rgba(0,0,0,0.7);
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 2;
    line-height: 1;
}
.equipped-weapon-slot .slot-sell:hover {
    color: #ff4444;
    background: rgba(255,68,68,0.25);
    box-shadow: 0 0 8px rgba(255,68,68,0.4);
}

/* 武器卡操作下拉（卖出/合并） */
.equipped-weapon-slot .slot-actions {
    position: absolute;
    top: -4px;
    right: -5px;
    z-index: 3;
}
.equipped-weapon-slot .slot-dropdown-btn {
    width: 16px;
    height: 16px;
    font-size: 0.55em;
    color: rgba(255,204,0,0.7);
    background: rgba(0,0,0,0.7);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: all 0.2s ease;
}
.equipped-weapon-slot .slot-dropdown-btn:hover {
    color: #ffcc00;
    background: rgba(255,204,0,0.25);
    box-shadow: 0 0 8px rgba(255,204,0,0.4);
}
.equipped-weapon-slot .slot-dropdown-menu {
    position: absolute;
    top: 20px;
    right: -4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: rgba(20,20,30,0.96);
    border: 1px solid rgba(255,204,0,0.3);
    border-radius: 4px;
    padding: 4px;
    min-width: 80px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
    pointer-events: all;
}
.equipped-weapon-slot .slot-dropdown-menu.hidden {
    display: none;
}
.equipped-weapon-slot .slot-dropdown-menu button {
    font-family: 'Rajdhani', 'Microsoft YaHei', sans-serif;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: #fff;
    border-radius: 3px;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.equipped-weapon-slot .slot-dropdown-menu button:hover:not(:disabled) {
    background: rgba(255,204,0,0.18);
    border-color: rgba(255,204,0,0.5);
}
.equipped-weapon-slot .slot-dropdown-menu button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.equipped-weapon-slot .slot-dropdown-menu .slot-action-sell {
    color: #ff8866;
}
.equipped-weapon-slot .slot-dropdown-menu .slot-action-merge {
    color: #88ff88;
}
.equipped-weapon-slot .slot-reroll {
    position: absolute;
    top: -5px;
    left: -5px;
    font-size: 0.5em;
    cursor: pointer;
    pointer-events: all;
    background: rgba(0,0,0,0.7);
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 2;
    line-height: 1;
    color: rgba(255,200,0,0.5);
}
.equipped-weapon-slot .slot-reroll:hover {
    color: #ffcc00;
    background: rgba(255,200,0,0.25);
    box-shadow: 0 0 8px rgba(255,200,0,0.4);
}

/* 词条浮层中的重随提示 */
.weapon-affix-reroll {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.5em;
    color: #ffcc00;
    background: rgba(255,200,0,0.08);
    border: 1px solid rgba(255,200,0,0.15);
    padding: 1px 6px;
    border-radius: 3px;
    margin-bottom: 2px;
    text-align: center;
    width: 100%;
}

.equipped-weapon-slot.merge-source {
    border-color: #ffcc00 !important;
    box-shadow: 0 0 16px rgba(255,204,0,0.4), inset 0 0 12px rgba(255,204,0,0.15) !important;
    animation: mergePulse 1s ease-in-out infinite;
}
.equipped-weapon-slot.merge-target {
    border-color: #00ff88 !important;
    box-shadow: 0 0 12px rgba(0,255,136,0.3), inset 0 0 8px rgba(0,255,136,0.1) !important;
    cursor: pointer;
}
.equipped-weapon-slot.merge-target::after {
    content: '⬇';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6em;
    color: #00ff88;
    opacity: 0.8;
}
@keyframes mergePulse {
    0%, 100% { box-shadow: 0 0 16px rgba(255,204,0,0.4), inset 0 0 12px rgba(255,204,0,0.15); }
    50% { box-shadow: 0 0 24px rgba(255,204,0,0.6), inset 0 0 18px rgba(255,204,0,0.2); }
}
.equipped-weapon-slot.empty {
    border-color: rgba(255, 255, 255, 0.04);
    border-style: dashed;
}
.equipped-weapon-slot.empty::after {
    content: '';
    width: 14px;
    height: 2px;
    background: rgba(255,255,255,0.08);
    border-radius: 1px;
}
.slot-label {
    font-size: 0.45em;
    color: rgba(255, 255, 255, 0.15);
    position: absolute;
    bottom: 1px;
    right: 4px;
}

/* 主区域：左商店 + 右属性（Brotato 风格） */
.shop-main-row {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 12px;
    margin-bottom: 12px;
}

/* 右：属性面板 */
.shop-stats-panel {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 12px;
}
.panel-title {
    font-family: 'Orbitron', monospace;
    font-size: 0.6em;
    color: rgba(0, 255, 255, 0.6);
    margin-bottom: 8px;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
}
.player-stats-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.player-stats-list .stat-item {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 2px 0;
    font-size: 0.7em;
    display: flex;
    align-items: center;
    gap: 5px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.player-stats-list .stat-item:last-child { border-bottom: none; }
.player-stats-list .stat-icon { font-size: 0.9em; width: 18px; text-align: center; }
.player-stats-list .stat-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.4);
    min-width: 28px;
}
.player-stats-list .stat-value {
    font-family: 'Orbitron', monospace;
    font-weight: 600;
    font-size: 0.85em;
    color: #00ffff;
    margin-left: auto;
}
.player-stats-list .stat-value.positive { color: #00ff88; }
.player-stats-list .stat-value.warning { color: #ffcc00; }
.player-stats-list .stat-value.danger { color: #ff4444; }
.player-stats-list .stat-value.at-cap { color: #ff4444; text-shadow: 0 0 8px rgba(255,68,68,0.4); }
/* .player-stats-list .stat-note display moved below */
.player-stats-list .stat-cap-bar { display: none; }
.player-stats-list .stat-xp { font-size: 0.75em; color: rgba(255,255,255,0.25); margin-left: auto; }
.player-stats-list .stat-item-armor { background: transparent; }
.player-stats-list .stat-item-hp { background: rgba(255,0,68,0.06); border-radius: 3px; padding: 2px 4px; }
.player-stats-list .stat-level-row {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* 属性 Tab 分页（按钮在 panel-title 内） */
.stat-tab-btn {
    background: rgba(0, 255, 255, 0.08);
    border: 1px solid rgba(0, 255, 255, 0.15);
    border-radius: 3px;
    color: rgba(0, 255, 255, 0.5);
    font-family: 'Orbitron', monospace;
    font-size: 0.6em;
    padding: 0 6px;
    line-height: 1.6;
    cursor: pointer;
    min-width: 20px;
    text-align: center;
    margin-left: 3px;
    transition: all 0.15s ease;
}
.stat-tab-btn:hover {
    background: rgba(0, 255, 255, 0.15);
    color: rgba(0, 255, 255, 0.8);
}
.stat-tab-btn.active {
    background: rgba(0, 255, 255, 0.2);
    border-color: rgba(0, 255, 255, 0.5);
    color: #00ffff;
}
.stat-tab-body {
    display: flex;
    flex-direction: column;
    min-height: 295px;
}
.stat-tab-page {
    display: none;
    flex-direction: column;
    gap: 3px;
}
.stat-tab-page.active {
    display: flex;
}
.player-stats-list .stat-note {
    font-size: 0.7em;
    color: rgba(255,255,255,0.2);
    margin-left: auto;
    white-space: nowrap;
}

/* 左：商店物品混合网格 */
.shop-items-panel {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 8px 10px;
}
.shop-items-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

/* 混合卡片（武器/道具共用） */
.mixed-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 8px 6px 6px;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.25s ease;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.mixed-card:hover {
    transform: translateY(-2px);
}
.mixed-card.weapon-card {
    border-color: rgba(255, 100, 0, 0.3);
    background: rgba(255, 100, 0, 0.04);
}
.mixed-card.weapon-card:hover {
    border-color: #ff6600;
    box-shadow: 0 4px 16px rgba(255, 100, 0, 0.2);
    background: rgba(255, 100, 0, 0.08);
}
.mixed-card.item-card {
    border-color: rgba(0, 255, 136, 0.2);
    background: rgba(0, 255, 136, 0.03);
}
.mixed-card.item-card:hover {
    border-color: #00ff88;
    box-shadow: 0 4px 16px rgba(0, 255, 136, 0.15);
    background: rgba(0, 255, 136, 0.06);
}
.mixed-card.too-expensive {
    opacity: 0.35;
    cursor: not-allowed;
    filter: grayscale(0.4);
}
.mixed-card.too-expensive:hover {
    transform: none;
    box-shadow: none;
}
.mixed-card.locked-card {
    border-color: #ffcc00 !important;
}
.mixed-card.locked-card:hover {
    box-shadow: 0 4px 16px rgba(255, 204, 0, 0.2);
}

/* 混合卡片内容 */
.mixed-card .mc-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 2px;
    width: 100%;
}
.mixed-card .mc-icon img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.mixed-card .mc-icon .item-placeholder {
    width: 36px;
    height: 36px;
    opacity: 0.4;
}
.mixed-card .mc-type-badge {
    position: absolute;
    top: 3px;
    left: 3px;
    font-size: 0.4em;
    padding: 1px 4px;
    border-radius: 2px;
    font-family: 'Orbitron', monospace;
    letter-spacing: 0.3px;
    line-height: 1.2;
}
.mixed-card.weapon-card .mc-type-badge {
    background: rgba(255, 100, 0, 0.2);
    color: #ff8833;
    border: 1px solid rgba(255, 100, 0, 0.3);
}
.mixed-card.item-card .mc-type-badge {
    background: rgba(0, 255, 136, 0.15);
    color: #00ff88;
    border: 1px solid rgba(0, 255, 136, 0.25);
}

/* 品质边框标签 */
.mixed-card .mc-quality-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    font-size: 0.4em;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid currentColor;
    letter-spacing: 0.3px;
    z-index: 2;
    line-height: 1.2;
}

/* 品质卡片悬浮增强效果 */
.mixed-card.weapon-card:hover {
    transform: translateY(-2px);
}
.mixed-card .mc-name {
    font-family: 'Orbitron', monospace;
    font-size: 0.52em;
    font-weight: 700;
    color: #00ffff;
    text-align: center;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    line-height: 1.3;
}
.mixed-card .mc-tag-row {
    min-height: 1.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin-bottom: 1px;
    width: 100%;
}
.mixed-card .mc-tag {
    display: inline-block;
    font-size: 0.4em;
    padding: 0 3px;
    border-radius: 2px;
    border: 1px solid currentColor;
    opacity: 0.6;
    font-family: 'Orbitron', monospace;
    text-align: center;
    width: fit-content;
    line-height: 1.3;
}
.mixed-card .mc-class-badge {
    display: inline-block;
    font-size: 0.45em;
    padding: 0 3px;
    border-radius: 2px;
    opacity: 0.7;
    margin: 0 auto 1px;
    text-align: center;
    width: fit-content;
    line-height: 1.3;
    background: rgba(255,255,255,0.06);
}
.mixed-card .mc-desc {
    font-size: 0.45em;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    line-height: 1.2;
    margin-bottom: 1px;
    width: 100%;
    height: 1.8em;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
    white-space: pre-line;
}
.mixed-card .mc-stats-grid {
    width: 100%;
    margin-bottom: 1px;
}
.mixed-card .mc-stats-grid .stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 6px;
}
.mixed-card .mc-stats-grid .stats-grid .stat-item {
    font-size: 0.45em;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.04);
    padding: 1px 3px;
    border-radius: 3px;
    text-align: left;
    word-break: break-word;
}
.mixed-card .mc-stats-grid .stats-grid .stat-item b {
    color: #ff8833;
    margin-right: 2px;
}
.mixed-card .mc-price-row {
    text-align: center;
    width: 100%;
    margin-top: auto;
    padding: 2px 0 1px;
}
.mixed-card .mc-price-row .mc-cost {
    font-family: 'Orbitron', monospace;
    font-size: 0.55em;
    color: #ffcc00;
    font-weight: 700;
}
.mixed-card .mc-lock-row {
    text-align: center;
    width: 100%;
    line-height: 1;
}
.mixed-card .mc-lock {
    display: inline-block;
    font-size: 0.45em;
    cursor: pointer;
    pointer-events: all;
    opacity: 0.35;
    transition: all 0.2s ease;
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid transparent;
}
.mixed-card .mc-lock:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}
.mixed-card .mc-lock.locked {
    opacity: 1;
    background: rgba(255, 204, 0, 0.12);
    border-color: rgba(255, 204, 0, 0.3);
}
.mixed-card .mc-lock.locked:hover {
    background: rgba(255, 204, 0, 0.2);
}

/* 适配度进度条 (武器卡片) */
.mc-fit-bar {
    width: 100%;
    height: 3px;
    border-radius: 2px;
    background: rgba(255,255,255,0.08);
    margin: 2px 0 2px;
    overflow: hidden;
    flex-shrink: 0;
}
.mc-fit-bar .mc-fit-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease, background 0.3s ease;
}
/* fit-0 时轨道染淡红色，fill 至少可见一截 */
.mc-fit-bar:has(.fit-0) { background: rgba(255,68,68,0.12); }
.mc-fit-bar .mc-fit-fill.fit-0  { width: 8%;   background: #ff4444; }
.mc-fit-bar .mc-fit-fill.fit-50 { width: 50%;  background: #ffaa00; }
.mc-fit-bar .mc-fit-fill.fit-100{ width: 100%; background: #44cc44; }

/* 适配度进度条 (详情面板) */
.wd-fit-bar {
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.06);
    margin: 6px 0 4px;
    overflow: hidden;
}
.wd-fit-bar .wd-fit-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}
.wd-fit-bar:has(.fit-0) { background: rgba(255,68,68,0.15); }
.wd-fit-bar .wd-fit-fill.fit-0  { width: 8%;   background: #ff4444; }
.wd-fit-bar .wd-fit-fill.fit-50 { width: 50%;  background: #ffaa00; }
.wd-fit-bar .wd-fit-fill.fit-100{ width: 100%; background: #44cc44; }
.wd-fit-label {
    font-size: 0.75em;
    color: rgba(255,255,255,0.5);
    margin-bottom: 2px;
}
.wd-fit-label .fit-0  { color: #ff4444; }
.wd-fit-label .fit-50 { color: #ffaa00; }
.wd-fit-label .fit-100{ color: #44cc44; }

.mixed-card .mc-slots {
    font-size: 0.45em;
    color: #ff8800;
    font-family: 'Orbitron', monospace;
    text-align: center;
}
.mixed-card .mc-owned {
    font-size: 0.4em;
    color: rgba(255,255,255,0.3);
    text-align: center;
    width: 100%;
    line-height: 1.2;
}
.mixed-card .mc-count-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.45em;
    font-family: 'Orbitron', monospace;
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    padding: 0 4px;
    border-radius: 6px;
    border: 1px solid rgba(0, 255, 136, 0.3);
    font-weight: 700;
    z-index: 2;
    line-height: 1.3;
}

/* 右面板刷新区 */
.shop-items-panel .panel-title .refresh-area {
    display: flex;
    align-items: center;
    gap: 4px;
}
.shop-items-panel .refresh-btn {
    font-family: 'Orbitron', monospace;
    font-size: 0.6em;
    padding: 3px 10px;
    border: 1px solid #00ff88;
    background: rgba(0, 255, 136, 0.08);
    color: #00ff88;
    border-radius: 4px;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.25s ease;
    white-space: nowrap;
}
.shop-items-panel .refresh-btn:hover {
    background: rgba(0, 255, 136, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.2);
}
.shop-items-panel .refresh-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.25);
    background: transparent;
}
.shop-items-panel .refresh-btn.disabled:hover {
    background: transparent;
    box-shadow: none;
}

/* 已购道具条 */
.shop-owned-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 6px 10px;
    background: rgba(255, 204, 0, 0.04);
    border: 1px solid rgba(255, 204, 0, 0.1);
    border-radius: 8px;
    min-height: 32px;
}
.owned-label {
    font-family: 'Orbitron', monospace;
    font-size: 0.55em;
    color: rgba(255, 204, 0, 0.5);
    white-space: nowrap;
}
.owned-items-display {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
}
.owned-item-badge {
    font-size: 0.6em;
    background: rgba(0, 255, 136, 0.06);
    border: 1px solid rgba(0, 255, 136, 0.15);
    padding: 2px 8px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    position: relative;
}
.owned-item-badge .asset-icon {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}
.owned-item-count {
    font-family: 'Orbitron', monospace;
    font-size: 0.7em;
    color: #ffcc00;
    font-weight: 700;
    margin-left: 1px;
}

/* 羁绊行 */
.shop-synergy-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 12px;
    padding: 6px 10px;
    background: rgba(0, 255, 255, 0.03);
    border: 1px solid rgba(0, 255, 255, 0.06);
    border-radius: 8px;
    min-height: 30px;
}
.shop-synergy-row:empty {
    display: none;
}
.shop-synergy-item {
    font-family: 'Orbitron', monospace;
    font-size: 0.55em;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 2px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.shop-synergy-item .synergy-icon { font-size: 0.85em; }
.shop-synergy-item .synergy-name { font-weight: 700; }
.shop-synergy-item .synergy-count {
    color: rgba(255, 255, 255, 0.4);
}
.shop-synergy-empty {
    font-size: 0.6em;
    color: rgba(255, 255, 255, 0.2);
    font-style: italic;
}

/* 商店提示条 */
.shop-error {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.92);
    color: #ffcc00;
    padding: 14px 28px;
    border-radius: 8px;
    border: 1px solid rgba(255,204,0,0.4);
    z-index: 1000;
    font-size: 1em;
    font-family: 'Orbitron', monospace;
    box-shadow: 0 0 30px rgba(255,204,0,0.15);
    animation: toastIn 0.3s ease-out;
    pointer-events: none;
    text-align: center;
}
@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, 60%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

/* 空状态提示 */
.owned-empty, .items-empty {
    font-size: 0.65em;
    color: rgba(255, 255, 255, 0.2);
    font-style: italic;
    padding: 4px 0;
}

/* HUD羁绊指示器（移至右上击杀下方） */
.hud-synergies {
    position: absolute;
    top: 52px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    pointer-events: none;
    align-items: flex-end;
}

.hud-synergy-item {
    font-family: 'Orbitron', monospace;
    font-size: 0.6em;
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, 0.5);
}

.hud-synergy-item .synergy-icon { font-size: 0.9em; }
.hud-synergy-item .synergy-count {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85em;
}
.hud-synergy-item .hud-synergy-bonus {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.85em;
    margin-left: auto;
}

/* === 宝箱奖励 === */
.chest-reward-content {
    max-width: 440px;
    width: 440px;
    text-align: center;
    padding: 24px 30px;
    border: 2px solid rgba(255, 204, 0, 0.35);
    background: rgba(12, 12, 35, 0.95);
    border-radius: 16px;
    box-shadow: 0 0 40px rgba(255, 204, 0, 0.1), inset 0 0 30px rgba(255, 204, 0, 0.03);
    animation: chestIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes chestIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}
.chest-reward-title {
    font-family: 'Orbitron', monospace;
    font-size: 2em;
    color: #ffcc00;
    text-shadow: 0 0 30px rgba(255, 204, 0, 0.4);
    margin-bottom: 4px;
}
.chest-reward-info {
    font-size: 0.85em;
    color: rgba(255, 204, 0, 0.5);
    margin-bottom: 16px;
}
.chest-reward-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.chest-reward-choice {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 204, 0, 0.2);
    border-radius: 10px;
    padding: 14px 18px;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 14px;
}
.chest-reward-choice:hover {
    border-color: #ffcc00;
    background: rgba(255, 204, 0, 0.1);
    transform: translateX(8px);
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.2);
}
.chest-reward-choice-icon {
    font-size: 1.6em;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}
.chest-reward-choice-text {
    flex: 1;
}
.chest-reward-choice-name {
    font-family: 'Orbitron', monospace;
    font-size: 0.85em;
    font-weight: 700;
    color: #ffcc00;
    margin-bottom: 2px;
}
.chest-reward-choice-desc {
    font-size: 0.78em;
    color: rgba(255, 255, 255, 0.6);
}

/* === 武器详情 Modal === */
.weapon-detail-content {
    max-width: 460px;
    width: 460px;
    padding: 20px 24px 22px;
    border: 2px solid rgba(120, 200, 255, 0.35);
    background: rgba(10, 16, 30, 0.96);
    border-radius: 14px;
    box-shadow: 0 0 40px rgba(120, 200, 255, 0.12), inset 0 0 30px rgba(120, 200, 255, 0.04);
    animation: wdIn 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #e0e8f0;
}
@keyframes wdIn {
    from { opacity: 0; transform: scale(0.85) translateY(-12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.wd-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(120, 200, 255, 0.18);
    margin-bottom: 14px;
}
.wd-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 10px;
    border: 1px solid rgba(120, 200, 255, 0.25);
    flex-shrink: 0;
}
.wd-icon img {
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
}
.wd-header-text { flex: 1; min-width: 0; }
.wd-name {
    font-family: 'Orbitron', monospace;
    font-size: 1.35em;
    color: #e8f4ff;
    margin: 0 0 4px 0;
    text-shadow: 0 0 12px rgba(120, 200, 255, 0.3);
}
.wd-meta {
    display: flex;
    gap: 10px;
    font-size: 0.85em;
    align-items: center;
}
.wd-quality {
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    font-weight: 600;
    letter-spacing: 0.5px;
}
.wd-level {
    color: #ffd54f;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
}
.wd-close {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ccc;
    font-size: 1.4em;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: all 0.15s;
}
.wd-close:hover {
    background: rgba(255, 80, 80, 0.15);
    border-color: rgba(255, 80, 80, 0.5);
    color: #ff8888;
}
.wd-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
    padding: 8px 0 12px;
    font-size: 0.9em;
}
.wd-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    border-bottom: 1px dashed rgba(120, 200, 255, 0.1);
}
.wd-stat-label { color: rgba(255, 255, 255, 0.6); }
.wd-stat-value { color: #e8f4ff; font-weight: 600; font-family: 'Orbitron', monospace; }
.wd-stat-value.dmg  { color: #ff7a7a; }
.wd-stat-value.cd   { color: #8ed8ff; }
.wd-stat-value.rng  { color: #b8ff9a; }
.wd-stat-value.spd  { color: #ffd54f; }
.wd-stat-value.tag  { color: #d4a5ff; }
.wd-special {
    background: rgba(120, 200, 255, 0.06);
    border-left: 3px solid rgba(120, 200, 255, 0.4);
    padding: 8px 12px;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
    border-radius: 4px;
    margin-bottom: 14px;
    min-height: 32px;
}
.wd-special:empty { display: none; }
.wd-dmg-breakdown {
    background: rgba(255, 200, 100, 0.06);
    border-left: 3px solid rgba(255, 200, 100, 0.3);
    padding: 6px 12px;
    margin: 4px 0 10px;
    border-radius: 4px;
    font-size: 0.78em;
    color: rgba(255, 255, 255, 0.7);
}
.wd-dmg-breakdown-title {
    color: rgba(255, 200, 100, 0.7);
    font-size: 0.9em;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}
.wd-dmg-breakdown-row {
    display: flex;
    justify-content: space-between;
    padding: 1px 0;
    line-height: 1.5;
}
.wd-dmg-breakdown-row .dmg { color: #ff7a7a; }
.wd-dmg-breakdown-total {
    border-top: 1px solid rgba(255, 200, 100, 0.2);
    margin-top: 2px;
    padding-top: 3px;
    font-weight: 600;
    color: #fff;
}
.wd-synergy-block {
    background: rgba(120, 200, 255, 0.04);
    border-left: 3px solid rgba(120, 200, 255, 0.25);
    padding: 6px 12px;
    margin: 4px 0 10px;
    border-radius: 4px;
    font-size: 0.78em;
}
.wd-synergy-title {
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}
.wd-syn-tier {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    line-height: 1.5;
}
.wd-syn-tier.wd-syn-active {
    color: rgba(255, 255, 255, 0.85);
}
.wd-syn-tier.wd-syn-inactive {
    color: rgba(255, 255, 255, 0.3);
}
.wd-syn-tier-label {
    min-width: 2.5em;
    font-weight: 600;
    font-family: 'Orbitron', monospace;
    font-size: 0.85em;
}
.wd-syn-tier-bonus {
    flex: 1;
}
.wd-syn-tier-check {
    color: #44cc44;
    font-weight: 700;
    font-size: 1.1em;
}
.wd-actions {
    display: flex;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(120, 200, 255, 0.15);
}
.wd-btn {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    color: #fff;
}
.wd-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.wd-btn-sell {
    background: rgba(255, 180, 60, 0.15);
    border-color: rgba(255, 180, 60, 0.5);
    color: #ffc266;
}
.wd-btn-sell:not(:disabled):hover {
    background: rgba(255, 180, 60, 0.3);
    border-color: #ffc266;
    transform: translateY(-1px);
}
.wd-btn-merge {
    background: rgba(100, 200, 255, 0.15);
    border-color: rgba(100, 200, 255, 0.5);
    color: #8ed8ff;
}
.wd-btn-merge:not(:disabled):hover {
    background: rgba(100, 200, 255, 0.3);
    border-color: #8ed8ff;
    transform: translateY(-1px);
}
.wd-btn-cancel {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ccc;
}
.wd-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* HUD宝箱计数 */
.hud-chests {
    font-family: 'Orbitron', monospace;
    font-size: 0.9em;
    color: #ffcc00;
    background: rgba(0, 0, 0, 0.6);
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 204, 0, 0.2);
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
    margin-left: 6px;
}

/* === Level Up === */
.levelup-content {
    max-width: 500px;
}

.levelup-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.8em;
    color: #00ff88;
    text-shadow: 0 0 30px rgba(0, 255, 136, 0.4);
    margin-bottom: 4px;
}

.levelup-info {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 16px;
}

.levelup-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.levelup-choice {
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
}
/* Brotato 风格 Tier 颜色 */
.levelup-choice.tier-I  { background: rgba(170,170,170,0.08); border: 1px solid rgba(170,170,170,0.25); }
.levelup-choice.tier-II { background: rgba(79,195,247,0.08); border: 1px solid rgba(79,195,247,0.25); }
.levelup-choice.tier-III { background: rgba(206,147,216,0.08); border: 1px solid rgba(206,147,216,0.25); }
.levelup-choice.tier-IV { background: rgba(255,213,79,0.08); border: 1px solid rgba(255,213,79,0.25); }

.levelup-choice:hover {
    transform: translateX(5px);
}
.levelup-choice.tier-I:hover  { border-color: #aaa;  background: rgba(170,170,170,0.15); box-shadow: 0 0 16px rgba(170,170,170,0.15); }
.levelup-choice.tier-II:hover { border-color: #4fc3f7; background: rgba(79,195,247,0.15); box-shadow: 0 0 16px rgba(79,195,247,0.15); }
.levelup-choice.tier-III:hover { border-color: #ce93d8; background: rgba(206,147,216,0.15); box-shadow: 0 0 16px rgba(206,147,216,0.15); }
.levelup-choice.tier-IV:hover { border-color: #ffd54f; background: rgba(255,213,79,0.15); box-shadow: 0 0 16px rgba(255,213,79,0.15); }

.levelup-choice-name {
    font-family: 'Orbitron', monospace;
    font-size: 0.9em;
    font-weight: 700;
}
.levelup-choice.tier-I  .levelup-choice-name { color: #ccc; }
.levelup-choice.tier-II .levelup-choice-name { color: #4fc3f7; }
.levelup-choice.tier-III .levelup-choice-name { color: #ce93d8; }
.levelup-choice.tier-IV .levelup-choice-name { color: #ffd54f; }

.levelup-choice-desc {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.3;
}

/* 卡牌图标区（左侧） */
.levelup-card-icon-wrap {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.levelup-card-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
}
.levelup-card-emoji {
    font-size: 2.4em;
    line-height: 1;
}

/* 卡牌信息区（右侧 2 行） */
.levelup-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

/* 卡牌头部行（Tier 徽标 + 名称） */
.levelup-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
}
.levelup-card-tier {
    font-family: 'Orbitron', monospace;
    font-size: 0.55em;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    line-height: 1.4;
    flex-shrink: 0;
}
.levelup-choice.tier-I  .levelup-card-tier { color: #aaa; background: rgba(170,170,170,0.15); border: 1px solid rgba(170,170,170,0.3); }
.levelup-choice.tier-II .levelup-card-tier { color: #4fc3f7; background: rgba(79,195,247,0.15); border: 1px solid rgba(79,195,247,0.3); }
.levelup-choice.tier-III .levelup-card-tier { color: #ce93d8; background: rgba(206,147,216,0.15); border: 1px solid rgba(206,147,216,0.3); }
.levelup-choice.tier-IV .levelup-card-tier { color: #ffd54f; background: rgba(255,213,79,0.15); border: 1px solid rgba(255,213,79,0.3); }

/* 重掷按钮 */
.levelup-reroll {
    margin-top: 12px;
    text-align: center;
}
.reroll-btn {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.75em;
    padding: 6px 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    pointer-events: all;
    transition: all 0.2s ease;
}
.reroll-btn:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.3); }
::-webkit-scrollbar-thumb { background: rgba(0, 255, 255, 0.3); border-radius: 2px; }

/* === 武器词条显示（装备栏 + 商店卡片） === */
.weapon-affixes {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: 4px;
    justify-content: center;
    width: 100%;
}

.weapon-affix {
    display: block;
    width: 100%;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.5em;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 255, 255, 0.06);
    border: 1px solid rgba(0, 255, 255, 0.08);
    padding: 1px 6px;
    border-radius: 3px;
    line-height: 1.3;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.weapon-affix:first-child {
    margin-top: 0;
}

/* 词条高亮动画（合并升级时新增/升级提示） */
.weapon-affix-new {
    animation: affixNewPulse 1.2s ease-out;
    box-shadow: 0 0 8px rgba(0, 255, 100, 0.5) !important;
    border-color: rgba(0, 255, 100, 0.5) !important;
}
.weapon-affix-upgraded {
    animation: affixUpgradePulse 1.2s ease-out;
    box-shadow: 0 0 8px rgba(255, 200, 0, 0.5) !important;
    border-color: rgba(255, 200, 0, 0.5) !important;
}
@keyframes affixNewPulse {
    0% { transform: scale(1); box-shadow: 0 0 12px rgba(0, 255, 100, 0.6); border-color: rgba(0, 255, 100, 0.6); }
    40% { transform: scale(1.05); box-shadow: 0 0 24px rgba(0, 255, 100, 0.9); border-color: rgba(0, 255, 100, 0.9); }
    100% { transform: scale(1); box-shadow: 0 0 8px rgba(0, 255, 100, 0.4); border-color: rgba(0, 255, 100, 0.4); }
}
@keyframes affixUpgradePulse {
    0% { transform: scale(1); box-shadow: 0 0 12px rgba(255, 200, 0, 0.5); border-color: rgba(255, 200, 0, 0.5); }
    40% { transform: scale(1.05); box-shadow: 0 0 24px rgba(255, 200, 0, 0.8); border-color: rgba(255, 200, 0, 0.8); }
    100% { transform: scale(1); box-shadow: 0 0 8px rgba(255, 200, 0, 0.4); border-color: rgba(255, 200, 0, 0.4); }
}

/* 词条品质着色 */
.weapon-affix-T1 {
    color: rgba(170, 170, 170, 0.8) !important;
    background: rgba(170, 170, 170, 0.06) !important;
    border-color: rgba(170, 170, 170, 0.15) !important;
}
.weapon-affix-T2 {
    color: rgba(68, 136, 255, 0.9) !important;
    background: rgba(68, 136, 255, 0.08) !important;
    border-color: rgba(68, 136, 255, 0.15) !important;
}
.weapon-affix-T3 {
    color: rgba(170, 68, 255, 0.9) !important;
    background: rgba(170, 68, 255, 0.08) !important;
    border-color: rgba(170, 68, 255, 0.18) !important;
}
.weapon-affix-T4 {
    color: rgba(255, 102, 0, 0.9) !important;
    background: rgba(255, 102, 0, 0.10) !important;
    border-color: rgba(255, 102, 0, 0.20) !important;
    text-shadow: 0 0 6px rgba(255, 102, 0, 0.25);
}

/* 装备栏武器弹出词条（独立于卡片，位置在武器槽下方） */
.equipped-weapon-slot .weapon-affixes {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 160px;
    background: rgba(0, 0, 0, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 4px 8px;
    z-index: 200;
    display: none;
    margin-top: 4px;
}

.equipped-weapon-slot:hover .weapon-affixes {
    display: flex;
}

/* 商店卡片词条提示 */
.mixed-card .weapon-affixes {
    margin: 1px 0;
}

.mixed-card .weapon-affix {
    font-size: 0.42em;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
    padding: 1px 4px;
}

/* === 战斗日志 === */
.combat-log {
    position: fixed;
    right: 12px;
    top: 70px;
    width: 260px;
    max-height: 280px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 55;
    pointer-events: none;
    display: flex;
    flex-direction: column;
}

.combat-log-header {
    font-family: 'Orbitron', monospace;
    font-size: 0.55em;
    color: rgba(255, 255, 255, 0.3);
    padding: 5px 10px 3px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    letter-spacing: 1px;
}

.combat-log-entries {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 2px 6px;
}

.combat-log-entry {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 4px;
    font-size: 0.65em;
    line-height: 1.3;
    opacity: 1;
    transition: opacity 0.5s ease;
    animation: logEntryIn 0.3s ease-out;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.combat-log-entry .log-icon {
    font-size: 0.9em;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.combat-log-entry .log-text {
    font-family: 'Rajdhani', sans-serif;
    color: rgba(255, 255, 255, 0.8);
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes logEntryIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* === 中止界面 (ESC 暂停) === */
.pause-content {
    text-align: center;
    padding: 32px 40px;
    border: 2px solid rgba(255, 200, 80, 0.4);
    background: rgba(10, 16, 30, 0.96);
    border-radius: 14px;
    box-shadow: 0 0 40px rgba(255, 200, 80, 0.12), inset 0 0 30px rgba(255, 200, 80, 0.04);
    max-width: 360px;
    width: 360px;
}
.pause-title {
    font-family: 'Orbitron', monospace;
    color: #ffd54f;
    font-size: 1.8em;
    margin: 0 0 8px;
    text-shadow: 0 0 16px rgba(255, 200, 80, 0.5);
}
.pause-info {
    color: rgba(255, 255, 255, 0.65);
    margin: 0 0 24px;
    font-size: 0.95em;
}
.pause-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}
.pause-actions .cyber-btn {
    width: 100%;
    font-size: 1em;
    padding: 10px 16px;
}
.pause-hint {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8em;
    margin: 0;
}

/* === UI Scale (整体缩放方案, 设计基准 720x960) ===
 * 原理: 所有 overlay 内容容器以 transform: scale(var(--ui-scale))
 * 整体缩放, 保持布局不变.
 * --ui-scale 由 JS (renderer._resize / index.html head) 计算设置.
 */
:root { --ui-scale: 1; }

.overlay {
    overflow: hidden;  /* 防止缩放溢出导致滚动条 */
}

/* 所有 overlay 内容容器参与缩放 */
.menu-content, .shop-content, .levelup-content,
.weapon-detail-content, .chest-reward-content,
.pause-content, .diff-content, .weapon-select-content,
.gameover-content, .victory-content {
    transform-origin: center center;
    transform: scale(var(--ui-scale));
}

/* HUD 非 overlay, 不参与 transform scale, 但窄屏时保留基础字号缩小 */
@media (max-width: 600px) {
    .hud-top-left { max-width: 75%; gap: 2px; padding: 4px 6px; }
    .health-bar-bg { width: 50px; }
    .xp-bar-bg { width: 50px; }
    .hud-timer { font-size: 0.9em; padding: 2px 10px; }
    .hud-level-tag { font-size: 0.55em; padding: 3px 7px; }
    .hud-kills { font-size: 0.55em; padding: 3px 7px; }
    .hud-materials { font-size: 0.55em; padding: 3px 7px; }
}
@media (max-width: 400px) {
    .hud-top-left { max-width: 85%; }
    .health-bar-bg { width: 36px; }
    .xp-bar-bg { width: 36px; }
    .hud-timer { font-size: 0.75em; padding: 1px 8px; }
    .hud-level-tag { font-size: 0.45em; padding: 2px 5px; }
    .hud-kills { font-size: 0.45em; padding: 2px 5px; }
    .hud-materials { font-size: 0.45em; padding: 2px 5px; }
    .combat-log { right: 4px; top: 52px; width: 140px; max-height: 160px; }
}

/* 竖屏模式：保证文字可读 */
@media (orientation: portrait) {
    .health-value { font-size: 1em; }
    .hud-timer { font-size: 1em; padding: 3px 12px; }
    .hud-level-tag, .hud-kills, .hud-materials { font-size: 0.7em; padding: 4px 8px; }
    .hud-top-left { max-width: 80%; gap: 3px; padding: 5px 8px; }
    .health-bar-bg { width: 55px; }
    .xp-bar-bg { width: 55px; }
    .combat-log { font-size: 0.85em; right: 4px; top: 54px; width: 150px; max-height: 180px; }
    .damage-text { font-size: 11px; }
}
