:root {
    --sidebar-width: 240px;
    --topbar-height: 56px;
    --primary: #4361ee;
    --primary-light: #e8ecfd;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #4361ee;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; background: #f1f5f9; color: #334155; }
.app-wrapper { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width); background: var(--sidebar-bg); color: var(--sidebar-text);
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 1000; display: flex; flex-direction: column;
    transition: transform 0.3s ease; overflow-y: auto;
}
.sidebar-header { padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-header h5 { color: #fff; font-size: 16px; }
.sidebar-header i { color: var(--primary); margin-right: 8px; }
.sidebar-nav { padding: 12px 0; flex: 1; }
.sidebar-nav .nav-link {
    display: flex; align-items: center; gap: 10px; padding: 10px 20px;
    color: var(--sidebar-text); text-decoration: none; font-size: 14px; transition: all 0.2s;
}
.sidebar-nav .nav-link:hover { color: #fff; background: rgba(255,255,255,0.05); }
.sidebar-nav .nav-link.active { color: #fff; background: var(--sidebar-active); border-radius: 0; }
.sidebar-nav .nav-link i { font-size: 18px; width: 22px; text-align: center; }
.sidebar-nav .nav-section { padding: 16px 20px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #64748b; }

/* 主内容 */
.main-content { margin-left: var(--sidebar-width); flex: 1; min-height: 100vh; }
.top-bar {
    height: var(--topbar-height); background: #fff; border-bottom: 1px solid #e2e8f0;
    display: flex; align-items: center; padding: 0 20px; position: sticky; top: 0; z-index: 100;
}
.sidebar-toggle { display: none; text-decoration: none; color: #334155; }
.content-wrapper { padding: 24px; }

/* 卡片 */
.stat-card { background: #fff; border-radius: 12px; padding: 20px; border: 1px solid #e2e8f0; transition: box-shadow 0.2s; }
.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.stat-card .stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: #1e293b; }
.stat-card .stat-label { font-size: 13px; color: #94a3b8; }

/* 表格 */
.table-card { background: #fff; border-radius: 12px; border: 1px solid #e2e8f0; overflow: hidden; }
.table-card .card-header { padding: 16px 20px; border-bottom: 1px solid #e2e8f0; background: transparent; display: flex; align-items: center; justify-content: space-between; }
.table-card .card-header h6 { margin: 0; font-weight: 600; color: #1e293b; }
.table-responsive { overflow-x: auto; }
.table { margin-bottom: 0; }
.table th { font-weight: 600; color: #64748b; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; background: #f8fafc; border-bottom-width: 1px; }
.table td { vertical-align: middle; color: #334155; font-size: 14px; }

/* 按钮 */
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: #3651d4; border-color: #3651d4; }
.btn-light-primary { background: var(--primary-light); color: var(--primary); border: none; }
.btn-light-primary:hover { background: #d5dcfa; color: var(--primary); }

/* 徽章 */
.badge-status { padding: 4px 10px; border-radius: 6px; font-weight: 500; font-size: 12px; }
.bg-success-soft { background: #dcfce7; color: #166534; }
.bg-warning-soft { background: #fef3c7; color: #92400e; }
.bg-danger-soft { background: #fee2e2; color: #991b1b; }
.bg-info-soft { background: #dbeafe; color: #1e40af; }
.bg-primary-soft { background: var(--primary-light); color: var(--primary); }

/* 表单 */
.form-control, .form-select { border-radius: 8px; border-color: #e2e8f0; font-size: 14px; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(67,97,238,0.15); }
.form-label { font-weight: 500; font-size: 14px; color: #475569; }

/* 登录页 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-card { background: #fff; border-radius: 16px; padding: 40px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
.login-card h3 { font-weight: 700; color: #1e293b; margin-bottom: 8px; }
.login-card p { color: #94a3b8; margin-bottom: 32px; }
.login-card .form-control { padding: 12px 16px; }
.login-card .btn-primary { padding: 12px; font-weight: 600; }

/* 分页 */
.pagination { margin: 16px 20px; }
.pagination .page-link { border-radius: 8px; margin: 0 2px; border: none; color: #64748b; }
.pagination .page-item.active .page-link { background: var(--primary); }

/* 警告提示卡片 */
.alert-card { border-radius: 12px; padding: 16px 20px; border: none; }

/* 手机端适配 */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 999; }
    .sidebar-overlay.show { display: block; }
    .main-content { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .content-wrapper { padding: 16px; }
    .stat-card .stat-value { font-size: 22px; }
}
