/**
 * 功能区布局 V2 - 演示页面样式
 * Zone Layout V2 - Demo Page Styles
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f0f2f5;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* 左侧配置面板 */
.config-panel {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 500px;
    background: #524270;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    overflow-y: auto;
    z-index: 10;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* 面板收起状态 */
.config-panel.collapsed {
    transform: translateX(-100%);
    opacity: 0;
    overflow: hidden;
}

/* 面板切换按钮 */
.panel-toggle-btn {
    position: fixed;
    left: 500px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 60px;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-left: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
    padding: 0;
}

.panel-toggle-btn:hover {
    background: #f0f2f5;
}

.panel-toggle-btn.collapsed {
    left: 0;
}

.panel-toggle-btn svg {
    transition: transform 0.3s ease;
}

.panel-toggle-btn.collapsed svg {
    transform: rotate(180deg);
}

/* 右侧场景区域 */
.scene-panel {
    flex: 1;
    position: relative;
    background: #f0f2f5;
    margin-left: 500px;
    transition: margin-left 0.3s ease;
}

/* 面板收起时场景区域占满全屏 */
.config-panel.collapsed ~ .scene-panel {
    margin-left: 0;
}

#scene-container {
    width: 100%;
    height: 100%;
}

/* 场景控制按钮 */
.scene-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    background: rgba(255,255,255,0.9);
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 100;
}

.scene-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background: #fff;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    border: 1px solid #d9d9d9;
}

.scene-btn:hover {
    background: #f0f0f0;
}

.scene-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 帮助文档面板 */
.help-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 100;
    min-width: 150px;
    overflow: hidden;
}

.help-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: #667eea;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.help-panel-toggle {
    font-size: 16px;
    transition: transform 0.3s;
}

.help-panel.collapsed .help-panel-toggle {
    transform: rotate(180deg);
}

.help-panel-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.help-panel.collapsed .help-panel-body {
    display: none;
}

.help-link {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
    white-space: nowrap;
}

.help-link:hover {
    background: #667eea;
    color: white;
}

/* 透明度控制 */
.opacity-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid #d9d9d9;
}

.opacity-label {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

.opacity-slider {
    width: 80px;
    cursor: pointer;
}

.opacity-value {
    font-size: 12px;
    color: #999;
    min-width: 35px;
    text-align: right;
}

/* 图例 */
.legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(255,255,255,0.95);
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 100;
}

.legend-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: opacity 0.3s;
}

.legend-item:hover {
    opacity: 0.8;
}

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

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

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

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

/* 提示信息 */
.tooltip {
    position: absolute;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
    display: none;
}

/* ========== 下拉菜单样式 ========== */
.dropdown-container {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    padding-right: 12px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 280px;
    z-index: 2000;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s;
}

.dropdown-container:hover .dropdown-menu,
.dropdown-container.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-item:hover {
    background: #f5f5f5;
    color: #1890ff;
}

.dropdown-item:first-child {
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-section-title {
    padding: 10px 16px 6px;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 4px 0;
}
