/* ============================================================
 * 全国应急救援志愿者管理系统 · 后台样式
 * ============================================================ */

/* 基础重置 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
       font-size: 14px; line-height: 1.6; color: #333; background: #f5f6fa; }

a { color: #4a6cf7; text-decoration: none; }
a:hover { color: #3b5de7; }

/* ============================================================
 * 头部导航
 * ============================================================ */
.admin-header {
    position: fixed; top: 0; left: 0; right: 0; height: 56px;
    background: #1a1a2e; color: #fff; display: flex; align-items: center;
    justify-content: space-between; padding: 0 24px; z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.header-left { display: flex; align-items: center; gap: 12px; }
.site-title { font-size: 16px; font-weight: 600; letter-spacing: 1px; }
.header-divider { color: rgba(255,255,255,0.3); }
.site-subtitle { font-size: 13px; color: rgba(255,255,255,0.6); }
.header-right { display: flex; align-items: center; gap: 16px; }
.user-info { font-size: 13px; color: rgba(255,255,255,0.85); }
.user-info small { color: rgba(255,255,255,0.5); margin-left: 4px; }
.btn-logout {
    padding: 6px 16px; background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.8);
    border-radius: 6px; font-size: 12px; transition: background 0.2s;
}
.btn-logout:hover { background: rgba(255,255,255,0.2); color: #fff; }

.position-switcher select {
    padding: 4px 8px; border: 1px solid rgba(255,255,255,0.2); border-radius: 4px;
    background: rgba(255,255,255,0.1); color: #fff; font-size: 12px; cursor: pointer;
}
.position-switcher select:focus { outline: none; border-color: rgba(255,255,255,0.4); }

/* ============================================================
 * 主体布局
 * ============================================================ */
.admin-body { display: flex; padding-top: 56px; min-height: 100vh; }

/* 侧边栏 */
.admin-sidebar {
    width: 220px; background: #16213e; flex-shrink: 0;
    overflow-y: auto; padding: 12px 0;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 20px; color: rgba(255,255,255,0.7); font-size: 13px;
    cursor: pointer; transition: all 0.2s; border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-parent .nav-arrow { margin-left: auto; font-size: 10px; transition: transform 0.2s; }
.nav-parent.expanded .nav-arrow { transform: rotate(90deg); }
.nav-parent.expanded { color: #fff; border-left-color: #4a6cf7; }
.nav-child { padding-left: 44px; font-size: 12px; }
.nav-children { display: none; }

/* 主内容区 */
.admin-content {
    flex: 1; padding: 24px; overflow-y: auto; background: #f5f6fa;
}

/* ============================================================
 * 页面头部
 * ============================================================ */
.page-header { margin-bottom: 24px; }
.page-header h2 { font-size: 22px; font-weight: 600; color: #1a1a2e; }
.text-muted { color: #888; font-size: 13px; margin-top: 4px; }

/* ============================================================
 * 统计卡片
 * ============================================================ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: #fff; border-radius: 12px; padding: 20px; display: flex; align-items: center; gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04); transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-value { font-size: 26px; font-weight: 700; color: #1a1a2e; }
.stat-label { font-size: 12px; color: #888; margin-top: 2px; }

/* ============================================================
 * 通用卡片
 * ============================================================ */
.card { background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.card-header { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; }
.card-header h3 { font-size: 15px; font-weight: 600; color: #1a1a2e; }
.card-body { padding: 20px; }
.card-body p { margin-bottom: 8px; line-height: 1.8; }
.mt-4 { margin-top: 24px; }

/* ============================================================
 * 面包屑
 * ============================================================ */
.breadcrumb { font-size: 12px; color: #888; margin-bottom: 16px; }
.breadcrumb a { color: #4a6cf7; }
.breadcrumb span { color: #333; }

/* ============================================================
 * 表单
 * ============================================================ */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: #333; }
.form-control {
    width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px;
    font-size: 13px; transition: border-color 0.2s; box-sizing: border-box;
}
.form-control:focus { border-color: #4a6cf7; outline: none; box-shadow: 0 0 0 3px rgba(74,108,247,0.1); }
select.form-control { background: #fff; cursor: pointer; }
textarea.form-control { min-height: 80px; resize: vertical; }

/* ============================================================
 * 按钮
 * ============================================================ */
.btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 20px;
    border: none; border-radius: 6px; font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all 0.2s;
}
.btn-primary { background: #4a6cf7; color: #fff; }
.btn-primary:hover { background: #3b5de7; }
.btn-success { background: #22c55e; color: #fff; }
.btn-success:hover { background: #16a34a; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-link { background: none; color: #4a6cf7; padding: 0; }
.btn-link:hover { text-decoration: underline; }

/* ============================================================
 * 表格
 * ============================================================ */
.table-wrapper { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; }
table.data-table th, table.data-table td {
    padding: 10px 16px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 13px;
}
table.data-table th { background: #fafafa; font-weight: 600; color: #555; white-space: nowrap; }
table.data-table tr:hover td { background: #f8f9ff; }

/* ============================================================
 * 状态标签
 * ============================================================ */
.badge {
    display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 11px; font-weight: 500;
}
.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-danger { background: #fce4ec; color: #c62828; }
.badge-warning { background: #fff3e0; color: #e65100; }
.badge-info { background: #e3f2fd; color: #1565c0; }

/* ============================================================
 * 空状态
 * ============================================================ */
.empty-state { text-align: center; padding: 60px 20px; color: #aaa; }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ============================================================
 * 弹窗/模态框
 * ============================================================ */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5);
    display: none; align-items: center; justify-content: center; z-index: 2000;
}
.modal-overlay.active { display: flex; }
.modal-box { background: #fff; border-radius: 12px; width: 560px; max-width: 90vw; max-height: 80vh; overflow-y: auto; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 16px; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #888; }
.modal-body { padding: 20px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid #f0f0f0; text-align: right; }

/* ============================================================
 * 工具类
 * ============================================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.p-4 { padding: 16px; }

/* ============================================================
 * 通用表格（简化版）
 * ============================================================ */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
    padding: 10px 14px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 13px;
}
.table th { background: #fafafa; font-weight: 600; color: #555; }
.table tr:hover td { background: #f8f9ff; }

/* ============================================================
 * 信息展示表格
 * ============================================================ */
.info-table td { vertical-align: top; }

/* ============================================================
 * 内联表单
 * ============================================================ */
.form-inline { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.form-inline .form-group { margin-bottom: 0; flex-shrink: 0; }

/* ============================================================
 * 标签页
 * ============================================================ */
.tabs { display: flex; gap: 0; border-bottom: 2px solid #e0e0e0; margin-bottom: 16px; }
.tab-link { padding: 8px 20px; text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -2px; color: #666; transition: all 0.2s; }
.tab-link:hover { color: #1976d2; }
.tab-link.active { border-bottom-color: #1976d2; color: #1976d2; }

/* ============================================================
 * 分页
 * ============================================================ */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 12px; border-radius: 4px; font-size: 13px; text-decoration: none; }
.pagination a { background: #f0f0f0; color: #333; }
.pagination a:hover { background: #e0e0e0; }
.pagination span.current { background: #1976d2; color: #fff; }

/* ============================================================
 * 个人档案网格
 * ============================================================ */
.profile-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }
@media (max-width: 768px) { .profile-grid { grid-template-columns: 1fr; } }

/* ============================================================
 * 间距辅助
 * ============================================================ */
.mt-3 { margin-top: 12px; }

/* ============================================================
 * 滚动条
 * ============================================================ */
.admin-sidebar::-webkit-scrollbar, .admin-content::-webkit-scrollbar { width: 6px; }
.admin-sidebar::-webkit-scrollbar-track { background: transparent; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
.admin-content::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
