/* ============================================
   文印管理后台 - 公共样式
   所有后台页面共享的基础样式
   ============================================ */

/* 重置 & 基础 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    min-height: 100vh;
}

/* 顶部导航栏 */
.admin-header {
    background: rgba(255,255,255,0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    color: #1d1d1f;
    padding: 0 20px;
    height: 52px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 16px rgba(0,0,0,0.18);
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.header-left {
    display: flex;
    align-items: center;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    margin-right: 30px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 25px;
}

.nav-menu li {
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #1d1d1f;
}

.nav-menu a {
    color: inherit;
    text-decoration: none;
}

.nav-menu li.active, .nav-menu li:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #283593;
    font-weight: 600;
}

.user-role {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 2px;
}

.logout-btn {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: #1d1d1f;
    padding: 6px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* 侧边栏 */
.admin-sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 220px;
    background-color: white;
    box-shadow: 3px 0 15px rgba(0,0,0,0.12);
    padding: 20px 0;
    z-index: 999;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid transparent;
}

.sidebar-menu li:hover {
    background-color: #f5f7fa;
    color: #283593;
}

.sidebar-menu li.active {
    background-color: #e8eaf6;
    color: #283593;
    border-left-color: #283593;
    font-weight: 500;
}

.sidebar-menu li i {
    width: 24px;
    margin-right: 12px;
    font-size: 18px;
}

/* 侧边栏折叠按钮 */
.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    margin: 0 12px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #f8f9fa;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    gap: 6px;
}

.sidebar-toggle:hover {
    background: #eef0f3;
    color: #333;
}

.sidebar-toggle i {
    font-size: 10px;
    transition: transform 0.2s;
}

/* 侧边栏最小化状态 */
body.sidebar-collapsed .admin-sidebar {
    width: 54px;
}

body.sidebar-collapsed .admin-sidebar span,
body.sidebar-collapsed .sidebar-toggle span {
    display: none;
}

body.sidebar-collapsed .sidebar-toggle {
    padding: 10px 0;
    margin: 0 6px 10px;
    justify-content: center;
}

body.sidebar-collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

body.sidebar-collapsed .sidebar-menu li i {
    margin-right: 0;
}

body.sidebar-collapsed .sidebar-menu li {
    justify-content: center;
    padding: 14px 0;
}

body.sidebar-collapsed .sidebar-menu a {
    justify-content: center;
}

body.sidebar-collapsed .admin-content {
    margin-left: 54px;
}

.sidebar-menu a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
}

/* 主内容区 */
.admin-content {
    margin-left: 220px;
    margin-top: 60px;
    padding: 25px;
    min-height: calc(100vh - 60px);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.page-subtitle {
    color: #666;
    margin-top: 5px;
    font-size: 14px;
}

.action-buttons {
    display: flex;
    gap: 12px;
}

/* 按钮样式 */
.btn {
    padding: 10px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: #5c6bc0;
    color: white;
}

.btn-primary:hover {
    background-color: #3f51b5;
}

.btn-secondary {
    background-color: #f0f2f5;
    color: #333;
}

.btn-secondary:hover {
    background-color: #e4e6e9;
}

.btn-success {
    background-color: #4caf50;
    color: white;
}

.btn-success:hover {
    background-color: #3d8b40;
}

.btn-danger {
    background-color: #f44336;
    color: white;
}

.btn-danger:hover {
    background-color: #d32f2f;
}

.btn-warning {
    background-color: #ff9800;
    color: white;
}

.btn-warning:hover {
    background-color: #e68900;
}

/* 卡片样式 */
.card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    margin-bottom: 25px;
}

.card-header {
    padding: 18px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px 10px 0 0;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.card-body {
    padding: 25px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 180px;
}

.filter-label {
    font-size: 14px;
    margin-bottom: 8px;
    color: #666;
    font-weight: 500;
}

.filter-select, .filter-input {
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 14px;
    background-color: white;
}

.filter-input {
    width: 100%;
}

.filter-actions {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

/* 表格样式 */
.table-container {
    overflow: auto;
    max-height: calc(100vh - 340px);
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    background-color: #f8f9fa;
    padding: 16px 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 1px 0 #f8f9fa;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background-color: #f9fafb;
}

/* 状态标签 */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
}

.status-uploaded {
    background-color: #e3f2fd;
    color: #1976d2;
}

.status-processing {
    background-color: #fff8e1;
    color: #ff8f00;
}

.status-completed {
    background-color: #e8f5e9;
    color: #388e3c;
}

.status-transferred {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.status-active {
    background-color: #e8f5e9;
    color: #388e3c;
}

.status-inactive {
    background-color: #ffebee;
    color: #d32f2f;
}

.status-pending {
    background-color: #fce4ec;
    color: #c62828;
}

.status-nocount {
    background-color: #fff3e0;
    color: #e65100;
}

.status-rejected {
    background-color: #fce4ec;
    color: #b71c1c;
}

.status-downloaded {
    background-color: #fff8e1;
    color: #ff8f00;
}

.status-printed {
    background-color: #ede7f6;
    color: #5e35b1;
}

.status-picked {
    background-color: #e8f5e9;
    color: #388e3c;
}

/* 紧急标签 */
.urgency-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.urgency-normal {
    background-color: #e8eaf6;
    color: #3f51b5;
}

.urgency-urgent {
    background-color: #ffebee;
    color: #f44336;
}

/* 角色标签 */
.role-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
}

.role-admin {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.role-operator {
    background-color: #e3f2fd;
    color: #1976d2;
}

.role-user {
    background-color: #fff8e1;
    color: #ff8f00;
}

/* 操作按钮组 */
.action-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.action-btn.small {
    padding: 4px 8px;
    font-size: 12px;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background-color: white;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: #283593;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-col {
    flex: 1;
}

/* 统计卡片 */
.stats-container {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    margin-bottom: 25px;
}

.stat-card {
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-info h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.blue {
    background-color: #e3f2fd;
    color: #1976d2;
}

.stat-icon.orange {
    background-color: #fff3e0;
    color: #ff9800;
}

.stat-icon.green {
    background-color: #e8f5e9;
    color: #4caf50;
}

.stat-icon.purple {
    background-color: #f3e5f5;
    color: #9c27b0;
}

/* 转单选择 */
.transfer-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.transfer-option {
    border: 2px solid #eee;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.transfer-option:hover {
    border-color: #283593;
    background-color: #f8f9ff;
}

.transfer-option.selected {
    border-color: #283593;
    background-color: #e8eaf6;
}

.transfer-school {
    font-weight: 600;
    margin-bottom: 5px;
}

.transfer-info {
    font-size: 13px;
    color: #666;
}

/* Toast 提示框 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    font-size: 20px;
}

.toast.success .toast-icon { color: #4caf50; }
.toast.error .toast-icon { color: #f44336; }
.toast.warning .toast-icon { color: #ff9800; }
.toast.info .toast-icon { color: #2196f3; }

/* 分页栏 */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding: 12px 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    flex-wrap: wrap;
    position: sticky;
    bottom: 0;
    z-index: 5;
}

.pagination-left, .pagination-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination-info {
    color: #666;
    font-size: 14px;
}

.page-size-select {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: white;
}

/* Excel 导入相关样式 */
.import-section {
    background-color: #f0f8ff;
    border: 2px dashed #2196f3;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    margin-bottom: 25px;
    cursor: pointer;
    transition: all 0.2s;
}

.import-section:hover {
    background-color: #e3f2fd;
    border-color: #1976d2;
}

.import-icon {
    font-size: 48px;
    color: #2196f3;
    margin-bottom: 15px;
}

.import-text {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
}

.import-hint {
    font-size: 14px;
    color: #999;
}

#import-excel-file,
#excel-file-input {
    display: none;
}

/* 导入结果提示 */
.import-result {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: none;
}

.import-result.success {
    background-color: #e8f5e9;
    color: #388e3c;
    display: block;
}

.import-result.error {
    background-color: #ffebee;
    color: #d32f2f;
    display: block;
}

/* 右下角浮窗样式 */
.float-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 400px;
    height: 400px;
    background-color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.float-window-header {
    background: linear-gradient(135deg, #2a8cff 0%, #1a6dcc 100%);
    color: white;
    padding: 15px 20px;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.float-window-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.float-window-content {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.float-window-content h3 {
    margin-top: 0;
    color: #303133;
    font-size: 18px;
    margin-bottom: 15px;
}

.float-window-content p {
    color: #606266;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* 标签样式 */
.tag-like {
    position: absolute;
    top: -10px;
    right: 20px;
    background-color: #2a8cff;
    color: white;
    padding: 5px 15px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 自动刷新标签 */
.auto-refresh {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f0f2f5;
    color: #555;
    font-size: 12px;
    line-height: 18px;
}

/* 文件信息 */
.file-info {
    margin-top: 5px;
    font-size: 13px;
    color: #666;
}

/* 复选框组 */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* 文本域 */
textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* 转单记录样式 */
.transfer-log {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
    margin-top: 5px;
    font-size: 13px;
}

.transfer-log-item {
    margin-bottom: 5px;
    color: #666;
}

/* 响应式调整 */
@media (max-width: 1600px) {
    .admin-sidebar {
        width: 70px;
    }
    
    .admin-sidebar span {
        display: none;
    }
    
    .admin-content {
        margin-left: 70px;
    }
    
    .sidebar-menu li i {
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-header {
        padding: 0 15px;
    }
    
    .nav-menu {
        display: none;
    }
    
    .admin-content {
        padding: 20px 15px;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
}
