* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0a0a1a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameCanvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

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

#ui-layer > * {
    pointer-events: auto;
}

/* 确保canvas只接收特定按钮的事件 */
#gameCanvas {
    pointer-events: none;
}

.hidden {
    display: none !important;
}

/* ===== 屏幕通用样式 ===== */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 1);
    z-index: 100;
}

.screen h2 {
    color: #fff;
    font-size: 32px;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(255, 100, 50, 0.8);
}

/* ===== 主菜单 ===== */
.game-title {
    color: #ff6b35;
    font-size: 42px;
    font-weight: bold;
    margin-bottom: 50px;
    text-shadow: 
        0 0 10px rgba(255, 107, 53, 0.8),
        0 0 30px rgba(255, 107, 53, 0.5),
        3px 3px 0 #8b2500;
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 200px;
}

.btn-primary, .btn-secondary {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b35, #e85d04);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.btn-primary:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ddd;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.95);
}

.version {
    position: absolute;
    bottom: 20px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
}

/* 主菜单玩家信息 */
#player-info-mini {
    margin-bottom: 20px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mini-coins {
    color: #FFD700;
    font-size: 16px;
    font-weight: bold;
}

/* ===== HUD ===== */
#hud {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 400px;
    padding: 6px 4px;
    z-index: 10;
}

#top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

#health-bar {
    position: relative;
    width: 120px;
    height: 20px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

#health-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #ff4444, #ff6666);
    border-radius: 8px;
    transition: width 0.3s;
}

#health-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

#exp-bar {
    position: relative;
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

#exp-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 4px;
    transition: width 0.3s;
}

#level-text {
    position: absolute;
    top: -18px;
    right: 0;
    color: #4CAF50;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

#score-display {
    color: white;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

#wave-display {
    color: #ff6b35;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    text-align: center;
    margin-bottom: 5px;
}

#skill-slots {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

.skill-slot {
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    position: relative;
}

.skill-slot .level-badge {
    position: absolute;
    bottom: -3px;
    right: -3px;
    background: #ff6b35;
    color: white;
    font-size: 9px;
    padding: 0 3px;
    border-radius: 3px;
}

/* ===== 技能选择 ===== */
#skill-select h2 {
    position: relative;
}

#skill-countdown {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 10px;
    background: rgba(255, 107, 53, 0.3);
    border: 1px solid rgba(255, 107, 53, 0.6);
    border-radius: 8px;
    color: #ff6b35;
    font-size: 20px;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

#skill-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 90vw;
}

.skill-card {
    width: 100px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(0, 0, 0, 0.6));
    border: 2px solid rgba(255, 107, 53, 0.5);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
}

.skill-card:hover, .skill-card:active {
    transform: scale(1.05);
    border-color: #ff6b35;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.3), rgba(0, 0, 0, 0.7));
}

.skill-card .skill-icon {
    font-size: 32px;
    margin-bottom: 5px;
}

.skill-card .skill-name {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 3px;
}

.skill-card .skill-desc {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
}

/* ===== 游戏结束 ===== */
#final-score, #final-wave, #final-kills {
    color: white;
    font-size: 18px;
    margin: 6px 0;
}

/* ===== 大厅 ===== */
.lobby-title {
    color: #ff6b35;
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 40px;
    text-shadow: 0 0 15px rgba(255, 107, 53, 0.6);
}

.lobby-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 220px;
    margin-bottom: 30px;
}

.lobby-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 20px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15), rgba(0, 0, 0, 0.5));
    border: 2px solid rgba(255, 107, 53, 0.4);
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.lobby-btn:hover, .lobby-btn:active {
    transform: scale(1.03);
    border-color: #ff6b35;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.25), rgba(0, 0, 0, 0.6));
}

.lobby-icon {
    font-size: 28px;
}

.lobby-label {
    font-size: 18px;
    font-weight: bold;
}

/* ===== 关卡选择 ===== */
#levels-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 360px;
    max-height: 460px;
    overflow-y: scroll;
    padding: 5px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#levels-list::-webkit-scrollbar {
    display: none;
}

.page-arrow {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.page-arrow:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
}

.page-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.levels-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.levels-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.2s;
}

.levels-dots .dot.active {
    background: #4CAF50;
    transform: scale(1.3);
}

.level-card {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(0, 0, 0, 0.5));
    border: 2px solid rgba(76, 175, 80, 0.5);
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.level-card:hover, .level-card:active {
    transform: scale(1.05);
    border-color: #4CAF50;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3), rgba(0, 0, 0, 0.6));
}

.level-card .level-num {
    font-size: 20px;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 2px;
}

.level-card .level-name {
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 2px;
    line-height: 1.2;
}

.level-card .level-stars {
    font-size: 10px;
    margin: 2px 0;
    letter-spacing: 1px;
}

.level-card .level-status {
    font-size: 9px;
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.2);
    padding: 1px 6px;
    border-radius: 4px;
    display: inline-block;
}

.level-card.locked {
    opacity: 0.4;
    pointer-events: none;
    border-color: rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(100, 100, 100, 0.2), rgba(0, 0, 0, 0.5));
}

.level-card.locked .level-num {
    color: #888;
}

.level-card.locked .level-status {
    color: #888;
    background: rgba(100, 100, 100, 0.2);
}

/* ===== 背包 ===== */
#bag-content {
    width: 280px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 20px;
    gap: 15px;
}

.bag-empty {
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
}

.bag-currency {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}

.currency-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.currency-icon {
    font-size: 20px;
}

.bag-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.bag-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: white;
}

.bag-item-icon {
    font-size: 20px;
}

.bag-item-name {
    flex: 1;
    font-size: 14px;
}

.bag-item-count {
    color: #ff6b35;
    font-weight: bold;
}

/* ===== 主角面板 ===== */
#bag-screen {
    justify-content: flex-start;
    padding-top: 20px;
    padding-bottom: 20px;
    overflow-y: auto;
}

#bag-screen h2 {
    margin-bottom: 15px;
    flex-shrink: 0;
}

#hero-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
    width: 90%;
    max-width: 400px;
    flex-shrink: 0;
}

#hero-info {
    padding: 15px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

#hero-level {
    color: #ff6b35;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 8px;
}

#hero-exp-bar {
    position: relative;
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

#hero-exp-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 4px;
    transition: width 0.3s;
}

#hero-exp-text {
    position: absolute;
    top: -16px;
    right: 0;
    color: #4CAF50;
    font-size: 10px;
}

#hero-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hero-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    color: white;
    font-size: 13px;
}

.stat-icon {
    font-size: 14px;
}

.stat-name {
    color: rgba(255, 255, 255, 0.7);
}

.stat-value {
    margin-left: auto;
    font-weight: bold;
    color: #FFD700;
}

/* 套装效果汇总 */
#hero-set-effects {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#hero-set-effects:empty {
    display: none;
}

.set-effect-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: white;
    margin-bottom: 4px;
}

.set-effect-summary:last-child {
    margin-bottom: 0;
}

.set-effect-icon {
    font-size: 14px;
}

.set-effect-name {
    font-weight: bold;
}

.set-effect-count {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
}

.set-effect-bonuses {
    margin-left: auto;
    font-size: 11px;
    color: #4CAF50;
}

.set-effect-bonuses .inactive {
    color: rgba(255, 255, 255, 0.3);
}

/* 装备槽 */
#equipment-slots {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px;
    justify-content: center;
    width: 100%;
}

.eq-slot {
    padding: 4px 2px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
}

.eq-slot:hover {
    border-color: #ff6b35;
    background: rgba(255, 107, 53, 0.1);
    transform: scale(1.05);
}

.eq-slot:active {
    transform: scale(0.98);
}

.eq-slot-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 9px;
    margin-bottom: 2px;
}

.eq-slot-content {
    color: white;
    font-size: 10px;
    font-weight: bold;
    line-height: 1.3;
}

.eq-slot-content.empty {
    color: rgba(255, 255, 255, 0.3);
}

/* 背包物品 */
#inventory-section {
    width: 90%;
    max-width: 400px;
    margin-bottom: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#batch-dismantle-bar {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 8px;
}

.btn-batch-dismantle {
    padding: 6px 12px;
    background: rgba(255, 68, 68, 0.3);
    border: 1px solid rgba(255, 68, 68, 0.5);
    border-radius: 6px;
    color: #ff6666;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-batch-dismantle:hover {
    background: rgba(255, 68, 68, 0.5);
}

.btn-batch-dismantle:active {
    transform: scale(0.95);
}

.btn-batch-dismantle.btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
}

.btn-batch-dismantle.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 选择模式 */
.inventory-item.selectable {
    position: relative;
    cursor: pointer;
}

.inventory-item.selectable.selected {
    border-color: #ff4444;
    background: rgba(255, 68, 68, 0.15);
}

.inventory-item .select-check {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: transparent;
    transition: all 0.2s;
}

.inventory-item.selectable.selected .select-check {
    border-color: #ff4444;
    background: #ff4444;
    color: white;
}

#inventory-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
    justify-content: center;
}

.inventory-tab {
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
}

.inventory-tab:hover {
    background: rgba(255, 255, 255, 0.1);
}

.inventory-tab.active {
    background: rgba(255, 107, 53, 0.25);
    border-color: rgba(255, 107, 53, 0.6);
    color: #ff6b35;
    font-weight: bold;
}

#inventory-tab-content {
    flex: 1;
    min-height: 80px;
    overflow-y: scroll;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#inventory-tab-content::-webkit-scrollbar {
    display: none;
}

#inventory-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

/* 材料列表 */
.materials-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.material-item {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: default;
}

.material-item .material-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.material-item .material-icon {
    font-size: 20px;
}

.material-item .material-name {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

.material-item .material-count {
    font-weight: bold;
    font-size: 14px;
}

.inventory-item {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.inventory-item:hover {
    border-color: #ff6b35;
    transform: scale(1.05);
}

.inventory-item .item-star {
    color: #FFD700;
    font-size: 10px;
}

.inventory-empty {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    text-align: center;
    width: 100%;
    padding: 20px;
}

/* ===== 技能升级 ===== */
#skills-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 300px;
    max-height: 60vh;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 5px;
}

.skill-upgrade {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: white;
}

.skill-upgrade .skill-icon {
    font-size: 24px;
}

.skill-upgrade .skill-info {
    flex: 1;
}

.skill-upgrade .skill-name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 2px;
}

.skill-upgrade .skill-level {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.skill-upgrade .skill-bonus {
    font-size: 11px;
    color: #4CAF50;
    margin-top: 2px;
}

.skill-upgrade .skill-cost {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

.skill-upgrade .skill-cost.max {
    color: #FFD700;
}

.btn-upgrade {
    padding: 6px 12px;
    background: linear-gradient(135deg, #ff6b35, #e85d04);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
}

.btn-upgrade:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

.skills-resources,
.lobby-resources {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 10px;
    margin-bottom: 12px;
    color: white;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.resource-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    white-space: nowrap;
}

.resource-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
}

.resource-tag.gold {
    color: #FFD700;
}

.resource-tag.skill {
    color: #E040FB;
}

/* ===== 设置 ===== */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 200px;
    padding: 12px;
    margin: 8px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
}

/* ===== 暂停按钮 ===== */
#pause-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 15;
}

/* ===== 倍速按钮 ===== */
#speed-btn {
    position: absolute;
    top: 4px;
    right: 44px;
    width: 44px;
    height: 36px;
    background: rgba(255, 107, 53, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 15;
    transition: all 0.2s;
}

#speed-btn:hover {
    background: rgba(255, 107, 53, 0.8);
}

#speed-btn:active {
    transform: scale(0.95);
}

/* ===== 响应式 ===== */
@media (max-width: 400px) {
    .game-title {
        font-size: 32px;
    }
    
    .screen h2 {
        font-size: 24px;
    }
    
    #health-bar {
        width: 100px;
        height: 18px;
    }
    
    .skill-card {
        width: 90px;
        padding: 10px;
    }
}

/* ===== 关卡结算界面 ===== */
#level-complete {
    background: rgba(0, 0, 0, 0.92);
}

.complete-title {
    color: #FFD700;
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    animation: titlePulse 1.5s ease-in-out infinite;
}

.complete-stars {
    font-size: 48px;
    margin-bottom: 20px;
    letter-spacing: 10px;
}

.complete-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.complete-info div {
    color: white;
    font-size: 16px;
}

.complete-info #complete-level {
    font-size: 20px;
    font-weight: bold;
    color: #ff6b35;
}

.complete-rewards {
    margin-bottom: 25px;
    width: 280px;
}

.complete-rewards h3 {
    color: #FFD700;
    font-size: 18px;
    margin-bottom: 10px;
    text-align: center;
}

.reward-placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

/* ===== 装备强化界面 ===== */
#enhance-screen {
    background: rgba(0, 0, 0, 0.92);
}

#enhance-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    width: 280px;
}

#enhance-item-card {
    padding: 15px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    width: 100%;
    text-align: center;
}

#enhance-stats-compare {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

.enhance-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-size: 14px;
}

.enhance-stat-current {
    color: rgba(255, 255, 255, 0.7);
}

.enhance-arrow {
    color: #4CAF50;
    font-size: 18px;
    font-weight: bold;
}

.enhance-stat-next {
    color: #4CAF50;
    font-weight: bold;
}

#enhance-cost-info {
    width: 100%;
    padding: 12px;
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.enhance-cost-row {
    display: flex;
    justify-content: space-between;
    color: white;
    font-size: 13px;
}

/* ===== 装备操作菜单 ===== */
#item-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    pointer-events: auto;
}

#item-menu-overlay.hidden {
    display: none;
}

#item-menu {
    width: 320px;
    max-width: 95vw;
    max-height: 85vh;
    overflow-y: auto;
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border: 2px solid rgba(255, 107, 53, 0.5);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: menuPopIn 0.2s ease-out;
}

/* 装备对比区域 */
#item-compare-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#item-compare-new,
#item-compare-equipped {
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

#item-compare-equipped {
    border-color: rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
}

#item-compare-equipped.hidden {
    display: none;
}

.compare-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: 1px;
}

#item-compare-vs {
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    color: #ff6b35;
    letter-spacing: 2px;
}

#item-compare-vs.hidden {
    display: none;
}

/* 已装备装备信息（对比用） */
#equipped-menu-header {
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#equipped-menu-name {
    font-size: 14px;
    font-weight: bold;
    color: white;
    margin-bottom: 3px;
}

#equipped-menu-stars {
    font-size: 12px;
    color: #FFD700;
}

#equipped-menu-set-name {
    font-size: 11px;
    font-weight: bold;
    margin-top: 3px;
}

#equipped-menu-stats {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    margin-top: 6px;
}

#equipped-menu-set-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    margin-top: 6px;
}

#equipped-menu-set-info:empty {
    display: none;
}

@keyframes menuPopIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

#item-menu-header {
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#item-menu-name {
    font-size: 16px;
    font-weight: bold;
    color: white;
    margin-bottom: 4px;
}

#item-menu-stars {
    font-size: 14px;
    color: #FFD700;
}

#item-menu-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

#item-menu-set-name {
    font-size: 12px;
    font-weight: bold;
    margin-top: 4px;
}

#item-menu-set-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

#item-menu-set-info:empty {
    display: none;
}

.set-info-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 4px;
}

.set-info-count {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-left: auto;
}

.set-bonus-tier {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    padding: 2px 0;
}

.set-bonus-tier .tier-label {
    padding: 1px 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
}

.set-bonus-tier.active .tier-label {
    background: rgba(76, 175, 80, 0.3);
    color: #4CAF50;
}

.set-bonus-tier.active .tier-desc {
    color: #4CAF50;
}

.set-bonus-tier.inactive {
    opacity: 0.4;
}

.set-bonus-tier.inactive .tier-desc {
    color: rgba(255, 255, 255, 0.5);
}

.item-menu-stat {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: space-between;
}

.item-menu-stat .stat-value {
    color: #FFD700;
}

#item-menu-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-item-action {
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-item-action:hover {
    transform: scale(1.03);
}

.btn-item-action:active {
    transform: scale(0.97);
}

.btn-equip {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.btn-equip:hover {
    background: linear-gradient(135deg, #5cbf60, #4CAF50);
}

.btn-enhance {
    background: linear-gradient(135deg, #FF6B35, #ff8555);
    color: white;
}

.btn-enhance:hover {
    background: linear-gradient(135deg, #ff8555, #FF6B35);
}

.btn-dismantle {
    background: linear-gradient(135deg, #9C27B0, #ba68c8);
    color: white;
}

.btn-dismantle:hover {
    background: linear-gradient(135deg, #ba68c8, #9C27B0);
}

.btn-unequip {
    background: linear-gradient(135deg, #f44336, #e53935);
    color: white;
}

.btn-unequip:hover {
    background: linear-gradient(135deg, #ef5350, #f44336);
}

#btn-item-menu-close {
    margin-top: 4px;
    padding: 8px;
    font-size: 13px;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    20% { opacity: 1; transform: translateX(-50%) translateY(0); }
    80% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* ===== 自定义确认弹窗 ===== */
#custom-confirm {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-confirm-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.custom-confirm-box {
    position: relative;
    width: 300px;
    max-width: 90%;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid rgba(255, 107, 53, 0.4);
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: confirmPopIn 0.2s ease-out;
}

@keyframes confirmPopIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.custom-confirm-title {
    font-size: 18px;
    font-weight: bold;
    color: #ff6b35;
    margin-bottom: 12px;
}

.custom-confirm-message {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin-bottom: 20px;
    white-space: pre-line;
}

.custom-confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.custom-confirm-buttons button {
    flex: 1;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.custom-confirm-buttons .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.custom-confirm-buttons .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.custom-confirm-buttons .btn-primary {
    background: linear-gradient(135deg, #ff6b35, #ff8c5a);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.custom-confirm-buttons .btn-primary:hover {
    background: linear-gradient(135deg, #ff8c5a, #ffaa7a);
    transform: translateY(-1px);
}
