/* ========================================
   数据库连接池配置工具 - 样式
   主题色：蓝色（#1976d2）· 深绿强调（#388e3c）
   布局：仿 SVG 编辑器三栏全屏沉浸式
   ======================================== */

/* ===== 工具级 CSS 变量 ===== */
:root {
    --dcp-primary:              #1976d2;
    --dcp-primary-hover:        #1565c0;
    --dcp-primary-dark:         #1565c0;
    --dcp-primary-light:        #90caf9;
    --dcp-secondary:            #388e3c;
    --dcp-divider:              #dde3eb;
    /* 滚动条颜色（主面板）*/
    --dcp-scrollbar-thumb:      rgba(25, 118, 210, 0.30);
    --dcp-scrollbar-thumb-hover:rgba(25, 118, 210, 0.55);
    --dcp-scrollbar-track:      transparent;
    /* 滚动条颜色（深色代码预览区）*/
    --dcp-scrollbar-dark-thumb:      rgba(144, 202, 249, 0.25);
    --dcp-scrollbar-dark-thumb-hover:rgba(144, 202, 249, 0.50);
}

/* ===== 主容器 ===== */
.dcp-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 620px;
    background: #f0f4f8;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.dcp-container.dcp-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ===== 顶部工具栏 ===== */
.dcp-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 60%, #1e88e5 100%);
    color: #fff;
    flex-shrink: 0;
    flex-wrap: wrap;
    box-shadow: 0 2px 6px rgba(21, 101, 192, 0.35);
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* 工具栏操作组之间的分隔线 */
.toolbar-group + .toolbar-group {
    border-left: 1px solid rgba(255, 255, 255, 0.22);
    padding-left: 10px;
    margin-left: 2px;
}

.toolbar-btn {
    padding: 6px 11px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #1565c0;
    transition: all 0.2s;
    white-space: nowrap;
}

.toolbar-btn:hover {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.toolbar-btn:active {
    transform: translateY(0);
}

.toolbar-btn-ai {
    background: linear-gradient(135deg, #fff9c4, #fff176);
    color: #e65100;
    font-weight: 600;
}

.toolbar-btn-ai:hover {
    background: #fff;
    color: #bf360c;
}

/* ===== 主内容区（三栏布局）===== */
.dcp-main {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f0f4f8;
}

/* ===== 左侧面板 ===== */
.dcp-left-panel {
    width: 190px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid var(--dcp-divider);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.left-section {
    padding: 10px;
    border-bottom: 1px solid #eef0f4;
}

.section-title {
    font-size: 11px;
    font-weight: 700;
    color: #546e7a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* 预设列表 */
.preset-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 3px;
    border: 1px solid transparent;
}

.preset-item:hover {
    background: #e3f2fd;
    border-color: #90caf9;
}

.preset-item.active {
    background: #e3f2fd;
    border-color: #1976d2;
}

.preset-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.preset-name {
    font-size: 12px;
    font-weight: 600;
    color: #1a237e;
}

.preset-desc {
    font-size: 10px;
    color: #78909c;
    margin-top: 1px;
}

/* 连接池类型 */
.pool-type-item {
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 4px;
    border: 1px solid #e0e4ea;
    background: #fafbfc;
}

.pool-type-item:hover {
    background: #e8f5e9;
    border-color: #81c784;
}

.pool-type-item.active {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-color: #1976d2;
}

.pool-type-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}

.pool-type-name {
    font-size: 12px;
    font-weight: 700;
    color: #1a237e;
}

.pool-badge {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 8px;
    font-weight: 600;
}

.pool-badge-recommended {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.pool-badge-monitor {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}

.pool-badge-stable {
    background: #f3e5f5;
    color: #6a1b9a;
    border: 1px solid #ce93d8;
}

.pool-badge-apache {
    background: #fce4ec;
    color: #c62828;
    border: 1px solid #f48fb1;
}

.pool-type-desc {
    font-size: 10px;
    color: #78909c;
}

/* MySQL 版本 */
.version-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.version-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 5px;
    border: 1px solid #e0e4ea;
    transition: all 0.15s;
}

.version-label:hover {
    background: #e3f2fd;
    border-color: #90caf9;
}

.version-label input[type="radio"] {
    accent-color: #1976d2;
}

.version-text {
    font-size: 12px;
    color: #37474f;
    font-weight: 500;
}

/* 校验摘要 */
.validation-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.validation-item {
    font-size: 11px;
    padding: 4px 7px;
    border-radius: 4px;
    display: flex;
    align-items: flex-start;
    gap: 4px;
    line-height: 1.4;
}

.validation-item.warn {
    background: #fff8e1;
    color: #e65100;
    border: 1px solid #ffcc02;
}

.validation-item.ok {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

/* ===== 中间面板（表单）===== */
.dcp-center-panel {
    flex: 1;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid var(--dcp-divider);
    overflow: hidden;
}

/* 配置 Tab 导航 */
.config-tabs {
    display: flex;
    background: #f5f7fa;
    border-bottom: 2px solid var(--dcp-divider);
    flex-shrink: 0;
}

.config-tab {
    flex: 1;
    padding: 10px 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #78909c;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.config-tab:hover {
    background: #e8f4fd;
    color: #1976d2;
}

.config-tab.active {
    color: #1565c0;
    border-bottom-color: #1565c0;
    background: #fff;
    font-weight: 700;
}

/* Tab 内容 */
.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.tab-content.active {
    display: block;
}

/* JDBC URL 预览 */
.jdbc-url-preview-box {
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    border: 1px solid #90caf9;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 14px;
}

/* JDBC URL 标题行（左文字 + 右复制按钮）*/
.jdbc-url-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    color: #1565c0;
    margin-bottom: 4px;
}

.jdbc-copy-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    color: #1565c0;
    opacity: 0.65;
    transition: all 0.2s;
    line-height: 1;
}

.jdbc-copy-btn:hover {
    opacity: 1;
    background: rgba(25, 118, 210, 0.12);
}

.jdbc-url-text {
    font-size: 11px;
    font-family: 'Consolas', 'Monaco', monospace;
    color: #37474f;
    word-break: break-all;
    line-height: 1.5;
}

/* 表单样式 */
.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 12px;
    flex: 1;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #455a64;
    margin-bottom: 4px;
}

.label-hint {
    font-size: 10px;
    font-weight: 400;
    color: #90a4ae;
    margin-left: 4px;
}

.form-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #cfd8dc;
    border-radius: 5px;
    font-size: 13px;
    color: #37474f;
    background: #fafbfc;
    transition: all 0.2s;
    box-sizing: border-box;
    outline: none;
    font-family: inherit;
}

.form-input:focus {
    border-color: #1976d2;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.12);
}

.form-input[readonly] {
    background: #eceff1;
    color: #78909c;
    cursor: default;
}

.form-select {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #cfd8dc;
    border-radius: 5px;
    font-size: 13px;
    color: #37474f;
    background: #fafbfc;
    transition: all 0.2s;
    box-sizing: border-box;
    outline: none;
    cursor: pointer;
}

.form-select:focus {
    border-color: #1976d2;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.12);
}

.field-hint {
    font-size: 11px;
    color: #90a4ae;
    margin-top: 3px;
    line-height: 1.4;
}

/* 密码输入框 */
.password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrap .form-input {
    padding-right: 34px;
}

.password-toggle-btn {
    position: absolute;
    right: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 15px;
    padding: 0;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.password-toggle-btn:hover {
    opacity: 1;
}

/* 分组标题 */
.section-group {
    background: #f8fafc;
    border: 1px solid #e8ecf0;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
}

.section-group-title {
    font-size: 12px;
    font-weight: 700;
    color: #37474f;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e0e4ea;
}

/* 复选框组 */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #455a64;
}

.checkbox-label input[type="checkbox"] {
    accent-color: #1976d2;
    width: 14px;
    height: 14px;
}

/* 连接池参数分组 */
.pool-param-group {
    background: #f8fafc;
    border: 1px solid #e8ecf0;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
}

.pool-param-group-title {
    font-size: 11px;
    font-weight: 700;
    color: #1565c0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #bbdefb;
}

/* 参数行 */
.param-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.param-row:last-child {
    margin-bottom: 0;
}

.param-label-col {
    flex: 0 0 180px;
}

.param-label {
    font-size: 12px;
    font-weight: 600;
    color: #37474f;
    display: block;
    margin-bottom: 2px;
}

.param-key {
    font-size: 10px;
    color: #90a4ae;
    font-family: monospace;
}

.param-input-col {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.param-desc {
    font-size: 10px;
    color: #90a4ae;
    margin-top: 3px;
    line-height: 1.4;
}

/* Toggle 开关（boolean参数）*/
.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cfd8dc;
    border-radius: 22px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #1976d2;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(18px);
}

.toggle-val-text {
    font-size: 12px;
    color: #546e7a;
    font-weight: 500;
}

/* 快捷键提示行 */
.ael-shortcut-tip {
    margin-top: 8px;
    font-size: 11px;
    color: #aab4be;
}

/* ===== 代码语法高亮颜色（深色背景适配）===== */
.hl-comment    { color: #6a9955; }   /* 注释：绿色 */
.hl-key        { color: #9cdcfe; }   /* 键名：浅蓝 */
.hl-string     { color: #ce9178; }   /* 字符串/属性值：橙色 */
.hl-number     { color: #b5cea8; }   /* 数字：浅绿 */
.hl-bool       { color: #569cd6; }   /* boolean：蓝色 */
.hl-tag        { color: #4ec9b0; }   /* XML标签：青色 */
.hl-attr       { color: #9cdcfe; }   /* XML属性名：浅蓝 */
.hl-keyword    { color: #569cd6; }   /* Java关键字：蓝色 */
.hl-annotation { color: #dcdcaa; }   /* Java注解：黄色 */

/* AI 推荐错误提示 */
.ai-error-hint {
    text-align: center;
    padding: 20px 14px;
    color: #c62828;
    font-size: 12px;
    line-height: 1.7;
    background: #fff3f3;
    border: 1px solid #ffcdd2;
    border-radius: 5px;
}

/* ===== AI 骨架屏占位符 ===== */
.ai-skeleton-wrap {
    padding: 4px 0;
}

.ai-skeleton-title {
    height: 14px;
    width: 55%;
    border-radius: 4px;
    margin-bottom: 14px;
    background: linear-gradient(90deg, #e0e0e0 25%, #f5f5f5 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: skeletonPulse 1.4s ease infinite;
}

.ai-skeleton-row {
    height: 10px;
    border-radius: 4px;
    margin-bottom: 8px;
    background: linear-gradient(90deg, #e0e0e0 25%, #f5f5f5 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: skeletonPulse 1.4s ease infinite;
}

.ai-skeleton-row--short  { width: 50%; }
.ai-skeleton-row--medium { width: 72%; }

.ai-skeleton-section {
    height: 52px;
    border-radius: 5px;
    margin: 12px 0;
    background: linear-gradient(90deg, #e8f5e9 25%, #f1f8f1 50%, #e8f5e9 75%);
    background-size: 200% 100%;
    animation: skeletonPulse 1.4s ease infinite;
}

@keyframes skeletonPulse {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== 滚动条美化 ===== */
.dcp-left-panel::-webkit-scrollbar,
.tab-content::-webkit-scrollbar,
.config-preview-wrap::-webkit-scrollbar,
.ai-sidebar-body::-webkit-scrollbar,
.dcp-modal-body::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

.dcp-left-panel::-webkit-scrollbar-track,
.tab-content::-webkit-scrollbar-track,
.config-preview-wrap::-webkit-scrollbar-track,
.ai-sidebar-body::-webkit-scrollbar-track,
.dcp-modal-body::-webkit-scrollbar-track {
    background: var(--dcp-scrollbar-track);
}

.dcp-left-panel::-webkit-scrollbar-thumb,
.tab-content::-webkit-scrollbar-thumb,
.ai-sidebar-body::-webkit-scrollbar-thumb,
.dcp-modal-body::-webkit-scrollbar-thumb {
    background: var(--dcp-scrollbar-thumb);
    border-radius: 3px;
}

.dcp-left-panel::-webkit-scrollbar-thumb:hover,
.tab-content::-webkit-scrollbar-thumb:hover,
.ai-sidebar-body::-webkit-scrollbar-thumb:hover,
.dcp-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--dcp-scrollbar-thumb-hover);
}

/* 代码预览区滚动条（深色背景）*/
.config-preview-wrap::-webkit-scrollbar-thumb {
    background: var(--dcp-scrollbar-dark-thumb);
    border-radius: 3px;
}

.config-preview-wrap::-webkit-scrollbar-thumb:hover {
    background: var(--dcp-scrollbar-dark-thumb-hover);
}

/* ===== 右侧面板（配置预览）===== */
.dcp-right-panel {
    width: 42%;
    min-width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #1e2730;
    overflow: hidden;
}

/* 格式选项 Tab */
.preview-tabs {
    display: flex;
    background: #16202a;
    flex-shrink: 0;
}

.preview-tab {
    flex: 1;
    padding: 9px 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    color: #78909c;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.preview-tab:hover {
    color: #90caf9;
    background: rgba(25, 118, 210, 0.1);
}

.preview-tab.active {
    color: #64b5f6;
    border-bottom-color: #1976d2;
    background: rgba(25, 118, 210, 0.12);
    font-weight: 700;
}

/* 预览操作栏 */
.preview-toolbar {
    display: flex;
    gap: 8px;
    padding: 7px 12px;
    background: #1a2430;
    border-bottom: 1px solid #2e3d4d;
    flex-shrink: 0;
}

.preview-action-btn {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: #b0bec5;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.preview-action-btn:hover {
    background: rgba(25, 118, 210, 0.3);
    color: #fff;
    border-color: #1976d2;
}

/* 代码预览区 */
.config-preview-wrap {
    flex: 1;
    overflow: auto;
    padding: 0;
}

.config-preview {
    margin: 0;
    padding: 14px 16px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.7;
    color: #aad8f3;
    background: transparent;
    white-space: pre;
    word-break: normal;
    overflow-wrap: normal;
    min-height: 100%;
}

/* 配置提示区 */
.config-notice {
    flex-shrink: 0;
    padding: 0 12px;
    font-size: 11px;
    color: #546e7a;
}

.config-notice .notice-item {
    padding: 6px 0;
    border-top: 1px solid #2e3d4d;
    color: #78909c;
    display: flex;
    align-items: flex-start;
    gap: 5px;
}

/* ===== AI 侧边栏 ===== */
.ai-sidebar {
    position: fixed;
    top: 0;
    right: -440px;
    width: 420px;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 100002;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.ai-sidebar.show {
    right: 0;
}

.ai-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid #e0e4ea;
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    flex-shrink: 0;
}

.ai-sidebar-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #1a237e;
}

.ai-close-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(0, 0, 0, 0.08);
    color: #546e7a;
    font-size: 14px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-close-btn:hover {
    background: rgba(198, 40, 40, 0.1);
    color: #c62828;
}

.ai-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.ai-info-box {
    background: #f3e5f5;
    border: 1px solid #ce93d8;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 12px;
    color: #4a148c;
    line-height: 1.6;
}

.ai-info-box p {
    margin: 0 0 4px 0;
}

.ai-info-box p:last-child {
    margin: 0;
}

.ai-field {
    margin-bottom: 16px;
}

.ai-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #455a64;
    margin-bottom: 5px;
}

.ai-pool-display {
    padding: 7px 12px;
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 700;
    color: #1565c0;
}

.ai-env-summary {
    padding: 7px 12px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    font-size: 12px;
    color: #546e7a;
    line-height: 1.5;
}

.ai-field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cfd8dc;
    border-radius: 5px;
    font-size: 12px;
    line-height: 1.6;
    font-family: inherit;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
    min-height: 70px;
    transition: all 0.2s;
}

.ai-field textarea:focus {
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.12);
}

.ai-actions {
    margin-bottom: 20px;
}

.ai-recommend-btn {
    width: 100%;
    padding: 11px 16px;
    background: linear-gradient(135deg, #1976d2, #1565c0);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ai-recommend-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #1565c0, #0d47a1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.35);
}

.ai-recommend-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ai-result {
    border-top: 1px solid #e0e4ea;
    padding-top: 16px;
}

.ai-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ai-result-header span {
    font-size: 13px;
    font-weight: 700;
    color: #1a237e;
}

.ai-apply-btn {
    padding: 5px 12px;
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-apply-btn:hover {
    background: #2e7d32;
    color: #fff;
    border-color: #2e7d32;
}

.ai-result-content {
    font-size: 12px;
    line-height: 1.6;
    color: #37474f;
}

.ai-result-params {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
}

.ai-result-params-title {
    font-weight: 700;
    color: #2e7d32;
    margin-bottom: 6px;
    font-size: 11px;
    text-transform: uppercase;
}

.ai-param-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 3px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.ai-param-item:last-child {
    border-bottom: none;
}

.ai-param-name {
    font-family: monospace;
    font-size: 11px;
    color: #1a237e;
}

.ai-param-value {
    font-family: monospace;
    font-size: 11px;
    color: #2e7d32;
    font-weight: 600;
}

.ai-warnings {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 5px;
    padding: 8px 10px;
    margin-bottom: 8px;
}

.ai-warnings-title {
    font-weight: 700;
    color: #e65100;
    margin-bottom: 4px;
    font-size: 11px;
}

.ai-warn-item {
    font-size: 11px;
    color: #bf360c;
    padding: 2px 0;
    display: flex;
    gap: 4px;
}

.ai-suggestions {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 5px;
    padding: 8px 10px;
}

.ai-suggestions-title {
    font-weight: 700;
    color: #1565c0;
    margin-bottom: 4px;
    font-size: 11px;
}

.ai-suggest-item {
    font-size: 11px;
    color: #0d47a1;
    padding: 2px 0;
    display: flex;
    gap: 4px;
}

/* AI 遮罩层 */
.ai-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.28);
    z-index: 100001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(2px);
}

.ai-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ===== 模态框（帮助）===== */
.dcp-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 100003;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.dcp-modal.show {
    display: flex;
}

.dcp-modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 720px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dcp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: linear-gradient(135deg, #1565c0, #1976d2);
    color: #fff;
    flex-shrink: 0;
}

.dcp-modal-header h3 {
    margin: 0;
    font-size: 15px;
}

.dcp-modal-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dcp-modal-close:hover {
    background: rgba(255,255,255,0.3);
}

.dcp-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.help-section {
    margin-bottom: 20px;
}

.help-section h4 {
    font-size: 13px;
    font-weight: 700;
    color: #1565c0;
    margin: 0 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #e3f2fd;
}

.help-section ol, .help-section ul {
    margin: 0;
    padding-left: 20px;
    font-size: 12px;
    color: #455a64;
    line-height: 1.8;
}

.help-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.help-table td, .help-table th {
    padding: 6px 10px;
    border: 1px solid #e0e4ea;
    vertical-align: top;
}

.help-table thead th {
    background: #e3f2fd;
    color: #1565c0;
    font-weight: 700;
}

.help-table tbody tr:nth-child(even) td {
    background: #f8fafc;
}

kbd {
    display: inline-block;
    padding: 2px 6px;
    background: #eceff1;
    border: 1px solid #b0bec5;
    border-bottom: 2px solid #90a4ae;
    border-radius: 3px;
    font-family: monospace;
    font-size: 11px;
    color: #37474f;
}

/* ===== Toast 提示 ===== */
.dcp-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(33, 33, 33, 0.88);
    color: #fff;
    padding: 10px 22px;
    border-radius: 24px;
    font-size: 13px;
    z-index: 200000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    animation: toastIn 0.3s ease;
    white-space: nowrap;
}

.dcp-toast.success { background: rgba(46, 125, 50, 0.9); }
.dcp-toast.error   { background: rgba(198, 40, 40, 0.9); }
.dcp-toast.warn    { background: rgba(230, 81, 0, 0.9); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(12px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .dcp-left-panel {
        width: 160px;
    }
    .dcp-right-panel {
        width: 38%;
        min-width: 240px;
    }
}

@media (max-width: 640px) {
    .dcp-main {
        flex-direction: column;
    }
    .dcp-left-panel {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        overflow-y: visible;
        max-height: none;
    }
    .left-section {
        flex: 1;
        min-width: 150px;
    }
    .dcp-center-panel {
        min-width: 0;
    }
    .dcp-right-panel {
        width: 100%;
        min-width: 0;
        min-height: 280px;
    }
    .ai-sidebar {
        width: 100vw;
        right: -100vw;
    }
}

/* ===== 暗黑模式 ===== */
body.theme-dark .dcp-container {
    background: #1a2332;
}

body.theme-dark .dcp-left-panel,
body.theme-dark .dcp-center-panel {
    background: #0f1924;
    border-color: rgba(255,255,255,0.1);
}

body.theme-dark .left-section {
    border-color: rgba(255,255,255,0.07);
}

body.theme-dark .section-title {
    color: #78909c;
}

body.theme-dark .preset-item {
    border-color: rgba(255,255,255,0.1);
}

body.theme-dark .preset-item:hover,
body.theme-dark .preset-item.active {
    background: rgba(25, 118, 210, 0.2);
    border-color: #1976d2;
}

body.theme-dark .preset-name {
    color: #90caf9;
}

body.theme-dark .preset-desc {
    color: #546e7a;
}

body.theme-dark .pool-type-item {
    background: #1a2332;
    border-color: rgba(255,255,255,0.1);
}

body.theme-dark .pool-type-item.active {
    background: rgba(25, 118, 210, 0.2);
    border-color: #1976d2;
}

body.theme-dark .pool-type-name {
    color: #90caf9;
}

body.theme-dark .pool-type-desc {
    color: #546e7a;
}

body.theme-dark .version-label {
    border-color: rgba(255,255,255,0.1);
}

body.theme-dark .version-label:hover {
    background: rgba(25, 118, 210, 0.2);
}

body.theme-dark .version-text {
    color: #b0bec5;
}

body.theme-dark .config-tabs {
    background: #1a2332;
    border-color: rgba(255,255,255,0.1);
}

body.theme-dark .config-tab {
    color: #546e7a;
}

body.theme-dark .config-tab:hover {
    background: rgba(25, 118, 210, 0.15);
    color: #90caf9;
}

body.theme-dark .config-tab.active {
    background: #0f1924;
    color: #90caf9;
    border-bottom-color: #1976d2;
}

body.theme-dark .form-label {
    color: #b0bec5;
}

body.theme-dark .form-input,
body.theme-dark .form-select {
    background: #1a2332;
    border-color: rgba(255,255,255,0.15);
    color: #e0e0e0;
}

body.theme-dark .form-input:focus,
body.theme-dark .form-select:focus {
    background: #1e2d3d;
    border-color: #1976d2;
}

body.theme-dark .form-input[readonly] {
    background: #131e28;
    color: #546e7a;
}

body.theme-dark .jdbc-url-preview-box {
    background: rgba(25, 118, 210, 0.15);
    border-color: rgba(25, 118, 210, 0.4);
}

body.theme-dark .jdbc-url-text {
    color: #90caf9;
}

body.theme-dark .section-group {
    background: #131e28;
    border-color: rgba(255,255,255,0.08);
}

body.theme-dark .section-group-title {
    color: #b0bec5;
    border-color: rgba(255,255,255,0.1);
}

body.theme-dark .pool-param-group {
    background: #131e28;
    border-color: rgba(255,255,255,0.08);
}

body.theme-dark .param-label {
    color: #b0bec5;
}

body.theme-dark .param-key {
    color: #546e7a;
}

body.theme-dark .field-hint,
body.theme-dark .param-desc {
    color: #546e7a;
}

body.theme-dark .ai-sidebar {
    background: #0f1924;
}

body.theme-dark .ai-sidebar-header {
    background: rgba(25, 118, 210, 0.2);
    border-color: rgba(255,255,255,0.1);
}

body.theme-dark .ai-sidebar-header h4 {
    color: #90caf9;
}

body.theme-dark .ai-field label {
    color: #b0bec5;
}

body.theme-dark .ai-info-box {
    background: rgba(156, 39, 176, 0.15);
    border-color: rgba(156, 39, 176, 0.3);
    color: #ce93d8;
}

body.theme-dark .ai-field textarea {
    background: #1a2332;
    border-color: rgba(255,255,255,0.15);
    color: #e0e0e0;
}

body.theme-dark .dcp-modal-body {
    background: #0f1924;
    color: #b0bec5;
}

body.theme-dark .help-section h4 {
    color: #90caf9;
    border-color: rgba(25, 118, 210, 0.3);
}

body.theme-dark .help-section ol,
body.theme-dark .help-section ul {
    color: #b0bec5;
}

body.theme-dark .help-table td,
body.theme-dark .help-table th {
    border-color: rgba(255,255,255,0.1);
    color: #b0bec5;
}

body.theme-dark .help-table thead th {
    background: rgba(25, 118, 210, 0.2);
    color: #90caf9;
}

body.theme-dark .help-table tbody tr:nth-child(even) td {
    background: rgba(255,255,255,0.03);
}

body.theme-dark kbd {
    background: #1a2332;
    border-color: rgba(255,255,255,0.15);
    color: #90caf9;
}

/* 暗色模式 - 骨架屏 */
body.theme-dark .ai-skeleton-title,
body.theme-dark .ai-skeleton-row {
    background: linear-gradient(90deg, #1a2332 25%, #243040 50%, #1a2332 75%);
    background-size: 200% 100%;
    animation: skeletonPulse 1.4s ease infinite;
}

body.theme-dark .ai-skeleton-section {
    background: linear-gradient(90deg, #0f2418 25%, #1a3424 50%, #0f2418 75%);
    background-size: 200% 100%;
    animation: skeletonPulse 1.4s ease infinite;
}

/* 暗色模式 - JDBC 复制按鈕 */
body.theme-dark .jdbc-copy-btn {
    color: #90caf9;
}

body.theme-dark .jdbc-copy-btn:hover {
    background: rgba(144, 202, 249, 0.12);
}

/* 暗色模式 - JDBC URL 标题行 */
body.theme-dark .jdbc-url-label {
    color: #64b5f6;
}

/* 暗色模式 - 连接池参数分组标题 */
body.theme-dark .pool-param-group-title {
    color: #64b5f6;
    border-color: rgba(25, 118, 210, 0.25);
}

/* 暗色模式 - 校验警告条目 */
body.theme-dark .validation-item.warn {
    background: rgba(230, 81, 0, 0.15);
    border-color: rgba(230, 81, 0, 0.3);
    color: #ff8a50;
}

/* 暗色模式 - Toggle 开关 */
body.theme-dark .toggle-slider {
    background-color: #2e3d4d;
}
body.theme-dark .toggle-val-text {
    color: #78909c;
}

/* 暗色模式 - 快捷键提示 */
body.theme-dark .ael-shortcut-tip {
    color: #546e7a;
}

/* 暗色模式 - AI 错误提示 */
body.theme-dark .ai-error-hint {
    background: rgba(198, 40, 40, 0.12);
    border-color: rgba(198, 40, 40, 0.3);
    color: #ef9a9a;
}
