/* ==================== 通用样式 ==================== */
body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
    color: #2d3748;
    overflow: auto;
}


.row.no-gutters {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
}

.row.no-gutters[style*="flex-direction"] {
    flex-direction: column;
    flex: 0 0 auto;
    min-height: 0;
}

.row.no-gutters.mt-3 {
    flex: 0 0 auto;
    flex-direction: row;
}

.row.no-gutters > [class*="col-"] {
    padding: 0;
}

h2 {
    color: #1a202c;
    font-weight: 700;
    font-size: 28px;
    letter-spacing: -0.5px;
    text-align: center;
    margin: 15px 0 10px 0;
    flex: 0 0 auto;
}

/* ==================== 新的上-下布局样式 ==================== */

/* 图表区容器 - 占据上部 */
.chart-area-container {
    flex: 0 0 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 10px !important;
    height: 400px;
    min-height: 300px;
}

/* 控制面板容器 - 占据下部 */
.control-panel-container {
    flex: 0 0 auto;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 15px !important;
    overflow: visible;
}

/* 水平控制面板布局 */
.control-panel-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

/* 单个控制区块 */
.control-section {
    flex: 1;
    min-width: 200px;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.control-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.filter-controls {
    margin-bottom: 10px;
}

.control-row {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-row label {
    font-size: 12px;
    margin-bottom: 0;
    flex: 0 0 auto;
    min-width: 80px;
    font-weight: 500;
    color: #6c757d;
}

.control-row input {
    flex: 1;
    font-size: 12px;
    padding: 4px 6px;
}

.control-row select.form-control {
    flex: 1;
    font-size: 12px;
    padding: 4px 6px;
    height: auto;
}

/* 浮动信息面板 - 右侧固定位置 - 已删除 */
.info-panel-floating {
    display: none !important;
}

/* 已选项目显示区 */
.selected-items-display {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
    max-height: 150px;
    overflow-y: auto;
}

/* 侧边栏样式 - 已弃用，保留向后兼容性 */
.sidebar {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    height: calc(100vh - 120px);
    overflow-y: auto;
    display: none;
}

/* 深蓝色侧边栏样式（专业软件风格）- 已弃用 */
.sidebar-dark {
    background-color: #1e3a5f;
    color: #fff;
    border-radius: 0;
    box-shadow: none;
    padding: 8px;
    margin-bottom: 0;
    height: 800px;
    min-height: 800px;
    overflow-y: auto;
    display: none;
    flex-direction: column;
}

.sidebar-dark .sidebar-header {
    background-color: #1e3a5f;
    color: #fff;
    padding: 6px 0;
    margin: 0 0 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-dark .sidebar-header h5 {
    margin: 0;
    font-size: 16px;
    color: #fff;
    font-weight: 600;
}

.sidebar-section {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.sidebar-dark .sidebar-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
    padding-bottom: 8px;
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-section h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    letter-spacing: 0.3px;
}

.sidebar-dark .sidebar-section h6 {
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* 图钉图标样式 */
.pin-icon {
    background-color: #dc3545;
    color: #fff;
    border: none;
    padding: 0.25rem 0.5rem;
}

.pin-icon i {
    color: #fff;
}

/* 深蓝色侧边栏的输入框样式 */
.sidebar-dark .form-control {
    background-color: #2c5282;
    border-color: #4a6fa5;
    color: #fff;
    padding: 3px 6px;
    font-size: 13px;
    margin-bottom: 3px;
}

.sidebar-dark .form-control:focus {
    background-color: #2c5282;
    border-color: #63b3ed;
    color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(99, 179, 237, 0.25);
}

.sidebar-dark .input-group-text {
    background-color: #2c5282;
    border-color: #4a6fa5;
    color: #fff;
}

/* 深灰色侧边栏的文本样式 */
.sidebar-dark .text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* ==================== 按钮样式 ==================== */
.btn-add {
    background-color: #fff;
    border: 2px solid #2c5282;
    color: #2c5282;
    font-size: 14px;
    padding: 8px 12px;
    text-align: left;
    transition: all 0.3s ease;
    border-radius: 4px;
    display: block;
    width: 100%;
}

.btn-add:hover:not(:disabled) {
    background-color: #2c5282;
    color: #fff;
    border-color: #2c5282;
}

.btn-add:disabled {
    border-color: #dee2e6;
    color: #6c757d;
    opacity: 0.5;
    cursor: not-allowed;
}

/* 新布局中的按钮样式 */
.control-section .btn-primary {
    background-color: #0d6efd;
    border: 1px solid #0d6efd;
    color: #fff;
    font-size: 13px;
    padding: 6px 12px;
    transition: all 0.3s ease;
    width: 100%;
}

.control-section .btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0b5ed7;
    color: #fff;
}

.control-section .btn-primary i {
    margin-right: 6px;
}

/* 导出按钮样式 */
.btn-outline-primary {
    border: 1px solid #0d6efd;
    color: #0d6efd;
    background-color: transparent;
    padding: 8px 20px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

/* 深蓝色侧边栏的按钮样式 */
.sidebar-dark .btn-add {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 13px;
    padding: 4px 8px;
    text-align: left;
    transition: all 0.3s ease;
    margin-bottom: 3px;
}

.sidebar-dark .btn-add:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.sidebar-dark .btn-add:disabled {
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    opacity: 0.5;
    cursor: not-allowed;
}

.sidebar-dark .btn-add i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

/* ==================== 按钮样式 ==================== */
.btn-export {
    background-color: #fff;
    border: 2px solid #38a169;
    color: #38a169;
    font-size: 14px;
    padding: 8px 12px;
    text-align: left;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.btn-export:hover {
    background-color: #38a169;
    color: #fff;
    border-color: #38a169;
}

/* 深蓝色侧边栏的导出按钮样式 */
.sidebar-dark .btn-export {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 13px;
    padding: 4px 8px;
    text-align: left;
    transition: all 0.3s ease;
    margin-bottom: 3px;
}

.sidebar-dark .btn-export:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.sidebar-dark .btn-export i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

/* Display按钮样式 */
.btn-display {
    background-color: #fff;
    border: 2px solid #805ad5;
    color: #805ad5;
    font-size: 14px;
    padding: 8px 12px;
    text-align: left;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.btn-display:hover {
    background-color: #805ad5;
    color: #fff;
}

.btn-display.active {
    background-color: #805ad5;
    color: #fff;
    border-color: #805ad5;
}

/* 深蓝色侧边栏的Display按钮样式 */
.sidebar-dark .btn-display {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 13px;
    padding: 4px 8px;
    text-align: left;
    transition: all 0.3s ease;
    margin-bottom: 3px;
}

.sidebar-dark .btn-display:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.sidebar-dark .btn-display.active {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.sidebar-dark .btn-display i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

/* 深灰色侧边栏的复选框样式 */
.sidebar-dark .custom-control-label {
    color: #fff;
    padding-left: 3px;
    font-size: 13px;
}

.sidebar-dark .custom-control-label i {
    margin-right: 5px;
    width: 14px;
    text-align: center;
}

.sidebar-dark .custom-control {
    margin-bottom: 3px;
    min-height: 1.1rem;
}

/* 已选项目内联显示列表 */
.selected-list-inline {
    margin-top: 8px;
    padding: 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    min-height: auto;
    font-size: 12px;
    max-height: none;
    overflow: visible;
}

.selected-list-inline:empty {
    display: none;
}

.selected-item-inline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 6px;
    margin-bottom: 6px;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    font-size: 12px;
    gap: 8px;
    transition: background-color 0.2s ease;
}

.selected-item-inline:last-child {
    margin-bottom: 0;
}

.selected-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.selected-item-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #212529;
}

.selected-item-wavelength {
    font-size: 11px;
    color: #6c757d;
    line-height: 1.3;
}

.wavelength-ex {
    color: #0066cc;
    font-weight: 500;
}

.wavelength-em {
    color: #cc0000;
    font-weight: 500;
}

.selected-item-remove {
    flex-shrink: 0;
    cursor: pointer;
    color: #dc3545;
    margin-top: 2px;
    font-size: 14px;
    transition: opacity 0.2s;
    line-height: 1;
}

.wavelength-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wavelength-checkbox {
    width: 14px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
    accent-color: #007bff;
}

.wavelength-checkbox:hover {
    accent-color: #0056b3;
}

.selected-item-remove:hover {
    opacity: 0.7;
}

/* ==================== 已选荧光团列表 ==================== */
.selected-list {
    max-height: 300px;
    overflow-y: auto;
}

.fluorophore-item {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 10px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.sidebar-dark .fluorophore-item {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.fluorophore-item .fluorophore-name {
    flex: 1;
    color: #333;
}

.sidebar-dark .fluorophore-item .fluorophore-name {
    color: #fff;
}

.fluorophore-item .btn-remove {
    padding: 2px 8px;
    font-size: 12px;
}

/* ==================== 信息面板样式（右列）==================== */
.info-panel {
    background-color: #fff;
    padding: 20px;
    height: 800px;
    min-height: 800px;
    overflow-y: auto;
    box-shadow: -2px 0 4px rgba(0,0,0,0.1);
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    display: none;
}

.info-panel-floating {
    position: fixed;
    right: 20px;
    top: 120px;
    width: 280px;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    padding: 15px;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 100;
}

.info-section {
    margin-bottom: 32px;
    min-width: 0;
    width: 100%;
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-header {
    color: #2c5282;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.compound-name {
    font-size: 16px;
    color: #2c5282;
    cursor: pointer;
    word-break: break-word;
    line-height: 1.5;
    font-weight: 500;
}

.compound-name:hover {
    text-decoration: underline;
}

.properties-list {
    list-style: none;
    padding: 0;
    margin: 0;
    min-width: 0;
    width: 100%;
}

.property-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    white-space: nowrap;
    flex-wrap: nowrap;
    min-width: 0;
    width: 100%;
    overflow: visible;
}

.property-item:last-child {
    border-bottom: none;
}

.property-label {
    color: #6c757d;
    font-weight: 600;
    flex-shrink: 0;
    margin-right: 8px;
    white-space: nowrap;
    overflow: visible;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.property-value {
    color: #2c5282;
    font-weight: 700;
    text-align: right;
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: auto;
    overflow: visible;
    font-size: 13px;
}

/* ==================== Excitation Source 列表样式（右下角）==================== */
.excitation-list-right {
    list-style: none;
    padding: 0;
    margin: 0;
    min-width: 0;
    width: 100%;
}

.excitation-item-right {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.excitation-item-right:last-child {
    border-bottom: none;
}

.excitation-label-right {
    color: #212529;
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.excitation-remove-right {
    flex-shrink: 0;
    cursor: pointer;
    color: #dc3545;
    margin-left: 8px;
    font-size: 14px;
    transition: opacity 0.2s;
}

.excitation-remove-right:hover {
    opacity: 0.7;
}

/* ==================== 图表容器 ==================== */
.chart-container {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 10px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    flex: 1;
}

/* ==================== 光谱彩虹条 ==================== */
.spectrum-bar { display: none; }

/* ==================== 加载遮罩 ==================== */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    border-radius: 8px;
}

/* ==================== 模态框样式 ==================== */
#fluorophoreSelect {
    height: 350px !important;
}

#fluorophoreSelect option {
    padding: 5px;
}

#fluorophoreSelect option:hover {
    background-color: #007bff;
    color: #fff;
}

/* ==================== 图表画布 ==================== */
#spectrumChart {
    height: 100% !important;
    width: 100% !important;
    max-width: 100%;
}

/* ==================== 自定义复选框 ==================== */
.custom-control-label {
    font-size: 14px;
    cursor: pointer;
}

/* ==================== 滚动条样式 ==================== */
.selected-list::-webkit-scrollbar,
#fluorophoreSelect::-webkit-scrollbar,
.info-panel::-webkit-scrollbar,
.sidebar-dark::-webkit-scrollbar {
    width: 8px;
}

.selected-list::-webkit-scrollbar-track,
#fluorophoreSelect::-webkit-scrollbar-track,
.info-panel::-webkit-scrollbar-track,
.sidebar-dark::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.selected-list::-webkit-scrollbar-thumb,
#fluorophoreSelect::-webkit-scrollbar-thumb,
.info-panel::-webkit-scrollbar-thumb,
.sidebar-dark::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.selected-list::-webkit-scrollbar-thumb:hover,
#fluorophoreSelect::-webkit-scrollbar-thumb:hover,
.info-panel::-webkit-scrollbar-thumb:hover,
.sidebar-dark::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 深蓝色侧边栏的滚动条样式 */
.sidebar-dark::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-dark::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
}

.sidebar-dark::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    .info-panel-floating {
        width: 250px;
        right: 10px;
        top: 110px;
    }
    
    .control-section {
        min-width: 180px;
    }
}

@media (max-width: 768px) {
    .container-fluid {
        width: 100%;
        max-width: 100%;
        padding: 0 10px;
        height: auto;
    }
    
    .chart-area-container {
        flex: 0 0 350px;
        min-height: 350px;
        max-height: 350px;
    }
    
    .control-panel-container {
        flex: 1;
        max-height: none;
        min-height: 300px;
    }
    
    .control-panel-horizontal {
        flex-direction: column;
        gap: 10px;
    }
    
    .control-section {
        min-width: 100%;
        flex: 1;
    }
    
    .info-panel-floating {
        position: static;
        width: 100%;
        border-radius: 0;
        margin-top: 15px;
        max-height: none;
    }
}

/* ==================== 提示框样式 ==================== */
.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* ==================== 模态框样式 ==================== */
#fluorophoreModal .modal-dialog {
    max-width: 600px;  /* 缩小宽度，默认modal-lg是800px */
    width: 90%;
    margin: 1.75rem auto;
}

/* ==================== 导出按钮容器样式 ==================== */
.export-buttons-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.export-buttons-container .btn {
    padding: 8px 20px;
    font-size: 14px;
    border-radius: 4px;
}

.export-buttons-container .btn i {
    margin-right: 6px;
}

/* ==================== 数据表格样式 ==================== */
.data-table-container {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    width: 100%;
    flex: 1;
    overflow-y: auto;
}

.data-table-container h6 {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.fluorophore-table-item {
    display: flex;
    align-items: center;
    padding: 5px 0;
}

.fluorophore-table-name {
    flex: 1;
    color: #333;
}

#spectrumDataTable {
    width: 100%;
    margin-top: 10px;
    font-size: 14px;
}

#spectrumDataTable thead th {
    background-color: #edf2f7;
    font-weight: 700;
    color: #2d3748;
    border: 1px solid #cbd5e0;
    padding: 12px;
    text-align: left;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#spectrumDataTable tbody td {
    border: 1px solid #e2e8f0;
    padding: 12px;
    color: #2d3748;
    font-size: 14px;
}

#spectrumDataTable tbody tr:nth-child(even) {
    background-color: #f7fafc;
}

/* ==================== 图例样式 ==================== */
/* 确保图例颜色正确显示，每个图例项独占一行并居中对齐 */
.chart-container ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
    text-align: center !important;
    width: 100% !important;
    display: block !important;
}

.chart-container li {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    margin: 0 auto !important;
    padding: 2px 0 !important;
    box-sizing: border-box !important;
}

.chart-container li * {
    text-align: center !important;
}

.chart-container li span {
    display: inline-block !important;
    width: 12px !important;
    height: 12px !important;
    margin-right: 5px !important;
    vertical-align: middle !important;
}

/* 模态框优化 - 使弹窗更紧凑 */
.modal-body {
    padding: 12px 15px;
}

.modal-header {
    padding: 10px 15px;
}

.modal-footer {
    padding: 8px 15px;
}

.modal-body .form-group {
    margin-bottom: 8px;
}

.modal-body .form-group label {
    margin-bottom: 3px;
    font-size: 12px;
}

.modal-body select,
.modal-body input {
    font-size: 13px;
    padding: 4px 6px;
}

/* 确保图例项内的所有内容都居中 */
.chart-container li > * {
    display: inline-block !important;
    vertical-align: middle !important;
}

/* ==================== 动画 ==================== */
@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    10% {
        opacity: 1;
        transform: translateY(0);
    }
    90% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(10px);
    }
}

