/* 
 * Telegram营销工具前端样式表
 * 现代化、简约风格的管理界面
 */

/* 全局样式重置 */
* {
    margin: 0;  /* 清除外边距 */
    padding: 0;  /* 清除内边距 */
    box-sizing: border-box;  /* 边框盒模型 */
}

/* 根元素样式 */
:root {
    /* 主题颜色 */
    --primary-color: #0088cc;  /* Telegram蓝 */
    --secondary-color: #0077b5;  /* 深蓝 */
    --success-color: #28a745;  /* 成功绿 */
    --danger-color: #dc3545;  /* 危险红 */
    --warning-color: #ffc107;  /* 警告黄 */
    --info-color: #17a2b8;  /* 信息青 */
    
    /* 背景颜色 */
    --bg-primary: #f5f7fa;  /* 主背景 */
    --bg-secondary: #ffffff;  /* 次级背景 */
    --bg-dark: #2c3e50;  /* 深色背景 */
    --bg-sidebar: #1e2a38;  /* 侧边栏背景 */
    
    /* 文字颜色 */
    --text-primary: #2c3e50;  /* 主文字 */
    --text-secondary: #6c757d;  /* 次级文字 */
    --text-light: #ffffff;  /* 浅色文字 */
    
    /* 边框颜色 */
    --border-color: #e0e6ed;  /* 边框 */
    
    /* 阴影 */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);  /* 小阴影 */
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);  /* 中阴影 */
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);  /* 大阴影 */
    
    /* 尺寸 */
    --sidebar-width: 260px;  /* 侧边栏宽度 */
    --topbar-height: 70px;  /* 顶部栏高度 */
    
    /* 过渡动画 */
    --transition: all 0.3s ease;  /* 标准过渡 */
}

/* 页面整体布局 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;  /* 系统字体栈 */
    background-color: var(--bg-primary);  /* 背景色 */
    color: var(--text-primary);  /* 文字颜色 */
    line-height: 1.6;  /* 行高 */
    overflow-x: hidden;  /* 隐藏水平滚动条 */
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;  /* 固定定位 */
    left: 0;  /* 左对齐 */
    top: 0;  /* 顶部对齐 */
    width: var(--sidebar-width);  /* 宽度 */
    height: 100vh;  /* 全屏高度 */
    background: linear-gradient(180deg, var(--bg-sidebar) 0%, #16202d 100%);  /* 渐变背景 */
    padding: 20px 0;  /* 内边距 */
    box-shadow: var(--shadow-lg);  /* 阴影 */
    z-index: 1000;  /* 层级 */
    overflow-y: auto;  /* 垂直滚动 */
}

/* Logo区域 */
.logo {
    display: flex;  /* 弹性布局 */
    align-items: center;  /* 垂直居中 */
    justify-content: center;  /* 水平居中 */
    padding: 0 20px 30px;  /* 内边距 */
    margin-bottom: 20px;  /* 底部外边距 */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);  /* 底部边框 */
}

.logo i {
    font-size: 32px;  /* 图标大小 */
    color: var(--primary-color);  /* 图标颜色 */
    margin-right: 12px;  /* 右边距 */
}

.logo h2 {
    color: var(--text-light);  /* 文字颜色 */
    font-size: 20px;  /* 字体大小 */
    font-weight: 600;  /* 字重 */
}

/* 菜单样式 */
.menu {
    padding: 0 10px;  /* 内边距 */
}

.menu-item {
    display: flex;  /* 弹性布局 */
    align-items: center;  /* 垂直居中 */
    padding: 14px 20px;  /* 内边距 */
    margin-bottom: 5px;  /* 底部外边距 */
    color: rgba(255, 255, 255, 0.7);  /* 文字颜色 */
    text-decoration: none;  /* 去除下划线 */
    border-radius: 8px;  /* 圆角 */
    transition: var(--transition);  /* 过渡动画 */
}

.menu-item i {
    font-size: 18px;  /* 图标大小 */
    width: 24px;  /* 图标宽度 */
    margin-right: 12px;  /* 右边距 */
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);  /* 悬停背景 */
    color: var(--text-light);  /* 悬停文字颜色 */
    transform: translateX(5px);  /* 位移效果 */
}

.menu-item.active {
    background: var(--primary-color);  /* 激活背景 */
    color: var(--text-light);  /* 激活文字颜色 */
}

/* 主内容区 */
.main-content {
    margin-left: var(--sidebar-width);  /* 左边距（侧边栏宽度） */
    min-height: 100vh;  /* 最小高度 */
    background: var(--bg-primary);  /* 背景色 */
}

/* 顶部栏 */
.topbar {
    height: var(--topbar-height);  /* 高度 */
    background: var(--bg-secondary);  /* 背景色 */
    box-shadow: var(--shadow-sm);  /* 阴影 */
    display: flex;  /* 弹性布局 */
    align-items: center;  /* 垂直居中 */
    justify-content: space-between;  /* 两端对齐 */
    padding: 0 30px;  /* 内边距 */
    position: sticky;  /* 粘性定位 */
    top: 0;  /* 顶部对齐 */
    z-index: 999;  /* 层级 */
}

.topbar h1 {
    font-size: 24px;  /* 字体大小 */
    font-weight: 600;  /* 字重 */
    color: var(--text-primary);  /* 文字颜色 */
}

.topbar-right {
    display: flex;  /* 弹性布局 */
    align-items: center;  /* 垂直居中 */
    gap: 20px;  /* 间距 */
}

/* 搜索框 */
.search-box {
    display: flex;  /* 弹性布局 */
    align-items: center;  /* 垂直居中 */
    background: var(--bg-primary);  /* 背景色 */
    border-radius: 25px;  /* 圆角 */
    padding: 8px 20px;  /* 内边距 */
    min-width: 300px;  /* 最小宽度 */
}

.search-box i {
    color: var(--text-secondary);  /* 图标颜色 */
    margin-right: 10px;  /* 右边距 */
}

.search-box input {
    border: none;  /* 无边框 */
    background: none;  /* 无背景 */
    outline: none;  /* 无轮廓 */
    width: 100%;  /* 全宽 */
    font-size: 14px;  /* 字体大小 */
}

/* 用户信息 */
.user-info {
    display: flex;  /* 弹性布局 */
    align-items: center;  /* 垂直居中 */
    gap: 10px;  /* 间距 */
    color: var(--text-primary);  /* 文字颜色 */
}

.user-info i {
    font-size: 24px;  /* 图标大小 */
    color: var(--primary-color);  /* 图标颜色 */
}

/* 内容容器 */
.content-container {
    padding: 30px;  /* 内边距 */
}

/* 页面显示控制 */
.page {
    display: none;  /* 默认隐藏 */
}

.page.active {
    display: block;  /* 激活时显示 */
    animation: fadeIn 0.3s ease;  /* 淡入动画 */
}

/* Telegram客户端页面特殊布局 */
#telegram-client-page.page.active {
    display: flex;  /* 使用flex布局实现左右分栏 */
    height: calc(100vh - 40px);  /* 全屏高度 */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }  /* 起始状态 */
    to { opacity: 1; transform: translateY(0); }  /* 结束状态 */
}

/* 统计卡片网格 */
.stats-grid {
    display: grid;  /* 网格布局 */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));  /* 自适应列 */
    gap: 20px;  /* 间距 */
    margin-bottom: 30px;  /* 底部外边距 */
}

/* 统计卡片 */
.stat-card {
    background: var(--bg-secondary);  /* 背景色 */
    border-radius: 12px;  /* 圆角 */
    padding: 25px;  /* 内边距 */
    box-shadow: var(--shadow-sm);  /* 阴影 */
    display: flex;  /* 弹性布局 */
    align-items: center;  /* 垂直居中 */
    gap: 20px;  /* 间距 */
    transition: var(--transition);  /* 过渡动画 */
}

.stat-card:hover {
    transform: translateY(-5px);  /* 悬停上移 */
    box-shadow: var(--shadow-md);  /* 悬停阴影 */
}

.stat-icon {
    width: 60px;  /* 宽度 */
    height: 60px;  /* 高度 */
    border-radius: 12px;  /* 圆角 */
    display: flex;  /* 弹性布局 */
    align-items: center;  /* 垂直居中 */
    justify-content: center;  /* 水平居中 */
    font-size: 24px;  /* 字体大小 */
    color: white;  /* 文字颜色 */
}

.stat-icon.blue { background: var(--primary-color); }  /* 蓝色图标 */
.stat-icon.green { background: var(--success-color); }  /* 绿色图标 */
.stat-icon.orange { background: var(--warning-color); }  /* 橙色图标 */
.stat-icon.purple { background: #6f42c1; }  /* 紫色图标 */

.stat-content h3 {
    font-size: 32px;  /* 字体大小 */
    font-weight: 700;  /* 字重 */
    color: var(--text-primary);  /* 文字颜色 */
    margin-bottom: 5px;  /* 底部外边距 */
}

.stat-content p {
    color: var(--text-secondary);  /* 文字颜色 */
    font-size: 14px;  /* 字体大小 */
}

/* 卡片样式 */
.card {
    background: var(--bg-secondary);  /* 背景色 */
    border-radius: 12px;  /* 圆角 */
    padding: 25px;  /* 内边距 */
    box-shadow: var(--shadow-sm);  /* 阴影 */
    margin-bottom: 20px;  /* 底部外边距 */
}

.card h3 {
    margin-bottom: 20px;  /* 底部外边距 */
    color: var(--text-primary);  /* 文字颜色 */
    font-size: 18px;  /* 字体大小 */
    font-weight: 600;  /* 字重 */
}

/* 快速操作按钮 */
.quick-actions {
    display: grid;  /* 网格布局 */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));  /* 自适应列 */
    gap: 15px;  /* 间距 */
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;  /* 内边距 */
    border: none;  /* 无边框 */
    border-radius: 8px;  /* 圆角 */
    font-size: 14px;  /* 字体大小 */
    font-weight: 500;  /* 字重 */
    cursor: pointer;  /* 鼠标指针 */
    transition: var(--transition);  /* 过渡动画 */
    display: inline-flex;  /* 行内弹性布局 */
    align-items: center;  /* 垂直居中 */
    justify-content: center;  /* 水平居中 */
    gap: 8px;  /* 间距 */
}

.btn:hover {
    transform: translateY(-2px);  /* 悬停上移 */
    box-shadow: var(--shadow-md);  /* 悬停阴影 */
}

.btn-primary { background: var(--primary-color); color: white; }  /* 主要按钮 */
.btn-success { background: var(--success-color); color: white; }  /* 成功按钮 */
.btn-info { background: var(--info-color); color: white; }  /* 信息按钮 */
.btn-warning { background: var(--warning-color); color: white; }  /* 警告按钮 */
.btn-danger { background: var(--danger-color); color: white; }  /* 危险按钮 */

/* 页面头部 */
.page-header {
    display: flex;  /* 弹性布局 */
    justify-content: space-between;  /* 两端对齐 */
    align-items: center;  /* 垂直居中 */
    margin-bottom: 20px;  /* 底部外边距 */
}

.page-header h2 {
    font-size: 22px;  /* 字体大小 */
    font-weight: 600;  /* 字重 */
    color: var(--text-primary);  /* 文字颜色 */
}

.page-actions {
    display: flex;  /* 弹性布局 */
    gap: 10px;  /* 间距 */
}

/* 数据表格 */
.data-table {
    width: 100%;  /* 全宽 */
    border-collapse: collapse;  /* 边框合并 */
}

.data-table thead {
    background: var(--bg-primary);  /* 背景色 */
}

.data-table th {
    padding: 15px;  /* 内边距 */
    text-align: left;  /* 左对齐 */
    font-weight: 600;  /* 字重 */
    color: var(--text-primary);  /* 文字颜色 */
    border-bottom: 2px solid var(--border-color);  /* 底部边框 */
}

.data-table td {
    padding: 15px;  /* 内边距 */
    border-bottom: 1px solid var(--border-color);  /* 底部边框 */
}

.data-table tbody tr:hover {
    background: var(--bg-primary);  /* 悬停背景 */
}

.text-center {
    text-align: center;  /* 文字居中 */
}

/* 模态框 */
.modal-overlay {
    display: none;  /* 默认隐藏 */
    position: fixed;  /* 固定定位 */
    top: 0;  /* 顶部对齐 */
    left: 0;  /* 左对齐 */
    width: 100%;  /* 全宽 */
    height: 100%;  /* 全高 */
    background: rgba(0, 0, 0, 0.5);  /* 半透明背景 */
    z-index: 9999;  /* 最高层级 */
    justify-content: center;  /* 水平居中 */
    align-items: center;  /* 垂直居中 */
}

.modal-overlay.active {
    display: flex;  /* 显示时使用弹性布局 */
    animation: fadeIn 0.3s ease;  /* 淡入动画 */
}

.modal {
    background: var(--bg-secondary);  /* 背景色 */
    border-radius: 12px;  /* 圆角 */
    max-width: 600px;  /* 最大宽度 */
    width: 90%;  /* 宽度 */
    max-height: 90vh;  /* 最大高度 */
    overflow-y: auto;  /* 垂直滚动 */
    box-shadow: var(--shadow-lg);  /* 阴影 */
}

.modal-header {
    padding: 20px;  /* 内边距 */
    border-bottom: 1px solid var(--border-color);  /* 底部边框 */
    display: flex;  /* 弹性布局 */
    justify-content: space-between;  /* 两端对齐 */
    align-items: center;  /* 垂直居中 */
}

.modal-header h3 {
    font-size: 20px;  /* 字体大小 */
    font-weight: 600;  /* 字重 */
}

.close-btn {
    background: none;  /* 无背景 */
    border: none;  /* 无边框 */
    font-size: 24px;  /* 字体大小 */
    cursor: pointer;  /* 鼠标指针 */
    color: var(--text-secondary);  /* 文字颜色 */
}

.modal-body {
    padding: 20px;  /* 内边距 */
}

/* 通知容器 */
#notification-container {
    position: fixed;  /* 固定定位 */
    top: 20px;  /* 顶部距离 */
    right: 20px;  /* 右侧距离 */
    z-index: 10000;  /* 最高层级 */
}

/* API配置特定样式 */
.search-filter-bar {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-box input {
    width: 100%;
    padding: 10px 15px 10px 45px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.1);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-group select {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.api-hash-display {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    background-color: var(--bg-primary);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
}

.api-hash-display:hover {
    background-color: var(--border-color);
}

.pagination {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.pagination-buttons {
    display: flex;
    gap: 5px;
    align-items: center;
}

.pagination-buttons span {
    color: var(--text-secondary);
    padding: 0 10px;
}

.pagination-info {
    font-size: 14px;
    color: var(--text-secondary);
}

.batch-actions {
    padding: 15px;
    background-color: var(--bg-primary);
    border-radius: 6px;
    display: flex;
    gap: 10px;
}

.config-checkbox {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.form-hint {
    display: block;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.form-hint code {
    background-color: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    color: var(--primary-color);
    display: block;
    margin-top: 5px;
    word-break: break-all;
}

.required {
    color: var(--danger-color);
    margin-left: 2px;
}

/* SweetAlert2 自定义样式 */
.swal-form-group {
    margin-bottom: 20px;
    text-align: left;
}

.swal-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

/* 文件上传美化样式 */
.file-upload-wrapper {
    margin-top: 10px;
}

.file-input-hidden {
    display: none;
}

.file-upload-display {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
}

.file-upload-display:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.15);
}

.file-upload-display.drag-over {
    border-color: var(--success-color);
    background: linear-gradient(135deg, #d4edda 0%, #ffffff 100%);
    border-style: solid;
}

.file-upload-text {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.file-name-display {
    font-size: 14px;
    margin: 0;
}

.swal2-input,
.swal2-textarea,
.swal2-file {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 10px 15px !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
}

.swal2-input:focus,
.swal2-textarea:focus,
.swal2-file:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.1) !important;
}

.swal2-textarea {
    min-height: 80px !important;
    resize: vertical !important;
}

.swal2-popup {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

/* AI聊天弹窗自定义样式 */
.ai-chat-popup-custom {
    background: transparent !important;
    box-shadow: none !important;
}

.ai-close-btn-custom {
    background: rgba(255,255,255,0.9) !important;
    color: #764ba2 !important;
    border-radius: 50% !important;
    width: 36px !important;
    height: 36px !important;
    font-size: 20px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    transition: all 0.3s !important;
}

.ai-close-btn-custom:hover {
    background: #764ba2 !important;
    color: white !important;
    transform: rotate(90deg) !important;
}

.swal2-title {
    color: var(--text-primary) !important;
}

.swal2-html-container {
    color: var(--text-primary) !important;
}

/* 代理延迟徽章样式 */
.delay-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Courier New', Courier, monospace;
}

.delay-badge.delay-good {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.delay-badge.delay-medium {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.delay-badge.delay-bad {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.delay-badge.delay-error {
    background-color: #e2e3e5;
    color: #6c757d;
    border: 1px solid #d6d8db;
}

/* 可用性徽章样式 */
.availability-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.availability-badge.availability-available {
    background-color: #d4edda;
    color: #155724;
}

.availability-badge.availability-unavailable {
    background-color: #f8d7da;
    color: #721c24;
}

.availability-badge.availability-unknown {
    background-color: #e2e3e5;
    color: #6c757d;
}

/* 成功率文本颜色 */
.text-success {
    color: #28a745 !important;
    font-weight: 600;
}

.text-warning {
    color: #ffc107 !important;
    font-weight: 600;
}

.text-danger {
    color: #dc3545 !important;
    font-weight: 600;
}

/* 代理表格优化 */
#proxies-table code {
    background-color: #f5f7fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);  /* 默认隐藏侧边栏 */
    }
    
    .main-content {
        margin-left: 0;  /* 取消左边距 */
    }
    
    .stats-grid {
        grid-template-columns: 1fr;  /* 单列布局 */
    }
    
    .search-filter-bar {
        flex-direction: column;
    }
    
    .search-box {
        width: 100%;
        min-width: auto;
    }
    
    .pagination-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .batch-actions {
        flex-wrap: wrap;
    }
    
    .swal2-popup {
        width: 90% !important;
    }
}

/* ==================== 批量采集群样式 ==================== */

/* 采集统计 */
.collect-stats {
    display: flex;
    gap: 8px;
    font-size: 14px;
}

.collect-stats span {
    padding: 2px 6px;
    border-radius: 3px;
    background: #f0f0f0;
}

/* 任务详情样式 */
.collect-task-details {
    text-align: left;
    max-height: 500px;
    overflow-y: auto;
}

.collect-task-details .detail-row {
    display: flex;
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.collect-task-details .detail-row:last-child {
    border-bottom: none;
}

.collect-task-details .detail-row label {
    width: 120px;
    font-weight: bold;
    color: #333;
    flex-shrink: 0;
}

.collect-task-details .detail-row span {
    flex: 1;
    color: #666;
}

/* 日志容器 */
.collect-logs-container {
    max-height: 500px;
    overflow-y: auto;
    text-align: left;
}

.collect-log-item {
    padding: 12px;
    border-left: 4px solid #ccc;
    margin-bottom: 10px;
    background: #f9f9f9;
    border-radius: 4px;
}

.collect-log-item.log-info {
    border-left-color: #17a2b8;
    background: #e7f7ff;
}

.collect-log-item.log-success {
    border-left-color: #28a745;
    background: #e7ffe7;
}

.collect-log-item.log-warning {
    border-left-color: #ffc107;
    background: #fff9e7;
}

.collect-log-item.log-error {
    border-left-color: #dc3545;
    background: #ffe7e7;
}

.collect-log-item .log-time {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}

.collect-log-item .log-message {
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
}

.collect-log-item .log-meta {
    font-size: 12px;
    color: #666;
}

/* 操作按钮样式 */
.action-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.action-buttons .btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-buttons .btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.action-buttons .btn-success {
    background: #28a745;
    color: white;
}

.action-buttons .btn-warning {
    background: #ffc107;
    color: #333;
}

.action-buttons .btn-danger {
    background: #dc3545;
    color: white;
}

.action-buttons .btn-info {
    background: #17a2b8;
    color: white;
}

.action-buttons .btn-primary {
    background: #0088cc;
    color: white;
}

/* 徽章样式 */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 3px;
    text-align: center;
}

.badge-primary {
    background: #0088cc;
    color: white;
}

.badge-secondary {
    background: #6c757d;
    color: white;
}

.badge-success {
    background: #28a745;
    color: white;
}

.badge-danger {
    background: #dc3545;
    color: white;
}

.badge-warning {
    background: #ffc107;
    color: #333;
}

.badge-info {
    background: #17a2b8;
    color: white;
}

/* 文本颜色 */
.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-info {
    color: #17a2b8 !important;
}

.text-muted {
    color: #6c757d !important;
}

/* 自动刷新指示器动画 */
@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.85;
        transform: scale(1.02);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

#auto-refresh-indicator {
    animation: pulse 2s ease-in-out infinite;
}

/* Toggle开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch span {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.switch span span {
    position: absolute;
    content: '';
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.switch input:checked + span {
    background-color: #2ecc71;
}

.switch input:checked + span span {
    transform: translateX(26px);
}

.switch input:focus + span {
    box-shadow: 0 0 1px #2ecc71;
}

/* ========== WhatsApp 联系人样式 ========== */

/* 会话选择器网格 */
.sessions-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

/* 会话选择器卡片 */
.session-selector-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.session-selector-card:hover {
    border-color: #25D366;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
    transform: translateY(-2px);
}

.session-selector-card.selected {
    border-color: #25D366;
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.3);
}

.session-selector-card.inactive {
    opacity: 0.6;
}

/* 会话头像 */
.session-avatar {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #25D366;
}

.session-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.session-status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    border: 2px solid white;
}

.session-status-indicator.active {
    background: #4caf50;
}

.session-status-indicator.inactive {
    background: #9e9e9e;
}

/* 会话信息 */
.session-info {
    flex: 1;
    min-width: 0;
}

.session-name {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-status-text {
    font-size: 11px;
    color: #95a5a6;
}

.session-push-name {
    font-size: 11px;
    color: #7f8c8d;
    margin-top: 2px;
}

/* 联系人网格 */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

/* 联系人卡片 */
.contact-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
}

.contact-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* 联系人头像 */
.contact-avatar {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: visible;
    flex-shrink: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* 未读消息徽章 */
.unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 联系人信息 */
.contact-info {
    flex: 1;
    min-width: 0;
}

.contact-name {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-number {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 4px;
}

.contact-status {
    font-size: 12px;
    color: #95a5a6;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 联系人操作按钮 */
.contact-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.contact-actions .btn {
    padding: 6px 10px;
    font-size: 14px;
}

/* 响应式：小屏幕 */
@media (max-width: 768px) {
    .contacts-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-card {
        padding: 15px;
    }
    
    .contact-avatar {
        width: 50px;
        height: 50px;
    }
}

/* ========== 转发搬运子导航样式 ========== */

/* 子导航项 */
.forward-nav-item {
    position: relative;
    color: #6c757d;
    font-size: 14px;
    user-select: none;
}

.forward-nav-item:hover {
    background: #f8f9fa;
    color: #0088cc;
    border-left-color: #e0e6ed !important;
}

.forward-nav-item.active {
    background: linear-gradient(90deg, rgba(0, 136, 204, 0.1) 0%, transparent 100%);
    color: #0088cc;
    font-weight: 600;
    border-left-color: #0088cc !important;
}

.forward-nav-item i {
    width: 20px;
    text-align: center;
}

/* 子页面 */
.forward-subpage {
    animation: fadeIn 0.3s;
}

.forward-subpage.active {
    display: block !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ==================== 数据库管理表单美化样式 ==================== */

/* 表单组 */
.db-form-group {
    margin-bottom: 0;
}

/* 表单标签 */
.db-form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    transition: all 0.3s;
}

.db-form-label i {
    font-size: 13px;
    color: #0088cc;
    opacity: 0.8;
}

.db-form-label:hover i {
    opacity: 1;
    transform: scale(1.1);
}

/* 必填星号 */
.required-star {
    color: #dc3545;
    font-size: 14px;
    margin-left: 2px;
}

/* 输入框容器 */
.db-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* 输入框样式 - 超级美化版 */
.db-input,
#about-mysql-page input.form-control,
#about-postgresql-page input.form-control,
#about-mongodb-page input.form-control,
#about-elasticsearch-page input.form-control,
#about-redis-page input.form-control,
#about-kafka-page input.form-control {
    width: 100% !important;
    padding: 14px 45px 14px 18px !important;
    border: 2px solid #e9ecef !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    color: #495057 !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    outline: none !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03) !important;
    font-weight: 500 !important;
}

.db-input::placeholder,
#about-mysql-page input.form-control::placeholder,
#about-postgresql-page input.form-control::placeholder,
#about-mongodb-page input.form-control::placeholder,
#about-elasticsearch-page input.form-control::placeholder,
#about-redis-page input.form-control::placeholder,
#about-kafka-page input.form-control::placeholder {
    color: #adb5bd !important;
    opacity: 1 !important;
    font-weight: 400 !important;
}

.db-input:hover,
#about-mysql-page input.form-control:hover,
#about-postgresql-page input.form-control:hover,
#about-mongodb-page input.form-control:hover,
#about-elasticsearch-page input.form-control:hover,
#about-redis-page input.form-control:hover,
#about-kafka-page input.form-control:hover {
    border-color: #ced4da !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06) !important;
    background: #ffffff !important;
}

.db-input:focus,
#about-mysql-page input.form-control:focus,
#about-postgresql-page input.form-control:focus,
#about-mongodb-page input.form-control:focus,
#about-elasticsearch-page input.form-control:focus,
#about-redis-page input.form-control:focus,
#about-kafka-page input.form-control:focus {
    border-color: #0088cc !important;
    box-shadow: 0 0 0 4px rgba(0, 136, 204, 0.12), 0 6px 20px rgba(0,136,204,0.15) !important;
    background: #ffffff !important;
    transform: translateY(-1px) !important;
}

.db-input:focus + .db-input-icon {
    color: #0088cc !important;
    transform: scale(1.15) rotate(5deg) !important;
}

/* 输入框图标 */
.db-input-icon {
    position: absolute;
    right: 18px;
    font-size: 16px;
    color: #adb5bd;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 帮助文本 */
.db-help-text {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 12px;
    color: #6c757d;
    line-height: 1.5;
    opacity: 0.9;
}

.db-help-text i {
    font-size: 11px;
    opacity: 0.7;
}

/* 数据库按钮 - 超级美化版 */
.db-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    min-width: 140px;
}

.db-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.db-btn:hover::before {
    width: 400px;
    height: 400px;
}

.db-btn i {
    font-size: 16px;
    transition: transform 0.3s;
}

.db-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.db-btn:hover i {
    transform: scale(1.15);
}

.db-btn:active {
    transform: translateY(-1px);
}

/* 成功按钮 */
.db-btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.db-btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
    box-shadow: 0 8px 24px rgba(40, 167, 69, 0.5);
}

/* 主要按钮 */
.db-btn-primary {
    background: linear-gradient(135deg, #0088cc 0%, #005580 100%);
    color: white;
}

.db-btn-primary:hover {
    background: linear-gradient(135deg, #0099dd 0%, #006699 100%);
    box-shadow: 0 8px 24px rgba(0, 136, 204, 0.5);
}

/* 次要按钮 */
.db-btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.db-btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #545b62 100%);
    box-shadow: 0 8px 24px rgba(108, 117, 125, 0.5);
}

/* 信息按钮 */
.db-btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #117a8b 100%);
    color: white;
}

.db-btn-info:hover {
    background: linear-gradient(135deg, #138496 0%, #0e6674 100%);
    box-shadow: 0 8px 24px rgba(23, 162, 184, 0.5);
}

/* SQL/代码编辑器美化 - 高优先级 */
.db-code-editor,
#about-mysql-page textarea.form-control,
#about-postgresql-page textarea.form-control,
#about-mongodb-page textarea.form-control,
#about-elasticsearch-page textarea.form-control,
#about-redis-page textarea.form-control,
#about-kafka-page textarea.form-control {
    width: 100% !important;
    padding: 18px !important;
    border: 2px solid #e9ecef !important;
    border-radius: 12px !important;
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace !important;
    font-size: 14px !important;
    color: #495057 !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    resize: vertical !important;
    line-height: 1.8 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
}

#about-mysql-page textarea.form-control::placeholder,
#about-postgresql-page textarea.form-control::placeholder,
#about-mongodb-page textarea.form-control::placeholder,
#about-elasticsearch-page textarea.form-control::placeholder,
#about-redis-page textarea.form-control::placeholder,
#about-kafka-page textarea.form-control::placeholder {
    color: #adb5bd !important;
    font-style: italic !important;
}

#about-mysql-page textarea.form-control:hover,
#about-postgresql-page textarea.form-control:hover,
#about-mongodb-page textarea.form-control:hover,
#about-elasticsearch-page textarea.form-control:hover,
#about-redis-page textarea.form-control:hover,
#about-kafka-page textarea.form-control:hover {
    border-color: #ced4da !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06) !important;
    background: #ffffff !important;
}

#about-mysql-page textarea.form-control:focus,
#about-postgresql-page textarea.form-control:focus,
#about-mongodb-page textarea.form-control:focus,
#about-elasticsearch-page textarea.form-control:focus,
#about-redis-page textarea.form-control:focus,
#about-kafka-page textarea.form-control:focus {
    outline: none !important;
    border-color: #0088cc !important;
    box-shadow: 0 0 0 4px rgba(0, 136, 204, 0.12), 0 6px 24px rgba(0,136,204,0.2) !important;
    background: #ffffff !important;
    transform: translateY(-2px) !important;
}

/* 连接状态徽章 - 动态效果 */
.db-connection-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    white-space: nowrap;
}

.db-connection-badge.connected {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 2px solid #28a745;
    animation: connectedPulse 2s ease-in-out infinite;
}

.db-connection-badge.disconnected {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 2px solid #dc3545;
}

.db-connection-badge i {
    font-size: 8px;
}

.db-connection-badge.connected i {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

@keyframes connectedPulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
    }
    50% {
        box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    }
}

/* 查询结果容器 */
.db-results-container {
    margin-top: 25px;
    border: 2px solid #e9ecef;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(0,0,0,0.08);
    animation: slideInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.db-results-header {
    padding: 18px 25px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.db-results-body {
    padding: 25px;
    background: #ffffff;
}

.db-results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.db-results-table thead {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.db-results-table th {
    padding: 14px 18px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 3px solid #dee2e6;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.db-results-table td {
    padding: 12px 18px;
    border-bottom: 1px solid #f1f3f5;
    color: #495057;
}

.db-results-table tbody tr {
    transition: all 0.2s;
}

.db-results-table tbody tr:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* 信息提示框 */
.db-info-box {
    padding: 16px 22px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f5f9ff 100%);
    border-left: 5px solid #0088cc;
    border-radius: 10px;
    font-size: 13px;
    color: #495057;
    margin-top: 15px;
    box-shadow: 0 2px 8px rgba(0,136,204,0.1);
}

.db-info-box i {
    color: #0088cc;
    margin-right: 8px;
    font-size: 14px;
}

/* 操作按钮区域美化 */
.db-actions-area {
    margin-top: 25px;
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 22px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    border: 2px dashed #dee2e6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.db-actions-area:hover {
    border-color: #0088cc;
    box-shadow: 0 4px 16px rgba(0,136,204,0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .db-input-wrapper {
        grid-template-columns: 1fr;
    }
    
    .db-btn {
        width: 100%;
        justify-content: center;
    }
    
    .db-actions-area {
        flex-direction: column;
    }
}