/* ========== 管理后台艺术化样式 ========== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&display=swap');

:root {
  --zj-gold: #c9a227;
  --zj-gold-light: #e8d179;
  --zj-purple: #8b5cf6;
  --zj-indigo: #6366f1;
  --zj-dark: #0f172a;
  --zj-panel: rgba(255, 255, 255, 0.08);
  --zj-border: rgba(255, 255, 255, 0.12);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

body {
  margin: 0;
  font-family: 'Microsoft YaHei', 'PingFang SC', 'Noto Serif SC', sans-serif;
  color: var(--text-main);
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  position: relative;
  overflow: hidden;
}

/* 艺术背景 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('/images/campus3-hd.jpg') center center / cover no-repeat;
  opacity: 0.10;
  z-index: -1;
  filter: saturate(0.7);
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at top right, rgba(99, 102, 241, 0.18), transparent 60%),
              radial-gradient(ellipse at bottom left, rgba(139, 92, 246, 0.14), transparent 55%);
  z-index: -1;
}

.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
  width: 260px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--zj-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 26px 22px 20px;
  border-bottom: 1px solid var(--zj-border);
}

.sidebar-header .logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--zj-gold), var(--zj-gold-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(201, 162, 39, 0.25);
}

.sidebar-header h2 {
  font-family: 'Noto Serif SC', serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px;
  line-height: 1.4;
}

.sidebar-header p {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
  letter-spacing: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 22px;
  margin: 4px 12px;
  font-size: 14px;
  color: #cbd5e1;
  text-decoration: none;
  transition: all 0.2s ease;
  border-radius: 10px;
  border-left: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.18));
  color: #fff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.18);
}

.nav-icon {
  font-size: 17px;
  width: 22px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--zj-border);
}

.sidebar-footer .btn {
  width: 100%;
}

/* 主内容区 */
.main-content {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
  max-height: 100vh;
}

.page-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}

/* 标签面板 */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.35s ease;
}

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

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stat-card {
  background: var(--zj-panel);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  border: 1px solid var(--zj-border);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,0.2);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--zj-gold), var(--zj-purple));
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

/* 卡片通用 */
.card {
  background: var(--zj-panel);
  backdrop-filter: blur(14px);
  border-radius: 16px;
  border: 1px solid var(--zj-border);
  padding: 22px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 表格 */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid var(--zj-border);
}

.table th {
  font-weight: 600;
  color: var(--zj-gold-light);
  background: rgba(0, 0, 0, 0.15);
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(90deg, var(--zj-indigo), var(--zj-purple));
  border: none;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.42);
}

.btn-gold {
  background: linear-gradient(90deg, var(--zj-gold), var(--zj-gold-light));
  color: #1a1a2e;
  border: none;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(201, 162, 39, 0.28);
}

.btn-gold:hover {
  box-shadow: 0 8px 28px rgba(201, 162, 39, 0.4);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
}

.btn-outline:hover {
  background: rgba(255,255,255,0.08);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fecaca;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
}

/* 表单 */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  color: #cbd5e1;
  margin-bottom: 8px;
  font-weight: 500;
}

.input, .select, textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--zj-border);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.input:focus, .select:focus, textarea:focus {
  border-color: var(--zj-gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

.input::placeholder, textarea::placeholder {
  color: rgba(255,255,255,0.35);
}

select option {
  background: #1e293b;
  color: #fff;
}

/* 标签 */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.badge-info {
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
}

.badge-success {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
}

.badge-warning {
  background: rgba(234, 179, 8, 0.18);
  color: #fef08a;
}

/* 过滤栏 */
.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.filter-bar .input,
.filter-bar .select {
  width: auto;
  min-width: 140px;
}

/* 空状态 */
.empty-state {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* 模态框 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--zj-border);
  border-radius: 18px;
  padding: 28px;
  width: 480px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.modal-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 22px;
}

/* 导入结果区域 */
.import-result {
  max-height: 220px;
  overflow-y: auto;
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
  padding: 12px;
  margin-top: 14px;
  font-size: 13px;
}

.import-result-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--zj-border);
}

.import-result-item:last-child {
  border-bottom: none;
}

.import-result-item.success { color: #86efac; }
.import-result-item.error { color: #fca5a5; }

/* Toast */
.toast {
  position: fixed;
  top: 22px;
  right: 22px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--zj-border);
  color: #fff;
  padding: 14px 20px;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  z-index: 2000;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

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

@media (max-width: 768px) {
  .sidebar {
    width: 200px;
  }
  .main-content {
    padding: 20px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* 学校卡片 */
.school-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px 16px;
  min-width: 200px;
}
.school-name { font-size: 15px; font-weight: 600; color: #fff; }
.school-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ========== 实时监控视频网格 ========== */
#monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.monitor-card {
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.monitor-video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  width: 100%;
}
.monitor-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}
.monitor-live-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(239,68,68,0.85);
  color: #fff;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}
.monitor-connecting {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  color: #cbd5e1;
  font-size: 13px;
}
.monitor-card.live .monitor-connecting { display: none; }
.monitor-audio-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: background 0.15s;
}
.monitor-audio-btn:hover { background: rgba(0,0,0,0.8); }
.monitor-audio-btn:not(.muted) { background: rgba(124,58,237,0.85); }
.monitor-meta {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.monitor-course { font-size: 15px; font-weight: 600; color: #fff; word-break: break-all; }
.monitor-detail { font-size: 13px; color: var(--text-muted); word-break: break-all; }
.monitor-time { font-size: 12px; color: #94a3b8; }
.monitor-actions { margin-top: 4px; }

/* 轻量浮层提示（巡课前校验等） */
.toast-tip {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(15,23,42,0.92);
  color: #fff;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  max-width: 80vw;
  text-align: center;
}
.toast-tip.show { opacity: 1; transform: translateX(-50%) translateY(0); }
