/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #121212;
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 100%;
    padding: 15px;
    margin: 0 auto;
}

/* 头部样式 */
header {
    text-align: center;
    padding: 10px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

header h1 {
    font-size: 24px;
    color: #03a9f4;
    text-shadow: 0 0 10px rgba(3, 169, 244, 0.3);
    margin: 0;
}

/* 用户面板样式 */
.user-panel {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.username {
    font-weight: bold;
    color: #03a9f4;
}

.btn-logout, .btn-login, .btn-register, .btn-account {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-logout {
    background-color: #f44336;
    color: white;
}

.btn-account {
    background-color: #4caf50;
    color: white;
    margin-right: 8px;
}

.btn-login {
    background-color: #03a9f4;
    color: white;
    margin-right: 8px;
}

.btn-register {
    background-color: #4caf50;
    color: white;
}

.btn-logout:hover, .btn-login:hover, .btn-register:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.login-buttons {
    display: flex;
    gap: 10px;
}

/* 标签页导航 */
.tabs {
    margin-bottom: 20px;
}

.tabs ul {
    display: flex;
    list-style: none;
    background-color: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
}

.tabs li {
    flex: 1;
    text-align: center;
    padding: 12px 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 14px;
}

.tabs li.active {
    background-color: #03a9f4;
    color: #fff;
}

.tabs li:hover:not(.active) {
    background-color: #333;
}

/* 内容区域 */
.tab-content {
    display: none;
    background-color: #1e1e1e;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.tab-content.active {
    display: block;
}

/* 实时数据页面头部信息 */
.realtime-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
    padding: 10px 15px;
    background-color: #262626;
    border-radius: 8px;
    border: 1px solid #333;
}

.resolution-info, .update-time, .account-status {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 5px 0;
}

.account-status {
    color: #ff9800;
    font-weight: bold;
}

.time-status {
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
}

.time-status.recent {
    background-color: rgba(0, 200, 0, 0.2);
    color: #4caf50;
}

.time-status.outdated {
    background-color: rgba(200, 0, 0, 0.2);
    color: #f44336;
}

/* 刷新数据区域 */
.refresh-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #1a1a1a;
    border-radius: 8px;
    border: 1px solid #333;
}

.auto-refresh {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-label-small {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    background-color: #444;
    border-radius: 20px;
    transition: all 0.3s;
    cursor: pointer;
}

.toggle-label-small:after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: all 0.3s;
}

input[type="checkbox"]:checked + .toggle-label-small:after {
    left: 22px;
}

input[type="checkbox"]:checked + .toggle-label-small {
    background-color: #03a9f4;
}

/* 武器名称样式 */
.weapon-name {
    font-size: 0.9em;
    color: #ff9800;
    margin-left: 5px;
}

/* 调试信息区域 */
.debug-info {
    margin-top: 20px;
    padding: 10px;
    background-color: #1a1a1a;
    border-radius: 8px;
    border: 1px solid #333;
    overflow-x: auto;
}

.debug-info pre {
    margin: 0;
    color: #03a9f4;
    font-family: monospace;
    font-size: 12px;
}

/* 武器展示区域 */
.weapons-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.weapon-box {
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
    background-color: #262626;
}

.weapon-box h3 {
    color: #03a9f4;
    margin-bottom: 15px;
    text-align: center;
}

.weapon-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.weapon-img-container {
    width: 100%;
    text-align: center;
    background-color: #bbb7b9;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.weapon-img {
    max-width: 100%;
    height: auto;
    max-height: 120px;
    object-fit: contain;
}

.weapon-info {
    width: 100%;
    background-color: #1a1a1a;
    padding: 12px;
    border-radius: 8px;
}

.attachment {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #444;
}

.attachment:last-child {
    border-bottom: none;
}

/* 姿势状态样式 */
.posture-status {
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
    background-color: #262626;
}

.posture-status h3 {
    color: #03a9f4;
    margin-bottom: 15px;
    text-align: center;
}

.status-display {
    display: flex;
    justify-content: space-around;
}

.status-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #444;
    border: 2px solid #333;
}

.status-indicator.active .indicator {
    background-color: #03a9f4;
    box-shadow: 0 0 10px rgba(3, 169, 244, 0.5);
}

/* 设置项目样式 */
.settings-list, .key-settings, .sensitivity-settings {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.setting-item, .key-item, .sensitivity-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    background-color: #262626;
    border-radius: 8px;
}

/* 开关样式 */
.toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    border-radius: 34px;
    transition: .4s;
}

.toggle-label:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
}

.toggle-input:checked + .toggle-label {
    background-color: #03a9f4;
}

.toggle-input:checked + .toggle-label:before {
    transform: translateX(30px);
}

/* 按键输入样式 */
.key-input-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.key-input {
    flex: 1;
    padding: 10px;
    border: 2px solid #444;
    background-color: #333;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
}

.key-code {
    min-width: 70px;
    padding: 5px 10px;
    background-color: #444;
    border-radius: 4px;
    text-align: center;
    font-size: 12px;
}

/* 滑块样式 */
.slider-container {
    position: relative;
}

.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: #444;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #03a9f4;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(3, 169, 244, 0.5);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #03a9f4;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(3, 169, 244, 0.5);
}

.slider-value {
    display: inline-block;
    color: #03a9f4;
    padding: 5px 0;
    width: 50px;
    text-align: center;
}

/* 按钮样式 */
.save-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #03a9f4;
    color: #fff;
}

.btn-secondary {
    background-color: #444;
    color: #fff;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

/* 标题样式 */
.sensitivity-settings h3 {
    color: #03a9f4;
    margin: 10px 0;
    font-size: 18px;
}

/* 响应式调整 */
@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
    
    .weapons-container {
        flex-direction: row;
    }
    
    .weapon-box {
        flex: 1;
    }
    
    .tabs li {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .tabs li {
        font-size: 12px;
        padding: 10px 2px;
    }
    
    header h1 {
        font-size: 20px;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .setting-item, .key-item, .sensitivity-item {
        padding: 10px;
    }
}

/* 添加通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background-color: #333;
    color: white;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification.success {
    background-color: #4caf50;
}

.notification.error {
    background-color: #f44336;
}

.notification.info {
    background-color: #2196f3;
}

/* 调整武器图片样式 */
.weapon-image {
    max-width: 100%;
    height: auto;
    max-height: 120px;
    object-fit: contain;
}

/* 调整刷新按钮样式 */
.debug-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .debug-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .debug-actions .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}