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

html {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    height: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

:root {
    --primary-color: #4fc3f7;
    --primary-dark: #0288d1;
    --secondary-color: #66bb6a;
    --danger-color: #ef5350;
    --warning-color: #ff9800;
    --dark-bg: #0a0e1a;
    --dark-surface: #131b2e;
    --dark-card: #1a2332;
    --dark-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    --glow-primary: rgba(79, 195, 247, 0.3);
    --glow-secondary: rgba(102, 187, 106, 0.3);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.35s ease;
    
    /* 深色主题 */
    --card-blue: #0f1d2f;
    --card-blue-hover: #152740;
    --card-blue-border: rgba(79, 195, 247, 0.15);
    --switch-green: #4fc3f7;
    
    /* 雷达网格规范 */
    --grid-cols: 20;
    --grid-rows: 14;
    --cell-size: 0.5; /* 米 */
}

/* 主布局容器 */
.main-container {
    min-height: 100vh;
    position: relative;
    width: 100%;
    padding-right: 0;
    transition: padding-right var(--transition-normal);
}

.main-container.log-open {
    padding-right: 320px;
}

/* 左侧主功能区域 */
.left-panel {
    padding: 16px;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    position: relative;
}

/* 大模块区域 */
.module-section {
    display: flex;
    flex-direction: column;
    gap: 0;
    animation: moduleFadeIn 0.3s ease;
}

@keyframes moduleFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 右侧日志区域 */
.right-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: var(--dark-surface);
    border-left: 1px solid var(--dark-border);
    overflow: hidden;
    transition: width var(--transition-normal);
    z-index: 100;
}

.right-panel .log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--dark-border);
}

.right-panel .log-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.right-panel .log-close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.right-panel .log-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* 日志工具栏 */
.right-panel .log-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--dark-border);
    background: rgba(0, 0, 0, 0.2);
}

.right-panel .log-tool-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--dark-border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.right-panel .log-tool-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.right-panel .log-auto-clear {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
}

.right-panel .log-auto-clear input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.right-panel .log-content {
    padding: 16px;
    height: calc(100% - 110px);
    overflow-y: auto;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* 日志项样式 */
.log-item {
    display: flex;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--dark-border);
    font-size: 12px;
}

.log-time {
    color: var(--text-muted);
    font-family: monospace;
    flex-shrink: 0;
}

.log-type {
    flex-shrink: 0;
    font-weight: 500;
    font-size: 11px;
}

.log-type-system { color: #4fc3f7; }
.log-type-function { color: #66bb6a; }
.log-type-interaction { color: #ffb74d; }
.log-type-server { color: #ce93d8; }
.log-type-recognition { color: #ff7043; }
.log-type-cloud { color: #81c784; }
.log-type-default { color: var(--text-secondary); }
.log-type-mqtt { color: #4fc3f7; }

.log-message {
    color: var(--text-secondary);
    flex: 1;
    word-break: break-word;
}

/* MQTT日志项样式 */
.log-item-mqtt {
    flex-direction: column;
    gap: 4px;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(79, 195, 247, 0.3);
    background: rgba(79, 195, 247, 0.05);
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.log-item-mqtt .log-topic {
    color: #81c784;
    font-family: monospace;
    font-size: 11px;
    word-break: break-all;
}

.log-item-mqtt .log-message {
    color: #b0bec5;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    white-space: pre-wrap;
    word-break: break-all;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px;
    border-radius: 3px;
    overflow: hidden;
}

/* 原始消息日志项样式 */
.log-item-raw {
    padding: 6px 0;
}

.log-item-raw .log-message {
    color: #90a4ae;
    font-size: 12px;
}

/* 日志滚动条样式 */
.log-content::-webkit-scrollbar,
.log-item-mqtt .log-message::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.log-content::-webkit-scrollbar-track,
.log-item-mqtt .log-message::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.log-content::-webkit-scrollbar-thumb,
.log-item-mqtt .log-message::-webkit-scrollbar-thumb {
    background: rgba(79, 195, 247, 0.3);
    border-radius: 3px;
}

.log-content::-webkit-scrollbar-thumb:hover,
.log-item-mqtt .log-message::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 195, 247, 0.5);
}

/* 日志开关按钮 */
.log-toggle-bar {
    margin-bottom: 16px;
}

.log-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--dark-border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.log-toggle-btn:hover {
    background: rgba(79, 195, 247, 0.1);
    border-color: rgba(79, 195, 247, 0.3);
    color: var(--primary-color);
}

/* 顶部状态栏 */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin-bottom: 8px;
}

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

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

.status-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

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

/* 线控器选择器 */
.gateway-list-link {
    color: var(--primary-color);
    font-size: 13px;
    margin-right: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.gateway-list-link:hover {
    color: #81d4fa;
    text-decoration: underline;
}

.gateway-selector {
    min-width: 120px;
}

.gateway-selector .layui-form-select {
    width: 100%;
}

.gateway-selector .layui-form-select .layui-select-title {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--dark-border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    height: 32px;
    line-height: 32px;
}

.gateway-selector .layui-form-select .layui-input {
    padding-left: 10px;
    padding-right: 24px;
}

.gateway-selector .layui-form-select dl {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    max-height: 400px !important;
    overflow-y: auto !important;
}

.gateway-selector .layui-form-select dl dd {
    color: var(--text-primary);
    padding: 4px 12px !important;
    line-height: 24px !important;
    height: auto !important;
    min-height: 24px !important;
}

.gateway-selector .layui-form-select dl dd:hover {
    background: rgba(79, 195, 247, 0.2);
}

/* 控制器开关 */
.controller-switch {
    margin: 0;
}

/* Layui Switch 开关组件样式 - 柔和青色主题 */
.layui-form .layui-form-switch {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    background-color: rgba(255, 255, 255, 0.12) !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 0 !important;
    width: 60px !important;
    height: 24px !important;
    cursor: pointer !important;
    overflow: hidden !important;
    position: relative !important;
    display: block !important;
    vertical-align: middle !important;
}

.layui-form .layui-form-switch em {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    line-height: 24px !important;
    font-size: 12px !important;
    color: rgba(255, 255, 255, 0.7) !important;
    transition: color 0.25s ease !important;
    white-space: nowrap !important;
    width: auto !important;
}

.layui-form .layui-form-switch em:first-child {
    left: 26px !important;
    right: 5px !important;
    text-align: right !important;
}

.layui-form .layui-form-switch em:last-child {
    left: 5px !important;
    right: 26px !important;
    text-align: left !important;
}

.layui-form .layui-form-onswitch em:first-child {
    color: #fff !important;
}

.layui-form .layui-form-onswitch em:last-child {
    color: rgba(255, 255, 255, 0.4) !important;
}

.layui-form .layui-form-switch i {
    display: block !important;
    background-color: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25) !important;
    border-radius: 50% !important;
    width: 20px !important;
    height: 20px !important;
    position: absolute !important;
    top: 2px !important;
    left: 2px !important;
    transition: left 0.25s ease !important;
    margin: 0 !important;
    transform: none !important;
    z-index: 2 !important;
}

.layui-form .layui-form-onswitch {
    background-color: rgba(79, 195, 247, 0.35) !important;
    border-color: rgba(79, 195, 247, 0.5) !important;
    box-shadow: 0 0 8px rgba(79, 195, 247, 0.3) !important;
}

.layui-form .layui-form-onswitch i {
    background-color: #4fc3f7 !important;
    left: 38px !important;
    box-shadow: 0 2px 8px rgba(79, 195, 247, 0.5) !important;
}

/* Layui Layer 弹窗样式修复 */
.layui-layer {
    background: rgba(26, 35, 50, 0.95) !important;
    border: 1px solid rgba(79, 195, 247, 0.2) !important;
    border-radius: 10px !important;
}

.layui-layer-title {
    background: rgba(30, 58, 95, 0.8) !important;
    color: #ffffff !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    position: relative !important;
}

.layui-layer-content {
    color: #ffffff !important;
}

.layui-layer-btn {
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.layui-layer-btn a {
    background: rgba(79, 195, 247, 0.2) !important;
    color: #4fc3f7 !important;
    border: 1px solid rgba(79, 195, 247, 0.3) !important;
    border-radius: 4px !important;
}

.layui-layer-btn a:hover {
    background: rgba(79, 195, 247, 0.3) !important;
}

.layui-layer-btn .layui-layer-btn0 {
    background: #4fc3f7 !important;
    color: #ffffff !important;
    border-color: #4fc3f7 !important;
}

.layui-layer-btn .layui-layer-btn0:hover {
    background: #0288d1 !important;
    border-color: #0288d1 !important;
}

/* msg提示框样式修复 */
.layui-layer-msg {
    background: rgba(26, 35, 50, 0.95) !important;
    border: 1px solid rgba(79, 195, 247, 0.2) !important;
    color: #ffffff !important;
}

.layui-layer-msg .layui-layer-content {
    color: #ffffff !important;
}

/* Layui Select 下拉框样式 */
.layui-form-select {
    width: 100%;
    border: none !important;
    outline: none !important;
    background: transparent !important;
}

.layui-form-select .layui-select-title {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px !important;
    color: #ffffff !important;
    font-size: 13px !important;
    height: 32px !important;
    line-height: 32px !important;
    box-shadow: none !important;
    outline: none !important;
    background-image: none !important;
}

.layui-form-select .layui-select-title:hover {
    border-color: rgba(79, 195, 247, 0.4) !important;
}

.layui-form-select .layui-select-title .layui-edge {
    border-color: rgba(255, 255, 255, 0.6) !important;
    border-top-color: transparent !important;
    border-left-color: transparent !important;
    border-right-color: transparent !important;
    border-bottom-color: rgba(255, 255, 255, 0.6) !important;
    border-width: 5px !important;
    border-style: solid !important;
    width: 0 !important;
    height: 0 !important;
    margin-top: -2px !important;
}

.layui-form-select .layui-input {
    padding-left: 10px !important;
    padding-right: 24px !important;
    background: transparent !important;
    color: #ffffff !important;
    border: none !important;
    outline: none !important;
}

.layui-form-select dl {
    background: #0f1d2f !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    color: #ffffff !important;
    overflow: hidden !important;
    max-height: 400px !important;
    overflow-y: auto !important;
}

.layui-form-select dl dt {
    background: #0f1d2f !important;
    color: #ffffff !important;
    padding: 6px 12px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.layui-form-select dl dd {
    color: #ffffff !important;
    padding: 4px 12px !important;
    background: #0f1d2f !important;
    line-height: 24px !important;
    height: auto !important;
    min-height: 24px !important;
}

.layui-form-select dl dd:hover {
    background: rgba(79, 195, 247, 0.2) !important;
    color: #ffffff !important;
}

.layui-form-select dl dd.layui-select-tips {
    color: rgba(255, 255, 255, 0.5) !important;
}

.layui-form-select dl dd.layui-this {
    background: rgba(79, 195, 247, 0.3) !important;
    color: #ffffff !important;
}

/* Layui Button 按钮样式 */
.layui-btn {
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 10px 20px !important;
    border: none !important;
    transition: all var(--transition-fast) !important;
    line-height: 1.4 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    user-select: none !important;
}

.layui-btn:active {
    transform: scale(0.96) !important;
}

.layui-btn[disabled],
.layui-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.layui-btn-primary {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.layui-btn-primary:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.layui-btn-primary:active {
    background: rgba(255, 255, 255, 0.1) !important;
}

.layui-btn-danger {
    background: var(--danger-color) !important;
    color: #fff !important;
}

.layui-btn-danger:hover {
    background: #e53935 !important;
}

.layui-btn-danger:active {
    background: #c62828 !important;
}

.layui-btn-warm {
    background: var(--warning-color) !important;
    color: #fff !important;
}

.layui-btn-warm:hover {
    background: #f57c00 !important;
}

.layui-btn-warm:active {
    background: #e65100 !important;
}

.layui-btn-normal {
    background: var(--primary-color) !important;
    color: #fff !important;
}

.layui-btn-normal:hover {
    background: #0288d1 !important;
}

.layui-btn-normal:active {
    background: #01579b !important;
}

.layui-btn-xs {
    padding: 4px 10px !important;
    font-size: 12px !important;
    height: 24px !important;
    line-height: 24px !important;
    min-width: 48px;
}

.layui-btn-sm {
    padding: 6px 14px !important;
    font-size: 13px !important;
    height: 28px !important;
    line-height: 28px !important;
}

.layui-btn-lg {
    padding: 12px 24px !important;
    font-size: 15px !important;
    height: 44px !important;
    line-height: 44px !important;
}

.layui-btn-group .layui-btn {
    margin-left: -1px !important;
    border-radius: 0 !important;
}

.layui-btn-group .layui-btn:first-child {
    border-radius: 8px 0 0 8px !important;
}

.layui-btn-group .layui-btn:last-child {
    border-radius: 0 8px 8px 0 !important;
}

/* 自定义按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
    line-height: 1.4;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: scale(0.96);
}

.btn[disabled],
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background: #0288d1;
    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.3);
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-danger {
    background: var(--danger-color);
    color: #fff;
}

.btn-danger:hover {
    background: #e53935;
    box-shadow: 0 4px 12px rgba(239, 83, 80, 0.3);
}

.btn-warning {
    background: var(--warning-color);
    color: #fff;
}

.btn-warning:hover {
    background: #f57c00;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    height: 28px;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 12px;
    height: 24px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
    height: 44px;
}

/* 图标样式统一 */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.icon:hover {
    color: var(--text-primary);
}

.icon-primary {
    color: var(--primary-color);
}

.icon-secondary {
    color: var(--secondary-color);
}

.icon-danger {
    color: var(--danger-color);
}

.icon-warning {
    color: var(--warning-color);
}

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

.icon-xs {
    font-size: 12px;
}

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

.icon-xl {
    font-size: 24px;
}
.layui-form-checkbox {
    padding-right: 24px !important;
}

.layui-form-checkbox i {
    width: 18px !important;
    height: 18px !important;
    border-radius: 4px !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.layui-form-checked i {
    background: var(--switch-green) !important;
    border-color: var(--switch-green) !important;
}

.layui-form-checkbox:hover i {
    border-color: var(--switch-green) !important;
}

/* 雷达网格区域 */
.radar-grid-section {
    margin-bottom: 16px;
}

.grid-container {
    position: relative;
    aspect-ratio: 20/14;
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.05) 0%, rgba(2, 136, 209, 0.05) 100%);
    border-radius: 12px;
    border: 2px solid rgba(79, 195, 247, 0.2);
    overflow: hidden;
    touch-action: none;
    margin-bottom: 8px;
    /* 14行×18列的网格布局（左右各9个格子）
       每个网格单元 0.5m×0.5m（实际宽度由容器决定，比例固定） */
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% + 1px);
    height: calc(100% + 1px);
    background-image: 
        linear-gradient(rgba(79, 195, 247, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 195, 247, 0.15) 1px, transparent 1px);
    background-size: calc(100% / 20) calc(100% / 14);
    pointer-events: none;
}

/* 顶部横向网格线（细化） */
.grid-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(79, 195, 247, 0.3);
}

/* 中间纵向网格线（细化） */
.grid-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 100%;
    background: rgba(79, 195, 247, 0.3);
}

/* 坐标轴指示（已隐藏） */
.grid-coord-axis {
    display: none;
}

/* 网格交点标记 */
.grid-intersection-marker {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ffeb3b;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    box-shadow: 0 0 10px #ffeb3b, 0 0 20px #ffeb3b;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.grid-intersection-marker.visible {
    opacity: 1;
}

/* 设置模块标题栏 */
.setting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--card-blue);
    border: 1px solid var(--card-blue-border);
    border-radius: 10px 10px 0 0;
    gap: 12px;
    border-bottom: none;
    margin-bottom: -1px;
    position: relative;
    z-index: 1;
}

.setting-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.setting-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
}

.setting-actions .scene-type-selector {
    margin: 0;
    width: 160px;
    height: 32px;
}

.setting-actions .layui-form-select {
    width: 100%;
    margin: 0;
    height: 32px;
}

.setting-actions .layui-form-select .layui-select-title {
    height: 32px !important;
    line-height: 32px !important;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--dark-border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    padding-left: 10px;
}

.setting-actions .layui-form-select dl {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
}

.setting-actions .layui-form-select dl dd {
    color: var(--text-primary);
}

.setting-actions .add-btn {
    height: 32px;
    line-height: 32px;
    padding: 0 14px;
    font-size: 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.setting-actions .add-btn i {
    font-size: 12px;
    margin-right: 2px;
}

/* 刷新按钮：与 add-btn 视觉风格统一 */
.refresh-btn {
    height: 32px;
    line-height: 32px;
    padding: 0 14px;
    font-size: 12px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}
.refresh-btn i {
    font-size: 13px;
}
/* 首页顶部 control-item-row 中的刷新按钮：与开关行对齐 */
.control-item-row .refresh-btn {
    height: 30px;
    line-height: 30px;
    padding: 0 12px;
}
/* 禁用态：视觉区分（半透明 + 禁止光标），保留点击以触发提示 */
.refresh-btn.refresh-btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: auto;
}
/* 加载态：图标旋转动画，防止重复点击 */
.refresh-btn.refresh-btn-loading i {
    animation: refresh-spin 0.8s linear infinite;
}
.refresh-btn.refresh-btn-loading {
    opacity: 0.75;
    pointer-events: none;
}
@keyframes refresh-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 区域列表容器 */
.zone-list-wrapper {
    background: var(--card-blue);
    border: 1px solid var(--card-blue-border);
    border-radius: 0 0 10px 10px;
    border-top: 1px solid var(--card-blue-border);
    padding: 10px 16px;
    margin-top: 0;
    position: relative;
}

.zone-list-wrapper .empty-tip {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    padding: 12px 0;
}

/* 底部操作区 */
.bottom-actions {
    padding-top: 12px;
}

.back-main-btn {
    background: rgba(79, 195, 247, 0.15);
    border: 1px solid rgba(79, 195, 247, 0.3);
    color: #4fc3f7;
    font-size: 14px;
    font-weight: 500;
    height: 40px;
    line-height: 40px;
    border-radius: 8px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.back-main-btn:hover {
    background: rgba(79, 195, 247, 0.25);
    border-color: rgba(79, 195, 247, 0.5);
    color: #81d4fa;
}

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

/* 空调挂墙示意图 */
.air-outlet {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

.air-outlet .outlet-body {
    width: 80px;
    height: 24px;
    background: linear-gradient(180deg, rgba(100, 100, 100, 0.9) 0%, rgba(60, 60, 60, 0.9) 100%);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 风效果 */
.wind-effect {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 100px;
    background: linear-gradient(180deg, rgba(79, 195, 247, 0.4) 0%, transparent 100%);
    border-radius: 50% 50% 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wind-effect.active {
    opacity: 1;
    animation: windFlow 1s ease-in-out infinite;
}

@keyframes windFlow {
    0%, 100% { transform: translateX(-50%) scaleY(1); }
    50% { transform: translateX(-50%) scaleY(1.2); }
}

/* 人员标记容器 */
.person-markers-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    pointer-events: none;
}

/* 人员标记 */
.person-marker {
    position: absolute;
    z-index: 20;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
}

.marker-dot-container {
    position: relative;
    width: 24px;
    height: 24px;
}

.marker-dot {
    width: 24px;
    height: 24px;
    background: var(--secondary-color);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--glow-secondary);
}

.marker-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: 900;
    color: #fff;
    text-shadow: 
        0 0 3px rgba(0, 0, 0, 0.8),
        0 0 6px rgba(0, 0, 0, 0.6),
        0 1px 3px rgba(0, 0, 0, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.5px;
}

.marker-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background: var(--secondary-color);
    border-radius: 50%;
    animation: markerPulse 2s ease-out infinite;
}

.marker-label {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: var(--secondary-color);
    background: var(--dark-card);
    padding: 2px 6px;
    border-radius: 8px;
    white-space: nowrap;
}

@keyframes markerPulse {
    0% { width: 16px; height: 16px; opacity: 0.8; }
    100% { width: 40px; height: 40px; opacity: 0; }
}

/* 送风目标点（一指送风）- 2×2方格 */
.wind-target {
    position: absolute;
    width: calc(2 * (100% / 20));
    height: calc(2 * (100% / 14));
    background: rgba(79, 195, 247, 0.2);
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.3s ease, box-shadow 0.3s ease;
    cursor: move;
    z-index: 30;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(79, 195, 247, 0.3);
}

.wind-target.active {
    opacity: 1;
    display: flex;
    box-shadow: 0 0 25px rgba(79, 195, 247, 0.5);
}

/* 手型图标容器 */
.wind-target-icon {
    width: 70%;
    height: 70%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(79, 195, 247, 0.8);
    pointer-events: none;
}

/* 一指送风位置稳定指示器 */
.wind-target-stabilizing {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: var(--primary-color);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wind-target-stabilizing.show {
    opacity: 1;
}

/* 送风区域（区域送风）- 4×4方格 */
.wind-zone {
    position: absolute;
    border: 2px solid #9c27b0;
    border-radius: 6px;
    background: rgba(156, 39, 176, 0.15);
    opacity: 0;
    transition: opacity 0.3s ease, box-shadow 0.3s ease;
    cursor: move;
    z-index: 25;
    display: none;
}

.wind-zone.active {
    opacity: 1;
    display: block;
    box-shadow: 0 0 20px rgba(156, 39, 176, 0.3);
}

/* 区域送风控制图标 */
.wind-zone-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
}

.wind-zone.show-controls .wind-zone-controls {
    display: block;
}

/* 右上角对号 - 保存 */
.wind-zone-save {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, background 0.2s ease;
    z-index: 5;
}

.wind-zone-save:hover {
    transform: scale(1.2);
    background: #4caf50;
}

/* 左下角移动图标 */
.wind-zone-move {
    position: absolute;
    bottom: -8px;
    left: -8px;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: move;
    color: white;
    font-size: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
    z-index: 5;
}

.wind-zone-move:hover {
    transform: scale(1.2);
}

/* 右下角缩放图标 */
.wind-zone-resize {
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: var(--warning-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: nwse-resize;
    color: white;
    font-size: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
    z-index: 5;
}

.wind-zone-resize:hover {
    transform: scale(1.2);
}

/* 水平缩放箭头 - 右边中间 */
.wind-zone-resize-h {
    position: absolute;
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: var(--warning-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ew-resize;
    color: white;
    font-size: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
    z-index: 5;
}

.wind-zone-resize-h:hover {
    transform: translateY(-50%) scale(1.2);
}

/* 垂直缩放箭头 - 底部中间 */
.wind-zone-resize-v {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: var(--warning-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ns-resize;
    color: white;
    font-size: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
    z-index: 5;
}

.wind-zone-resize-v:hover {
    transform: translateX(-50%) scale(1.2);
}

/* 区域稳定指示器 */
.wind-zone-stabilizing {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: var(--primary-color);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: rgba(15, 29, 47, 0.9);
    padding: 2px 8px;
    border-radius: 4px;
}

.wind-zone-stabilizing.show {
    opacity: 1;
}

/* 场景区域容器 */
.scene-zones-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 15;
}

/* 场景区域 - 基础样式 */
.scene-zone {
    position: absolute;
    border: 2px solid;
    border-radius: 6px;
    cursor: move;
    transition: opacity var(--transition-fast), box-shadow var(--transition-fast);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 拖动时禁用所有transition */
.scene-zone.dragging,
.interference-zone.dragging,
.wind-zone.dragging {
    transition: none !important;
}

/* 运动区域 - 红色 */
.scene-zone[data-type="sports"] {
    border-color: #ef5350;
    background: rgba(239, 83, 80, 0.15);
}

/* 就餐区域 - 蓝色 */
.scene-zone[data-type="dining"] {
    border-color: #4fc3f7;
    background: rgba(79, 195, 247, 0.15);
}

/* 学习区域 - 绿色 */
.scene-zone[data-type="study"] {
    border-color: #66bb6a;
    background: rgba(102, 187, 106, 0.15);
}

/* 睡眠区域 - 棕色 */
.scene-zone[data-type="rest"] {
    border-color: #8d6e63;
    background: rgba(141, 110, 99, 0.15);
}

/* 区域中心内容容器 —— 名称和面积两行布局 */
.scene-zone .zone-center-content,
.interference-zone .zone-center-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 3px;
    pointer-events: none;
    z-index: 25;
    text-align: center;
    white-space: normal !important;
}

/* 区域名称 —— 第一行 */
.scene-zone .zone-center-content .zone-name,
.interference-zone .zone-center-content .zone-name {
    font-size: 12px !important;
    font-weight: 500;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    position: static !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
}

/* 区域面积显示 —— 第二行 */
.scene-zone .zone-center-content .zone-area-display,
.interference-zone .zone-center-content .zone-area-display {
    font-size: 11px !important;
    color: rgba(255, 255, 255, 0.85) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    position: static !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
}

/* 不同场景类型的颜色 */
.scene-zone.border-red {
    border-color: #ef5350;
    background: rgba(239, 83, 80, 0.15);
}

.scene-zone.border-blue {
    border-color: #4fc3f7;
    background: rgba(79, 195, 247, 0.15);
}

.scene-zone.border-green {
    border-color: #66bb6a;
    background: rgba(102, 187, 106, 0.15);
}

.scene-zone.border-brown {
    border-color: #8d6e63;
    background: rgba(141, 110, 99, 0.15);
}

/* 区域高亮状态 */
.scene-zone.highlight {
    animation: zoneHighlight 0.5s ease;
    box-shadow: 0 0 20px currentColor;
}

@keyframes zoneHighlight {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* 调节手柄容器 */
.zone-handles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 旧手柄样式已废弃 - 使用新的ctrl-icon样式 */
.handle {
    display: none !important;
}

.scene-zone.show-handles .handle {
    display: none !important;
}

/* 旧手柄样式已废弃 */
.handle-delete,
.handle-corner-tr,
.handle-corner-bl,
.handle-corner-br,
.handle-resize-h,
.handle-resize-v,
/* 稳定检测提示 */
.zone-stabilizing {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: var(--primary-color);
    background: rgba(15, 29, 47, 0.95);
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--transition-fast);
    pointer-events: none;
}

.scene-zone.stabilizing .zone-stabilizing,
.interference-zone.stabilizing .zone-stabilizing {
    opacity: 1;
}

/* 干扰源区域 */
.interference-zones-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 18;
}

.interference-zone {
    position: absolute;
    border: 2px dashed;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity var(--transition-fast), box-shadow var(--transition-fast);
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 干扰源1 - 橙色 */
.interference-zone[data-type="source1"] {
    border-color: #ff9800;
    background: rgba(255, 152, 0, 0.15);
}

/* 干扰源2 - 紫色 */
.interference-zone[data-type="source2"] {
    border-color: #9c27b0;
    background: rgba(156, 39, 176, 0.15);
}

/* 干扰源3 - 青色 */
.interference-zone[data-type="source3"] {
    border-color: #00bcd4;
    background: rgba(0, 188, 212, 0.15);
}

.interference-zone.active {
    border-style: solid;
    box-shadow: 0 0 16px rgba(239, 83, 80, 0.4);
}

.interference-zone .zone-label {
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 10px;
    font-weight: 500;
    color: var(--danger-color);
    background: rgba(0, 0, 0, 0.7);
    padding: 1px 4px;
    border-radius: 3px;
}

/* 区域统一控制点：4 角 */
.zone-control-handles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    pointer-events: none;  /* 让鼠标事件穿透到下方区域元素，支持拖动 */
}

.zone-control-handles .ctrl-icon {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    cursor: pointer;
    pointer-events: auto;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    transition: transform var(--transition-fast);
    user-select: none;
    z-index: 30;
}

.zone-control-handles .ctrl-icon:hover {
    transform: scale(1.15);
}

/* 角控制点 */
.ctrl-tl, .ctrl-tr, .ctrl-bl, .ctrl-br {
    background: #2196f3;
}

.ctrl-tl { 
    top: -14px; 
    left: -14px; 
    cursor: nwse-resize; 
}
.ctrl-tr { 
    top: -14px; 
    right: -14px; 
    cursor: nesw-resize; 
}
.ctrl-bl { 
    bottom: -14px; 
    left: -14px; 
    cursor: nesw-resize; 
}
.ctrl-br { 
    bottom: -14px; 
    right: -14px; 
    cursor: nwse-resize; 
}

/* 边线中间控制点 */
.ctrl-t {
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
}
.ctrl-b {
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
}
.ctrl-l {
    left: -14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: ew-resize;
}
.ctrl-r {
    right: -14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: ew-resize;
}

/* 旧的边线控制点类名（保持兼容性） */
.ctrl-right, .ctrl-bottom, .ctrl-drag {
    display: none !important;
}

.scene-zone.active,
.interference-zone.active {
    border-style: solid;
}

.scene-zone .zone-control-handles,
.interference-zone .zone-control-handles {
    display: none;
}

.scene-zone.active .zone-control-handles,
.interference-zone.active .zone-control-handles {
    display: block;
}

.interference-zone .zone-delete-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 20px;
    height: 20px;
    background: var(--danger-color);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

/* 功能控制区域 */
.function-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 第一行：检测可视化（全宽） */
.control-row-full {
    width: 100%;
}

.control-card-full {
    background: var(--card-blue);
    border: 1px solid var(--card-blue-border);
    border-radius: 10px;
    padding: 14px 16px;
}

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

/* 标签分组：用于将刷新按钮与文字标签组合在同一行内紧贴显示 */
.control-label-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.control-item-row + .control-item-row {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 10px;
    padding-top: 10px;
}

.control-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* 第二行：两个卡片组 */
.control-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.control-card-group {
    background: var(--card-blue);
    border: 1px solid var(--card-blue-border);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
}

/* 第三行：导航按钮卡片 */
.control-card-nav {
    background: var(--card-blue);
    border: 1px solid var(--card-blue-border);
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
}

.nav-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-btn i {
    font-size: 16px;
}

/* 模态框 */
/* 设置面板 */
.setting-panel {
    display: none;
    flex-direction: column;
    background: var(--dark-card);
    border-radius: 12px;
    border: 1px solid var(--dark-border);
    overflow: hidden;
    animation: panelFadeIn 0.3s ease;
}

@keyframes panelFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.setting-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--dark-border);
    background: var(--card-blue);
}

.setting-panel-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.panel-close-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.panel-close-btn:hover {
    background: rgba(239, 83, 80, 0.3);
    color: #fff;
}

.setting-panel-body {
    padding: 16px;
    max-height: calc(90vh - 56px);
    overflow-y: auto;
}

/* 模态框网格容器 */
/* 场景设定区域 */
.scene-setting-section {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
}

.type-selector {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.type-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.type-selector .layui-form-select {
    width: 100%;
}

.type-selector .layui-form-select .layui-select-title {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--dark-border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    height: 36px;
    line-height: 36px;
}

.type-selector .layui-form-select dl {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
}

.type-selector .layui-form-select dl dd {
    color: var(--text-primary);
}

/* 添加场景按钮包装器 */
.add-scene-btn-wrapper {
    display: flex;
    align-items: center;
}

/* 添加场景按钮 */
.add-scene-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--card-blue);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.add-scene-btn:hover {
    background: var(--card-blue-hover);
}

/* 场景区域列表 */
.scene-zones-list {
    margin-bottom: 16px;
    padding: 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid var(--dark-border);
    overflow: hidden;
}

/* 列表头部 */
.zone-list-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--dark-border);
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
}

/* 列表列 */
.list-col-name {
    flex: 1;
    text-align: left;
}

.list-col-status {
    flex: 1;
    text-align: center;
}

.list-col-action {
    flex: 0.6;
    text-align: right;
}

/* 列表项 */
.zone-list-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--dark-border);
    transition: background var(--transition-fast);
    gap: 10px;
}

.zone-list-item .zone-name {
    font-size: 13px;
    font-weight: 500;
    flex: 0 0 auto;
}

.zone-list-item .zone-result {
    flex: 1;
    text-align: right;
    font-size: 11px;
    color: var(--text-muted);
}

.zone-list-item .zone-result.success {
    color: #66bb6a;
    font-weight: 500;
}

.zone-list-item .zone-delete-btn {
    padding: 3px 10px;
    background: rgba(239, 83, 80, 0.15);
    border: 1px solid rgba(239, 83, 80, 0.3);
    border-radius: 4px;
    color: #ef5350;
    font-size: 11px;
    cursor: pointer;
}

.zone-list-item .zone-delete-btn:hover {
    background: rgba(239, 83, 80, 0.3);
}

.zone-list-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.zone-list-item:last-child {
    border-bottom: none;
}

.zone-list-item .list-col-name {
    flex: 1;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.zone-list-item .list-col-name:hover {
    opacity: 0.8;
}

.zone-list-item .list-col-status {
    flex: 1;
    text-align: center;
    font-size: 12px;
    color: var(--secondary-color);
}

.zone-list-item .list-col-action {
    flex: 0.6;
    text-align: right;
}

/* 删除按钮 */
.delete-zone-btn {
    padding: 4px 10px;
    background: rgba(239, 83, 80, 0.2);
    border: 1px solid rgba(239, 83, 80, 0.3);
    border-radius: 4px;
    color: #ef5350;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.delete-zone-btn:hover {
    background: rgba(239, 83, 80, 0.3);
    border-color: rgba(239, 83, 80, 0.5);
}

/* 空提示 */
.empty-tip {
    padding: 24px 12px;
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}

/* 面板标题 */
.panel-title {
    font-size: 14px;
    font-weight: 600;
}

/* 头部控制区域 */
.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 类型选择器包装器 */
.type-select-wrapper {
    min-width: 120px;
}

.scene-zone-item .zone-color {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.scene-zone-item .zone-name {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
}

.scene-zone-item .delete-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 83, 80, 0.15);
    border: 1px solid rgba(239, 83, 80, 0.3);
    border-radius: 4px;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 10px;
}

/* 识别结果 */
.recognition-result {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid var(--dark-border);
}

.recognition-status {
    text-align: center;
}

.result-text {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.result-text.success {
    color: #ff9800;
}

/* 返回主界面按钮 */
.back-main-btn {
    width: 100%;
    padding: 12px;
    background: rgba(79, 195, 247, 0.15);
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 8px;
    color: #4fc3f7;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.back-main-btn:hover {
    background: rgba(79, 195, 247, 0.25);
    border-color: rgba(79, 195, 247, 0.5);
    color: #81d4fa;
}

/* 干扰源添加按钮 */
.add-interference-btn {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: rgba(239, 83, 80, 0.15);
    border: 2px dashed var(--danger-color);
    border-radius: 8px;
    color: var(--danger-color);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 16px;
}

.add-interference-btn:hover {
    background: rgba(239, 83, 80, 0.25);
}

/* 干扰源列表 - 与场景区域列表风格一致 */
.interference-list {
    margin-bottom: 16px;
    padding: 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid var(--dark-border);
    overflow: hidden;
}

.interference-list-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--dark-border);
    transition: background var(--transition-fast);
    gap: 10px;
}

.interference-list-item .interference-name {
    font-size: 13px;
    font-weight: 500;
    flex: 1;
    text-align: left;
    color: var(--danger-color);
    cursor: pointer;
}

.interference-list-item .interference-name:hover {
    opacity: 0.8;
}

.interference-list-item .interference-delete-btn {
    padding: 3px 10px;
    background: rgba(239, 83, 80, 0.15);
    border: 1px solid rgba(239, 83, 80, 0.3);
    border-radius: 4px;
    color: #ef5350;
    font-size: 11px;
    cursor: pointer;
}

.interference-list-item .interference-delete-btn:hover {
    background: rgba(239, 83, 80, 0.3);
}

.interference-list-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.interference-list-item:last-child {
    border-bottom: none;
}

.hint-text {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* 场景区域列表项样式 */
.scene-zones-list .interference-list-item .interference-name {
    color: var(--text-primary);
}

.scene-zones-list .interference-list-item .interference-delete-btn {
    background: rgba(239, 83, 80, 0.15);
    border: 1px solid rgba(239, 83, 80, 0.3);
    color: #ef5350;
}

/* 场景识别状态样式 */
.scene-recognition-status {
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 12px;
    color: #4fc3f7;
    background: rgba(79, 195, 247, 0.15);
    border-radius: 4px;
    animation: recognition-pulse 1.5s ease-in-out infinite;
}

@keyframes recognition-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* 控制栏样式 */
.control-bar {
    margin: 16px 0;
    padding: 12px 16px;
    background: var(--card-blue);
    border-radius: 8px;
}

.switch-group {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 16px;
}

.switch-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.switch-item-label {
    font-size: 13px;
    color: #fff;
    font-weight: 500;
}

/* 按钮组样式 */
.layui-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.layui-btn-group .layui-btn {
    flex: 1;
    min-width: 70px;
}

/* 响应式设计 */
@media (min-width: 768px) {
    .left-panel {
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (min-width: 1024px) {
    .left-panel {
        max-width: 600px;
    }
}

/* 应用容器 */
.page-container {
    padding: 0 16px;
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 80px;
    position: relative;
}

.page-container .panel-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 100;
}

/* 线控器管理页面样式 */
.gateway-container {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.gateway-table-wrapper {
    overflow-x: auto;
    position: relative;
}

.gateway-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.gateway-table th,
.gateway-table td {
    padding: 10px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.gateway-table th {
    background: rgba(79, 195, 247, 0.1);
    font-weight: 500;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.gateway-table th:first-child {
    border-radius: 8px 0 0 0;
}

.gateway-table th:last-child {
    border-radius: 0 8px 0 0;
}

.gateway-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.gateway-table tr:last-child td {
    border-bottom: none;
}

.gateway-table input[type="text"] {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--card-blue-border);
    border-radius: 4px;
    background: var(--dark-surface);
    color: var(--text-primary);
    font-size: 13px;
}

.gateway-table input[type="text"]:focus {
    border-color: var(--primary-color);
    outline: none;
}

.gateway-table .action-column {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
}

/* 整行hover效果，确保所有单元格包括操作列都有背景色 */
.gateway-table tr:hover td {
    background: rgba(255, 255, 255, 0.05) !important;
}

.btn-group {
    display: flex;
    gap: 4px;
    align-items: center;
}

.btn-group .layui-btn {
    padding: 4px 10px !important;
    font-size: 12px !important;
    height: 24px !important;
    line-height: 24px !important;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-btn {
    color: var(--secondary-color);
    font-size: 16px;
    cursor: pointer;
    font-weight: 600;
}

.add-btn:hover {
    color: #81c784;
}

/* layui卡片样式覆盖 */
.layui-card {
    background: var(--card-blue);
    border: 1px solid var(--card-blue-border);
    border-radius: 10px;
    margin-bottom: 16px;
}

.layui-card-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.layui-card-body {
    padding: 16px;
}

/* layui按钮样式覆盖 */
.layui-btn {
    border-radius: 8px;
    font-size: 13px;
    padding: 8px 16px;
}

.layui-btn-primary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.layui-btn-danger {
    background: rgba(239, 83, 80, 0.2);
    border: 1px solid rgba(239, 83, 80, 0.3);
    color: #ef5350;
}

/* layui按钮组 */
.layui-btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* layui弹窗iframe样式 */
.layui-layer-iframe {
    overflow: hidden !important;
}

.layui-layer-iframe iframe {
    border: none;
    overflow: hidden !important;
}

.layui-layer-content {
    overflow: hidden !important;
}

/* 模块标题栏 */
.module-title-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.module-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 1px;
}

/* 报告日期栏 */
.report-date-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
    margin-bottom: 16px;
    gap: 16px;
    flex-wrap: wrap;
}

.date-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.date-trigger-input {
    width: 140px;
    height: 36px;
    line-height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
}

.date-selector select {
    height: 32px;
    line-height: 32px;
    padding: 0 12px;
    border: 1px solid var(--card-blue-border);
    border-radius: 6px;
    background: var(--card-blue);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
}

.date-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.date-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-inputs input {
    height: 32px;
    line-height: 32px;
    padding: 0 12px;
    border: 1px solid var(--card-blue-border);
    border-radius: 6px;
    background: var(--card-blue);
    color: var(--text-primary);
    font-size: 14px;
    width: 130px;
}

.date-inputs input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.date-separator {
    color: var(--text-secondary);
    font-size: 14px;
}

.date-hint {
    color: var(--text-secondary);
    font-size: 13px;
    margin-left: 8px;
}

.date-display {
    height: 32px;
    line-height: 32px;
    padding: 0 12px;
    border: 1px solid var(--card-blue-border);
    border-radius: 6px;
    background: var(--card-blue);
    color: var(--text-primary);
    font-size: 14px;
    width: 130px;
    display: inline-block;
    box-sizing: border-box;
}

.date-display:hover {
    border-color: var(--primary-color);
}

.date-picker-box {
    height: 32px;
    line-height: 32px;
    padding: 0 12px;
    border: 1px solid var(--card-blue-border);
    border-radius: 6px;
    background: var(--card-blue);
    color: var(--text-primary);
    font-size: 14px;
    width: 150px;
    display: inline-block;
    box-sizing: border-box;
    cursor: pointer;
}

.date-picker-box:hover {
    border-color: var(--primary-color);
}

/* 睡眠统计 */
.sleep-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-item {
    background: var(--card-blue);
    border: 1px solid var(--card-blue-border);
    border-radius: 10px;
    padding: 14px;
    height: 100px;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.stat-time {
    font-size: 11px;
    color: var(--text-muted);
}

/* 图表区域 */
.chart-section {
    margin-bottom: 16px;
    background: var(--card-blue);
    border: 1px solid var(--card-blue-border);
    border-radius: 10px;
    padding: 16px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.chart-actions {
    display: flex;
    gap: 16px;
}

.action-link {
    font-size: 12px;
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.action-link:hover {
    color: #81d4fa;
    text-decoration: underline;
}

.chart-container {
    height: 320px;
    position: relative;
    margin-top: 12px;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-color.deep {
    background: #6B4C9A;
}

.legend-color.light {
    background: #B085C7;
}

.legend-color.rem {
    background: #FF6B6B;
}

.legend-color.awake {
    background: #FFD93D;
}

.legend-text {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 饼图容器 */
.pie-chart-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 250px;
    position: relative;
}

.pie-chart-center {
    position: absolute;
    text-align: center;
}

.pie-chart-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.pie-chart-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
}

/* 日期切换 */
.date-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.date-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.date-tab.active {
    background: rgba(79, 195, 247, 0.2);
    color: var(--primary-color);
}

/* 干扰源设置 */
.interference-section {
    margin-bottom: 16px;
    background: var(--card-blue);
    border: 1px solid var(--card-blue-border);
    border-radius: 10px;
    padding: 16px;
}

.interference-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.interference-buttons {
    display: flex;
    gap: 10px;
}

.interference-btn {
    flex: 1;
    padding: 10px;
    text-align: center;
    background: rgba(239, 83, 80, 0.2);
    border: 1px solid rgba(239, 83, 80, 0.3);
    border-radius: 8px;
    font-size: 13px;
    color: #ef5350;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.interference-btn:hover {
    background: rgba(239, 83, 80, 0.3);
}

/* 坐标信息 */
.coordinate-info {
    background: var(--card-blue);
    border: 1px solid var(--card-blue-border);
    border-radius: 10px;
    padding: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* 时间范围切换 */
.time-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.tab-btn {
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    background: rgba(79, 195, 247, 0.1);
    border-color: rgba(79, 195, 247, 0.3);
}

.tab-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #000000;
    font-weight: 600;
}

.nav-arrow-btn {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 40px;
}

.nav-arrow-btn:hover {
    background: rgba(79, 195, 247, 0.1);
    border-color: rgba(79, 195, 247, 0.3);
}

/* 饼图区域 */
.pie-section {
    background: var(--card-blue);
    border-radius: 10px;
    border: 1px solid var(--card-blue-border);
    padding: 16px;
    margin-bottom: 16px;
}

.pie-chart-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 250px;
    position: relative;
}

.pie-center {
    position: absolute;
    text-align: center;
}

.pie-label {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.pie-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.pie-stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.pie-stat-item .stat-bar {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.pie-stat-item.deep .stat-bar {
    background: #6B4C9A;
}

.pie-stat-item.light .stat-bar {
    background: #B085C7;
}

.pie-stat-item.rem .stat-bar {
    background: #FF6B6B;
}

.pie-stat-item.awake .stat-bar {
    background: #FFD93D;
}

.pie-stat-item .stat-label {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
}

.pie-stat-item .stat-percent {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.pie-stat-item .stat-duration {
    font-size: 12px;
    color: var(--text-muted);
}

/* 睡眠数据页面 - 一行统计布局 */
.sleep-stats-row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(79, 195, 247, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(79, 195, 247, 0.1);
}

.sleep-stats-row .stat-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 6px;
    min-width: 80px;
    flex: 1;
}

.sleep-stats-row .sleep-card {
    background: rgba(79, 195, 247, 0.08);
    border: 1px solid rgba(79, 195, 247, 0.15);
}

.sleep-stats-row .sleep-card .stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #4fc3f7;
    line-height: 1.2;
}

.sleep-stats-row .sleep-card .stat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
}

.sleep-stats-row .stat-item .stat-bar {
    height: 4px;
    width: 100%;
    border-radius: 2px;
    margin-bottom: 2px;
}

.sleep-stats-row .pie-stat-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px 10px;
}

.sleep-stats-row .pie-stat-item .stat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    flex: none;
}

.sleep-stats-row .pie-stat-item .stat-percent {
    font-size: 13px;
    font-weight: bold;
    color: #fff;
}

.sleep-stats-row .pie-stat-item .stat-duration {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.sleep-stats-row .stat-time {
    color: #4fc3f7;
    font-weight: bold;
}

/* 雷达网格区域 */
.radar-grid-section {
    margin-bottom: 16px;
}

.grid-container.clickable {
    cursor: crosshair;
}

/* 空调挂墙示意图 */
.air-conditioner {
    position: absolute;
    top: 8%;
    left: 50%;
    transform: translateX(-50%);
    width: 30%;
    height: 8%;
    background: rgba(79, 195, 247, 0.2);
    border: 2px solid rgba(79, 195, 247, 0.4);
    border-radius: 4px;
}

/* 区域容器 */
.zones-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* 区域送风选择 */
.zone-selection {
    position: absolute;
    width: 25%;
    height: 15%;
    left: 25%;
    top: 40%;
    z-index: 100;
}

/* 干扰源选择 */
.interference-selection {
    position: absolute;
    width: 25%;
    height: 15%;
    left: 25%;
    top: 40%;
    z-index: 100;
}

.zone-box {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background: rgba(79, 195, 247, 0.15);
    pointer-events: none;
}

.zone-box.danger {
    border-color: #ef5350;
    background: rgba(239, 83, 80, 0.15);
}

.zone-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.zone-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--primary-color);
    white-space: nowrap;
}

.zone-box.danger .zone-name {
    color: #ef5350;
}

/* 操作手柄 */
.handle {
    position: absolute;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-blue);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
}

.handle .layui-icon {
    font-size: 16px;
    color: var(--primary-color);
    margin: 0;
    display: inline-block;
    line-height: 1;
}

.handle.close {
    top: -14px;
    left: -14px;
    border-color: #ef5350;
}

.handle.close .layui-icon {
    color: #ef5350;
}

.handle.confirm {
    top: -14px;
    right: -14px;
    border-color: #66bb6a;
}

.handle.confirm .layui-icon {
    color: #66bb6a;
}

.handle.resize-h {
    top: 50%;
    right: -14px;
    transform: translateY(-50%);
    cursor: ew-resize;
}

.handle.resize-v {
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
}

.handle.resize-corner {
    bottom: -14px;
    right: -14px;
    cursor: nwse-resize;
}

.handle.drag {
    top: 50%;
    left: -14px;
    transform: translateY(-50%);
    cursor: move;
}

/* 坐标信息面板 */
.coordinates-panel {
    background: var(--card-blue);
    border: 1px solid var(--card-blue-border);
    border-radius: 10px;
    margin-bottom: 16px;
}

.coordinates-content {
    padding: 0 8px;
}

.coord-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.coord-item:last-of-type {
    border-bottom: none;
}

.coord-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.coord-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary-color);
    font-family: monospace;
}

.coord-divider {
    height: 8px;
    background: rgba(255, 255, 255, 0.03);
    margin: 4px 0;
    border-radius: 4px;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    background: rgba(15, 29, 47, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item i {
    font-size: 22px;
}

.nav-item span {
    font-size: 10px;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 轨迹SVG */
.trail-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.layui-layer-close {
    color: #fff !important;
    font-size: 16px !important;
    width: 18px !important;
    height: 18px !important;
    line-height: 18px !important;
    text-align: center !important;
    position: absolute !important;
    
    border-radius: 6px !important;
    right: 16px !important;
    top: calc(50% - 9px) !important;
    margin-top: 0 !important;
    transform: none !important;
}

.layui-layer-close:hover {
    background: rgba(239, 83, 80, 0.3) !important;
    color: #fff !important;
}

/* ==================== 睡眠页面通用样式 ==================== */
/* 自定义头部 */
.custom-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 44px;
    background: #2B3445;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-header-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.custom-header-btn {
    padding: 0 16px;
    font-size: 13px;
    height: 28px;
    line-height: 28px;
    background: rgba(79, 195, 247, 0.2);
    border: 1px solid rgba(79, 195, 247, 0.3);
    color: #4FC3F7;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    vertical-align: middle;
}

.custom-header-btn:hover {
    background: rgba(79, 195, 247, 0.3);
    border-color: rgba(79, 195, 247, 0.5);
}

/* ==================== 睡眠报告页面样式 (sleep.html) ==================== */
.sleep-report-page .page-container {
    padding-top: 44px;
    height: 100%;
    box-sizing: border-box;
}

/* ==================== 睡眠数据页面样式 (sleep-data.html) ==================== */
html,
body.sleep-data-page {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.sleep-data-page .page-container {
    display: flex;
    height: 100%;
    padding-top: 44px;
}

.sleep-data-page .left-panel {
    width: 260px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.5);
    position: fixed;
    left: 0;
    top: 44px;
    bottom: 0;
    z-index: 10;
}

.sleep-data-page .right-panel {
    width: calc(100% - 260px);
    display: flex;
    flex-direction: column;
    margin-left: 260px;
    min-width: 400px;
    overflow: hidden;
    flex-shrink: 0;
}

.sleep-data-page .panel-header {
    padding: 8px 12px;
    background: rgba(79, 195, 247, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.sleep-data-page .panel-header .layui-btn {
    padding: 0 10px;
    font-size: 11px;
    height: 24px;
    line-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sleep-data-page .panel-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px;
}

.sleep-data-page .date-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: background var(--transition-fast);
}

.sleep-data-page .date-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sleep-data-page .date-item.selected {
    background: rgba(79, 195, 247, 0.2);
}

.sleep-data-page .date-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

.sleep-data-page .date-label {
    font-size: 12px;
    color: var(--text-primary);
    flex: 1;
    user-select: none;
}

.sleep-data-page .data-table {
    width: 100%;
    border-collapse: collapse;
}

.sleep-data-page .data-table th,
.sleep-data-page .data-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
}

.sleep-data-page .data-table th {
    background: rgba(79, 195, 247, 0.1);
    font-weight: 500;
    color: var(--text-primary);
}

.sleep-data-page .data-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sleep-data-page .status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.sleep-data-page .status-deep { background: rgba(107, 76, 154, 0.3); color: #B085C7; }
.sleep-data-page .status-light { background: rgba(176, 133, 199, 0.3); color: #D4B8E0; }
.sleep-data-page .status-rem { background: rgba(255, 107, 107, 0.3); color: #FF9999; }
.sleep-data-page .status-awake { background: rgba(255, 217, 61, 0.3); color: #FFE066; }

.sleep-data-page .empty-tip {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
}

.sleep-data-page .select-all-checkbox {
    width: 14px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
}