/* 基础样式 */
:root {
    --primary: #3f51b5;
    --success: #4caf50;
    --danger: #f44336;
    --warning: #ff9800;
    --text: #333;
    --text-light: #666;
    --border: #e0e0e0;
    --bg-light: #f5f5f5;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--bg-light);
    color: var(--text);
    line-height: 1.6;
}

/* 布局 */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 250px;
    background: white;
    box-shadow: var(--shadow);
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar .logo {
    padding: 20px;
    font-size: 20px;
    font-weight: bold;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
}

.sidebar nav ul {
    list-style: none;
    padding: 20px 0;
}

.sidebar nav li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar nav li a:hover,
.sidebar nav li a.active {
    background: var(--primary);
    color: white;
}

.sidebar nav li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 20px;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 500;
}

.card-body {
    padding: 20px;
}

/* 统计卡片网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.stat-card .stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary);
    margin: 10px 0;
}

.stat-card .stat-label {
    color: var(--text-light);
    font-size: 14px;
}

/* 表格样式 */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--bg-light);
    font-weight: 500;
}

.data-table tr:hover {
    background: var(--bg-light);
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn i {
    margin-right: 6px;
    font-size: 16px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #303f9f;
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text);
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* 登录页面样式 */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-box {
    background: white;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    width: 300px;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: white;
    color: var(--text);
    text-decoration: none;
    transition: all 0.3s;
}

.page-link:hover {
    background: var(--bg-light);
}

.page-link.active {
    background: var(--primary);
    color: white;
}

.page-link i {
    font-size: 18px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 500px;
    margin: 40px auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 500;
    color: var(--text);
    margin: 0;
}

.modal-header .close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: all 0.3s;
}

.modal-header .close:hover {
    background: var(--bg-light);
    color: var(--danger);
}

.modal-body {
    padding: 20px;
}

.form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 4px;
    color: white;
    z-index: 1000;
}

.notification.success {
    background: #28a745;
}

.notification.error {
    background: #dc3545;
}

/* 表格内容单元格样式 */
.content-cell {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 状态标签样式 */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-text { background: var(--primary); color: white; }
.badge-image { background: var(--success); color: white; }
.badge-link { background: var(--warning); color: white; }
.badge-success { background: var(--success); color: white; }
.badge-warning { background: var(--warning); color: white; }

/* 紧凑型表单控件 */
.form-control.compact {
    width: auto;
    min-width: 200px;
    margin-left: 10px;
}

/* 表头布局 */
.header-left {
    display: flex;
    align-items: center;
}

/* 小按钮样式 */
.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

/* 二次确认对话框 */
.confirm-dialog {
    max-width: 400px;
}

.confirm-dialog .modal-body {
    text-align: center;
    padding: 30px 20px;
}

.confirm-dialog .btn-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

/* 内联表单样式 */
.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.form-inline .form-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-separator {
    color: var(--text-light);
}

/* 表格内容样式增强 */
.content-cell {
    position: relative;
}

.content-cell:hover {
    white-space: normal;
    overflow: visible;
    z-index: 1;
}

.content-cell:hover::after {
    content: attr(data-content);
    position: absolute;
    left: 0;
    top: 100%;
    background: white;
    padding: 10px;
    border-radius: 4px;
    box-shadow: var(--shadow);
    max-width: 300px;
    z-index: 2;
}

/* 卡片头部操作按钮组 */
.header-actions {
    display: flex;
    gap: 10px;
}

/* 筛选表单样式 */
.filter-form {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* 响应式优化 */
@media (max-width: 576px) {
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        margin: 20px auto;
    }
    
    .form-buttons {
        flex-direction: column-reverse;
    }
    
    .form-buttons .btn {
        width: 100%;
    }
}

/* 设置组样式 */
.settings-group {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.settings-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.settings-group h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 20px;
    color: var(--text);
}

.form-text {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 12px;
}

/* ===== 新增：智能引擎 / 交互升级样式 ===== */

.badge-info { background: var(--primary); color: white; }
.badge-danger { background: var(--danger, #c62828); color: white; }
.badge-event { background: #e65100; color: white; }

/* 启用/禁用行内开关 */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border, #ccc);
    border-radius: 20px;
    transition: background 0.2s;
}
.switch .slider::before {
    content: "";
    position: absolute;
    height: 14px;
    width: 14px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}
.switch input:checked + .slider { background: var(--success, #4caf50); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* 试一试面板 */
.test-panel {
    background: var(--bg-secondary, #f8f9fa);
    border: 1px solid var(--border, #e0e0e0);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}
.test-panel h3 {
    font-size: 15px;
    font-weight: 500;
    margin: 0 0 6px;
}
.test-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.test-result { margin-top: 12px; }
.test-hit { padding: 10px 12px; border-radius: 8px; background: #e8f5e9; }
.test-hit .test-reply {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(0,0,0,0.15);
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 13px;
}
.test-miss { padding: 10px 12px; border-radius: 8px; background: #fff3e0; font-size: 13px; }

/* toast 通知定位（增强原有 .notification） */
.wb-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 200px;
    max-width: 360px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: wbToastIn 0.25s ease;
}
@keyframes wbToastIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
} 