/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    position: fixed;
    background: #000;
}

/* 视频背景层 */
#video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: #1a1a1a;
}

#video-stream {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#video-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
}

#video-placeholder p {
    font-size: 24px;
    margin-bottom: 10px;
}

#video-placeholder small {
    font-size: 14px;
}

/* 控制层 */
#control-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

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

/* 顶部状态栏 - 紧凑显示，移除模糊效果提升性能 */
#status-bar {
    position: absolute;
    top: 10px;
    left: 10px;
    height: auto;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    color: #fff;
    font-size: 12px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 3px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background: #4CAF50;
    box-shadow: 0 0 8px #4CAF50;
}

.status-dot.offline {
    background: #f44336;
}

.icon {
    font-size: 14px;
}

/* 右上角控制按钮 - 竖向排列 */
#top-right-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

.control-button-small {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.control-button-small:active {
    background: rgba(76, 175, 80, 0.8);
}

.control-button-small .icon {
    font-size: 20px;
}

/* 摇杆容器 - 缩小尺寸，半透明，方便看画面 */
.joystick-container {
    position: absolute;
    bottom: 80px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    opacity: 0.6;
    will-change: opacity;
}

.joystick-container:active {
    opacity: 0.9;
}

.joystick-container.left {
    left: 20px;
}

.joystick-container.right {
    right: 20px;
}

.joystick-label {
    display: none;
}

/* 摇杆 */
.joystick {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* 摇杆底座 - 圆形设计，缩小尺寸，半透明 */
.joystick-base {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.08));
    border: 2px solid rgba(255, 255, 255, 0.25);
    position: relative;
    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.3),
        inset 0 1px 5px rgba(0, 0, 0, 0.2);
}

/* 方向指示线 */
.joystick-base::before,
.joystick-base::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
}

/* 垂直线（上下指示） */
.joystick-container.left .joystick-base::before {
    width: 3px;
    height: 80px;
    left: 50%;
    top: 15px;
    transform: translateX(-50%);
}

.joystick-container.left .joystick-base::after {
    width: 3px;
    height: 80px;
    left: 50%;
    bottom: 15px;
    transform: translateX(-50%);
}

/* 水平线（左右指示） */
.joystick-container.right .joystick-base::before {
    width: 80px;
    height: 3px;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
}

.joystick-container.right .joystick-base::after {
    width: 80px;
    height: 3px;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
}

/* 方向箭头 */
.joystick-base .direction-indicator {
    display: none;
}

/* 摇杆手柄 - 圆形设计，缩小尺寸 */
.joystick-stick {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(76, 175, 80, 0.8), rgba(45, 122, 47, 0.8));
    border: 3px solid rgba(255, 255, 255, 0.6);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.4),
        inset 0 -1px 3px rgba(0, 0, 0, 0.2),
        inset 0 1px 3px rgba(255, 255, 255, 0.2);
    z-index: 10;
    cursor: grab;
    will-change: transform;
}

.joystick-stick:active {
    cursor: grabbing;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.8),
        inset 0 -2px 5px rgba(0, 0, 0, 0.4),
        inset 0 2px 5px rgba(255, 255, 255, 0.2);
}

/* 摇杆中心点 */
.joystick-stick::before {
    content: '';
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.joystick-value {
    display: none;
}

/* 底部控制按钮 */
#bottom-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    align-items: center;
}

.control-button {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 12px 20px;
    color: #fff;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.control-button:active {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0.95);
}

.control-button.small {
    padding: 12px;
    font-size: 20px;
}

/* GPS信息面板 */
.info-panel {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 10px 15px;
    color: #fff;
    font-size: 12px;
}

.info-item {
    display: flex;
    gap: 5px;
    margin: 3px 0;
}

.info-item .label {
    color: #aaa;
}

/* 设置面板 */
#settings-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

#settings-panel.hidden {
    display: none;
}

.panel-content {
    background: #2a2a2a;
    border-radius: 15px;
    padding: 25px;
    width: 90%;
    max-width: 400px;
    color: #fff;
}

.panel-content h2 {
    margin-bottom: 20px;
    text-align: center;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    color: #ccc;
    font-size: 14px;
}

.setting-group input[type="text"],
.setting-group select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #444;
    background: #1a1a1a;
    color: #fff;
    font-size: 16px;
}

.setting-group input[type="range"] {
    width: calc(100% - 60px);
    margin-right: 10px;
}

.setting-group .checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 5px;
}

.setting-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.setting-group small {
    display: block;
    color: #888;
    font-size: 12px;
    margin-top: 5px;
}

/* 单选按钮组样式 */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.radio-label:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4CAF50;
}

.radio-label span {
    font-size: 14px;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #4CAF50;
    color: #fff;
}

.btn-primary:active {
    background: #45a049;
}

.btn-secondary {
    background: #666;
    color: #fff;
}

.btn-secondary:active {
    background: #555;
}

/* 响应式调整 - 移动设备上保持紧凑 */
@media (max-width: 768px) {
    .joystick-base {
        width: 160px;
        height: 160px;
    }

    .joystick-stick {
        width: 65px;
        height: 65px;
    }

    .joystick-container {
        bottom: 60px;
    }

    .joystick-container.left {
        left: 15px;
    }

    .joystick-container.right {
        right: 15px;
    }

    #status-bar {
        font-size: 11px;
        padding: 5px 10px;
        gap: 6px;
    }

    .control-button-small {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

@media (max-height: 600px) {
    .joystick-base {
        width: 140px;
        height: 140px;
    }

    .joystick-stick {
        width: 55px;
        height: 55px;
    }

    .joystick-container {
        bottom: 50px;
    }

    .joystick-container.left {
        left: 10px;
    }

    .joystick-container.right {
        right: 10px;
    }

    .control-button-small {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

