/* style.css - 全局样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    font-size: 14px;
}

/* ===== 顶部导航 ===== */
.navbar {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d6a9f 100%);
    color: #fff;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 60px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-size: 20px;
    font-weight: 700;
    margin-right: 40px;
    white-space: nowrap;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 5px;
    flex: 1;
}

.navbar-nav a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.navbar-nav a:hover,
.navbar-nav a.active {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* ===== 主内容区 ===== */
.main-content {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== 卡片 ===== */
.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
    font-size: 15px;
    color: #1e3a5f;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 20px;
}

/* ===== 统计卡片 ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-icon.blue { background: #eff6ff; }
.stat-icon.green { background: #f0fdf4; }
.stat-icon.orange { background: #fff7ed; }
.stat-icon.red { background: #fef2f2; }
.stat-icon.purple { background: #faf5ff; }

.stat-info .label {
    font-size: 13px;
    color: #888;
    margin-bottom: 4px;
}

.stat-info .value {
    font-size: 22px;
    font-weight: 700;
    color: #1e3a5f;
}

.stat-info .value.green { color: #16a34a; }
.stat-info .value.red { color: #dc2626; }
.stat-info .value.orange { color: #ea580c; }

/* ===== 表单 ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group .required::after {
    content: ' *';
    color: #dc2626;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 2px solid #e1e5ee;
    border-radius: 7px;
    font-size: 14px;
    transition: border-color 0.2s;
    outline: none;
    background: #fff;
}

.form-control:focus {
    border-color: #2d6a9f;
    box-shadow: 0 0 0 3px rgba(45,106,159,0.1);
}

select.form-control {
    cursor: pointer;
}

/* ===== 按钮 ===== */
.btn {
    padding: 9px 18px;
    border: none;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: #2d6a9f; color: #fff; }
.btn-success { background: #16a34a; color: #fff; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-warning { background: #ea580c; color: #fff; }
.btn-secondary { background: #6b7280; color: #fff; }
.btn-info { background: #0891b2; color: #fff; }
.btn-light { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }

/* ===== 表格 ===== */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: #f8fafc;
    padding: 12px 14px;
    text-align: left;
    font-size: 13px;
    color: #555;
    font-weight: 600;
    border-bottom: 2px solid #e8ecf0;
    white-space: nowrap;
}

table td {
    padding: 11px 14px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    vertical-align: middle;
}

table tr:hover td {
    background: #f8fafc;
}

table tr:last-child td {
    border-bottom: none;
}

/* ===== 徽标 ===== */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: #dcfce7; color: #16a34a; }
.badge-danger { background: #fee2e2; color: #dc2626; }
.badge-warning { background: #fff7ed; color: #ea580c; }
.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-secondary { background: #f3f4f6; color: #6b7280; }

/* ===== 提示框 ===== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success { background: #dcfce7; color: #16a34a; border: 1px solid #86efac; }
.alert-error { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }
.alert-warning { background: #fff7ed; color: #ea580c; border: 1px solid #fdba74; }
.alert-info { background: #e0f2fe; color: #0369a1; border: 1px solid #7dd3fc; }

/* ===== 分页 ===== */
.pagination {
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
    padding: 15px 0;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 7px;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
}

.pagination a {
    background: #fff;
    color: #555;
    border: 1px solid #e1e5ee;
}

.pagination a:hover {
    background: #2d6a9f;
    color: #fff;
    border-color: #2d6a9f;
}

.pagination .active {
    background: #2d6a9f;
    color: #fff;
    border: 1px solid #2d6a9f;
}

/* ===== 搜索栏 ===== */
.search-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #f0f0f0;
}

.search-bar .form-group {
    margin-bottom: 0;
    min-width: 150px;
}

/* ===== 模态框 ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 16px;
    color: #1e3a5f;
}

.modal-body { padding: 22px; }

.modal-footer {
    padding: 16px 22px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #888;
    line-height: 1;
    padding: 2px;
}

.modal-close:hover { color: #333; }

/* ===== 空数据 ===== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #aaa;
}

.empty-state .icon { font-size: 50px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .navbar-nav { display: none; }
    .main-content { padding: 12px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
    .search-bar { flex-direction: column; }
    .search-bar .form-group { width: 100%; }
}

/* ===== 加载动画 ===== */
.loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== 工具类 ===== */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-green { color: #16a34a; }
.text-red { color: #dc2626; }
.text-orange { color: #ea580c; }
.text-gray { color: #888; }
.font-bold { font-weight: 700; }
.mt-10 { margin-top: 10px; }
.mb-10 { margin-bottom: 10px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-10 { gap: 10px; }
.nowrap { white-space: nowrap; }