:root {
    --bg-dark: #0a0c10;
    --panel-bg: rgba(20, 25, 35, 0.95);
    --accent: #ff4757;
    --accent-glow: rgba(255, 71, 87, 0.3);
    --text-main: #f1f2f6;
    --text-muted: #a4b0be;
    --border: rgba(255, 255, 255, 0.1);
    --font-zh: 'Noto Sans SC', sans-serif;
}

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

body {
    background: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-zh);
    overflow: hidden;
    cursor: none;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#gameCanvas {
    display: block;
}

/* 顶部状态栏 */
#hud-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    border-bottom: 1px solid var(--border);
    pointer-events: none;
}

.hud-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hud-item.main {
    flex: 0 1 400px;
    align-items: center;
}

.hud-item .label {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.hud-item .value {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-main);
}

.progress-container {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    position: relative;
    margin-top: 5px;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 4px;
    box-shadow: 0 0 10px var(--accent-glow);
    transition: width 0.3s;
}

.progress-container span {
    position: absolute;
    right: 0;
    top: -20px;
    font-size: 14px;
    font-weight: bold;
}

/* 侧边栏通用 */
#weapon-sidebar, #control-sidebar {
    position: absolute;
    top: 100px;
    bottom: 60px;
    width: 280px;
    background: var(--panel-bg);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

#weapon-sidebar { 
    left: 30px; 
    border-radius: 0 12px 12px 0; 
    border-left: 4px solid var(--accent);
}
#control-sidebar { 
    right: 30px; 
    border-radius: 12px 0 0 12px; 
    border-right: 4px solid var(--accent);
}

#weapon-sidebar.collapsed {
    transform: translateX(-260px);
}

#control-sidebar.collapsed {
    transform: translateX(260px);
}

.sidebar-content {
    padding: 25px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* 折叠标签 */
.toggle-tab {
    position: absolute;
    top: 20px;
    width: 30px;
    height: 60px;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 0 10px var(--accent-glow);
    pointer-events: auto;
}

#weapon-sidebar .toggle-tab {
    right: -30px;
    border-radius: 0 8px 8px 0;
}

#control-sidebar .toggle-tab {
    left: -30px;
    border-radius: 8px 0 0 8px;
}

.sidebar-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
}

/* 武器网格 */
.weapon-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.weapon-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: grid;
    grid-template-areas: "icon name" "icon desc";
    grid-template-columns: 40px 1fr;
    gap: 5px 15px;
}

.weapon-item .icon {
    grid-area: icon;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.weapon-item .name {
    grid-area: name;
    font-weight: bold;
    font-size: 15px;
}

.weapon-item .desc {
    grid-area: desc;
    font-size: 11px;
    color: var(--text-muted);
}

.weapon-item:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--accent);
}

.weapon-item.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    box-shadow: inset 0 0 15px var(--accent-glow);
}

/* 控制组件 */
.control-group {
    margin-bottom: 35px;
}

.group-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.interval-options {
    display: flex;
    gap: 8px;
}

.opt-btn {
    flex: 1;
    background: #2d3436;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.opt-btn.active {
    background: var(--accent);
    border-color: var(--accent);
}

.toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input { display: none; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #2d3436;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--accent); }
input:checked + .slider:before { transform: translateX(26px); }

/* 按钮组 */
.button-stack {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.main-btn {
    width: 100%;
    padding: 15px;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.main-btn:hover {
    background: var(--accent);
    color: white;
    box-shadow: 0 5px 15px var(--accent-glow);
}

.performance-info {
    margin-top: 20px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

/* 底部栏 */
#footer-overlay {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.5);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 11px;
    color: var(--text-muted);
    pointer-events: none;
}

/* 自定义光标 */
#cursor {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
}

#cursor .ring {
    width: 40px;
    height: 40px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    animation: ring-pulse 1.5s infinite;
}

#cursor .point {
    position: absolute;
    top: 50%; left: 50%;
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

@keyframes ring-pulse {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0; }
}
