/* 图形分析面板专用样式 - index.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 全屏容器 */
.container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* 顶部控制栏包装器 */
.top-bar-wrapper {
    position: relative;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
    flex-shrink: 0;
}

/* 右侧按钮固定位置 */
.top-bar-right-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 101;
}

/* 顶部全宽控制栏 */
.top-bar {
    background: white;
    padding: 10px 20px;
    padding-right: 120px;
    /* 为右侧固定按钮预留空间 */
    display: flex;
    align-items: center;
    gap: 25px;
    flex-shrink: 0;
}

.top-bar-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-bar-label {
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    white-space: nowrap;
}

/* 输入框聚焦效果 */
.input-small {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.input-small:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Custom Select Dropdown Styles */
.custom-select-wrapper {
    position: relative;
    display: inline-block;
}

.custom-select-trigger {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    gap: 8px;
    white-space: nowrap;
}

.custom-select-trigger:hover {
    border-color: #cbd5e0;
}

.custom-select-trigger.active {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.custom-select-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #2d3748;
}

.custom-select-arrow {
    margin-left: 10px;
    transition: transform 0.3s;
    color: #718096;
    font-size: 10px;
}

.custom-select-trigger.active .custom-select-arrow {
    transform: rotate(180deg);
}

.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    min-width: 100%;
    background: white;
    border: 2px solid #667eea;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    max-height: 90vh;
    overflow-y: auto;
}

.custom-select-dropdown.show {
    display: block;
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-select-option {
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f7fafc;
    font-size: 13px;
    color: #2d3748;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-select-option:last-child {
    border-bottom: none;
}

.custom-select-option:hover {
    background: #f7fafc;
}

.custom-select-option.selected {
    background: #edf2f7;
    color: #667eea;
    font-weight: 600;
}

.custom-select-option.selected::after {
    content: '✓';
    margin-left: 8px;
    color: #667eea;
}

.custom-select-dropdown::-webkit-scrollbar {
    width: 6px;
}

.custom-select-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* 时段选择下拉面板 - 4行6列网格布局 */
[data-select-id="startHour"] .custom-select-dropdown,
[data-select-id="endHour"] .custom-select-dropdown {
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(4, auto);
    padding: 8px;
    gap: 4px;
    min-width: 280px;
    max-height: none;
    overflow: visible;
    left: auto;
    right: 0;
}

[data-select-id="startHour"] .custom-select-dropdown.show,
[data-select-id="endHour"] .custom-select-dropdown.show {
    display: grid;
}

[data-select-id="startHour"] .custom-select-option,
[data-select-id="endHour"] .custom-select-option {
    padding: 8px 4px;
    text-align: center;
    border: none;
    border-radius: 4px;
    font-size: 12px;
}

[data-select-id="startHour"] .custom-select-option.selected::after,
[data-select-id="endHour"] .custom-select-option.selected::after {
    content: '';
    margin-left: 0;
}

/* 按钮组样式 */
.btn-group {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.btn-action {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

/* 主体内容区域 - 允许滚动 */
.main-content {
    flex: 1;
    overflow: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: #f0f2f5;
}

/* 图表容器 */
.chart-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.chart-box {
    height: 400px;
}

.full-width-chart {
    grid-column: 1 / -1;
    height: 500px;
}

@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

/* 滚动条美化 */
.main-content::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.main-content::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}