/* === 智教耘·智慧画布课堂 - Shared Styles === */
/* Brand: #5B67D3 | Font: Source Han Sans | BG: #F0F4F8 */

:root {
  --primary: #5B67D3;
  --primary-light: #7B85E0;
  --primary-dark: #4550B0;
  --bg: #F0F4F8;
  --surface: #FFFFFF;
  --text: #1A1A2E;
  --text-secondary: #6B7280;
  --border: #E5E7EB;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --sidebar-w: 240px;
  --topbar-h: 56px;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.12);
}

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

body {
  font-family: "Source Han Sans SC", "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100vh;
}

/* === Layout === */
.app { display: flex; height: 100vh; flex-direction: column; }
.topbar {
  height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 16px; gap: 12px; flex-shrink: 0;
  box-shadow: var(--shadow);
}
.topbar h1 { font-size: 16px; font-weight: 600; color: var(--primary); }
.topbar .spacer { flex: 1; }
.main { display: flex; flex: 1; overflow: hidden; }
.sidebar {
  width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border);
  padding: 16px; overflow-y: auto; flex-shrink: 0;
}
.content { flex: 1; overflow: auto; padding: 16px; }
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius); border: none;
  font-size: 14px; font-weight: 500; cursor: pointer; transition: all .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-icon { padding: 6px; border-radius: 50%; background: transparent; border: none; cursor: pointer; }
.btn-icon:hover { background: var(--bg); }

/* === Status Badges === */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 12px;
  font-size: 12px; font-weight: 500;
}
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-info { background: #DBEAFE; color: #1E40AF; }

/* === Cards === */
.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.card-header { padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 600; }
.card-body { padding: 16px; }

/* === Student Thumbnail Grid (Teacher Monitor) === */
.monitor-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px; padding: 8px;
}
.monitor-card {
  border: 2px solid var(--border); border-radius: var(--radius);
  padding: 8px; cursor: pointer; transition: border-color .15s;
  text-align: center;
}
.monitor-card:hover { border-color: var(--primary); }
.monitor-card.active { border-color: var(--success); }
.monitor-card.idle { opacity: .6; }
.monitor-card .thumb { width: 100%; aspect-ratio: 4/3; background: #E8EAED; border-radius: 4px; margin-bottom: 4px; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); font-size: 12px; }
.monitor-card .name { font-size: 12px; font-weight: 500; }
.monitor-card .status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.status-dot.active { background: var(--success); }
.status-dot.idle { background: var(--warning); }
.status-dot.offline { background: var(--danger); }

/* === Forms === */
.input {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 14px; outline: none;
  transition: border-color .15s;
}
.input:focus { border-color: var(--primary); }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; color: var(--text-secondary); }

/* === Full-screen Display === */
.display-full {
  position: fixed; inset: 0; background: #000;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 24px; z-index: 9999;
}
.display-code { text-align: center; }
.display-code .code { font-size: 64px; font-weight: 700; letter-spacing: 8px; color: var(--primary-light); margin: 24px 0; }
.display-code .label { font-size: 16px; color: #999; }

/* === Responsive (Pad priority, C5e 10.4" = 2000x1200) === */
@media (max-width: 768px) {
  .sidebar { display: none; }
  :root { --sidebar-w: 0; }
}
@media (min-width: 1200px) {
  .monitor-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }
