/* ── Subject Symbol Toolbar ───────────────────────── */
.cat-btn {
  display: inline-flex; align-items: center;
  padding: 3px 10px; height: 26px;
  border-radius: 5px; border: 1px solid var(--border);
  background: #fff; cursor: pointer;
  font-size: 0.78rem; color: var(--text-secondary); white-space: nowrap;
  transition: all 0.15s; flex-shrink: 0;
  font-family: inherit; line-height: 1;
}
.cat-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.cat-btn.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 600; box-shadow: 0 0 0 2px rgba(59,130,246,0.12); }

.symbol-panel {
  display: flex; flex-wrap: wrap; align-items: center; gap: 3px;
  padding: 0 12px; max-height: 0; overflow: hidden;
  background: #faf9f7;
  border-left: 0 solid var(--border-strong);
  border-right: 0 solid var(--border-strong);
  transition: max-height 0.28s var(--ease-smooth), padding 0.28s var(--ease-smooth), border-left-width 0.28s var(--ease-smooth), border-right-width 0.28s var(--ease-smooth);
}
.symbol-panel.open {
  max-height: 280px; padding: 6px 12px; overflow-y: auto;
  border-left-width: 1.5px; border-right-width: 1.5px;
}

.sym-cat-label {
  font-size: 0.6rem; font-weight: 600; color: var(--text-muted);
  letter-spacing: 0.5px; margin-right: 4px; text-transform: uppercase;
}

.sym-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; padding: 0 6px;
  border-radius: 5px; border: 1px solid var(--border);
  background: #fff; cursor: pointer;
  font-size: 1rem; color: var(--text);
  transition: all 0.12s; flex-shrink: 0;
  line-height: 1; font-family: 'Times New Roman', serif;
}
.sym-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); box-shadow: 0 2px 6px rgba(59,130,246,0.12); }
.sym-btn:active { transform: scale(0.95); }
.sym-btn-img { padding: 2px; min-width: 36px; }
.sym-btn-img img { display: block; height: 22px; width: auto; }

.sym-sub-label {
  display: inline-flex; align-items: center;
  font-size: 0.6rem; font-weight: 600; color: var(--text-muted);
  letter-spacing: 0.3px; margin: 0 3px 0 1px; white-space: nowrap;
  user-select: none; height: 30px;
}

/* ── Toolbar visibility → editor border-radius ───── */
.editor-group .editor-wysiwyg { border-radius: var(--radius-md); border-top: 1.5px solid var(--border-strong); }
.editor-group.toolbar-active .editor-toolbar { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.editor-group.toolbar-active .editor-wysiwyg { border-radius: 0 0 var(--radius-md) var(--radius-md); border-top: none; }

/* ── Drag & Drop for Unit Management ─────────────── */
.drag-handle {
  cursor: grab;
  color: #ccc;
  font-size: 0.85rem;
  user-select: none;
  padding: 0 4px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.drag-handle:hover {
  color: #888;
}
.drag-handle:active {
  cursor: grabbing;
}
.dragging {
  opacity: 0.4;
}
.drag-over {
  border-bottom: 2px solid var(--primary) !important;
}
.unit-card {
  transition: transform 0.15s ease;
}
.lesson-row {
  transition: transform 0.15s ease;
}

/* ═══════════════════════════════════════════════════════
智能组卷系统 — 组件样式
   动画 · 登录页 · 热力图 · 个人中心 · 移动端组件等
   基础样式 → style.css  响应式 → responsive.css

   设计说明：因内网穿透隧道对静态资源有约 43KB 传输限制，
   CSS 拆分为三个文件 + 后端 gzip 压缩确保完整传输。
   ═══════════════════════════════════════════════════════ */

/* ── Unit Slide Animation ───────────────────────────── */
.unit-slide-wrap {
  overflow: hidden;
  width: 0; max-height: 0;
  opacity: 0;
  transition: width 0.35s ease, max-height 0.35s ease, opacity 0.25s ease 0.05s;
  flex-shrink: 0;
  white-space: nowrap;
}
.unit-slide-wrap.show { width: 160px; max-height: 80px; opacity: 1; }
.lesson-slide-wrap {
  overflow: hidden;
  width: 0; max-height: 0;
  opacity: 0;
  transition: width 0.35s ease, max-height 0.35s ease, opacity 0.25s ease 0.05s;
  flex-shrink: 0;
  white-space: nowrap;
}
.lesson-slide-wrap.show { width: 150px; max-height: 80px; opacity: 1; }

/* ── Login Page ─────────────────────────────────────── */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  top: -40%; right: -20%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(59,130,246,0.07), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.login-page::after {
  content: '';
  position: absolute;
  bottom: -30%; left: -15%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(16,185,129,0.05), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.login-card {
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  padding: 40px;
  width: 420px;
  max-width: 92vw;
  box-shadow: var(--shadow-modal);
  border: 1px solid rgba(255,255,255,0.5);
  position: relative;
}
.login-card .brand { text-align: center; margin-bottom: 28px; }
.login-card .brand .logo { font-size: 2.8rem; margin-bottom: 4px; }
.login-card .brand h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--deep);
  margin-bottom: 4px;
}
.login-card .brand p { font-size: 0.82rem; color: var(--text-muted); }
.login-card .form-group { margin-bottom: 18px; }
.login-card label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--text);
}
.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  transition: all var(--duration-fast);
  background: rgba(255,255,255,0.7);
  box-sizing: border-box;
}
.login-card input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
  background: #fff;
}
.login-card .btn-login {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
}
.login-card .btn-login:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59,130,246,0.25);
}
.login-card .btn-login:active { transform: scale(0.98); }
.login-card .hint {
  text-align: center;
  margin-bottom: 20px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Subject tab (inline badge) ─────────────────────── */
.subj-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
}

/* ── Diff stars inline ──────────────────────────────── */
.diff-stars { color: var(--accent-amber); font-size: 0.82rem; letter-spacing: 1px; }

/* ── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d4d2cd; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #bbb; }

/* ── Heatmap ────────────────────────────────────────── */
.heatmap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.heatmap-header h4 { font-size: 0.92rem; color: var(--deep); font-weight: 600; }
.heatmap-total { font-size: 0.82rem; color: var(--text-secondary); }
.heatmap-total strong { color: var(--success); }
.heatmap-wrap { overflow-x: auto; overflow-y: visible; padding: 4px 0 20px; }
.heatmap-table {
  display: inline-grid;
  grid-template-rows: repeat(7, 14px);
  grid-auto-flow: column;
  gap: 3px;
  padding: 4px;
}
.heatmap-month-labels {
  position: relative;
  height: 18px;
  padding-left: 4px;
  margin-bottom: 2px;
}
.heatmap-month-label { flex-shrink: 0; text-align: left; }
.heatmap-day-labels {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  margin-right: 4px;
  margin-top: 30px;
  font-size: 0.65rem;
  color: var(--text-muted);
}
.heatmap-day-label { height: 14px; line-height: 14px; white-space: nowrap; }
.heatmap-inner { display: flex; align-items: flex-start; }
.heatmap-cell {
  width: 14px; height: 14px;
  border-radius: 3px;
  background: #ebedf0;
  cursor: pointer;
  position: relative;
  transition: opacity var(--duration-fast);
}
.heatmap-cell:hover { opacity: 0.8; outline: 1px solid rgba(0,0,0,0.1); }
.heatmap-cell.level-0 { background: #ebedf0; }
.heatmap-cell.level-1 { background: #9be9a8; }
.heatmap-cell.level-2 { background: #40c463; }
.heatmap-cell.level-3 { background: #30a14e; }
.heatmap-cell.level-4 { background: #216e39; }
.heatmap-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--deep);
  color: #fff;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-fast);
  z-index: 999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.heatmap-cell:hover .heatmap-tooltip { opacity: 1; }
.heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.heatmap-legend-cell { width: 12px; height: 12px; border-radius: 2px; }

/* ── Filter-group sizing (desktop) ────────────────── */
.fg-grade { min-width: 110px; flex-shrink: 0; }
.fg-unit  { min-width: 150px; flex-shrink: 0; }
.fg-lesson { min-width: 140px; flex-shrink: 0; }
.fg-type  { min-width: 130px; flex-shrink: 0; }
.fg-search { flex: 1; min-width: 0; }
.fg-search input { width: 100%; }
.fg-btn   { flex-shrink: 0; }

/* ── Browser filters (desktop) ─────────────────────── */
.browser-filters {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
}

/* ── Form narrow ──────────────────────────────────── */
.form-narrow { max-width: 500px; }
.input-disabled { background: #f5f5f5; cursor: not-allowed; }

/* ── Profile ──────────────────────────────────────── */
.profile-layout { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.profile-col-left { flex: 1; min-width: 280px; display: flex; flex-direction: column; gap: 20px; }
.profile-col-right { flex: 1.5; min-width: 350px; }
.profile-card { background: var(--card); border-radius: var(--radius-xl); padding: 24px; box-shadow: var(--shadow-card); border: 1px solid var(--border); }
.profile-card-top { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.profile-avatar {
  width: 60px; height: 60px; border-radius: 50%; background: var(--primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 700; flex-shrink: 0;
}
.profile-name { margin: 0 0 4px; font-size: 1.1rem; }
.profile-role-badge { color: #fff; padding: 2px 8px; border-radius: var(--radius-sm); font-size: 0.75rem; }
.profile-role-badge.role-admin { background: var(--primary); }
.profile-role-badge.role-teacher { background: var(--success); }
.profile-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.profile-stat-item { text-align: center; padding: 12px; border-radius: var(--radius-sm); }
.profile-stat-item.stat-green { background: var(--success-bg); }
.profile-stat-item.stat-blue { background: var(--primary-light); }
.profile-stat-num { font-size: 1.5rem; font-weight: 700; }
.profile-stat-item.stat-green .profile-stat-num { color: var(--success); }
.profile-stat-item.stat-blue .profile-stat-num { color: var(--primary); }
.profile-stat-label { font-size: 0.8rem; color: var(--text-secondary); }
.profile-meta { margin-bottom: 12px; font-size: 0.9rem; color: var(--text-secondary); }
.profile-meta > div { margin-bottom: 6px; }
.heatmap-section { background: var(--card); border-radius: var(--radius-xl); padding: 20px; box-shadow: var(--shadow-card); border: 1px solid var(--border); }
.heatmap-loading { text-align: center; color: var(--text-muted); padding: 20px; }

/* ── Teaching checkboxes ──────────────────────────── */
.teaching-checkboxes { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.teaching-checkbox-label {
  display: flex; align-items: center; gap: 4px; cursor: pointer;
  padding: 5px 10px; border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm); font-size: 0.85rem;
  transition: all var(--duration-fast);
}
.teaching-checkbox-label input { width: auto; }
.teaching-checkbox-label:hover { border-color: var(--primary); }
.teaching-checkbox-label.checked { background: var(--primary-light); border-color: var(--primary-border); color: var(--primary); }

/* ── Subject Tabs (Questions page) ──────────────────── */
.subject-tabs {
  display: flex;
  gap: 0;
  background: var(--card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  border-bottom: none;
  margin-bottom: 0;
}
.subject-tab {
  flex: 1;
  padding: 14px 16px;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: #faf9f7;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  user-select: none;
  border-bottom: 2px solid transparent;
}
.subject-tab:hover { color: var(--primary); background: var(--primary-light); }
.subject-tab.active {
  color: var(--primary);
  background: var(--card);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.subject-tab .tab-icon { margin-right: 6px; }
.subject-tab .tab-count { font-size: 0.72rem; color: var(--text-muted); margin-left: 4px; font-weight: 400; }

/* ── Table horizontal scroll wrapper ────────────────── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
}
.table-wrap .table { border-radius: 0; box-shadow: none; border: none; }
.table-wrap::after {
  content: '← 左右滑动查看 →';
  display: none;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 8px;
  background: #faf9f7;
  border-top: 1px solid var(--border);
}

/* ── Hamburger menu button (mobile only) ──────────── */
.hamburger {
  display: none;
  position: fixed;
  top: 10px; left: 10px;
  z-index: 200;
  width: 40px; height: 40px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  font-size: 1.3rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast);
}
.hamburger:active { transform: scale(0.92); }

/* ── Sidebar drawer (mobile) ──────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30,41,59,0.4);
  z-index: 150;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.sidebar-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* ── Build page mobile tabs ───────────────────────── */
.build-tabs {
  display: none;
  border-bottom: 1px solid var(--border);
  background: #faf9f7;
}
.build-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  transition: all var(--duration-fast);
}
.build-tab.active {
  color: var(--primary);
  background: var(--card);
  border-bottom-color: var(--primary);
}

/* ── Inline Confirm (refined) ─────────────────────── */
@keyframes confirmSlideIn {
  from { opacity: 0; transform: translateX(8px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes confirmSlideOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(-6px) scale(0.95); }
}
.confirm-inline-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 1px 4px;
  background: var(--danger-bg);
  animation: confirmSlideIn 0.25s var(--ease-spring) both;
}
.confirm-inline-wrap.confirm-out {
  animation: confirmSlideOut 0.18s ease-in both;
}
.confirm-inline-text {
  font-size: 0.75rem;
  color: #b91c1c;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-right: 2px;
}
.confirm-inline-btn {
  padding: 0 10px;
  height: 24px;
  border: none;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  line-height: 24px;
  text-align: center;
  transition: transform 0.12s var(--ease-spring),
              box-shadow 0.15s ease,
              background 0.15s ease;
  flex-shrink: 0;
}
.confirm-inline-btn:active {
  transform: scale(0.85);
}
.confirm-inline-btn.confirm-yes {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 1px 3px rgba(239,68,68,0.25);
}
.confirm-inline-btn.confirm-yes:hover {
  background: #dc2626;
  box-shadow: 0 2px 8px rgba(239,68,68,0.35);
  transform: scale(1.1);
}
.confirm-inline-btn.confirm-no {
  background: #f3f4f6;
  color: #6b7280;
}
.confirm-inline-btn.confirm-no:hover {
  background: #e5e7eb;
  color: #374151;
  transform: scale(1.1);
}
.confirm-inline-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── Search Highlight ─────────────────────────────── */
mark.search-highlight {
  background: #fef08a;
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════
