/* ========== 全局重置 ========== */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
}
body { 
    background: #f3f4f6; 
    font-size: 14px;
    line-height: 1.5;
}

/* ========== 导航栏 所有页面通用 ========== */
.nav {
    background: #1f2937;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.nav a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s;
}
.nav a:hover, .nav a.active {
    background: #2563eb;
}

/* ========== 主容器 ========== */
.admin-wrap {
    padding: 24px;
    min-height: calc(100vh - 48px);
}
.admin-wrap h3 {
    font-size: 18px;
    color: #1f2937;
    margin-bottom: 20px;
    font-weight: 600;
}

/* ========== 白色卡片 所有页面通用 ========== */
.box {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 20px;
    margin-bottom: 20px;
}
.box h4 {
    font-size: 16px;
    color: #1f2937;
    margin-bottom: 16px;
    font-weight: 600;
}

/* ========== 按钮样式 所有页面通用 ========== */
.btn {
    padding: 6px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    display: inline-block;
    background: #2563eb;
    color: #fff;
    transition: all 0.2s;
}
.btn:hover {
    opacity: 0.9;
}
.btn-success { background: #10b981; }
.btn-danger { background: #ef4444; }
.btn-warning { background: #f59e0b; }
.btn-sm { 
    padding: 4px 10px; 
    font-size: 12px; 
}

/* ========== 按钮组 ========== */
.btn-group {
    margin-bottom: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ========== 表单行内布局 ========== */
.form-inline {
    margin-bottom: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.form-inline input,
.form-inline select {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
}
.form-inline input {
    width: 280px;
}

/* ========== 统计卡片 首页用 ========== */
.stats-grid {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 18px 12px;
    text-align: center;
}
.stat-card h4 {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: normal;
}
.stat-card .num {
    font-size: 22px;
    font-weight: bold;
    color: #1f2937;
}
.stat-card .per {
    font-size: 12px;
    color: #2563eb;
    margin-top: 4px;
}

/* ========== 图表容器 首页用 ========== */
.chart-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
.chart-container {
    width: 100%;
    height: 280px;
}
.map-container {
    width: 100%;
    height: 400px;
}

/* ========== 表格 所有页面通用 ========== */
table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed !important;
    margin-top: 10px;
}
th, td {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}
td a { 
    margin-right: 6px; 
}

/* ========== 分页 所有页面通用 ========== */
.page {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 13px;
}
.page a, .page span, .page button {
    padding: 4px 10px;
    border: 1px solid #d1d5db;
    text-decoration: none;
    border-radius: 4px;
    color: #374151;
    background: #fff;
    cursor: pointer;
}
.page a:hover { 
    background: #2563eb; 
    color: #fff; 
    border-color: #2563eb; 
}
.page input {
    width: 50px;
    padding: 4px 6px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
}

/* ========== 弹窗 所有页面通用 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    align-items: center;
    justify-content: center;
}
.modal.show { display: flex; }
.modal-content {
    background: #fff;
    border-radius: 8px;
    width: 420px;
    padding: 24px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-content p { 
    margin-bottom: 12px; 
}
.modal-content input, 
.modal-content select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
}
.modal-footer { 
    margin-top: 20px; 
    text-align: right; 
    display: flex; 
    gap: 8px; 
    justify-content: flex-end; 
}