/* 数据库模态弹窗样式 */
.database-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.database-modal.active {
    display: flex !important;
    opacity: 1;
}

.database-modal-content {
    background: rgba(15, 20, 25, 0.98);
    border: 1px solid rgba(0, 219, 255, 0.3);
    border-radius: 8px;
    width: 95vw;
    height: 92vh;
    max-width: 1600px;
    max-height: 1000px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 219, 255, 0.3);
    position: relative;
    transform: scale(0.95) translateY(20px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.database-modal.active .database-modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* 全屏状态 */
.database-modal-content.fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
}

/* 移动端响应式调整 */
@media (max-width: 768px) {
    .database-modal-content {
        width: 98vw;
        height: 95vh;
        max-width: none;
    }
    
    .database-modal-content.fullscreen {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
    
    .database-modal-container {
        flex-direction: row; /* 保持横向布局 */
    }
    
    /* 移动端数据库树改为抽屉式侧边栏 */
    .database-modal-container .db-tree {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(15, 23, 42, 0.95));
        backdrop-filter: blur(20px);
        border: none;
        border-right: 1px solid rgba(0, 219, 255, 0.2);
        z-index: 10001;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
        flex: none;
        padding: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    .database-modal-container .db-tree.mobile-open {
        transform: translateX(0);
    }
    
    /* 移动端db-content占满整个容器 */
    .database-modal-container .db-content {
        flex: 1;
        width: 100%;
    }
    
    /* 移动端数据库树遮罩层 */
    .db-tree-mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 10000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .db-tree-mobile-overlay.show {
        opacity: 1;
        visibility: visible;
    }
    
    /* 移动端数据库树头部 */
    .db-tree-mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 15px 5px 20px 5px;
        border-bottom: 1px solid rgba(0, 219, 255, 0.2);
        margin-bottom: 15px;
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(15, 23, 42, 0.3));
        border-radius: 8px;
        flex-shrink: 0;
    }
    
    .db-tree-mobile-title {
        color: rgba(0, 219, 255, 0.9);
        font-size: 16px;
        font-weight: 600;
        margin: 0;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    }
    
    .db-tree-mobile-close {
        background: rgba(0, 0, 0, 0.2);
        border: 1px solid rgba(0, 219, 255, 0.2);
        color: rgba(255, 255, 255, 0.7);
        cursor: pointer;
        padding: 8px;
        border-radius: 50%;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
    }
    
    .db-tree-mobile-close:hover {
        background: rgba(0, 219, 255, 0.1);
        border-color: rgba(0, 219, 255, 0.4);
        color: rgba(0, 219, 255, 0.9);
        transform: rotate(90deg);
    }
    
    .db-tree-mobile-close svg {
        width: 16px;
        height: 16px;
    }
    
    /* 移动端数据库树内容区域 */
    .database-modal-container .db-tree .db-loading {
        flex: 1;
        overflow-y: auto;
        padding: 15px;
        min-height: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    .database-modal-container .db-tree > :not(.db-tree-mobile-header) {
        padding: 0 15px 15px 15px;
    }
    
    /* 移动端数据库树添加水平滚动 */
    .database-modal-container .db-tree {
        overflow-x: auto;
        overflow-y: auto;
    }
    
    /* 移动端数据库树水平滚动条样式 */
    .database-modal-container .db-tree::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
    
    .database-modal-container .db-tree::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.3);
        border-radius: 4px;
        margin: 2px;
    }
    
    .database-modal-container .db-tree::-webkit-scrollbar-thumb {
        background: rgba(0, 219, 255, 0.3);
        border-radius: 4px;
        border: 1px solid rgba(0, 0, 0, 0.2);
    }
    
    .database-modal-container .db-tree::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 219, 255, 0.5);
    }
    
    /* 为Firefox添加移动端滚动条样式 */
    .database-modal-container .db-tree {
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 219, 255, 0.3) rgba(0, 0, 0, 0.3);
    }
    
    /* 移动端数据库树项目样式微调 */
    .database-modal-container .db-tree .db-tree-item {
        margin-bottom: 8px;
    }
    
    .database-modal-container .db-tree .db-tree-content {
        padding: 8px;
        border-radius: 6px;
        font-size: 14px;
        min-width: fit-content;
        white-space: nowrap;
    }
    
    .database-modal-container .db-tree .db-tree-name {
        white-space: nowrap;
        text-overflow: none;
        overflow: visible;
    }
    
    .database-modal-container .db-tree .db-tree-children {
        margin-left: 16px;
    }
    
    /* 移动端显示菜单按钮 */
    .db-mobile-menu-toggle {
        display: flex !important;
    }
    
    /* 移动端隐藏调整手柄 */
    .database-modal-container .db-tree .db-tree-resize-handle {
        display: none !important;
    }
    
    /* 移动端隐藏全屏按钮（可选，因为在移动端全屏效果可能不明显）*/
    .fullscreen-toggle-button {
        display: none;
    }
}

.database-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

/* 移动端数据库菜单按钮 */
.db-mobile-menu-toggle {
    display: none;
    background: rgba(0, 219, 255, 0.1);
    border: 1px solid rgba(0, 219, 255, 0.2);
    border-radius: 8px;
    color: rgba(0, 219, 255, 0.8);
    cursor: pointer;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-right: 12px;
}

.db-mobile-menu-toggle:hover {
    background: rgba(0, 219, 255, 0.2);
    border-color: rgba(0, 219, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 219, 255, 0.3);
}

.db-mobile-menu-toggle svg {
    width: 18px;
    height: 18px;
    stroke: rgba(0, 219, 255, 0.8);
    transition: transform 0.3s ease;
}

.db-mobile-menu-toggle:hover svg {
    transform: scale(1.1);
    stroke: rgba(0, 219, 255, 1);
}

/* 头部左侧区域，包含菜单按钮和标题 */
.database-modal-header-left {
    display: flex;
    align-items: center;
    gap: 0;
}

/* 桌面端隐藏移动端专用元素 */
@media (min-width: 769px) {
    .db-mobile-menu-toggle,
    .db-tree-mobile-header,
    .db-tree-mobile-overlay {
        display: none !important;
    }
    
    /* 桌面端数据库树保持原有样式，但添加水平滚动 */
    .database-modal-container .db-tree {
        position: static;
        transform: none;
        width: auto;
        height: auto;
        background: transparent;
        backdrop-filter: none;
        border: none;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        z-index: auto;
        box-shadow: none;
        flex: 0 0 300px;
        padding: 15px;
        display: block;
        overflow-y: auto;
        overflow-x: auto; /* 添加水平滚动 */
    }
    
    /* 桌面端数据库树滚动条样式 */
    .database-modal-container .db-tree::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
    
    .database-modal-container .db-tree::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.5);
        border-radius: 4px;
        margin: 2px;
    }
    
    .database-modal-container .db-tree::-webkit-scrollbar-thumb {
        background: #00dbff; /* 使用纯色，不透明 */
        border-radius: 4px;
        border: 1px solid rgba(0, 0, 0, 0.5);
        min-height: 20px; /* 确保最小高度 */
    }
    
    .database-modal-container .db-tree::-webkit-scrollbar-thumb:hover {
        background: #33e5ff; /* 悬停时更亮的纯色 */
    }
    
    /* 桌面端数据库树表名不截断 */
    .database-modal-container .db-tree .db-tree-name {
        overflow: visible;
        text-overflow: none;
        white-space: nowrap;
    }
}

.database-modal.active .database-modal-header {
    opacity: 1;
    transform: translateY(0);
}

.database-modal-header h2 {
    color: #00dbff;
    font-size: 20px;
    margin: 0;
}

.database-modal-header-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fullscreen-toggle-button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-toggle-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #00dbff;
}

.fullscreen-toggle-button svg {
    width: 18px;
    height: 18px;
}

.close-database-modal-button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-database-modal-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.close-database-modal-button svg {
    width: 20px;
    height: 20px;
}

.database-modal-container {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}

.database-modal.active .database-modal-container {
    opacity: 1;
    transform: translateY(0);
}

/* 原数据库侧边栏样式 - 已废弃，改为模态弹窗 */
/*
.database-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 250px;
    background: rgba(0, 0, 0, 0.9);
    border-left: 1px solid rgba(0, 219, 255, 0.3);
    z-index: 103;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
*/

/* 仅在桌面端应用自定义滚动条样式和更大宽度 */
@media (min-width: 769px) {
    /* 移除侧边栏宽度设置，现在在模态弹窗中处理 */
    /*
    .database-sidebar {
        width: 85vw;
    }
    */
}

/* 移动端宽度调整 */
@media (max-width: 768px) {
    /* 移除侧边栏宽度设置，现在在模态弹窗中处理 */
    /*
    .database-sidebar {
        width: 85%;
    }
    */
    
    /* 移动端数据显示区域的滚动条样式 */
    .db-table-view {
        &::-webkit-scrollbar {
            width: 6px;
        }
        &::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.1);
            border-radius: 3px;
        }
        &::-webkit-scrollbar-thumb {
            background: rgba(0, 219, 255, 0.3);
            border-radius: 3px;
        }
        &::-webkit-scrollbar-thumb:hover {
            background: rgba(0, 219, 255, 0.5);
        }
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 219, 255, 0.3) rgba(0, 0, 0, 0.1);
    }
}

/* 拖动条样式 (数据库侧边栏整体拖动) - 模态弹窗中不需要 */
/*
.db-resize-handle {
    position: absolute;
    top: 0;
    left: -5px;
    width: 10px;
    height: 100%;
    cursor: ew-resize;
    z-index: 104;
}
*/

/* 数据库树的基础样式 */
.db-tree {
    flex: 0 0 300px;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto; /* 添加水平滚动 */
    padding: 15px;
    box-sizing: border-box; /* 确保 padding 不影响高度计算 */
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    position: relative; /* 为子元素的绝对定位做准备 */
}

/* 数据库树的自定义滚动条样式 */
.db-tree::-webkit-scrollbar {
    width: 8px;
    height: 8px; /* 添加水平滚动条高度 */
}

.db-tree::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    margin: 2px;
}

.db-tree::-webkit-scrollbar-thumb {
    background: #00dbff; /* 使用纯色，不透明 */
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.5);
    min-height: 20px; /* 确保最小高度 */
}

.db-tree::-webkit-scrollbar-thumb:hover {
    background: #33e5ff; /* 悬停时更亮的纯色 */
}

/* 为Firefox添加数据库树滚动条样式 */
.db-tree {
    scrollbar-width: thin;
    scrollbar-color: #00dbff rgba(0, 0, 0, 0.5);
}

/* 数据库内容区域 */
.db-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 树和内容之间的垂直拖动手柄 */
.db-tree-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    background-color: transparent;
    transition: background-color 0.2s;
    z-index: 10;
}

.db-tree-resize-handle:hover {
    background-color: rgba(0, 219, 255, 0.3);
}

/* SQL查询区域 */
.sql-query-area {
    display: flex;
    flex-direction: column;
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sql-query-input {
    width: 100%;
    height: 100px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 219, 255, 0.3);
    border-radius: 4px;
    color: #00dbff;
    resize: vertical;
    font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    overflow: auto;
    margin-bottom: 10px;
}

/* 添加SQL输入区域的自定义滚动条样式 */
.sql-query-input::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.sql-query-input::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    margin: 2px;
}

.sql-query-input::-webkit-scrollbar-thumb {
    background: rgba(0, 219, 255, 0.3);
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.sql-query-input::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 219, 255, 0.5);
}

/* 为Firefox添加样式 */
.sql-query-input {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 219, 255, 0.3) rgba(0, 0, 0, 0.3);
}

/* SQL语法高亮 */
.sql-query-input::selection {
    background: rgba(0, 219, 255, 0.3);
    color: #fff;
}

.sql-query-input:focus {
    outline: none;
    border-color: rgba(0, 219, 255, 0.8);
    box-shadow: 0 0 5px rgba(0, 219, 255, 0.3);
}

.query-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.action-buttons .db-pagination-button {
    height: 36px;
    background: rgba(106, 90, 205, 0.2); /* 紫罗兰色调 */
    display: flex;
    align-items: center;
    border: 1px solid rgba(106, 90, 205, 0.7); /* 加深边框颜色透明度 */
}

.action-buttons .db-pagination-button:hover {
    background: rgba(106, 90, 205, 0.4);
}

.action-buttons .db-pagination-button.filter-active {
    background: rgba(106, 90, 205, 0.4);
    border-color: rgba(106, 90, 205, 0.9);
}

.action-buttons .db-pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(106, 90, 205, 0.1);
}

/* 即使是禁用状态，也允许hover效果，且效果更明显 */
.action-buttons .db-pagination-button:disabled:hover {
    background: rgba(106, 90, 205, 0.3);
    opacity: 0.7;
}

.sql-execute-button, .db-export-button, .db-chart-button {
    background: rgba(0, 219, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(0, 219, 255, 0.5);
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    height: 36px;
    display: flex;
    align-items: center;
}

.sql-execute-button:hover, .db-export-button:hover, .db-chart-button:hover {
    background: rgba(0, 219, 255, 0.4);
}

.db-export-button {
    background: rgba(0, 180, 40, 0.2);
    border-color: rgba(0, 180, 40, 0.5);
}

.db-export-button:hover {
    background: rgba(0, 180, 40, 0.4);
}

.db-export-button:disabled:hover {
    background: rgba(0, 180, 40, 0.3);
}

.db-chart-button {
    background: rgba(255, 150, 0, 0.2);
    border-color: rgba(255, 150, 0, 0.5);
}

.db-chart-button:hover {
    background: rgba(255, 150, 0, 0.4);
}

.db-chart-button:disabled:hover {
    background: rgba(255, 150, 0, 0.3);
}

.db-export-button svg, .db-chart-button svg {
    width: 16px;
    height: 16px;
}

.db-export-button:disabled, .db-chart-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 数据表显示区域 */
.db-table-view {
    flex: 1;
    overflow: hidden; /* 让内部容器处理滚动 */
    padding: 15px 15px 0 15px; /* 顶部和两侧保留填充，底部不填充 */
    position: relative; /* 为绝对定位的tooltip做准备 */
    display: flex;
    flex-direction: column;
}

/* 非表格内容的通用容器样式 */
.db-content-view {
    flex: 1;
    overflow: auto; /* 自动显示滚动条 */
    padding: 15px;
    margin-right: 2px; /* 让垂直滚动条外露 */
    margin-bottom: 5px; /* 让水平滚动条外露 */
    
    /* 自定义滚动条样式 */
    &::-webkit-scrollbar {
        width: 12px;
        height: 12px;
        background: transparent;
    }
    &::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.1);
        border-radius: 3px;
        margin: 4px;
    }
    &::-webkit-scrollbar-thumb {
        background: rgba(0, 219, 255, 0.3);
        border-radius: 3px;
        border: 1px solid rgba(0, 0, 0, 0.2);
    }
    &::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 219, 255, 0.5);
    }
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 219, 255, 0.3) rgba(0, 0, 0, 0.1);
}

/* 数据库信息列表样式 */
.db-info-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    overflow-x: auto; /* 允许横向滚动 */
    white-space: nowrap; /* 防止文本换行 */
}

.db-info-list li {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.db-info-list li:hover {
    background: rgba(0, 219, 255, 0.1);
}

.db-info-heading {
    color: #00dbff;
    margin-top: 0;
    margin-bottom: 15px;
    word-break: break-word; /* 允许长标题在必要时断行 */
}

/* 表格滚动包装容器 */
.table-scroll-wrapper {
    overflow-x: auto;
    margin-bottom: 0; /* 减少底部边距以便水平滚动条更靠近底部 */
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 16px; /* 为水平滚动条留出更多空间 */
    
    /* 自定义滚动条 */
    &::-webkit-scrollbar {
        height: 12px; /* 进一步增加水平滚动条高度，使其更容易点击 */
    }
    &::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.1);
        border-radius: 3px;
        margin: 0 4px; /* 在两侧添加边距 */
    }
    &::-webkit-scrollbar-thumb {
        background: rgba(0, 219, 255, 0.3);
        border-radius: 3px;
        border: 1px solid rgba(0, 0, 0, 0.2); /* 添加边框以增强可见性 */
    }
    &::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 219, 255, 0.5);
    }
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 219, 255, 0.3) rgba(0, 0, 0, 0.1);
}

.table-container {
    overflow-y: auto;
    flex: 1;
    padding-right: 10px; /* 为垂直滚动条留出更多空间 */
    margin-right: 2px; /* 增加右侧边距，使滚动条更外露 */
    
    /* 自定义垂直滚动条 */
    &::-webkit-scrollbar {
        width: 12px; /* 增加垂直滚动条宽度，使其更容易点击 */
        background: transparent;
    }
    &::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.1);
        border-radius: 3px;
        margin: 4px 0;
    }
    &::-webkit-scrollbar-thumb {
        background: rgba(0, 219, 255, 0.3);
        border-radius: 3px;
        border: 1px solid rgba(0, 0, 0, 0.2); /* 添加边框以增强可见性 */
    }
    &::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 219, 255, 0.5);
    }
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 219, 255, 0.3) rgba(0, 0, 0, 0.1);
}

.db-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: #fff;
    table-layout: fixed; /* 固定表格布局，便于调整列宽 */
}

.db-table th {
    background: rgba(0, 219, 255, 0.2);
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 219, 255, 0.5);
    position: relative; /* 为列调整器做准备 */
    white-space: nowrap; /* 列标题不换行 */
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 100px; /* 最小列宽 */
}

/* 可排序表头样式 */
.sortable-header {
    cursor: pointer;
    user-select: none;
}

.sortable-header:hover {
    background: rgba(0, 219, 255, 0.3);
}

.sortable-header.sorted {
    background: rgba(0, 219, 255, 0.3);
}

/* 排序指示器样式 */
.sort-indicator {
    display: inline-block;
    margin-left: 5px;
    font-size: 10px;
    vertical-align: middle;
    color: rgba(255, 255, 255, 0.8);
}

.db-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap; /* 单元格内容不换行 */
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative; /* 为tooltip做准备 */
}

.db-table tr:hover {
    background: rgba(0, 219, 255, 0.1);
}

/* 列宽调整器 */
.column-resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    background-color: rgba(0, 219, 255, 0.3);
    cursor: col-resize;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.2s;
}

.db-table th:hover .column-resizer {
    opacity: 1;
}

/* 单元格tooltip */
.cell-tooltip {
    position: absolute;
    background: rgba(40, 44, 52, 0.95);
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 10200;
    max-width: 300px;
    word-wrap: break-word;
    border: 1px solid rgba(0, 219, 255, 0.5);
    font-size: 14px;
    display: none;
}

/* 树结构展开图标样式修改 */
.db-tree-item.expanded > .db-tree-content .db-tree-expander svg polyline {
    transform: rotate(90deg);
    transform-origin: center;
}

/* 确保列宽调整时的流畅体验 */
.db-table.resizing {
    cursor: col-resize;
    user-select: none;
}

/* 分页控件 */
.db-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 5px; /* 在分页控件上方添加额外间距 */
}

.db-pagination-info {
    color: #aaa;
}

/* Desktop pagination layout */
.db-pagination-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.db-pagination-row-1 {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.db-pagination-row-2 {
    display: none; /* Hide second row by default (desktop view) */
}

.mobile-jump {
    display: none; /* Hide mobile jump controls by default */
}

.db-pagination-button {
    background: rgba(0, 219, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(0, 219, 255, 0.5);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.db-pagination-button:hover {
    background: rgba(0, 219, 255, 0.4);
}

.db-pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 页码跳转样式 */
.db-page-jump {
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
}

.db-page-jump input {
    width: 60px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    border: 1px solid rgba(0, 219, 255, 0.3);
    border-radius: 4px;
    padding: 4px 5px;
    text-align: center;
    font-size: 13px;
    height: 28px;
}

.db-page-jump input:focus {
    outline: none;
    border-color: rgba(0, 219, 255, 0.7);
}

/* 移除input中的spinner箭头 */
.db-page-jump input::-webkit-outer-spin-button,
.db-page-jump input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.db-page-jump input[type=number] {
    -moz-appearance: textfield;
}

/* 更新跳转按钮样式使其更紧凑 */
.db-page-jump .db-pagination-button {
    padding: 4px 8px;
    height: 28px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 219, 255, 0.3);
    min-width: 40px;
    margin-left: 2px;
}

.db-page-jump .db-pagination-button:hover {
    background: rgba(0, 219, 255, 0.2);
    border-color: rgba(0, 219, 255, 0.5);
}

/* Mobile-specific pagination layout */
@media (max-width: 768px) {
    .db-pagination {
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }
    
    .db-pagination-info {
        align-self: center;
        margin-bottom: 5px;
    }
    
    .db-pagination-controls {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    
    /* First row - navigation buttons */
    .db-pagination-row-1 {
        width: 100%;
        display: flex;
        justify-content: center;
        gap: 10px;
    }
    
    /* Hide desktop jump controls */
    .desktop-jump {
        display: none !important;
    }
    
    /* Style navigation buttons */
    .nav-button {
        flex: none;
        padding: 4px 12px;
        font-size: 12px;
        min-width: auto;
        width: auto;
        white-space: nowrap;
        background: rgba(0, 219, 255, 0.2);
        border: 1px solid rgba(0, 219, 255, 0.5);
    }
    .nav-button:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        background: rgba(0, 219, 255, 0.1);
    }
    
    /* Show second row with jump controls */
    .db-pagination-row-2 {
        display: flex;
        width: 100%;
        justify-content: center;
    }
    
    /* Show mobile jump controls */
    .mobile-jump {
        display: flex !important;
        justify-content: center;
        align-items: center;
        gap: 5px;
        margin: 0 auto;
    }
    
    /* Style mobile jump controls */
    .mobile-jump input {
        width: 40px;
        background: rgba(0, 0, 0, 0.3);
        color: #fff;
        border: 1px solid rgba(0, 219, 255, 0.3);
        border-radius: 4px;
        padding: 4px 5px;
        text-align: center;
        font-size: 12px;
    }
    
    .mobile-jump .db-pagination-button {
        flex: none;
        width: auto;
        padding: 4px 8px;
        height: 28px;
        font-size: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(0, 0, 0, 0.4);
        border: 1px solid rgba(0, 219, 255, 0.3);
        min-width: 40px;
        max-width: 50px;
        white-space: nowrap;
        margin-left: 2px;
    }
    
    .mobile-jump .db-page-info {
        font-size: 12px;
    }
}

/* Special styling for jump control in the second row */
@media (max-width: 768px) {
    .db-pagination-row-2 {
        display: flex;
        width: 100%;
    }
    
    /* Create a container specifically for mobile jump control in second row */
    .db-pagination-row-2 .db-page-jump {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 5px;
        margin: 0 auto;
    }
}

/* 数据库树结构 */
.db-tree-item {
    margin-bottom: 5px;
    user-select: none;
}

.db-tree-content {
    display: flex;
    align-items: center;
    padding: 5px;
    cursor: pointer;
    color: #fff;
    border-radius: 4px;
}

.db-tree-content:hover {
    background: rgba(0, 219, 255, 0.2);
}

.db-tree-content.active {
    background: rgba(0, 219, 255, 0.3);
}

.db-tree-icon {
    margin-right: 5px;
    display: flex;
    align-items: center;
}

.db-tree-expander {
    width: 16px;
    height: 16px;
    margin-right: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.db-tree-name {
    flex: 1;
    overflow: visible; /* 改为可见，不截断 */
    text-overflow: none; /* 不使用省略号 */
    white-space: nowrap; /* 保持不换行 */
}

.db-tree-children {
    margin-left: 20px;
    display: none;
}

.db-tree-item.expanded > .db-tree-children {
    display: block;
}

/* 数据库侧边栏遮罩层 */
/*
.database-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 102;
    display: none;
}
*/

/* 数据库加载中显示 */
.db-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #00dbff;
    height: 100%;
    text-align: center;
}

.db-loading-spinner {
    border: 4px solid rgba(0, 219, 255, 0.1);
    border-left: 4px solid rgba(0, 219, 255, 0.8);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

/* 错误提示样式 */
.db-error-icon {
    margin-bottom: 15px;
}

.db-error-message {
    color: #ff4a4a;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.db-error-details {
    color: #ff8080;
    background: rgba(255, 0, 0, 0.1);
    padding: 10px 15px;
    border-radius: 4px;
    border: 1px solid rgba(255, 0, 0, 0.3);
    max-width: 90%;
    word-break: break-word;
    font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

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

/* 数据库视图布局 */
/*
.database-sidebar.active {
    transform: translateX(0);
    display: flex;
}

.database-sidebar-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.close-database-sidebar-button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 5px;
    margin-right: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-database-sidebar-button svg {
    width: 24px;
    height: 24px;
    stroke: #00dbff;
}
*/

/* 导出提示对话框样式 */
.db-export-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.db-export-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.db-export-modal-content {
    background: rgba(25, 25, 35, 0.95);
    border: 1px solid rgba(0, 219, 255, 0.5);
    border-radius: 8px;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.db-export-modal-content h3 {
    color: #00dbff;
    margin-top: 0;
    margin-bottom: 15px;
}

.db-export-modal-content p {
    color: #fff;
    margin-bottom: 20px;
}

.db-export-modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.db-export-modal-button {
    background: rgba(0, 219, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(0, 219, 255, 0.5);
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.db-export-modal-button:hover {
    background: rgba(0, 219, 255, 0.4);
}

.db-export-modal-button.confirm {
    background: rgba(0, 180, 40, 0.2);
    border-color: rgba(0, 180, 40, 0.5);
}

.db-export-modal-button.confirm:hover {
    background: rgba(0, 180, 40, 0.4);
}

/* 自定义警告弹窗样式 */
.db-alert-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10100; /* 增加z-index值，确保在其他弹窗之上 */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.db-alert-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.db-alert-modal-content {
    background: rgba(25, 25, 35, 0.95);
    border: 1px solid rgba(0, 219, 255, 0.5);
    border-radius: 8px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.db-alert-icon {
    margin-bottom: 15px;
}

.db-alert-modal-content p {
    color: #fff;
    margin-bottom: 20px;
}

.db-alert-modal-button {
    background: rgba(0, 219, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(0, 219, 255, 0.5);
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    margin: 0 auto;
    display: block;
}

.db-alert-modal-button:hover {
    background: rgba(0, 219, 255, 0.4);
}

/* 绘图对话框样式 */
.db-chart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.db-chart-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.db-chart-modal-content {
    background: rgba(25, 25, 35, 0.98);
    border: 1px solid rgba(0, 219, 255, 0.5);
    border-radius: 8px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.db-chart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.db-chart-modal-header h3 {
    color: #00dbff;
    margin: 0;
}

.db-chart-close-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.db-chart-close-button svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
    transition: stroke 0.2s;
}

.db-chart-close-button:hover svg {
    stroke: #00dbff;
}

.db-chart-config {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chart-config-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.chart-config-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
    flex: 1;
}

.chart-config-item label {
    color: #ddd;
    font-size: 14px;
}

.chart-config-item select, .chart-config-item input {
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: 1px solid rgba(0, 219, 255, 0.3);
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 14px;
    outline: none;
}

.chart-config-item select:focus, .chart-config-item input:focus {
    border-color: rgba(0, 219, 255, 0.7);
    box-shadow: 0 0 5px rgba(0, 219, 255, 0.3);
}

.chart-series {
    flex-grow: 1;
}

.chart-series-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    max-height: 120px;
    overflow-y: auto;
    padding: 5px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.chart-series-options::-webkit-scrollbar {
    width: 8px;
}

.chart-series-options::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.chart-series-options::-webkit-scrollbar-thumb {
    background: rgba(0, 219, 255, 0.3);
    border-radius: 4px;
}

.chart-series-options::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 219, 255, 0.5);
}

.chart-series-option {
    display: flex;
    align-items: center;
    gap: 5px;
    user-select: none;
}

/* Custom checkbox styling */
.chart-series-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.chart-series-option label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    color: #fff;
    padding-left: 24px;
    position: relative;
}

.chart-series-option label:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 16px;
    height: 16px;
    border: 1px solid rgba(0, 219, 255, 0.5);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    transition: all 0.2s ease;
}

.chart-series-option label:after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid #00dbff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    opacity: 0;
    transition: all 0.2s ease;
}

.chart-series-option input[type="checkbox"]:checked + label:before {
    background: rgba(0, 219, 255, 0.2);
    border-color: rgba(0, 219, 255, 0.8);
}

.chart-series-option input[type="checkbox"]:checked + label:after {
    opacity: 1;
    transform: rotate(45deg) scale(1);
}

.chart-series-option input[type="checkbox"]:focus + label:before {
    box-shadow: 0 0 5px rgba(0, 219, 255, 0.5);
}

.chart-series-option:hover label:before {
    border-color: rgba(0, 219, 255, 0.8);
}

/* Style for select elements */
.chart-config-item select {
    appearance: none;
    background: rgba(0, 0, 0, 0.4) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2300dbff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
    cursor: pointer;
}

/* Custom select dropdown styling */
select option {
    background-color: rgba(15, 20, 30, 0.95);
    color: #fff;
    padding: 10px;
    border: none;
}

.db-chart-generate-button {
    background: linear-gradient(to right, rgba(0, 219, 255, 0.4), rgba(0, 150, 255, 0.4));
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    align-self: center;
    margin-top: 5px;
}

.db-chart-generate-button:hover {
    background: linear-gradient(to right, rgba(0, 219, 255, 0.6), rgba(0, 150, 255, 0.6));
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.db-chart-generate-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
}

.db-chart-container {
    flex: 1;
    padding: 20px;
    min-height: 400px;
    overflow: hidden;
}

/* Style for chart canvas container */
.chart-area {
    width: 100%;
    height: 100%;
    min-height: 400px;
    background: rgba(15, 18, 25, 0.7);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden; /* Prevent chart from expanding outside its container */
    cursor: grab; /* Indicate that area is draggable for panning */
}

.chart-area:active {
    cursor: grabbing; /* Change cursor when actively dragging */
}

/* Fix for zoom selection height issues */
#chart-canvas {
    max-height: 400px; /* Enforce maximum height */
}

/* 图表错误信息样式 */
.chart-error {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #ff6b6b;
    background-color: rgba(30, 30, 40, 0.9);
    text-align: center;
}

.chart-error .error-icon {
    font-size: 32px;
    margin-bottom: 15px;
}

.chart-error p {
    margin: 5px 0;
}

.chart-error .error-detail {
    font-size: 0.9em;
    color: #aaa;
    max-width: 80%;
    overflow-wrap: break-word;
    margin-top: 10px;
    padding: 10px;
    background-color: rgba(20, 20, 30, 0.7);
    border-radius: 4px;
}

/* 图表占位符 */
.chart-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.3);
}

.chart-placeholder svg {
    width: 80px;
    height: 80px;
    stroke: rgba(0, 219, 255, 0.2);
    margin-bottom: 15px;
}

.chart-placeholder p {
    font-size: 16px;
}

/* 适配移动设备 */
@media (max-width: 768px) {
    .db-chart-modal-content {
        width: 95vw;
        max-height: 90vh;
        max-width: none;
    }
    
    .chart-config-item {
        min-width: 100%;
    }
}

/* Adjust the pagination dropdown styling to match */
#page-size-selector {
    appearance: none;
    background-color: rgba(0, 0, 0, 0.4) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2300dbff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 5px center !important;
    color: #fff !important;
    border: 1px solid rgba(0, 219, 255, 0.3) !important;
    border-radius: 4px !important;
    padding: 2px 20px 2px 5px !important;
    margin-left: 10px !important;
}

/* Chart.js 样式定制 */
.chart-tooltip {
    background: rgba(25, 25, 35, 0.9) !important;
    border: 1px solid rgba(0, 219, 255, 0.5) !important;
    border-radius: 4px !important;
    color: #fff !important;
    font-family: Arial, sans-serif !important;
    padding: 8px 12px !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3) !important;
    z-index: 10200 !important;
}

.chart-tooltip-header {
    font-weight: bold;
    color: #00dbff;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 3px;
}

.chart-tooltip-body {
    display: flex;
    align-items: center;
    gap: 5px;
}

.chart-tooltip-color {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.chart-tooltip-label {
    font-size: 13px;
}

.chart-tooltip-value {
    font-weight: bold;
    margin-left: auto;
}

/* 图表分页控件样式 */
.chart-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chart-pagination button {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 1px solid rgba(0, 219, 255, 0.3);
    border-radius: 4px;
    padding: 3px 10px;
    margin: 0 5px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.chart-pagination button:hover {
    background: rgba(0, 219, 255, 0.2);
    border-color: rgba(0, 219, 255, 0.7);
}

.chart-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.3);
}

.chart-page-info {
    margin: 0 10px;
    color: #ccc;
    font-size: 12px;
}

.chart-page-goto {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

.chart-page-goto input {
    width: 50px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 1px solid rgba(0, 219, 255, 0.3);
    border-radius: 4px;
    padding: 3px 5px;
    text-align: center;
    font-size: 12px;
}

.chart-page-goto button {
    margin-left: 5px;
}

.chart-page-size {
    display: flex;
    align-items: center;
    margin-left: 15px;
}

.chart-page-size span {
    color: #ccc;
    font-size: 12px;
    margin-right: 5px;
}

#chart-page-size-selector {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 1px solid rgba(0, 219, 255, 0.3);
    border-radius: 4px;
    padding: 3px 5px;
    font-size: 12px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2300dbff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 5px center;
    padding-right: 20px;
    cursor: pointer;
}

#chart-page-size-selector:hover {
    border-color: rgba(0, 219, 255, 0.7);
}

.db-page-info {
    color: #aaa;
    font-size: 12px;
    margin: 0 5px;
    white-space: nowrap;
}

/* 筛选模态框样式 */
.db-filter-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    transition: opacity 0.3s ease;
    opacity: 0;
}

.db-filter-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.db-filter-modal-content {
    width: 650px;
    max-width: 95%;
    background: linear-gradient(to bottom, #1a1a2e, #16213e);
    border: 1px solid rgba(0, 219, 255, 0.5);
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    color: #f0f0f0;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* 防止内容溢出 */
    box-sizing: border-box;
}

.db-filter-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.db-filter-modal-header h3 {
    margin: 0;
    color: rgba(0, 219, 255, 0.9);
}

.db-filter-close-button {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    width: 30px;
    height: 30px;
    padding: 5px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.db-filter-close-button:hover {
    color: rgba(0, 219, 255, 0.9);
    background: rgba(0, 219, 255, 0.1);
}

.db-filter-close-button svg {
    width: 18px;
    height: 18px;
}

.db-filter-conditions {
    padding: 15px 20px;
    overflow-y: auto;
    max-height: 50vh;
    width: 100%;
    box-sizing: border-box;
}

.db-filter-condition {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    position: relative;
    padding-right: 32px;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

.db-filter-condition select, 
.db-filter-condition input {
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    border: 1px solid rgba(0, 219, 255, 0.3);
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 14px;
    min-width: 0; /* 确保内容可以正常收缩 */
    width: 100%; /* 让输入框填满其容器 */
    box-sizing: border-box;
}

.db-filter-condition select:focus, 
.db-filter-condition input:focus {
    outline: none;
    border-color: rgba(0, 219, 255, 0.7);
}

.db-filter-column {
    flex: 2;
    min-width: 0; /* 允许在必要时收缩 */
    
    /* 自定义滚动条样式 */
    &::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }
    
    &::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.1);
        border-radius: 3px;
    }
    
    &::-webkit-scrollbar-thumb {
        background: rgba(0, 150, 255, 0.5);
        border-radius: 3px;
    }
    
    &::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 150, 255, 0.7);
    }
    
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 150, 255, 0.5) rgba(0, 0, 0, 0.1);
}

.db-filter-operator {
    flex: 1;
    min-width: 0; /* 允许在必要时收缩 */
}

.db-filter-value {
    flex: 2;
    min-width: 0; /* 允许在必要时收缩 */
}

.db-filter-remove {
    position: absolute;
    right: 0;
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    width: 24px;
    height: 24px;
    padding: 2px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.db-filter-remove:hover {
    color: #ff4d4f;
    background: rgba(255, 77, 79, 0.1);
}

.db-filter-remove svg {
    width: 16px;
    height: 16px;
}

.db-filter-buttons {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.db-filter-add-button {
    background: rgba(0, 219, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(0, 219, 255, 0.5);
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.db-filter-add-button:hover {
    background: rgba(0, 219, 255, 0.3);
}

.db-filter-action-buttons {
    display: flex;
    gap: 10px;
}

.db-filter-reset-button {
    background: rgba(150, 150, 150, 0.2);
    color: #fff;
    border: 1px solid rgba(150, 150, 150, 0.5);
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
}

.db-filter-reset-button:hover {
    background: rgba(150, 150, 150, 0.3);
}

.db-filter-apply-button {
    background: rgba(0, 219, 255, 0.3);
    color: #fff;
    border: 1px solid rgba(0, 219, 255, 0.6);
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.db-filter-apply-button:hover {
    background: rgba(0, 219, 255, 0.4);
}

/* 筛选按钮激活状态 */
.db-pagination-button.filter-active {
    background: rgba(0, 219, 255, 0.4);
    border-color: rgba(0, 219, 255, 0.8);
}

/* 自然语言处理指示器样式 */
.nl-processing-indicator {
    margin-top: 20px;
    padding: 15px;
    background-color: rgba(0, 219, 255, 0.1);
    border-radius: 8px;
    text-align: center;
}

.thinking-dots {
    margin: 10px 0;
    text-align: center;
    font-size: 24px;
    height: 24px;
}

.thinking-dots span {
    display: inline-block;
    margin: 0 2px;
    opacity: 0.3;
    transition: all 0.3s ease;
}

/* 数据库侧边栏登录覆盖层 */
.database-sidebar-login-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.92);
    border-top: 1px solid rgba(78, 204, 255, 0.3);
    color: #fff;
    z-index: 105;
    padding: 20px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    margin-top: 60px; /* Account for the header height instead of using top: 60px */
    height: calc(100% - 60px); /* Adjust height to account for the header */
}

.database-sidebar-login-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.database-sidebar-login-overlay .login-requirement-icon {
    margin-bottom: 15px;
    position: relative;
    width: 70px;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.database-sidebar-login-overlay .login-requirement-icon svg {
    filter: drop-shadow(0 0 8px rgba(78, 204, 255, 0.5));
    animation: pulseIcon 2s infinite ease-in-out;
}

@keyframes pulseIcon {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 8px rgba(78, 204, 255, 0.5));
    }
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 12px rgba(78, 204, 255, 0.7));
    }
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 8px rgba(78, 204, 255, 0.5));
    }
}

.database-sidebar-login-overlay h2 {
    background: linear-gradient(to right, #4eceff, #c054ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
    font-weight: 600;
    margin: 15px 0;
    letter-spacing: 1px;
    font-size: 24px;
}

.database-sidebar-login-overlay p {
    margin-bottom: 25px;
    font-size: 16px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    max-width: 90%;
    text-align: center;
    padding: 0 20px;
}

.database-sidebar-login-overlay .buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 10px;
    width: 100%;
    max-width: 300px;
}

.database-sidebar-login-overlay .buttons button {
    flex: 1;
    background: linear-gradient(135deg, #4eceff, #c054ff);
    border-radius: 12px;
    border: none;
    padding: 12px 20px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

#database-sidebar-login-button {
    background: linear-gradient(135deg, #4eceff, #c054ff);
    color: #fff;
}

#database-sidebar-login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

#database-sidebar-cancel-button {
    background: linear-gradient(135deg, #4a4a6b, #2d325a);
    color: #fff;
}

#database-sidebar-cancel-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Button hover effect */
.database-sidebar-login-overlay .buttons button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.database-sidebar-login-overlay .buttons button:hover::after {
    left: 100%;
}

/* Hide database content when login overlay is active */
.database-sidebar-login-overlay.active ~ .db-tree,
.database-sidebar-login-overlay.active ~ .db-content,
.database-sidebar-login-overlay.active ~ .sql-query-area {
    display: none !important;
}

/* Mobile optimization for database sidebar login overlay */
@media (max-width: 768px) {
    .database-sidebar-login-overlay {
        padding: 18px;
        margin-top: 50px; /* Adjust for smaller header on mobile */
        height: calc(100% - 50px);
    }
    
    .database-sidebar-login-overlay .login-requirement-icon {
        margin-bottom: 10px;
        width: 50px;
        height: 50px;
    }
    
    .database-sidebar-login-overlay .login-requirement-icon svg {
        width: 30px;
        height: 30px;
    }
    
    .database-sidebar-login-overlay h2 {
        font-size: 20px;
        margin: 6px 0 8px 0;
    }
    
    .database-sidebar-login-overlay p {
        font-size: 15px;
        margin-bottom: 16px;
        padding: 0 10px;
    }
    
    .database-sidebar-login-overlay .buttons {
        gap: 12px;
        max-width: 250px;
    }
    
    .database-sidebar-login-overlay .buttons button {
        padding: 9px 14px;
        font-size: 14px;
    }
    
    /* Mobile optimization for database pagination */
    .db-pagination {
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }
    
    .db-pagination-info {
        align-self: center;
        margin-bottom: 5px;
    }
    
    .db-pagination-controls {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    
    /* First row - navigation buttons */
    .db-pagination-row-1 {
        width: 100%;
        display: flex;
        justify-content: center;
        gap: 10px;
    }
    
    /* Second row - jump controls */
    .db-pagination-row-2 {
        display: flex;
        width: 100%;
        justify-content: center;
    }
    
    .db-pagination-button {
        min-width: auto;
        padding: 4px 8px;
        font-size: 12px;
        flex: none;
        white-space: nowrap;
    }
    
    .db-page-jump {
        gap: 5px;
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    .db-page-jump input {
        width: 40px;
        font-size: 12px;
    }
    
    .db-page-info {
        font-size: 12px;
    }
}

/* 筛选模态框移动端适配 */
@media (max-width: 576px) {
    .db-filter-condition {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding-right: 0; /* 移动端移除右侧内边距 */
        padding-bottom: 30px; /* 为删除按钮留出空间 */
    }
    
    .db-filter-column,
    .db-filter-operator,
    .db-filter-value {
        width: 100%;
    }
    
    .db-filter-remove {
        position: absolute;
        bottom: 0;
        right: 0;
    }
}

/* toast通知样式 */
.db-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 10300;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s;
    opacity: 0;
    max-width: 80%;
    text-align: center;
    font-size: 14px;
    line-height: 1.4;
    border-left: 3px solid rgba(0, 219, 255, 0.7);
}

.db-toast.warning {
    border-left: 3px solid rgba(255, 204, 0, 0.7);
}

.db-toast.error {
    border-left: 3px solid rgba(255, 77, 79, 0.7);
} 