/* Hub 统一管理平台样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --sidebar-bg: #0f172a;
    --sidebar-text: #cbd5e1;
    --sidebar-active: #2563eb;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

/* ============ 登录页 ============ */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    padding: 20px;
}
.auth-container { width: 100%; max-width: 420px; }
.auth-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.auth-logo { text-align: center; margin-bottom: 32px; color: var(--primary); }
.auth-logo h1 { font-size: 22px; color: var(--text); margin-top: 12px; }
.auth-subtitle { color: var(--text-light); font-size: 13px; margin-top: 4px; }
.auth-form .form-group { margin-bottom: 18px; }
.auth-form label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 13px; color: var(--text); }
.remember-row { display: flex; align-items: center; }
.checkbox-label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; color: var(--text-light); }
.checkbox-label input { width: auto; }
.auth-footer { text-align: center; margin-top: 24px; color: var(--text-light); font-size: 12px; }
.auth-msg { margin-top: 12px; min-height: 18px; text-align: center; font-size: 13px; }
.auth-msg.error { color: var(--danger); }
.auth-msg.success { color: var(--success); }

/* ============ 通用组件 ============ */
.input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    font-family: inherit;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
    text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: #f8fafc; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ============ 后台布局 ============ */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
}
.sidebar-logo {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 14px;
    transition: all .2s;
    cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; }
.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}
.sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar-footer .btn { color: var(--sidebar-text); border-color: rgba(255,255,255,0.2); }
.sidebar-footer .btn:hover { background: rgba(255,255,255,0.08); color: #fff; }

.main-content {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.topbar {
    background: var(--card-bg);
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar h2 { font-size: 18px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.admin-name { cursor: pointer; color: var(--primary); font-weight: 500; }
.badge-super { background: var(--warning); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; }

.content-area { flex: 1; padding: 24px; }

/* ============ 页面切换 ============ */
.page { display: none; }
.page.active { display: block; }

/* ============ 卡片 ============ */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    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 h3 { font-size: 15px; font-weight: 600; }
.card-hint { color: var(--text-light); font-size: 12px; }
.card-body { padding: 20px; }

/* ============ 统计卡片 ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.blue { background: #dbeafe; color: #2563eb; }
.stat-icon.green { background: #dcfce7; color: #16a34a; }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-icon.orange { background: #fed7aa; color: #d97706; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat-label { color: var(--text-light); font-size: 13px; margin-top: 2px; }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; padding: 10px 12px; background: #f8fafc; color: var(--text-light); font-weight: 500; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table tr:hover td { background: #f8fafc; }
.table .empty { text-align: center; color: var(--text-light); padding: 32px; }

/* ============ 空状态 ============ */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-light); }
.empty-state svg { color: #cbd5e1; margin-bottom: 16px; }
.empty-state p { margin-bottom: 4px; }
.empty-desc { font-size: 12px; color: #94a3b8; }

/* ============ 弹窗 ============ */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-card {
    background: var(--card-bg);
    border-radius: 12px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-light); line-height: 1; }
.modal-body { padding: 20px; }
.modal-body .form-group { margin-bottom: 16px; }
.modal-body label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 13px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ============ Toast ============ */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--text);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 2000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    max-width: 360px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ============ 响应式 ============ */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform .3s; }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
}
