/* ============ 全局 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f0f2f5; color: #1f2937; line-height: 1.6;
}
a { text-decoration: none; color: inherit; }

/* ============ 管理后台布局 ============ */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 220px; background: #1e293b; color: #cbd5e1;
    display: flex; flex-direction: column; position: fixed;
    top: 0; left: 0; bottom: 0; z-index: 100;
}
.sidebar-logo {
    padding: 24px 20px; font-size: 16px; font-weight: 700;
    color: #fff; border-bottom: 1px solid #334155;
    word-break: break-all; line-height: 1.4;
}
.sidebar-nav { padding: 12px 0; flex: 1; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 20px; color: #94a3b8; font-size: 14px;
    transition: all 0.2s; border-left: 3px solid transparent;
}
.nav-item:hover { background: #334155; color: #fff; }
.nav-item.active { background: #334155; color: #fff; border-left-color: #3b82f6; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.main-content {
    flex: 1; margin-left: 220px; padding: 32px;
    min-width: 0;
}

/* ============ 页面头部 ============ */
.page-header {
    display: flex; align-items: baseline; gap: 12px;
    margin-bottom: 28px;
}
.page-header h1 { font-size: 24px; font-weight: 700; color: #1e293b; }
.page-subtitle { font-size: 14px; color: #64748b; }

/* ============ 统计卡片 ============ */
.stats-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 20px; margin-bottom: 32px;
}
.stat-card {
    background: #fff; border-radius: 12px; padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    display: flex; flex-direction: column; gap: 8px;
    border-top: 3px solid;
}
.stat-card.stat-blue { border-top-color: #3b82f6; }
.stat-card.stat-green { border-top-color: #22c55e; }
.stat-card.stat-orange { border-top-color: #f59e0b; }
.stat-icon { font-size: 28px; }
.stat-number { font-size: 32px; font-weight: 700; color: #1e293b; }
.stat-label { font-size: 14px; color: #64748b; }

/* ============ 内容区块 ============ */
.content-section {
    background: #fff; border-radius: 12px; padding: 24px;
    margin-bottom: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.content-section h2 {
    font-size: 16px; font-weight: 600; color: #1e293b;
    margin-bottom: 20px; padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

/* ============ 表格 ============ */
.data-table {
    width: 100%; border-collapse: collapse; font-size: 14px;
}
.data-table th {
    text-align: left; padding: 12px 16px; background: #f8fafc;
    color: #64748b; font-weight: 600; font-size: 13px;
    border-bottom: 2px solid #e2e8f0; white-space: nowrap;
}
.data-table td {
    padding: 12px 16px; border-bottom: 1px solid #f1f5f9;
    color: #334155; vertical-align: middle;
}
.data-table tr:hover td { background: #f8fafc; }

/* ============ 徽章 ============ */
.badge {
    display: inline-block; padding: 3px 10px;
    border-radius: 20px; font-size: 12px; font-weight: 500;
}
.badge-green { background: #dcfce7; color: #16a34a; }
.badge-gray { background: #f1f5f9; color: #64748b; }

/* ============ 表单 ============ */
.jump-form { margin-top: 8px; }
.form-row {
    display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap;
}
.form-group {
    display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 220px;
}
.form-group label {
    font-size: 13px; font-weight: 600; color: #475569;
}
.form-input {
    padding: 10px 14px; border: 1px solid #d1d5db; border-radius: 8px;
    font-size: 14px; transition: border 0.2s; outline: none;
    font-family: inherit;
}
.form-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.form-hint { font-size: 12px; color: #94a3b8; }
.form-arrow {
    font-size: 24px; color: #3b82f6; padding-bottom: 10px;
}

/* ============ 按钮 ============ */
.btn {
    padding: 10px 20px; border: none; border-radius: 8px;
    font-size: 14px; font-weight: 500; cursor: pointer;
    transition: all 0.2s; font-family: inherit; white-space: nowrap;
}
.btn-primary { background: #3b82f6; color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-info { background: #e0f2fe; color: #0369a1; }
.btn-info:hover { background: #bae6fd; }
.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-danger:hover { background: #fecaca; }
.btn-gray { background: #f1f5f9; color: #475569; }
.btn-gray:hover { background: #e2e8f0; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ============ 提示 ============ */
.alert {
    padding: 12px 16px; border-radius: 8px; margin-bottom: 20px;
    font-size: 14px; font-weight: 500;
}
.alert-error { background: #fee2e2; color: #dc2626; }
.alert-success { background: #dcfce7; color: #16a34a; }

/* ============ 空状态 ============ */
.empty-state {
    text-align: center; padding: 40px 20px; color: #94a3b8;
}
.empty-state a { color: #3b82f6; }

/* ============ 登录页 ============ */
.login-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; background: linear-gradient(135deg, #1e293b, #334155);
}
.login-card {
    background: #fff; border-radius: 16px; padding: 40px 36px;
    width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    text-align: center;
}
.login-icon {
    width: 64px; height: 64px; margin: 0 auto 20px;
    background: #eff6ff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
}
.login-card h1 { font-size: 20px; font-weight: 700; color: #1e293b; margin-bottom: 4px; }
.login-subtitle { font-size: 14px; color: #64748b; margin-bottom: 28px; }
.login-error {
    background: #fee2e2; color: #dc2626; padding: 10px 16px;
    border-radius: 8px; margin-bottom: 20px; font-size: 14px;
}
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form .form-input {
    padding: 14px 16px; font-size: 15px;
}
.login-btn {
    padding: 14px; background: #3b82f6; color: #fff;
    border: none; border-radius: 8px; font-size: 16px;
    font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.login-btn:hover { background: #2563eb; }

/* ============ 弹窗 ============ */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
}
.modal-box {
    background: #fff; border-radius: 12px; padding: 28px;
    width: 90%; max-width: 440px;
}
.modal-box h3 { font-size: 18px; font-weight: 600; margin-bottom: 20px; }
.modal-form { display: flex; flex-direction: column; gap: 16px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* ============ 操作列 ============ */
.action-cell { white-space: nowrap; display: flex; gap: 8px; }

/* ============ 响应式 ============ */
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar-logo { font-size: 0; padding: 20px 10px; }
    .sidebar-logo::first-letter { font-size: 20px; }
    .nav-item { padding: 12px 18px; font-size: 0; }
    .nav-icon { font-size: 18px; }
    .main-content { margin-left: 60px; padding: 20px; }
    .stats-grid { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; }
    .form-arrow { transform: rotate(90deg); }
}
