/* ==========================================================================
   择校通 (ZHEXIAOTONG) - 独立内容管理后台系统 (Admin Console & CMS)
   Modern Enterprise Dark/Light Hybrid Aesthetic System
   ========================================================================== */

:root {
  --admin-primary: #2563eb;
  --admin-primary-dark: #1d4ed8;
  --admin-primary-light: #eff6ff;
  --admin-accent: #f59e0b;
  --admin-success: #10b981;
  --admin-danger: #ef4444;
  --admin-sidebar-bg: #0f172a;
  --admin-sidebar-hover: #1e293b;
  --admin-sidebar-text: #94a3b8;
  --admin-sidebar-active: #3b82f6;
  --admin-body-bg: #f8fafc;
  --admin-card-bg: #ffffff;
  --admin-border: #e2e8f0;
  --admin-text-main: #0f172a;
  --admin-text-muted: #64748b;
  --admin-radius: 12px;
  --admin-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
  --admin-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --admin-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Segoe UI", Roboto, sans-serif;
}

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

body {
  font-family: var(--admin-font);
  background: var(--admin-body-bg);
  color: var(--admin-text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* 后台主框架布局 */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.admin-sidebar {
  width: 260px;
  background: var(--admin-sidebar-bg);
  color: #ffffff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #2563eb 0%, #38bdf8 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.brand-info h2 {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.brand-info span {
  font-size: 0.72rem;
  color: #38bdf8;
  font-weight: 600;
  text-transform: uppercase;
}

.sidebar-menu {
  flex: 1;
  padding: 18px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-category-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
  padding: 12px 14px 6px;
  letter-spacing: 0.6px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--admin-sidebar-text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.menu-item:hover {
  background: var(--admin-sidebar-hover);
  color: #ffffff;
}

.menu-item.active {
  background: rgba(37, 99, 235, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.menu-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3.5px;
  background: #38bdf8;
  border-radius: 0 4px 4px 0;
}

.menu-item svg {
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-user-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}

/* 主内容区域 */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* 顶部导航栏 */
.admin-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--admin-border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 4px rgba(0,0,0,0.02);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.breadcrumb-path {
  font-size: 0.9rem;
  color: var(--admin-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb-path strong {
  color: var(--admin-text-main);
  font-weight: 700;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-admin-primary {
  background: var(--admin-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-admin-primary:hover {
  background: var(--admin-primary-dark);
}

.btn-admin-outline {
  background: #ffffff;
  border-color: var(--admin-border);
  color: var(--admin-text-main);
}

.btn-admin-outline:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-admin-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--admin-danger);
}

.btn-admin-danger:hover {
  background: var(--admin-danger);
  color: #ffffff;
}

.btn-admin-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

/* 内容主容器 */
.admin-container {
  padding: 28px 32px;
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
}

/* 标签页视图 */
.admin-tab-view {
  display: none;
  animation: adminFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-tab-view.active {
  display: block;
}

@keyframes adminFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* KPI 指标卡片网格 */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.metric-card {
  background: #ffffff;
  border-radius: var(--admin-radius);
  padding: 20px 22px;
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--admin-shadow);
}

.metric-info h3 {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--admin-text-main);
  margin-bottom: 4px;
}

.metric-info span {
  font-size: 0.85rem;
  color: var(--admin-text-muted);
  font-weight: 600;
}

.metric-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.icon-blue { background: #eff6ff; color: #2563eb; }
.icon-amber { background: #fef3c7; color: #d97706; }
.icon-emerald { background: #ecfdf5; color: #059669; }
.icon-purple { background: #f5f3ff; color: #7c3aed; }

/* 操作工具栏卡片 */
.admin-card {
  background: #ffffff;
  border-radius: var(--admin-radius);
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--admin-text-main);
}

.card-title .badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-search-input {
  padding: 8px 14px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  font-size: 0.88rem;
  width: 240px;
  outline: none;
  transition: border-color 0.2s;
}

.admin-search-input:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* 现代响应式数据表格 */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  background: #f8fafc;
  padding: 12px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  border-bottom: 1px solid var(--admin-border);
  white-space: nowrap;
}

.admin-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.88rem;
  color: #1e293b;
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background: #f8fafc;
}

/* 标签胶囊 */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.pill-blue { background: #dbeafe; color: #1d4ed8; }
.pill-green { background: #d1fae5; color: #047857; }
.pill-amber { background: #fef3c7; color: #b45309; }
.pill-purple { background: #ede9fe; color: #6d28d9; }
.pill-gray { background: #f1f5f9; color: #475569; }

/* 模态框体系 */
.admin-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.admin-modal-overlay.active {
  display: flex;
}

.admin-modal-card {
  background: #ffffff;
  border-radius: 16px;
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--admin-border);
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--admin-text-main);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: #64748b;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--admin-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #f8fafc;
  border-radius: 0 0 16px 16px;
}

/* 表单控件 */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--admin-text-main);
  outline: none;
  transition: all 0.2s;
  background: #ffffff;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Toast 提示条 */
.admin-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  padding: 12px 20px;
  border-radius: 10px;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  animation: toastSlideUp 0.25s ease;
}

@keyframes toastSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* 安全认证锁全屏屏障 */
.admin-auth-lock {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.auth-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 36px 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.auth-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: #eff6ff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 16px;
}

.auth-card h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}

.auth-card p {
  font-size: 0.88rem;
  color: #64748b;
  margin-bottom: 24px;
}

/* 响应式断点 */
@media (max-width: 1024px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    height: auto;
    position: static;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .admin-container {
    padding: 16px;
  }
  .topbar-left, .topbar-right {
    flex-wrap: wrap;
  }
}
