/**
 * 老戏童记账机器人系统 - 管理后台统一样式文件
 * 整合所有admin页面的样式，统一管理，避免重复和冲突
 * 
 * 包含：
 * - header.php中的822行内联样式
 * - assets/css/admin-ui-optimized.css中的295行样式
 * - 各页面的内联样式属性
 */

/* =====================================================================
 * CSS 变量定义
 * ===================================================================== */

:root {
    /* 布局变量 */
    --sidebar-width: 260px;
    --topbar-height: 70px;
    
    /* 现代化颜色方案 */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --secondary-color: #f093fb;
    
    /* 按钮渐变 */
    --btn-primary-color: #4e73df;
    --btn-primary-dark: #224abe;
    --btn-primary-gradient: linear-gradient(135deg, var(--btn-primary-color) 0%, var(--btn-primary-dark) 100%);
    --btn-primary-hover-gradient: linear-gradient(135deg, var(--btn-primary-dark) 0%, #1e3a8a 100%);
    --btn-secondary-gradient: linear-gradient(135deg, #6c757d, #5a6268);
    --btn-secondary-hover-gradient: linear-gradient(135deg, #5a6268, #495057);
    
    /* 状态颜色渐变 */
    --success-gradient: linear-gradient(135deg, #48bb78, #38a169);
    --warning-gradient: linear-gradient(135deg, #ed8936, #dd6b20);
    --danger-gradient: linear-gradient(135deg, #f56565, #e53e3e);
    --info-gradient: linear-gradient(135deg, #4299e1, #3182ce);
    
    /* 浅色背景渐变 */
    --readonly-gradient: linear-gradient(135deg, #f8f9fc, #edf2f7);
    --alert-danger-gradient: linear-gradient(135deg, #fef2f2, #fee2e2);
    --alert-warning-gradient: linear-gradient(135deg, #fffbeb, #fef3c7);
    --notice-gradient: linear-gradient(135deg, #fef3c7, #fde68a);
    --lock-gradient: linear-gradient(135deg, #fee2e2, #fecaca);
    
    /* 侧边栏颜色 */
    --sidebar-bg: linear-gradient(180deg, #1a202c 0%, #2d3748 100%);
    --sidebar-active: rgba(102, 126, 234, 0.1);
    --sidebar-hover: rgba(255, 255, 255, 0.05);
    
    /* 背景颜色 */
    --bg-primary: #f7fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #edf2f7;
    
    /* 文本颜色 */
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-light: rgba(255, 255, 255, 0.9);
    
    /* 阴影 */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* 圆角 */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* 常用间距 */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 0.75rem;
    --spacing-lg: 1rem;
    --spacing-xl: 1.5rem;
    --spacing-2xl: 2rem;
    
    /* 过渡 */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
}

/* =====================================================================
 * 全局样式
 * ===================================================================== */

* {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    font-weight: 400;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =====================================================================
 * 顶部导航栏
 * ===================================================================== */

.topbar {
    height: var(--topbar-height);
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    transition: var(--transition-slow);
}

.topbar-brand {
    font-size: 1.2rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: var(--transition-base);
}

.topbar-brand:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.topbar-toggler {
    color: var(--text-secondary);
    background: rgba(102, 126, 234, 0.1);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.25rem;
    margin-right: 1.5rem;
    cursor: pointer;
    padding: 0.75rem;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.topbar-toggler:hover {
    background: rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
    color: var(--primary-color);
}

.topbar-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-user-name {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.topbar-user .dropdown-toggle {
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    color: var(--text-secondary);
    transition: var(--transition-base);
}

.topbar-user .dropdown-toggle:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

/* =====================================================================
 * 侧边栏
 * ===================================================================== */

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    min-height: 100vh;
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    z-index: 1020;
    transition: var(--transition-slow);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow-lg);
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar.collapsed {
    margin-left: calc(-1 * var(--sidebar-width));
}

.sidebar-header {
    padding: 1.5rem 1.5rem 1rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
    position: relative;
}

.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: 0.5rem;
    left: 1.5rem;
    right: 1.5rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.sidebar-menu {
    list-style: none;
    padding: 0 1rem;
    margin: 0;
}

.sidebar-item {
    margin-bottom: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: var(--radius-lg);
    font-weight: 500;
    font-size: 0.85rem;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.sidebar-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-gradient);
    opacity: 0;
    transition: var(--transition-base);
    z-index: -1;
}

.sidebar-link:hover {
    color: white;
    background: var(--sidebar-hover);
    transform: translateX(4px);
}

.sidebar-link.active {
    color: white;
    background: var(--sidebar-active);
    box-shadow: var(--shadow-md);
}

.sidebar-link.active::before {
    opacity: 0.1;
}

.sidebar-link.active::after {
    content: '';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--primary-color);
}

.sidebar-icon {
    margin-right: 0.875rem;
    font-size: 1rem;
    width: 1rem;
    text-align: center;
    transition: var(--transition-base);
}

.sidebar-link:hover .sidebar-icon {
    transform: scale(1.1);
}

/* =====================================================================
 * 主内容区
 * ===================================================================== */

.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 1.5rem;
    flex: 1;
    transition: var(--transition-slow);
    min-height: calc(100vh - var(--topbar-height));
}

.main-content.expanded {
    margin-left: 0;
}

/* =====================================================================
 * 卡片组件
 * ===================================================================== */

.card {
    border: 1px solid #e3e6f0;
    margin-bottom: 2rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.08);
    border-radius: 6px;
    background: var(--bg-secondary);
    overflow: hidden;
    transition: var(--transition-base);
    position: relative;
    animation: fadeIn 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    background: var(--primary-gradient);
    border-bottom: 1px solid #e3e6f0;
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    border-radius: 6px 6px 0 0;
}

.card-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 2rem;
    right: 2rem;
    height: 2px;
    background: var(--primary-gradient);
    border-radius: 1px;
    opacity: 0.1;
}

.card-header h5,
.card-title {
    color: white !important;
    margin: 0;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.025em;
}

.card-body {
    padding: 1.5rem;
}

/* =====================================================================
 * 按钮组件
 * ===================================================================== */

.btn {
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    border: none;
    border-width: 1px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--btn-primary-gradient);
    border-color: var(--btn-primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--btn-primary-hover-gradient);
    border-color: #224abe;
    box-shadow: var(--shadow-lg);
    filter: brightness(1.05);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-outline-secondary {
    color: #495057;
    border-color: #6c757d;
    background: transparent;
    font-weight: 500;
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--btn-secondary-gradient);
    border-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: var(--btn-secondary-hover-gradient);
    border-color: #5a6268;
    color: white;
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success-gradient);
    color: white;
}

.btn-warning {
    background: var(--warning-gradient);
    color: white;
}

.btn-danger {
    background: var(--danger-gradient);
    color: white;
}

.btn-sm {
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 3px;
}

.btn-lg {
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    border-radius: 5px;
}

/* =====================================================================
 * 表格组件
 * ===================================================================== */

.table {
    --bs-table-bg: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    font-size: 0.875rem;
}

.table thead th {
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
    color: #5a5c69;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.75rem;
}

.table tbody td {
    padding: 0.75rem;
    color: var(--text-primary);
    border-top: 1px solid #f3f3f3;
    transition: var(--transition-fast);
    vertical-align: middle;
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background-color: #f8f9fc;
}

.table tbody tr:hover td {
    transform: translateX(2px);
}

/* 机器人管理页面特殊处理：当下拉菜单显示时，不应用hover效果 */
.bots-page .table tbody tr.dropdown-open:hover {
    background-color: transparent !important;
}

.bots-page .table tbody tr.dropdown-open:hover td {
    transform: none !important;
}

/* =====================================================================
 * 表单组件
 * ===================================================================== */

.form-control, .form-select {
    border: 1px solid #d1d3e2;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    background: var(--bg-secondary);
}

.form-control:focus, .form-select:focus {
    border-color: var(--btn-primary-color);
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.15);
    transform: translateY(-1px);
}

.form-control-sm, .form-select-sm {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 3px;
}

.form-label {
    font-weight: 500;
    color: #5a5c69;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
}

.form-label.small {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
}

/* =====================================================================
 * 标题样式
 * ===================================================================== */

h1, .h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

h2, .h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

h3, .h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

h4, .h4 {
    font-size: 1.1rem;
    font-weight: 600;
}

h5, .h5 {
    font-size: 1rem;
    font-weight: 600;
}

h6, .h6 {
    font-size: 0.9rem;
    font-weight: 600;
}

/* =====================================================================
 * 徽章组件
 * ===================================================================== */

.badge {
    font-weight: 600;
    padding: 0.35rem 0.6rem;
    border-radius: 3px;
    font-size: 0.75rem;
}

.badge.bg-success {
    background: var(--success-gradient) !important;
}

.badge.bg-warning {
    background: var(--warning-gradient) !important;
}

.badge.bg-danger {
    background: var(--danger-gradient) !important;
}

.badge.bg-info {
    background: var(--info-gradient) !important;
}

/* =====================================================================
 * 提醒框组件
 * ===================================================================== */

.alert {
    border: none;
    border-radius: 4px;
    padding: 0.875rem 1.25rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.1), rgba(56, 161, 105, 0.1));
    color: #22543d;
    border-left: 4px solid #48bb78;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(237, 137, 54, 0.1), rgba(221, 107, 32, 0.1));
    color: #744210;
    border-left: 4px solid #ed8936;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(245, 101, 101, 0.1), rgba(229, 62, 62, 0.1));
    color: #742a2a;
    border-left: 4px solid #f56565;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border-left: 4px solid #4299e1;
}

/* =====================================================================
 * 分页组件
 * ===================================================================== */

.pagination {
    margin: 0;
}

.pagination .page-link {
    border: 1px solid #dee2e6;
    border-radius: 3px;
    margin: 0 2px;
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
    color: #5a5c69;
    font-weight: 500;
    transition: var(--transition-base);
}

.pagination .page-link:hover {
    background-color: #f8f9fc;
    border-color: var(--btn-primary-color);
    color: var(--btn-primary-color);
    transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
    background: var(--btn-primary-gradient);
    border-color: var(--btn-primary-color);
    box-shadow: var(--shadow-md);
}

/* =====================================================================
 * 导航标签
 * ===================================================================== */

.nav-tabs .nav-link {
    border: none;
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-weight: 500;
    margin-right: 0.5rem;
    transition: var(--transition-base);
}

.nav-tabs .nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

/* =====================================================================
 * 下拉菜单
 * ===================================================================== */

.dropdown-menu {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.dropdown-item {
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: var(--transition-base);
}

.dropdown-item:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    transform: translateX(4px);
}

/* =====================================================================
 * 特殊功能样式
 * ===================================================================== */


/* 图片指示器 */
.photo-indicator {
    background-color: #f8f9fc;
    border: 1px solid #e3e6f0;
    border-radius: 3px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    display: inline-block;
    transition: all 0.2s ease;
}

.photo-indicator:hover {
    background-color: var(--btn-primary-color);
    color: white;
    border-color: var(--btn-primary-color);
    cursor: pointer;
}

/* 状态指示器 */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-indicator.online {
    background: #48bb78;
    box-shadow: 0 0 8px rgba(72, 187, 120, 0.5);
}

.status-indicator.offline {
    background: #f56565;
    box-shadow: 0 0 8px rgba(245, 101, 101, 0.5);
}

.status-indicator.warning {
    background: #ed8936;
    box-shadow: 0 0 8px rgba(237, 137, 54, 0.5);
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

/* =====================================================================
 * 工具类
 * ===================================================================== */

/* 指针样式 */
.cursor-pointer {
    cursor: pointer !important;
}

/* 会话ID样式 */
.session-id-width {
    width: 150px;
}

/* 图片容器 */
.img-max-height {
    max-height: 500px;
}

/* 日志内容容器 */
.log-content-container {
    max-width: 500px;
    word-break: break-word;
}

/* 自动宽度选择框 */
.form-select-auto {
    width: auto !important;
}

/* 大尺寸图标 */
.icon-large {
    font-size: 3rem;
    color: #3a6fdd;
}

/* 流水号编辑样式 - 统一定义，移除重复 */
.serial-number-display {
    border: 1px dashed transparent !important;
    padding: 2px 4px !important;
    border-radius: 3px !important;
    transition: border-color 0.2s ease, background-color 0.2s ease !important;
    min-height: 28px !important;
    line-height: 1.2 !important;
    display: inline-block !important;
    min-width: 120px !important;
    box-sizing: border-box !important;
}

.serial-number-display:hover {
    border-color: #007bff !important;
    background-color: #f8f9fa !important;
}

/* 流水号编辑输入框 */
.serial-edit-input {
    width: 120px !important;
    min-height: 28px !important;
    line-height: 1.2 !important;
    padding: 2px 6px !important;
    transform: none !important;
}

.serial-edit-input:focus {
    transform: none !important;
    box-shadow: 0 0 0 2px rgba(78, 115, 223, 0.25) !important;
}

/* Toast提示框样式 */
.toast-notification {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 9999 !important;
    min-width: 300px !important;
}


/* =====================================================================
 * 登录页面CSS加载顺序优化
 * ===================================================================== */

/* 注意：Bootstrap 5已包含me-1, me-2, mt-1, mt-2, mt-4等工具类 */

/* =====================================================================
 * Toast 提示
 * ===================================================================== */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    border-radius: 4px;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* =====================================================================
 * 动画效果
 * ===================================================================== */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.card, .alert {
    animation: slideIn 0.5s ease-out;
}

.topbar, .sidebar {
    animation: fadeIn 0.3s ease-out;
}

/* =====================================================================
 * 滚动条样式
 * ===================================================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.4);
}

/* =====================================================================
 * 选择文本样式
 * ===================================================================== */

::selection {
    background: rgba(102, 126, 234, 0.2);
    color: var(--text-primary);
}

::-moz-selection {
    background: rgba(102, 126, 234, 0.2);
    color: var(--text-primary);
}

/* =====================================================================
 * 机器人管理页面特定样式
 * ===================================================================== */

/* 机器人管理页面容器 - 统一overflow设置 */
.bots-page .table-responsive {
    overflow-x: auto;
    overflow-y: visible;
}

.bots-page .card-body,
.bots-page .card,
.bots-page .container-fluid,
.bots-page .row,
.bots-page .col-12,
.bots-page .table,
.bots-page .table td,
.bots-page .btn,
.bots-page .dropdown-toggle,
.bots-page .main-content {
    overflow: visible !important;
}

/* 下拉菜单优化 */
.bots-page .dropdown-menu {
    z-index: 10000 !important;
    min-width: 160px;
    border: none !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-xl) !important;
    padding: 0.5rem !important;
    will-change: auto;
    max-height: none !important;
}

.bots-page .dropdown-menu.show {
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 10001 !important;
}

.bots-page .dropdown-item {
    border-radius: var(--radius-md);
    padding: 0.5rem 0.875rem;
    font-size: 0.85rem;
    transition: var(--transition-base);
}

.bots-page .dropdown-item:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    transform: none !important; /* 覆盖全局的transform */
}

.bots-page .dropdown-item.text-danger:hover {
    background: rgba(245, 101, 101, 0.1);
    color: #e53e3e;
}

/* 表格行和按钮组定位 */
.bots-page tbody tr {
    position: relative;
}

.bots-page .btn-group {
    position: relative;
}

.bots-page .btn-group.dropdown .dropdown-menu {
    position: absolute !important;
    right: 0;
    left: auto;
    top: 100% !important;
    transform: none !important;
}

/* 表格单元格定位 */
.bots-page .table td {
    position: relative;
}

/* 确保表格行不会遮挡下拉菜单 */
.bots-page .table tbody tr {
    position: relative;
    z-index: 1;
}

.bots-page .table tbody tr.dropdown-open {
    z-index: 10000; /* 当下拉菜单打开时提高z-index */
}

/* 操作按钮样式 */
.bots-page .dropdown-toggle {
    white-space: nowrap;
    font-size: 0.75rem;
}

/* 表格悬停效果 */
.bots-page .table tbody tr:hover .btn-primary {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* 支持下拉菜单的body类 */
body.has-bots-page {
    overflow-x: auto;
    overflow-y: auto;
}


/* =====================================================================
 * 响应式设计
 * ===================================================================== */

@media (max-width: 1200px) {
    .main-content {
        padding: 1.25rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
}

@media (max-width: 768px) {
    :root {
        --topbar-height: 60px;
    }
    
    .topbar {
        padding: 0 1rem;
    }
    
    .topbar-brand {
        font-size: 1.1rem;
    }
    
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
        box-shadow: none;
    }
    
    .sidebar.show {
        margin-left: 0;
        box-shadow: var(--shadow-xl);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .btn {
        padding: 0.35rem 0.7rem;
        font-size: 0.8rem;
        width: 100%;
        justify-content: center;
    }
    
    .btn + .btn {
        margin-top: 0.5rem;
        margin-left: 0;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.5rem;
    }
    
    .table-responsive {
        border-radius: var(--radius-lg);
    }
}

@media (max-width: 576px) {
    body {
        font-size: 13px;
    }
    
    .main-content {
        padding: 0.75rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .card-header {
        padding: 0.875rem 1rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .card-header h5 {
        font-size: 0.9rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .sidebar-header {
        padding: 1.25rem 1rem 0.875rem;
    }
    
    .sidebar-link {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    /* 机器人管理页面移动端优化 */
    .bots-page .dropdown-menu {
        min-width: 140px;
    }
    
    .bots-page .table {
        font-size: 0.75rem;
    }
    
    .bots-page .btn-sm {
        padding: 0.2rem 0.5rem;
        font-size: 0.7rem;
    }
}

/* =====================================================================
 * Webhook URL 只读输入框样式
 * ===================================================================== */

.form-control[readonly] {
    background: var(--readonly-gradient) !important;
    color: var(--text-secondary) !important;
    border-color: #d1d5db !important;
    cursor: default !important;
    font-weight: 500;
}

.form-control[readonly]:focus {
    background: var(--readonly-gradient) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.1) !important;
}

/* Webhook模态框特殊样式 */
#webhookModal .form-control[readonly] {
    position: relative;
}

#webhookModal .form-control[readonly]::before {
    content: '🔒';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
}

/* =====================================================================
 * 登录页面样式 - 从login-secure.css合并
 * ===================================================================== */

/* 登录页面专用body样式 */
body.login-page {
    color: var(--text-primary);
    background: var(--primary-gradient);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 登录容器 */
.login-container {
    width: 100%;
    max-width: 440px;
    padding: var(--spacing-md, 1rem);
    animation: fadeIn 0.6s ease-out;
}

/* 登录卡片 */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.login-card:hover {
    transform: translateY(-2px);
}

/* 登录头部 */
.login-header {
    background: var(--primary-gradient);
    color: white;
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    position: relative;
    z-index: 1;
    letter-spacing: -0.025em;
}

.login-header .subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.5rem;
    position: relative;
    z-index: 1;
    font-weight: 400;
}

/* 登录主体 */
.login-body {
    padding: 2.5rem 2rem;
}

/* 登录表单组件 */
.login-page .form-group {
    margin-bottom: 1.5rem;
}

.login-page .form-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    letter-spacing: -0.01em;
}

.login-page .input-group {
    display: flex;
    position: relative;
}

.login-page .input-group-text {
    background: var(--bg-primary);
    border: 1px solid #d1d5db;
    border-right: none;
    padding: 0.75rem 1rem;
    border-radius: 12px 0 0 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

.login-page .form-control {
    flex: 1;
    border: 1px solid #d1d5db;
    border-left: none;
    border-radius: 0 12px 12px 0;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-secondary);
    transition: all 0.2s ease;
    outline: none;
}

.login-page .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-page .form-control:disabled {
    background: var(--bg-primary);
    color: var(--text-muted);
    cursor: not-allowed;
}

.login-page .form-control::placeholder {
    color: var(--text-muted);
}

/* 登录按钮样式 */
.btn-login {
    width: 100%;
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    letter-spacing: -0.01em;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.3s ease;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px -5px rgba(102, 126, 234, 0.4);
}

.btn-login:hover:not(:disabled)::before {
    left: 100%;
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 登录页面警告框 */
.login-page .alert {
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-page .alert-danger {
    background: var(--alert-danger-gradient);
    color: #dc2626;
    border-left: 4px solid #dc2626;
}

.login-page .alert-warning {
    background: var(--alert-warning-gradient);
    color: #d97706;
    border-left: 4px solid #d97706;
}

/* 安全提示 */
.security-notice {
    background: var(--notice-gradient);
    border: 1px solid #f59e0b;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: #92400e;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.security-notice i {
    color: #f59e0b;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

/* 锁定状态 */
.lock-status {
    background: var(--lock-gradient);
    border: 1px solid #f87171;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    color: #dc2626;
    margin-bottom: 1.5rem;
}

.lock-status i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* 尝试次数信息 */
.attempts-info {
    background: var(--bg-primary);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* IP信息 */
.ip-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 1rem;
}

.ip-address {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}

.ip-location {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
    background: var(--bg-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* 页脚信息 */
.footer-info {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.5;
}

.footer-info > div {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.footer-info > div + div {
    margin-top: 0.25rem;
}

/* =====================================================================
 * 日志页面专用样式 - 重构优化
 * ===================================================================== */

/* 日志页面基础样式 */
.logs-page .log-level-badge {
    font-size: 0.75em;
    min-width: 60px;
}

.logs-page .log-message {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.logs-page .log-timestamp {
    font-size: 0.85em;
    color: #6c757d;
}

/* 性能信息卡片 */
.logs-page .performance-info {
    background: var(--primary-gradient);
    color: white;
    border-radius: 10px;
}

/* 日志标签页样式 */
.logs-page .log-tabs .nav-link {
    border-radius: 0.5rem;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
}

.logs-page .log-tabs .nav-link.active {
    background: var(--primary-gradient);
    color: white;
    border: none;
}

.logs-page .log-tabs .nav-link:hover:not(.active) {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

/* 搜索卡片样式 */
.logs-page .log-search-card {
    background: #ffffff;
    border: 1px solid #edf2f7;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* 统计卡片样式 */
.logs-page .stats-card {
    background: #ffffff;
    border: 1px solid #edf2f7;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.logs-page .stats-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* 日志页面表格优化 */
.logs-page .table td:first-child {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    white-space: nowrap;
}