/* ===== 全局 ===== */
:root {
    --primary: #e74c3c;
    --primary-hover: #c0392b;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;
    --dark: #2c3e50;
    --border: #e0e0e0;
    --bg: #f5f6fa;
    --card: #fff;
    --text: #333;
    --text-muted: #999;
    --sidebar-w: 220px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 登录页 ===== */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-box { background: #fff; border-radius: 12px; padding: 40px; width: 400px; max-width: 90vw; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-header { text-align: center; margin-bottom: 30px; }
.login-header .logo { font-size: 48px; margin-bottom: 10px; }
.login-header h1 { font-size: 20px; color: var(--dark); }
.login-header .subtitle { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.login-footer { text-align: center; color: var(--text-muted); font-size: 12px; margin-top: 24px; }

/* ===== 侧边栏 ===== */
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w); background: var(--dark); color: #fff; display: flex; flex-direction: column; z-index: 100; }
.sidebar-header { display: flex; align-items: center; gap: 10px; padding: 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-header .logo { font-size: 24px; }
.sidebar-title { font-size: 14px; font-weight: 600; }
.sidebar-nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 12px 20px; color: rgba(255,255,255,.7); transition: all .2s; font-size: 14px; text-decoration: none; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.nav-item.active { color: #fff; background: rgba(255,255,255,.15); border-right: 3px solid var(--primary); }
.nav-item i { width: 20px; text-align: center; }
.sidebar-footer { padding: 15px 20px; border-top: 1px solid rgba(255,255,255,.1); }
.user-info { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.user-info a { color: rgba(255,255,255,.6); }
.user-info a:hover { color: #fff; text-decoration: none; }

/* ===== 主内容 ===== */
.main-content { margin-left: var(--sidebar-w); padding: 24px; min-height: 100vh; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header h1 { font-size: 22px; font-weight: 600; }

/* ===== 卡片 ===== */
.card { background: var(--card); border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 20px; overflow: hidden; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-header h2 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }
.card-body.no-padding { padding: 0; }
.card-footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: 1px solid var(--border); }

/* ===== 按钮 ===== */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: none; border-radius: 6px; font-size: 13px; cursor: pointer; transition: all .2s; text-decoration: none; color: #fff; font-family: inherit; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); }
.btn-danger { background: var(--danger); }
.btn-default { background: #95a5a6; }
.btn-block { width: 100%; justify-content: center; padding: 12px; }
.btn-sm { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--border); background: #fff; cursor: pointer; transition: all .2s; color: var(--text-muted); font-size: 13px; padding: 0; }
.btn-sm:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: #555; }
.form-control { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; transition: border-color .2s; font-family: inherit; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(231,76,60,.1); }
.input-group { display: flex; gap: 8px; }
.input-group .form-control { flex: 1; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
textarea.form-control { resize: vertical; }
.checkbox-group { display: flex; gap: 20px; }
.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.checkbox-label input { width: 16px; height: 16px; }

/* ===== 筛选栏 ===== */
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-bar .form-control { flex: none; }

/* ===== 表格 ===== */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: #f8f9fa; padding: 10px 14px; text-align: left; font-size: 12px; font-weight: 600; color: #666; text-transform: uppercase; letter-spacing: .3px; border-bottom: 1px solid var(--border); }
.data-table td { padding: 10px 14px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.data-table tr:hover { background: #fafafa; }
.info-table { width: 100%; }
.info-table td { padding: 8px 14px; border-bottom: 1px solid #f0f0f0; }
.info-table td:first-child { color: var(--text-muted); width: 140px; font-size: 13px; }

/* ===== 状态卡片 ===== */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--card); border-radius: 8px; padding: 20px; display: flex; align-items: center; gap: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.stat-value { font-size: 16px; font-weight: 600; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ===== Mini统计 ===== */
.mini-stats { display: flex; gap: 24px; flex-wrap: wrap; }
.mini-stat { text-align: center; }
.mini-stat-value { font-size: 28px; font-weight: 700; }
.mini-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ===== Badge ===== */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; }
.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-primary { background: #e3f2fd; color: #1565c0; }
.badge-warning { background: #fff3e0; color: #ef6c00; }
.badge-danger { background: #fce4ec; color: #c62828; }
.badge-info { background: #e0f7fa; color: #00838f; }
.badge-default { background: #f5f5f5; color: #757575; }

/* ===== 状态横幅 ===== */
.status-banner { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-radius: 8px; font-size: 15px; margin-bottom: 20px; }
.status-success { background: #e8f5e9; color: #2e7d32; }
.status-warning { background: #fff3e0; color: #ef6c00; }
.status-danger { background: #fce4ec; color: #c62828; }

/* ===== 弹窗 ===== */
.modal { display: none; position: fixed; inset: 0; z-index: 1000; }
.modal.show { display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.modal-content { position: relative; background: #fff; border-radius: 10px; max-width: 500px; width: 90vw; max-height: 80vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 16px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #999; padding: 0 4px; }
.modal-body { padding: 20px; }
.modal-body pre { background: #f5f5f5; padding: 12px; border-radius: 6px; overflow-x: auto; font-size: 12px; margin-top: 8px; max-height: 300px; overflow-y: auto; }

/* ===== Tabs ===== */
.tabs { display: flex; gap: 4px; }
.tab { padding: 4px 12px; border: 1px solid var(--border); border-radius: 4px; background: #fff; cursor: pointer; font-size: 13px; font-family: inherit; }
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== 步骤 ===== */
.steps { padding: 10px 0; }
.step { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.step-text { font-size: 13px; padding-top: 3px; line-height: 1.6; }

/* ===== 分页 ===== */
.pager { display: flex; gap: 4px; }

/* ===== Alert ===== */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.alert-error { background: #fce4ec; color: #c62828; }

/* ===== 工具类 ===== */
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-primary { color: var(--info) !important; }
.text-center { text-align: center; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.hidden { display: none !important; }
.mt-3 { margin-top: 12px; }
code { background: #f0f0f0; padding: 2px 6px; border-radius: 3px; font-size: 12px; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar-title, .nav-item span, .user-info span { display: none; }
    .sidebar-header { justify-content: center; padding: 15px 10px; }
    .nav-item { justify-content: center; padding: 12px; }
    .main-content { margin-left: 60px; }
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
    .filter-bar { flex-direction: column; }
    .filter-bar .form-control { width: 100% !important; }
    .mini-stats { justify-content: space-around; }
}
