/* ==================== 管理后台样式 ==================== */

:root {
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --success-color: #48bb78;
    --danger-color: #fc8181;
    --warning-color: #ed8936;
    --info-color: #4299e1;

    --bg-primary: #f7fafc;
    --bg-secondary: #ffffff;
    --bg-dark: #2d3748;
    --bg-sidebar: #1a202c;

    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-light: #a0aec0;

    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ==================== 登录页面 ==================== */
.admin-login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.login-header h1 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-header .subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.login-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.login-footer p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
}

.login-footer a:hover {
    text-decoration: underline;
}

.error-message {
    color: var(--danger-color);
    background-color: #fff5f5;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    font-size: 0.875rem;
    text-align: center;
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

/* ==================== 布局 ==================== */
.admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 240px;
    height: 100vh;
    background-color: var(--bg-sidebar);
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.admin-main {
    margin-left: 240px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== 侧边栏 ==================== */
.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .logo {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.sidebar-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background-color: var(--primary-color);
    color: white;
}

.nav-item .icon {
    font-size: 1.25rem;
    margin-right: 0.75rem;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-info {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
}

.admin-avatar {
    width: 36px;
    height: 36px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 0.75rem;
}

.admin-details {
    flex: 1;
}

.admin-name {
    font-size: 0.875rem;
    font-weight: 600;
}

.admin-role {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* ==================== 顶部导航 ==================== */
.admin-header {
    background-color: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.current-time {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ==================== 主内容区 ==================== */
.admin-content {
    padding: 2rem;
    flex: 1;
}

/* ==================== 按钮 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--bg-primary);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #e53e3e;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-block {
    width: 100%;
}

.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    transition: opacity 0.2s;
}

.btn-icon:hover {
    opacity: 0.7;
}

.btn-icon-danger:hover {
    color: var(--danger-color);
}

/* ==================== 表单 ==================== */
.form-group {
    margin-bottom: 1.25rem;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    margin-left: 5%;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 90%;
    margin: 0 auto;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
    display: block;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    color: var(--text-secondary);
    font-size: 0.75rem;
    display: block;
    margin-top: 0.25rem;
    margin-left: 5%;
}

/* 确保所有表单内的 select 元素使用正确的盒模型 */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23718096' d='M6 8.825L1.175 4 2.238 2.938 6 6.7 9.763 2.938 10.825 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.625rem center;
    padding-right: 2rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* ==================== 统计卡片 ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-sm {
    padding: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-blue {
    background-color: #ebf8ff;
}

.stat-green {
    background-color: #f0fff4;
}

.stat-purple {
    background-color: #faf5ff;
}

.stat-orange {
    background-color: #fffaf0;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.stat-trend {
    font-size: 0.75rem;
    font-weight: 600;
}

.trend-up {
    color: var(--success-color);
}

.trend-down {
    color: var(--danger-color);
}

/* ==================== 数据表格 ==================== */
.data-table-container {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background-color: var(--bg-primary);
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.data-table tr.selected {
    background-color: #ebf8ff;
}

.data-table tr:hover {
    background-color: var(--bg-primary);
}

.checkbox-column {
    width: 40px;
}

.actions-column {
    width: 120px;
}

/* ==================== 批量导入样式 ==================== */
.import-steps {
    padding: 1rem 0;
}

.import-step {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
}

.step-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
}

.step-content {
    flex: 1;
}

.step-content h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.step-content>p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.import-tips {
    background: #fffaf0;
    border: 1px solid #fed7aa;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

.import-tips ul {
    margin: 0.5rem 0 0 1.5rem;
}

.import-tips li {
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
}

/* 文件上传区域 */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-area:hover,
.file-upload-area.drag-over {
    border-color: var(--primary-color);
    background: #ebf8ff;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.upload-icon {
    font-size: 3rem;
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.upload-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

/* 导入预览 */
.import-preview {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-top: 1rem;
}

/* ==================== 产品管理样式 ==================== */

/* 产品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* 产品卡片 */
.product-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.product-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #fff 100%);
}

.product-card-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: var(--shadow-md);
}

.product-card-actions {
    display: flex;
    gap: 0.5rem;
}

.product-card-body {
    padding: 1.5rem;
}

.product-card-body h3 {
    margin: 0 0 0.75rem 0;
    color: var(--text-primary);
    font-size: 1.125rem;
}

.product-card-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-category {
    display: inline-block;
    background: var(--bg-primary);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
}

.product-card-footer {
    display: flex;
    justify-content: space-around;
    padding: 1rem 1.5rem;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.product-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.product-stat .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.product-stat .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* 产品信息卡片 */
.product-info-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.product-info-header {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.product-info-header .product-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

.product-details h2 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.product-details p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

.product-info-stats {
    display: flex;
    gap: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.info-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.info-stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* 返回按钮 */
.header-title-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-title-group button {
    margin-right: 1rem;
}

/* 来源标签 */
.source-badge {
    display: inline-block;
    background: #e2e8f0;
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 0.5rem;
}

/* 分类标签 */
.category-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 0.5rem;
}

/* 知识分类标签栏 */
.knowledge-categories {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
}

.category-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.category-tab:hover {
    background: #e2e8f0;
    border-color: var(--primary-color);
}

.category-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 600;
}

.category-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 20px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 0 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.category-tab.active .category-count {
    background: rgba(255, 255, 255, 0.2);
}

/* 表单提示 */
.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* 知识列表 - 产品视图 */
.product-knowledge-list .knowledge-item {
    border-left: 4px solid var(--primary-color);
}

/* 筛选工具栏 - 产品视图 ==================== */

.preview-header {
    margin-bottom: 1rem;
}

.preview-header h4 {
    margin-bottom: 0.5rem;
}

.preview-summary {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.text-success {
    color: var(--success-color);
    font-weight: 600;
}

.text-danger {
    color: var(--danger-color);
    font-weight: 600;
}

.preview-table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.preview-table thead {
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 1;
}

.preview-table th,
.preview-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.preview-table th {
    font-weight: 600;
    color: var(--text-secondary);
}

.preview-table tbody tr.invalid {
    background-color: #fff5f5;
}

.preview-table tbody tr:hover {
    background-color: var(--bg-primary);
}

.preview-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* ==================== 筛选工具栏 ==================== */
.filter-toolbar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    box-sizing: border-box;
}

/* ==================== 分页 ==================== */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: white;
    border-top: 1px solid var(--border-color);
}

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

.pagination-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.page-number {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
}

.page-number:hover {
    background-color: var(--bg-primary);
}

.page-number.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-ellipsis {
    padding: 0.375rem 0.5rem;
    color: var(--text-secondary);
}

/* ==================== 模态框 ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.modal-content * {
    box-sizing: border-box;
}

.modal-large {
    max-width: 700px;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-x: hidden;
    width: 100%;
}

/* ==================== 徽章 ==================== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-role {
    background-color: #ebf8ff;
    color: #4299e1;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.status-active {
    background-color: #f0fff4;
    color: var(--success-color);
}

.status-inactive {
    background-color: #fffaf0;
    color: var(--warning-color);
}

.status-disabled {
    background-color: #fff5f5;
    color: var(--danger-color);
}

.status-vectorized {
    background-color: #f0fff4;
    color: var(--success-color);
}

.status-pending {
    background-color: #fffaf0;
    color: var(--warning-color);
}

.status-error {
    background-color: #fff5f5;
    color: var(--danger-color);
}

.score-value {
    font-weight: 600;
    color: var(--primary-color);
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.empty-state .btn {
    margin: 0.5rem;
}

.no-data {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* ==================== Toast ==================== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--bg-dark);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background-color: var(--success-color);
}

.toast-error {
    background-color: var(--danger-color);
}

.toast-warning {
    background-color: var(--warning-color);
}

/* ==================== 权限管理样式 ==================== */
.roles-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* 角色标签栏 */
.roles-tabs {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    height: fit-content;
}

.role-tab {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    background: var(--bg-primary);
}

.role-tab:last-child {
    margin-bottom: 0;
}

.role-tab:hover {
    background: #e2e8f0;
    border-color: #cbd5e0;
}

.role-tab.active {
    background: linear-gradient(135deg, #ebf8ff 0%, #e3f2fd 100%);
    border-color: var(--primary-color);
}

.role-tab-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
}

.role-tab-info {
    flex: 1;
}

.role-tab-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.role-tab-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.role-tab-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.role-tab.active .role-tab-count {
    background: var(--primary-color);
    color: white;
}

/* 权限矩阵 */
.permissions-matrix {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.permissions-matrix h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.permissions-matrix h3::before {
    content: '🔐';
    font-size: 1.5rem;
}

.permission-category {
    margin-bottom: 2rem;
}

.permission-category:last-child {
    margin-bottom: 0;
}

.category-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.permission-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.permission-item:hover {
    background: #e2e8f0;
    border-color: #cbd5e0;
}

.permission-item:last-child {
    margin-bottom: 0;
}

.permission-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.permission-icon {
    font-size: 1.25rem;
}

.permission-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

/* 开关样式 */
.permission-switch {
    position: relative;
    width: 52px;
    height: 28px;
}

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

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e0;
    transition: 0.3s;
    border-radius: 28px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.permission-switch input:checked+.switch-slider {
    background-color: var(--primary-color);
}

.permission-switch input:checked+.switch-slider:before {
    transform: translateX(24px);
}

/* 角色成员部分 */
.role-members-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.role-members-section h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.role-members-section h3::before {
    content: '👥';
    font-size: 1.5rem;
}

/* 信息卡片 */
.info-card {
    background: linear-gradient(135deg, #ebf8ff 0%, #e3f2fd 100%);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #bbeeff;
}

.info-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.info-card p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==================== 系统设置样式 ==================== */
.settings-container {
    display: grid;
    gap: 1.5rem;
}

.settings-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.settings-section:hover {
    box-shadow: var(--shadow-md);
}

.settings-section h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.settings-section .form-group {
    margin-bottom: 1.5rem;
}

.settings-section .form-group:last-of-type {
    margin-bottom: 0;
}

/* 危险区域 */
.settings-section.danger-zone {
    border: 2px solid var(--danger-color);
}

.settings-section.danger-zone h3 {
    color: var(--danger-color);
}

.warning-text {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #fff5f5;
    border-radius: var(--radius-md);
    border: 1px solid #fed7d7;
}

.data-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* 设置输入框特殊样式 */
.settings-section input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.settings-section label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* ==================== 组织架构样式 ==================== */
.org-container {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    min-height: calc(100vh - 200px);
}

/* 部门树容器 */
.org-tree-container {
    background: white;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.tree-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-primary) 0%, #fff 100%);
}

.tree-header h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
}

.tree-actions {
    display: flex;
    gap: 0.5rem;
}

.org-tree {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* 空状态 */
.tree-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.tree-empty .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* 树节点 */
.tree-node {
    margin-bottom: 0.5rem;
}

.tree-node.selected>.tree-node-content {
    background: linear-gradient(135deg, #ebf8ff 0%, #e3f2fd 100%);
    border-color: var(--primary-color);
    border-radius: var(--radius-md);
}

.tree-node-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.tree-node-content:hover {
    background: var(--bg-primary);
    border-color: #cbd5e0;
}

.tree-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: transform 0.2s ease;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.tree-toggle::before {
    content: '▶';
    display: block;
}

.tree-toggle.expanded {
    transform: rotate(90deg);
}

.tree-toggle-empty {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.tree-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.tree-label {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.tree-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    background: var(--bg-primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.tree-node.selected .tree-count {
    background: var(--primary-color);
    color: white;
}

.tree-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tree-node-content:hover .tree-actions,
.tree-node.selected>.tree-node-content .tree-actions {
    opacity: 1;
}

.tree-add,
.tree-edit,
.tree-delete {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.tree-add:hover {
    background: var(--success-color);
    color: white;
}

.tree-edit:hover {
    background: var(--info-color);
    color: white;
}

.tree-delete:hover {
    background: var(--danger-color);
    color: white;
}

.tree-children {
    margin-left: 0.5rem;
    border-left: 2px solid var(--border-color);
    padding-left: 0.5rem;
}

/* 部门详情容器 */
.org-details-container {
    background: var(--bg-primary);
    overflow-y: auto;
}

.dept-details {
    padding: 2rem;
}

/* 部门信息卡片 */
.dept-info-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.dept-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.dept-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

.dept-title {
    flex: 1;
}

.dept-title h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dept-id {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: monospace;
}

.dept-actions {
    display: flex;
    gap: 0.5rem;
}

/* 部门统计 */
.dept-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    background: linear-gradient(135deg, var(--bg-primary) 0%, #f7fafc 100%);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.stat-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* 部门元数据 */
.dept-meta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
}

.meta-item {
    display: flex;
    gap: 0.75rem;
}

.meta-item label {
    min-width: 60px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.meta-item span {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* 部门成员部分 */
.dept-users-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.dept-users-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dept-users-section h3::before {
    content: '👥';
    font-size: 1.25rem;
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.user-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
    overflow: hidden;
}

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

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* 下级部门部分 */
.dept-children-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.dept-children-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dept-children-section h3::before {
    content: '🏗️';
    font-size: 1.25rem;
}

.child-dept-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.child-dept-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    cursor: pointer;
}

.child-dept-item:hover {
    background: #ebf8ff;
    border-color: var(--primary-color);
}

.child-icon {
    font-size: 1rem;
}

.child-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.child-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

/* ==================== Dashboard 样式 ==================== */

/* 头部副标题 */
.header-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0.25rem 0 0 0;
    font-weight: 400;
}

/* Dashboard 统计卡片网格 */
.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.dashboard-stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-color: var(--primary-color);
}

/* 统计卡片头部 */
.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.users-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.sessions-icon {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.departments-icon {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.knowledge-icon {
    background: linear-gradient(135deg, #9f7aea 0%, #805ad5 100%);
}

.stat-card-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.trend-up {
    color: var(--success-color);
}

.trend-down {
    color: var(--danger-color);
}

/* 统计卡片主体 */
.stat-card-body {
    flex: 1;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.stat-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.detail-label {
    font-weight: 500;
}

.detail-value {
    font-weight: 600;
    color: var(--primary-color);
}

/* 统计卡片底部 */
.stat-card-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.footer-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Dashboard 主内容区 */
.dashboard-main-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

/* Dashboard 左侧列 */
.dashboard-left-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Dashboard 图表卡片 */
.dashboard-chart-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-primary) 0%, #fff 100%);
}

.chart-card-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-period-selector {
    display: flex;
    gap: 0.5rem;
}

.period-btn {
    padding: 0.375rem 0.875rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.period-btn:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
}

.period-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.chart-card-body {
    padding: 1.5rem;
}

/* 练习趋势柱状图 */
.chart-bars-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 200px;
    padding: 1rem 0;
}

.chart-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.chart-bar {
    width: 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.chart-bar:hover {
    transform: scaleY(1.05);
    box-shadow: var(--shadow-md);
}

.chart-bar.highlight {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.bar-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.bar-value {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.chart-bar:hover .bar-value {
    opacity: 1;
}

/* 场景分布列表 */
.scenario-distribution {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.scenario-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.scenario-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 120px;
}

.scenario-icon {
    font-size: 1.25rem;
}

.scenario-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.scenario-stats {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.scenario-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    text-align: right;
}

.scenario-bar {
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
}

.scenario-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Dashboard 右侧列 */
.dashboard-right-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Dashboard 活动卡片 */
.dashboard-activity-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.activity-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-primary) 0%, #fff 100%);
}

.activity-card-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.activity-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.activity-card-body {
    padding: 1.5rem;
}

/* 活动时间线 */
.activity-timeline {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.activity-timeline-item {
    display: flex;
    gap: 1rem;
    position: relative;
}

.activity-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.activity-login {
    background: #48bb78;
}

.activity-practice {
    background: #667eea;
}

.activity-knowledge {
    background: #9f7aea;
}

.activity-user {
    background: #ed8936;
}

.activity-content {
    flex: 1;
}

.activity-text {
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.activity-text strong {
    font-weight: 600;
    color: var(--primary-color);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.activity-score {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--success-color);
    padding: 0.25rem 0.5rem;
    background: #f0fff4;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.activity-card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}

/* 快捷操作卡片 */
.dashboard-quick-actions-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.quick-actions-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-primary) 0%, #fff 100%);
}

.quick-actions-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1.5rem;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-action-btn:hover {
    background: #e2e8f0;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.action-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.action-users {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.action-knowledge {
    background: linear-gradient(135deg, #9f7aea 0%, #805ad5 100%);
}

.action-dept {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.action-perm {
    background: linear-gradient(135deg, #fc8181 0%, #f56565 100%);
}

.action-export {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
}

.action-settings {
    background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
}

.action-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* 系统状态卡片 */
.dashboard-status-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.status-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-primary) 0%, #fff 100%);
}

.status-card-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.status-indicator {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
}

.status-online {
    background: #f0fff4;
    color: var(--success-color);
}

.status-offline {
    background: #fff5f5;
    color: var(--danger-color);
}

.status-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
}

.status-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.status-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.status-success {
    color: var(--success-color);
}

.status-warning {
    color: var(--warning-color);
}

.status-error {
    color: var(--danger-color);
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 200px;
    }

    .admin-main {
        margin-left: 200px;
    }

    .admin-content {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .filter-toolbar {
        flex-direction: column;
    }

    .org-container {
        grid-template-columns: 1fr;
    }

    .org-tree-container {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .dept-details {
        padding: 1rem;
    }

    .dept-stats {
        grid-template-columns: 1fr;
    }

    /* 权限管理响应式 */
    .roles-container {
        grid-template-columns: 1fr;
    }

    .roles-tabs {
        max-height: 300px;
        overflow-y: auto;
    }

    .permissions-matrix {
        padding: 1rem;
    }

    .permission-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .permission-switch {
        width: 100%;
    }

    /* Dashboard 响应式 */
    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-main-content {
        grid-template-columns: 1fr;
    }

    .chart-bars-container {
        height: 150px;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .admin-sidebar {
        width: 60px;
    }

    .sidebar-header h2,
    .nav-item span:not(.icon) {
        display: none;
    }

    .admin-main {
        margin-left: 60px;
    }

    .admin-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .dept-header {
        flex-direction: column;
        text-align: center;
    }

    .dept-actions {
        width: 100%;
        justify-content: center;
    }

    .dept-meta {
        align-items: flex-start;
    }

    /* 系统设置响应式 */
    .settings-section {
        padding: 1rem;
    }

    .data-actions {
        flex-direction: column;
    }

    .data-actions .btn {
        width: 100%;
    }

    /* Dashboard 移动端 */
    .dashboard-stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 2rem;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-action-btn {
        padding: 1rem;
    }

    .chart-bars-container {
        gap: 0.25rem;
    }

    .chart-bar {
        width: 30px;
    }

    .chart-card-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
}