/* 后台管理系统 - 商用级UI */
:root {
    --sidebar-bg: #1a1f36;
    --sidebar-hover: #272d45;
    --sidebar-active: #3b82f6;
    --primary: #3b82f6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1e293b;
    --gray: #64748b;
    --light: #f8fafc;
    --border: #e2e8f0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; background: #f1f5f9; color: #334155; }

/* Layout */
.admin-wrapper { display: flex; min-height: 100vh; }
.admin-sidebar { width: 250px; background: var(--sidebar-bg); position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; overflow-y: auto; transition: all .3s; }
.admin-main { margin-left: 250px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* Sidebar */
.sidebar-brand { padding: 20px; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 12px; }
.sidebar-brand .logo { width: 40px; height: 40px; background: var(--primary); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 20px; font-weight: bold; }
.sidebar-brand .title { color: #fff; font-size: 16px; font-weight: 600; }
.sidebar-brand .sub { color: var(--gray); font-size: 11px; }
.sidebar-nav { padding: 15px 0; }
.sidebar-nav .nav-group { padding: 0 15px; margin-bottom: 5px; }
.sidebar-nav .nav-group-title { color: var(--gray); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; padding: 10px 5px; font-weight: 600; }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 15px; color: #94a3b8; text-decoration: none; border-radius: 8px; margin: 2px 10px; font-size: 14px; transition: all .2s; }
.sidebar-nav a:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.sidebar-nav a.active { background: var(--primary); color: #fff; }
.sidebar-nav a i { font-size: 18px; width: 22px; text-align: center; }

/* Header */
.admin-header { background: #fff; padding: 15px 25px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.admin-header h4 { font-size: 16px; color: var(--dark); }
.admin-header .header-right { display: flex; align-items: center; gap: 15px; }
.admin-header .user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; cursor: pointer; }

/* Content */
.admin-content { padding: 25px; flex: 1; }

/* Cards */
.card { background: #fff; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h5 { font-size: 15px; color: var(--dark); font-weight: 600; }
.card-body { padding: 20px; }
.card-body .table { margin-bottom: 0; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 25px; }
.stat-card { background: #fff; border-radius: 12px; padding: 20px; border: 1px solid var(--border); display: flex; align-items: center; gap: 15px; }
.stat-card .stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff; }
.stat-card .stat-info h3 { font-size: 24px; font-weight: 700; color: var(--dark); }
.stat-card .stat-info p { color: var(--gray); font-size: 13px; margin: 0; }
.bg-blue { background: var(--primary); }
.bg-green { background: var(--success); }
.bg-red { background: var(--danger); }
.bg-orange { background: var(--warning); }

/* Table */
.table { width: 100%; border-collapse: collapse; }
.table th { background: #f8fafc; padding: 12px 15px; font-size: 13px; color: var(--gray); font-weight: 600; text-align: left; border-bottom: 2px solid var(--border); }
.table td { padding: 12px 15px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:hover { background: #f8fafc; }
.table .badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* Buttons */
.btn { padding: 8px 18px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; border: none; transition: all .2s; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline { background: #fff; color: var(--dark); border: 1px solid var(--border); }
.btn-outline:hover { background: #f1f5f9; }
.btn-clear-all { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; font-weight: 600; }
.btn-clear-all:hover { background: #fecaca; }

/* Forms */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: 13px; color: var(--dark); font-weight: 600; margin-bottom: 6px; }
.form-control { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; transition: border-color .2s; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
textarea.form-control { min-height: 100px; resize: vertical; }

/* Search */
.search-bar { display: flex; gap: 10px; margin-bottom: 15px; }
.search-bar .form-control { max-width: 300px; }

/* Alerts */
.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 15px; font-size: 14px; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* Pagination */
.pagination { display: flex; gap: 5px; list-style: none; justify-content: center; padding: 15px 0; }
.pagination li a, .pagination li span { display: block; padding: 8px 14px; border-radius: 8px; font-size: 13px; color: var(--dark); text-decoration: none; border: 1px solid var(--border); }
.pagination li.active span { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; }
.toast { background: #fff; border-radius: 10px; padding: 14px 20px; margin-bottom: 10px; box-shadow: 0 4px 20px rgba(0,0,0,.15); display: flex; align-items: center; gap: 10px; font-size: 14px; animation: slideIn .3s; min-width: 280px; }
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal-box { background: #fff; border-radius: 16px; padding: 30px; max-width: 440px; width: 90%; text-align: center; }
.modal-box .modal-icon { font-size: 48px; margin-bottom: 10px; }
.modal-box h3 { font-size: 18px; margin-bottom: 8px; }
.modal-box p { color: var(--gray); font-size: 14px; margin-bottom: 20px; }
.modal-box .btn-group { display: flex; gap: 10px; justify-content: center; }

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .admin-header { padding: 12px 15px; }
    .admin-content { padding: 15px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .table { display: block; overflow-x: auto; }
}
.mobile-toggle { display: none; }
@media (max-width: 768px) { .mobile-toggle { display: block; } }
