/* ============================================
   全局样式变量
============================================ */
:root {
    --primary: #2a5298;
    --primary-dark: #1e3c72;
    --primary-light: #3b6cb0;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
    --radius: 8px;
    --radius-lg: 12px;
}

/* ============================================
   页面通用布局
============================================ */
.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.page-desc {
    color: var(--gray-600);
    font-size: 14px;
}

/* ============================================
   选项卡导航
============================================ */
.tabs-nav {
    display: flex;
    gap: 4px;
    background: white;
    border-radius: var(--radius-lg);
    padding: 6px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(42,82,152,0.3);
}

.tab-icon {
    font-size: 16px;
}

.tab-badge {
    background: rgba(255,255,255,0.2);
    padding: 2px 6px;
    border-radius: 20px;
    font-size: 11px;
    margin-left: 4px;
}

.tab-btn.active .tab-badge {
    background: rgba(255,255,255,0.3);
}

.tabs-content .tab-pane {
    display: none;
}

.tabs-content .tab-pane.active {
    display: block;
}

/* ============================================
   卡片组件
============================================ */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.card-header p {
    margin: 0;
    font-size: 13px;
    color: var(--gray-600);
}

/* ============================================
   表单组件
============================================ */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
}

.required {
    color: var(--danger);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.2s;
}

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

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

/* ============================================
   按钮组件
============================================ */
.btn {
    padding: 8px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(42,82,152,0.3);
}

.btn-secondary {
    background: white;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-100);
}

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

.btn-danger:hover {
    background: #c82333;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

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

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

.btn-icon {
    padding: 6px 12px;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    cursor: pointer;
}

/* ============================================
   表格组件
============================================ */
.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.data-table th {
    background: var(--gray-100);
    font-weight: 600;
    color: var(--gray-700);
}

.data-table tr:hover {
    background: var(--gray-100);
}

/* ============================================
   搜索栏
============================================ */
.search-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.search-input,.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;width: 240px;
}
.dept-select{
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;width: 120px;
}
.search-input:focus,.dept-select:focus {
    width: 240px;
    outline: none;
    border-color: #2c7da0;
    box-shadow: 0 0 0 3px rgba(44,125,160,0.1);
}
.dept-select:focus {
    width: 120px;
    outline: none;
    border-color: #2c7da0;
    box-shadow: 0 0 0 3px rgba(44,125,160,0.1);
}

/* ============================================
   分页组件
============================================ */
.pagination {
    padding: 16px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid var(--gray-200);
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid var(--gray-300);
    background: white;
    border-radius: 6px;
    cursor: pointer;
}

.pagination button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============================================
   上传区域
============================================ */
.upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    margin: 20px;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: var(--primary);
    background: var(--gray-100);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-text {
    font-size: 14px;
    color: var(--gray-600);
}

.upload-hint {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 8px;
}

/* ============================================
   加载动画
============================================ */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   响应式
============================================ */
@media (max-width: 768px) {
    .page-container {
        padding: 12px;
    }
    
    .tabs-nav {
        border-radius: 8px;
        padding: 4px;
    }
    
    .tab-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .search-bar {
        width: 100%;
    }
    
    .search-input {
        flex: 1;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }  
}
       /* 浮动提示 & 模态框 */
        .toast-message {
            position: fixed;
            top: 170px;
            left: 50%;
            transform: translateX(-50%);
            background: #1f2f40;
            color: white;
            padding: 12px 24px;
            border-radius: 40px;
            font-size: 14px;
            z-index: 2000;
            box-shadow: 0 10px 20px rgba(0,0,0,0.2);
            backdrop-filter: blur(4px);
            transition: all 0.2s;
            font-weight: 500;
            pointer-events: none;
        }
        .toast-success { background: #1f6e43; }
        .toast-error { background: #c2412c; }
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            backdrop-filter: blur(3px);
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .modal-container {
            background: white;
            width: 460px;
            max-width: 90%;
            border-radius: 25px;
            box-shadow: 0 25px 40px rgba(0,0,0,0.2);
            overflow: hidden;
            animation: scaleIn 0.2s ease;
        }
        @keyframes scaleIn {
            from { transform: scale(0.95); opacity: 0;}
            to { transform: scale(1); opacity: 1;}
        }
        .modal-header {
            padding: 20px 24px;
            background: #fafcff;
            border-bottom: 1px solid #eef2f8;
            font-weight: 700;
            font-size: 18px;
        }
        .modal-body {
            padding: 24px;
        }
        .modal-footer {
            padding: 16px 24px;
            background: #fafcff;
            display: flex;
            justify-content: flex-end;
            gap: 12px;
            border-top: 1px solid #eef2f8;
        }
        .delete-warning { color: #b91c1c; margin-bottom: 12px; }
        .flex-between { display: flex; justify-content: space-between; align-items: center; }  