/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    padding: 10px;
    /* 移除padding-left，让主内容区域全屏显示 */
}

.container {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0 auto;
}

/* 悬浮操作面板样式 */
.floating-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 300px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all 0.3s ease;
    overflow: hidden;
}

.floating-panel.collapsed {
    height: 60px;
}

.floating-panel.collapsed .panel-content {
    display: none;
}

.panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: move;
    user-select: none;
    position: relative;
    color: white;
}

.panel-header::before {
    content: "⋮⋮";
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    pointer-events: none;
}

.panel-header h3 {
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.panel-toggle {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.9);
    font-size: 22px;
    color: #2c3e50;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    width: 40px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.panel-toggle:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(255, 255, 255, 1);
    color: #1a252f;
    transform: scale(1.08);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.panel-toggle:active {
    transform: scale(0.95);
    transition: all 0.1s ease;
}

.panel-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.panel-content {
    background: #f8f9fa;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding: 20px;
}

.panel-content::-webkit-scrollbar {
    width: 6px;
}

.panel-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 1. 导航提示区 - 已移除，无需样式 */
/*
.header {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 15px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 13px;
}

.status.connected {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status.disconnected {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.device-name {
    background: #e2e3e5;
    color: #383d41;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 13px;
}
*/

/* 2. 功能操作区 */
.function-area {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    margin: 10px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.function-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.function-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.function-card h3, .function-card h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 悬浮面板内的功能卡片样式 */
.floating-panel .function-card {
    background: rgba(248, 249, 250, 0.8);
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 10px;
    border: 1px solid rgba(233, 236, 239, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.floating-panel .function-card h4 {
    font-size: 14px;
    margin-bottom: 12px;
}

/* 按钮样式 */
.btn {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 3px;
    min-width: 80px;
}

/* 悬浮面板内的按钮样式 */
.floating-panel .btn {
    padding: 6px 10px;
    font-size: 12px;
    margin: 2px;
    min-width: 70px;
}

.floating-panel .button-group {
    gap: 3px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: border-color 0.3s ease;
}

/* 悬浮面板内的表单控件样式 */
.floating-panel .form-control {
    padding: 6px 10px;
    font-size: 13px;
    pointer-events: auto;
    z-index: 1001;
    position: relative;
}

.floating-panel .form-group {
    margin-bottom: 12px;
}

.floating-panel .form-group label {
    font-size: 12px;
    margin-bottom: 4px;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control:disabled {
    background: #e9ecef;
    cursor: not-allowed;
}

/* 数据显示 */
.data-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

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

.data-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

.data-item span:last-child {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

/* 统计信息 */
.statistics-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 13px;
    color: #6c757d;
}

.stat-item span:last-child {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
}

/* 键盘快捷键 */
.keyboard-shortcuts {
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
}

.keyboard-shortcuts h4 {
    font-size: 14px;
    color: #495057;
    margin-bottom: 8px;
}

.keyboard-shortcuts ul {
    list-style: none;
    padding: 0;
}

.keyboard-shortcuts li {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 4px;
}

kbd {
    background: #e9ecef;
    border: 1px solid #adb5bd;
    border-radius: 3px;
    padding: 2px 4px;
    font-family: monospace;
    font-size: 11px;
}

/* 3. 图形显示区 */
.display-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 10px 0;
    min-height: 400px;
}

.chart-section,
.three-d-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.chart-section h3,
.three-d-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 图表容器 */
.charts-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chart-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.chart-item h4 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
}

.chart-item canvas {
    width: 100%;
    height: 300px;
    max-height: 300px;
}

/* 3D容器 */
.three-d-container {
    height: 700px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
    position: relative;
    overflow: hidden;
}

/* 错误提示 */
.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #dc3545;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    font-size: 14px;
}

/* 加载提示 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-text {
    color: white;
    font-size: 16px;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 15px;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-close:hover {
    color: #000;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.device-list {
    margin: 20px 0;
    max-height: 300px;
    overflow-y: auto;
}

.device-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin: 5px 0;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.device-item:hover {
    background: #e9ecef;
}

.device-item.selected {
    background: #667eea;
    color: white;
}
