/* =========================================================
   中国七~九年级初中数学提分系统 - 核心视觉与自适应响应式样式表
   ========================================================= */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-dark: #1e3a8a;
  
  --secondary: #10b981;
  --secondary-light: #ecfdf5;
  
  --accent-purple: #8b5cf6;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "Fira Code", Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: clip;
  min-height: 100vh;
}

/* ==================== 顶部全局导航栏 ==================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: var(--shadow-sm);
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.brand-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: #fff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -0.5px;
}

.brand-badge {
  font-size: 11px;
  background: #dbeafe;
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-tab-btn {
  background: transparent;
  border: none;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-tab-btn:hover {
  color: var(--primary);
  background: var(--primary-light);
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-auth-status {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-auth-status.activated {
  background: var(--secondary-light);
  color: var(--secondary);
  border-color: #a7f3d0;
}

.btn-auth-status.unactivated {
  background: #fff1f2;
  color: var(--accent-rose);
  border-color: #fecdd3;
}

/* ==================== 未激活全屏锁定遮罩 ==================== */
.app-lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lock-card {
  background: #ffffff;
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.lock-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.lock-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.lock-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ==================== 主布局容器 ==================== */
.app-layout {
  display: flex;
  min-height: calc(100vh - 64px);
  max-width: 1600px;
  margin: 0 auto;
  overflow: visible;
}

.sidebar-tree {
  width: 320px;
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid var(--border-color);
  padding: 20px 16px;
  overflow-y: auto;
  max-height: calc(100vh - 64px);
  position: sticky;
  top: 64px;
}

.sidebar-search {
  margin-bottom: 16px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  background: var(--bg-main);
}

.search-input:focus {
  border-color: var(--primary);
  background: #fff;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 14px;
}

.pillar-group {
  margin-bottom: 20px;
}

.pillar-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
  padding: 6px 10px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

/* ==================== 新版四级知识树立体样式 ==================== */
.tree-grade-card {
  margin-bottom: 12px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: all 0.2s ease;
}

.tree-grade-card:hover {
  border-color: #cbd5e1;
}

.tree-grade-header {
  padding: 10px 14px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  font-size: 14px;
  color: #1e293b;
  border-bottom: 1px solid transparent;
  transition: background 0.15s ease;
}

.tree-grade-header:hover {
  background: #f1f5f9;
}

.tree-grade-card.expanded > .tree-grade-header {
  background: #eff6ff;
  color: #1d4ed8;
  border-bottom: 1px solid #dbeafe;
}

.tree-grade-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tree-grade-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 12px;
  background: #e2e8f0;
  color: #475569;
}

.tree-grade-card.expanded > .tree-grade-header .tree-grade-badge {
  background: #dbeafe;
  color: #1e40af;
}

.tree-arrow {
  font-size: 11px;
  color: #94a3b8;
  display: inline-block;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tree-grade-card.expanded > .tree-grade-header .tree-arrow,
.tree-semester-card.expanded > .tree-semester-header .tree-arrow {
  transform: rotate(90deg);
  color: #2563eb;
}

.tree-grade-body {
  padding: 8px 10px;
  display: none;
}

.tree-grade-card.expanded > .tree-grade-body {
  display: block;
}

.tree-semester-card {
  margin-bottom: 8px;
  border-radius: 6px;
  border: 1px solid #f1f5f9;
  background: #fafafa;
  overflow: hidden;
}

.tree-semester-header {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  background: #f8fafc;
  transition: all 0.15s ease;
}

.tree-semester-header:hover {
  background: #f1f5f9;
}

.tree-semester-card.expanded > .tree-semester-header {
  background: #f0fdf4;
  color: #15803d;
  border-bottom: 1px solid #dcfce7;
}

.tree-semester-body {
  padding: 6px 8px;
  display: none;
}

.tree-semester-card.expanded > .tree-semester-body {
  display: block;
}

.tree-domain-section {
  margin-bottom: 10px;
}

.tree-domain-section:last-child {
  margin-bottom: 4px;
}

.tree-domain-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 4px 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
  border-left: 3px solid #94a3b8;
  margin-bottom: 4px;
  background: #ffffff;
  border-radius: 0 4px 4px 0;
}

.tree-domain-header.domain-algebra {
  border-left-color: #3b82f6;
  color: #1d4ed8;
}

.tree-domain-header.domain-geometry {
  border-left-color: #10b981;
  color: #047857;
}

.tree-domain-header.domain-statistics {
  border-left-color: #f59e0b;
  color: #b45309;
}

.tree-domain-count {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
}

.grade-block {
  margin-left: 8px;
  margin-bottom: 12px;
}

.grade-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 8px;
  text-transform: uppercase;
}

.topic-list {
  list-style: none;
  margin-left: 8px;
}

.topic-item {
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topic-item:hover {
  background: var(--bg-subtle);
  color: var(--primary);
}

.topic-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  border-left: 3px solid var(--primary);
}

.main-content {
  flex: 1;
  padding: 20px 28px;
  max-width: 1200px;
  overflow: visible;
  position: relative;
}

/* ==================== 九步法精讲卡片 ==================== */
.lesson-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.lesson-header-card {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: #fff;
  padding: 28px 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.lesson-header-card::after {
  content: '∑';
  position: absolute;
  right: 20px;
  bottom: -20px;
  font-size: 140px;
  color: rgba(255, 255, 255, 0.08);
  font-family: serif;
  pointer-events: none;
}

.lesson-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

.meta-tag {
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 12.5px;
  font-weight: 600;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.lesson-tag-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 10px;
}

.lesson-tag-label {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding-top: 3px;
}

.tag-label-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-branch {
  background: rgba(16, 185, 129, 0.22);
  color: #a7f3d0;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.badge-thinking {
  background: rgba(192, 132, 252, 0.22);
  color: #f5d0fe;
  border: 1px solid rgba(192, 132, 252, 0.45);
}

.badge-method {
  background: rgba(251, 191, 36, 0.22);
  color: #fef08a;
  border: 1px solid rgba(251, 191, 36, 0.45);
}

.lesson-tag-chips-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
}

.branch-chip {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.35);
  transition: all 0.2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}

.branch-chip:hover {
  background: #ffffff;
  color: var(--primary-dark);
  border-color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.branch-chip:active {
  transform: translateY(0);
}

/* 细分知识分支精讲弹窗与高亮面板 */
.branch-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeInModal 0.2s ease;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.branch-modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  border-radius: var(--radius-lg);
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  animation: slideUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.branch-modal-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #ffffff;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.branch-modal-title {
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.branch-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.branch-modal-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

.branch-modal-body {
  padding: 24px;
  font-size: 14.5px;
  line-height: 1.8;
  color: #334155;
}

.branch-section {
  margin-bottom: 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px;
}

.branch-section-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.branch-section.trap-section {
  background: #fffdfd;
  border-color: #fecdd3;
}

.branch-section.trap-section .branch-section-title {
  color: var(--accent-rose);
}

.thinking-chip, .thinking-tag {
  background: #fdf4ff;
  color: #86198f;
  border: 1px solid #f0abfc;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(134, 25, 143, 0.06);
}

.thinking-chip:hover, .thinking-tag:hover {
  background: #fae8ff;
  border-color: #d946ef;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(134, 25, 143, 0.15);
}

.method-chip, .method-tag {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(6, 95, 70, 0.06);
}

.method-chip:hover, .method-tag:hover {
  background: #d1fae5;
  border-color: #34d399;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(6, 95, 70, 0.15);
}

.lesson-main-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.nine-steps-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.step-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.step-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.step-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 8px;
}

.step-content {
  font-size: 14.5px;
  line-height: 1.85;
  color: #334155;
  word-break: break-word;
}

.step-content strong {
  color: var(--primary-dark);
}

.step-content br + br {
  display: block;
  content: "";
  margin-top: 10px;
}

.step-card.trap-card {
  border-left: 4px solid var(--accent-rose);
  background: #fffdfd;
}

.step-card.trap-card .step-title {
  color: var(--accent-rose);
  border-bottom-color: #ffe4e6;
}

.step-card.trap-card .step-content strong {
  color: #991b1b;
}

/* 难度筛选按钮 */
.btn-filter-diff {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-filter-diff:hover {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
}

.btn-filter-diff.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

/* ==================== 沙盒实验室 (方案B：左满高画布 + 右侧参数/解析双段栏) ==================== */
.sandbox-view-container {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: stretch;   /* 左右等高拉伸 */
}

/* 左侧：画布卡片（包含标签条 + canvas，撑满可用高度）*/
.sandbox-canvas-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 16px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ===== 折叠抽屉式模式导航 ===== */
.sandbox-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.sandbox-drawer-group {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

/* 抽屉标题行 */
.sandbox-drawer-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: #f8fafc;
  border: none;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  transition: background 0.15s;
  text-align: left;
}
.sandbox-drawer-header:hover {
  background: #f1f5f9;
}

.drawer-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.drawer-icon { font-size: 14px; flex-shrink: 0; }
.drawer-title { white-space: nowrap; }

/* 题数徽章 */
.drawer-badge {
  background: #e2e8f0;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  flex-shrink: 0;
}
/* 当前分组包含 active 按钮时高亮徽章 */
.sandbox-drawer-group:has(.btn-sandbox-tab.active) .drawer-badge {
  background: var(--primary);
  color: #fff;
}
/* 当前分组标题也一起高亮 */
.sandbox-drawer-group:has(.btn-sandbox-tab.active) .sandbox-drawer-header {
  background: #eff6ff;
  color: var(--primary-dark);
}

.drawer-chevron {
  font-size: 10px;
  color: #94a3b8;
  flex-shrink: 0;
  transition: transform 0.2s;
}

/* 抽屉内容区：折叠动画 */
.sandbox-drawer-body {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 10px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, padding 0.25s ease;
}
.sandbox-drawer-body.open {
  max-height: 360px;   /* 足够容纳多行按钮 */
  padding: 8px 10px;
}

/* 模式标签条：横向紧凑滚动，不折行，三组用竖线分隔 */
.sandbox-tabs-category-wrapper {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.sandbox-tabs-category-wrapper::-webkit-scrollbar {
  height: 4px;
}
.sandbox-tabs-category-wrapper::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}

/* 标签条内部：单行排列，三组用分隔符隔开 */
.sandbox-tab-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
  min-width: max-content;
}

.sandbox-tab-divider {
  width: 1px;
  height: 22px;
  background: #cbd5e1;
  flex-shrink: 0;
  margin: 0 4px;
}

.sandbox-tab-group-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}

.btn-sandbox-tab {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-sandbox-tab:hover {
  background: var(--bg-subtle);
  border-color: #94a3b8;
}

.btn-sandbox-tab.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
}

/* 画布容器：铺满剩余高度 */
.sandbox-canvas-wrapper {
  flex: 1;
  min-height: 0;
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.sandbox-canvas-wrapper canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  touch-action: none;
}

/* 右侧：控制栏（粘性吸附，内部可滚动，上下双段） */
.sandbox-controls-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 90px);
}

/* 右侧上段：参数控制区（可独立滚动） */
.sandbox-params-section {
  flex-shrink: 0;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border-color);
  overflow-y: auto;
  max-height: 52vh;
  scrollbar-width: thin;
  scrollbar-color: #e2e8f0 transparent;
}
.sandbox-params-section::-webkit-scrollbar {
  width: 4px;
}
.sandbox-params-section::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 2px;
}

/* 右侧下段：信息面板 + 认知舱（可独立滚动） */
.sandbox-info-section {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px 16px;
  scrollbar-width: thin;
  scrollbar-color: #e2e8f0 transparent;
}
.sandbox-info-section::-webkit-scrollbar {
  width: 4px;
}
.sandbox-info-section::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 2px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
}

.slider-input {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}

/* 信息卡片（沙盒实例写入 #sandbox-info-panel 内的包装） */
.sandbox-info-card {
  background: var(--bg-main);
  border-radius: var(--radius-md);
  padding: 9px 11px;
  border: 1px solid var(--border-color);
  margin-bottom: 8px;
  overflow-wrap: break-word;
  word-break: break-word;
  text-align: left;
  font-family: var(--font-sans);
}

.sandbox-info-card h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 6px;
  line-height: 1.35;
  overflow-wrap: break-word;
  text-align: left;
  font-family: var(--font-sans);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 6px;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 6px;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
}

.sandbox-controls-card .katex {
  font-size: 0.95em;
  max-width: 100%;
  text-align: left;
}

/* ==================== 考试系统与试卷分类 ==================== */
.exam-grade-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.exam-grade-card.highlight {
  border-color: #bfdbfe;
  background: #f8faff;
}

.exam-grade-header {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
}

.exam-btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-exam-choice {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-exam-choice:hover {
  background: #ffffff;
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.15);
  transform: translateY(-1px);
}

.btn-exam-choice.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
  font-weight: 700;
}

/* 单考点测试与自定义智能组卷卡片 */
.topic-quiz-card, .custom-exam-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.topic-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px 10px;
  max-height: 200px;
  overflow-y: auto;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  margin-top: 10px;
  scrollbar-width: thin;
}

.topic-check-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #334155;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}

.topic-check-item:hover {
  background: #e2e8f0;
  color: var(--primary-dark);
}

.topic-check-item input[type="checkbox"] {
  accent-color: var(--primary);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  cursor: pointer;
}

.config-input-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 16px 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

@media (max-width: 960px) {
  .config-input-group {
    grid-template-columns: 1fr;
  }
}

.config-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.config-field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.config-field-row {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 13px;
  color: #475569;
  font-weight: 600;
}

.config-field input[type="number"] {
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  outline: none;
  text-align: center;
  transition: all 0.15s;
}

.config-field input[type="number"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.config-bonus-banner {
  grid-column: 1 / -1;
  background: #f0fdf4;
  border: 1px dashed #22c55e;
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.exam-header-bar {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.exam-timer {
  font-size: 18px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-rose);
  background: #fff1f2;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  border: 1px solid #fecdd3;
  display: flex;
  align-items: center;
  gap: 8px;
}

.exam-main-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
  position: relative;
}

.paper-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px 34px;
  box-shadow: var(--shadow-sm);
}

.paper-title-block {
  text-align: center;
  border-bottom: 2px solid var(--text-main);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.paper-title {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
}

.paper-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

.question-box {
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--border-color);
}

.question-header {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.question-stem {
  font-size: 15px;
  line-height: 1.8;
  color: #1e293b;
  margin-bottom: 14px;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.option-btn {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.option-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.option-btn.selected {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
}

.fill-input {
  width: 260px;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
}

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

/* ==================== 填空题多空答题卡片与排版 ==================== */
.multi-blank-wrap {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-top: 10px;
}

.multi-blank-notice {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.multi-blank-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

.multi-blank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.multi-blank-item {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  transition: all 0.2s ease;
}

.multi-blank-item:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.multi-blank-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 5px;
}

.multi-blank-field-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.multi-blank-input {
  width: 100%;
  padding: 7px 10px;
  font-size: 13.5px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  outline: none;
  background: #f8fafc;
  transition: all 0.2s;
}

.multi-blank-input:focus {
  background: #ffffff;
  border-color: var(--primary);
}

.multi-blank-preview {
  min-width: 60px;
  max-width: 140px;
  min-height: 28px;
  font-size: 13px;
  padding: 3px 8px;
  background: #f1f5f9;
  border-radius: 4px;
  display: flex;
  align-items: center;
  overflow-x: auto;
}


.solve-textarea {
  width: 100%;
  min-height: 110px;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  line-height: 1.6;
}

.solve-textarea:focus {
  border-color: var(--primary);
}

/* ==================== 数学符号工具栏与公式预览 ==================== */
.math-symbol-toolbar {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 8px;
}

.toolbar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.symbol-buttons-group {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.btn-sym {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 4px 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-sym:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.phrases-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  border-top: 1px dashed var(--border-color);
  padding-top: 6px;
}

.btn-phrase {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-phrase:hover {
  background: var(--primary);
  color: #fff;
}

.math-live-preview {
  padding: 6px 10px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  min-height: 36px;
  display: flex;
  align-items: center;
  font-size: 13.5px;
}

.solve-preview-container {
  margin-top: 8px;
}

.math-live-preview.solve-box {
  min-height: 48px;
  background: #fdfdfd;
  border-left: 3px solid var(--primary);
  display: block;
  line-height: 1.8;
}

/* ==================== 几何图形画板与辅助线工具 ==================== */
.figure-interactive-wrapper {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px;
  margin: 12px 0 16px 0;
  max-width: 480px;
}

.figure-tools-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 8px;
}

.btn-fig-tool {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-fig-tool:hover {
  background: var(--bg-subtle);
}

.btn-fig-tool.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.figure-stage {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  overflow: hidden;
  border-radius: 4px;
}

.figure-base-svg {
  width: 100%;
  pointer-events: none;
}

.figure-overlay-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

/* ==================== 1. 右侧栏专精展示说明卡片 (Sticky 视口固定) ==================== */
.exam-sidebar-sticky {
  position: -webkit-sticky;
  position: sticky;
  top: 80px;
  align-self: flex-start;
  width: 340px;
  max-width: 340px;
  flex-shrink: 0;
  z-index: 25;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
}

/* ==================== 1.1 说明卡片折叠按钮 ==================== */
.inst-toggle-btn {
  margin-left: auto;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.inst-toggle-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* ==================== 1.2 动态答题卡 (已答 / 未答 / 待复查 + 快速跳转) ==================== */
.exam-answer-card {
  margin-top: 14px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 16px 16px 16px;
  box-shadow: var(--shadow-sm);
}

.ans-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.ans-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ans-progress-text {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 20px;
  padding: 2px 10px;
  white-space: nowrap;
}

.ans-progress-track {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}

.ans-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
  border-radius: 3px;
  transition: width 0.25s ease;
}

.ans-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.ans-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.ans-legend-item b {
  color: var(--text-main);
}

.ans-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  display: inline-block;
}

.ans-dot-answered { background: #22c55e; }
.ans-dot-unanswered { background: #e2e8f0; border: 1px solid #cbd5e1; }
.ans-dot-flagged { background: #f59e0b; }

.ans-group-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  margin: 10px 0 6px 0;
}

.ans-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px 6px;
}

.ans-item {
  position: relative;
}

.ans-num {
  width: 100%;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #64748b;
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.ans-num:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.ans-num.answered {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}

.ans-num.flagged {
  border-color: #fbbf24;
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.35);
}

.ans-num.current {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.ans-flag {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 17px;
  height: 17px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #cbd5e1;
  font-size: 9px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ans-flag:hover {
  border-color: #f59e0b;
  color: #f59e0b;
}

.ans-flag.on {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #ffffff;
}

.ans-flag-pop {
  animation: ansFlagPop 0.3s ease;
}

@keyframes ansFlagPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.ans-footer {
  margin-top: 12px;
}

.ans-tip {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 10px;
}

.ans-submit-btn {
  width: 100%;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* 跳转定位后题目高亮闪烁 */
.question-box-flash {
  animation: questionBoxFlash 1.2s ease;
}

@keyframes questionBoxFlash {
  0% { background: rgba(59, 130, 246, 0.14); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18); }
  100% { background: transparent; box-shadow: none; }
}

/* ==================== 2. 使用说明卡片紧凑优雅排版 (严格遵循图3规范) ==================== */
.exam-instructions-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.inst-header {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--primary-dark);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.inst-item {
  margin-bottom: 14px;
}

.inst-item-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.inst-mapping-list {
  list-style: none;
  margin: 4px 0 6px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inst-mapping-item {
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #334155;
  background: #f8fafc;
  padding: 4px 8px;
  border-radius: 5px;
  border: 1px solid #f1f5f9;
}

.code-badge {
  background: #f1f5f9;
  color: #b91c1c;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid #e2e8f0;
}

.arrow-render {
  color: var(--text-light);
  font-weight: bold;
  font-size: 12px;
}

.render-result {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
}

/* 按钮规范 */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-secondary {
  background: #fff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
}

.btn-secondary.active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #1d4ed8 !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35) !important;
  font-weight: 700 !important;
}

/* 技能图谱三层级联筛选胶囊样式与高亮 */
.skill-filter-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skill-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 0;
}

.skill-filter-row:not(:last-child) {
  border-bottom: 1px dashed #f1f5f9;
  padding-bottom: 10px;
}

.skill-filter-label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  min-width: 82px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.skill-filter-pill {
  background: #ffffff;
  color: #475569;
  border: 1px solid #cbd5e1;
  padding: 5px 13px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  user-select: none;
}

.skill-filter-pill:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
  transform: translateY(-1px);
}

.skill-filter-pill.active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #1d4ed8 !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4) !important;
  font-weight: 700 !important;
  transform: translateY(-1px);
}

.skill-filter-pill .pill-count {
  font-size: 11px;
  opacity: 0.85;
  background: rgba(0,0,0,0.06);
  padding: 1px 6px;
  border-radius: 10px;
}

.skill-filter-pill.active .pill-count {
  opacity: 1;
  background: rgba(255,255,255,0.25);
  color: #ffffff;
}

/* 模态弹窗 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 500px;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
}

.btn-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
}

.device-fingerprint-box {
  background: var(--bg-main);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-family: var(--font-mono);
  word-break: break-all;
}

/* ==================== 移动端底栏与跨端抽屉交互基础样式 ==================== */
.btn-sidebar-toggle {
  display: none;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 11px;
  cursor: pointer;
  align-items: center;
  gap: 5px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-right: 10px;
  flex-shrink: 0;
}
.btn-sidebar-toggle:hover {
  background: #dbeafe;
  color: var(--primary-dark);
}
.btn-sidebar-toggle:active {
  transform: scale(0.96);
}

.header-left-zone {
  display: flex;
  align-items: center;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 55;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.sidebar-overlay.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.sidebar-drawer-header {
  display: none;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}
.btn-drawer-close {
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 14px;
  font-weight: bold;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.btn-drawer-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* 模考手机端浮动状态条与底部抽屉 */
.exam-mobile-sticky-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 56px;
  z-index: 35;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.exam-mobile-sheet-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 80;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.exam-mobile-sheet-backdrop.open {
  display: block;
  opacity: 1;
  pointer-events: auto;
}
.exam-mobile-sheet-card {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: 18px 18px 0 0;
  z-index: 85;
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)) 16px;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.2);
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-overflow-scrolling: touch;
}
.exam-mobile-sheet-backdrop.open .exam-mobile-sheet-card {
  transform: translateY(0);
}

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(58px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  z-index: 40;
  justify-content: space-around;
  align-items: center;
  padding-left: 8px;
  padding-right: 8px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.mobile-nav-btn.active {
  color: var(--primary);
  font-weight: 700;
}

.mobile-nav-icon {
  font-size: 18px;
  line-height: 1;
}

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

/* ==================== 响应式设计分层架构 (Tier 1 ~ Tier 4) ==================== */

/* Tier 3: iPad 与平板主流尺寸 (769px ~ 1024px) */
@media (max-width: 1024px) {
  .app-header {
    padding: 0 16px;
  }
  .btn-sidebar-toggle {
    display: inline-flex;
  }
  .sidebar-tree {
    width: 250px;
    transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), padding 0.25s ease, opacity 0.2s ease;
  }
  /* iPad 竖屏一键折叠侧栏，释放 800px+ 完整主阅读区 */
  .sidebar-tree.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    border-right: none !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
  .main-content {
    padding: 20px 18px;
  }

  /* 沙盒在 iPad 竖屏下的自适应多列控件网格 */
  .sandbox-view-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .sandbox-controls-card {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    position: static;
    max-height: none;
  }
  .sandbox-params-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    max-height: none;
    overflow-y: visible;
  }
  .sandbox-info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    overflow-y: visible;
  }

  /* 模考在 iPad 竖屏下的紧凑并列 */
  .exam-main-grid {
    grid-template-columns: 1fr 240px;
    gap: 14px;
  }
  .ans-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .ans-num {
    height: 32px;
    font-size: 12px;
  }
  .paper-card {
    padding: 24px 20px;
  }
}

/* Tier 2 & Tier 1: 手机端与小平板折叠屏 (<= 768px) */
@media (max-width: 768px) {
  .app-header {
    height: 56px;
    padding: 0 12px;
  }
  .app-header .nav-tabs {
    display: none;
  }
  .brand-logo {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
  .brand-title {
    font-size: 15px;
  }
  .brand-badge {
    display: none;
  }
  .admin-btn-label {
    display: none;
  }
  #btn-admin-panorama {
    padding: 5px 9px;
    font-size: 13px;
  }

  .mobile-bottom-nav {
    display: flex;
  }
  .main-content {
    padding: 12px 10px calc(72px + env(safe-area-inset-bottom, 0px)) 10px;
  }

  /* 侧边栏转为全功能侧滑抽屉 (Slide-out Drawer) */
  .sidebar-tree {
    display: none;
  }
  .sidebar-tree.mobile-open {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 85% !important;
    max-width: 330px !important;
    height: 100vh !important;
    max-height: 100vh !important;
    z-index: 60 !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35) !important;
    padding: 16px 14px calc(24px + env(safe-area-inset-bottom, 0px)) 14px !important;
    border-right: 1px solid #cbd5e1 !important;
    border-radius: 0 16px 16px 0 !important;
    animation: slideDrawerIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar-drawer-header {
    display: flex;
  }

  /* 知识九步精讲卡片移动端优化 */
  .lesson-header-card {
    padding: 14px 12px;
    border-radius: 12px;
  }
  .lesson-main-title {
    font-size: 17px;
    line-height: 1.4;
  }
  .lesson-tag-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .lesson-tag-label {
    padding-top: 0;
  }
  .step-card {
    padding: 14px 12px;
    margin-bottom: 12px;
    border-radius: 10px;
  }
  .step-title {
    font-size: 14.5px;
  }
  .branch-chip,
  .thinking-chip,
  .method-chip {
    font-size: 11.5px;
    padding: 4px 10px;
  }

  /* 模考单列流与浮动答题卡 */
  .exam-main-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .exam-mobile-sticky-bar {
    display: flex;
  }
  .exam-sidebar-sticky {
    position: static;
    width: 100%;
    max-width: 100%;
  }
  .ans-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  .ans-num {
    height: 36px;
    font-size: 13px;
  }
  .options-grid {
    grid-template-columns: 1fr;
  }
  .option-item {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 14px;
  }
  .paper-card {
    padding: 16px 12px;
  }
  .question-header {
    font-size: 14.5px;
  }

  /* 技能树自适应三级筛选栏与 2x2 指标看板 */
  .skill-filter-card {
    padding: 12px 10px;
    gap: 8px;
    border-radius: 10px;
  }
  .skill-filter-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 4px 0;
  }
  .skill-filter-label {
    font-size: 12px;
    min-width: auto;
    font-weight: 700;
  }
  .skill-filter-pill {
    font-size: 11.5px;
    padding: 4px 10px;
  }

  /* 沙盒画布与手势解耦 */
  .sandbox-canvas-wrapper {
    touch-action: pan-y;
    overscroll-behavior: contain;
    padding: 4px;
  }
  .sandbox-canvas-wrapper canvas {
    touch-action: pan-y;
  }
  .sandbox-tabs-category-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    margin-bottom: 10px;
  }
  .btn-sandbox-tab {
    padding: 6px 11px;
    font-size: 12px;
    min-height: 34px;
    white-space: nowrap;
  }

  /* 弹窗小屏适配 */
  .branch-modal-card {
    width: 95vw;
    max-height: 88vh;
    border-radius: 12px;
  }
  .branch-modal-header {
    padding: 14px 16px;
  }
  .branch-modal-title {
    font-size: 15px;
  }
  .branch-modal-body {
    padding: 14px 12px;
    font-size: 13.5px;
  }
  .modal-backdrop {
    padding: 10px;
  }

  /* 输入框防 iOS Safari 强制缩放 */
  input[type="text"],
  input[type="number"],
  .fill-blank-input,
  .multi-blank-input,
  .fill-input-box,
  .param-direct-input {
    font-size: 16px !important;
  }

  /* 全景检阅台满屏卡片触控优化 */
  .admin-panorama-card {
    width: 98vw;
    height: 96vh;
    border-radius: 10px;
  }
  .admin-panorama-header {
    padding: 12px 14px;
  }
  .admin-panorama-body {
    padding: 12px 8px;
  }
  .admin-filter-bar {
    gap: 8px;
    padding: 10px 12px;
  }
  .admin-filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .admin-filter-group {
    width: 100%;
  }
  .admin-select-topic,
  .admin-select-diff,
  .admin-search-input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 13px;
    height: 34px;
  }
  .admin-capacity-stat {
    margin-left: 0;
  }
  .admin-q-layout.has-diagram {
    flex-direction: column;
  }
  .admin-q-diagram-pane {
    width: 100%;
    max-width: 260px;
    margin: 8px auto 0 auto;
  }
  .admin-q-options {
    grid-template-columns: 1fr;
  }
}

/* Tier 1: 极小屏手机专项优化 (<= 480px, 如 iPhone SE) */
@media (max-width: 480px) {
  .app-header {
    padding: 0 8px;
  }
  .btn-sidebar-toggle {
    padding: 4px 7px;
    font-size: 11.5px;
    margin-right: 4px;
  }
  .brand-title {
    font-size: 14px;
  }
  .brand-logo {
    width: 26px;
    height: 26px;
    font-size: 14px;
  }
  .main-content {
    padding: 10px 6px calc(68px + env(safe-area-inset-bottom, 0px)) 6px;
  }
  .paper-card {
    padding: 12px 8px;
  }
  .exam-header-bar {
    padding: 10px 12px;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }
  .ans-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}


/* 打印排版 */
@media print {
  @page {
    margin: 15mm;
    size: auto;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
    line-height: 1.5;
  }
  .app-header,
  .sidebar-tree,
  .mobile-bottom-nav,
  .exam-header-bar,
  .exam-presets-bar,
  .exam-sidebar-sticky,
  .exam-instructions-card,
  .math-symbol-toolbar,
  .figure-tools-bar,
  .drill-summary-card,
  .btn-primary,
  .btn-secondary,
  .btn-fig-tool,
  .btn-sandbox-tab,
  .modal-backdrop,
  .app-lock-overlay,
  .branch-modal-overlay,
  .print-no-print {
    display: none !important;
  }
  .app-layout {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .main-content {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .paper-card, .drill-question-item, .question-box {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 18px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  .paper-title-block {
    border-bottom: 2px solid #000 !important;
    margin-bottom: 20px !important;
    text-align: center;
  }
  .math-svg {
    max-height: 130px !important;
  }
  .figure-interactive-wrapper, .figure-stage {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  /* A3 双栏排版 */
  body.print-mode-a3 #paper-questions-list,
  body.print-mode-a3 #topic-questions-container {
    column-count: 2 !important;
    column-gap: 25mm !important;
    column-rule: 1px dashed #94a3b8 !important;
  }

  /* 装订线 - 左侧 */
  body.print-binding-left {
    padding-left: 30mm !important;
    position: relative;
  }
  body.print-binding-left::before {
    content: "密 封 线 内 不 要 答 题   姓名：___________ 考号：___________ 班级：___________";
    position: fixed;
    left: 8mm;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    font-size: 11pt;
    letter-spacing: 5px;
    border-bottom: 1px dashed #64748b;
    padding-bottom: 4px;
    white-space: nowrap;
  }

  /* 装订线 - 顶部 */
  body.print-binding-top {
    padding-top: 25mm !important;
    position: relative;
  }
  body.print-binding-top::before {
    content: "密 封 线 内 不 要 答 题   姓名：___________ 准考证号：___________ 考场：___________ 座位号：___________";
    position: fixed;
    top: 8mm;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11pt;
    letter-spacing: 4px;
    border-bottom: 1px dashed #64748b;
    padding-bottom: 4px;
    white-space: nowrap;
    width: 90%;
    text-align: center;
  }
}

/* ==================== 印刷级数学排版引擎与根号分式样式 ==================== */
.math-inline {
  font-family: 'KaTeX_Main', 'Cambria Math', 'Times New Roman', 'Source Han Serif SC', serif;
  font-size: 1.05em;
  padding: 0 1px;
  color: var(--primary-dark);
  display: inline;
}

.math-block {
  display: block;
  text-align: center;
  margin: 8px 0;
  font-family: 'KaTeX_Main', 'Cambria Math', 'Times New Roman', serif;
  font-size: 1.1em;
}

/* 根号排版体系 */
.math-root {
  display: inline-flex;
  align-items: baseline;
  vertical-align: -0.05em;
  font-style: italic;
  font-family: 'KaTeX_Main', 'Cambria Math', 'Times New Roman', serif;
  margin: 0 2px;
}

.root-deg {
  font-size: 0.65em;
  margin-right: -1px;
  vertical-align: 0.6em;
}

.root-radical {
  font-style: normal;
  font-size: 1.15em;
  font-weight: 400;
  line-height: 1;
  margin-right: 0.5px;
}

.root-content {
  border-top: 1.2px solid currentColor;
  padding: 0 2px;
  line-height: 1.2;
  font-style: italic;
  letter-spacing: 0.5px;
}

/* 分式排版体系 */
.math-fraction {
  display: inline-flex;
  flex-direction: column;
  vertical-align: -0.35em;
  text-align: center;
  font-size: 0.9em;
  margin: 0 3px;
  line-height: 1;
  font-family: 'KaTeX_Main', 'Cambria Math', 'Times New Roman', serif;
}

.frac-top {
  border-bottom: 1.1px solid currentColor;
  padding: 0 2px 1px 2px;
  line-height: 1.1;
}

.frac-bottom {
  padding: 1px 2px 0 2px;
  line-height: 1.1;
}

/* 方程组大括号 */
.math-cases {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin: 0 4px;
}

.cases-bracket {
  font-size: 1.8em;
  font-weight: 200;
  line-height: 1;
  margin-right: 3px;
  font-family: 'KaTeX_Main', 'Cambria Math', serif;
}

.cases-body {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.cases-row {
  line-height: 1.2;
}

/* 78 考点全景技能图谱卡片动效 */
.skill-topic-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md) !important;
  border-color: var(--primary) !important;
}

/* 启发式脚手架提示折叠组件 */
.hint-details {
  transition: all 0.2s ease;
}

.hint-details[open] {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

.hint-details summary::-webkit-details-marker {
  display: inline-block;
  margin-right: 6px;
}

/* 变式题卡片 */
.variant-card {
  transition: border-color 0.2s;
}

.variant-card:hover {
  border-color: #cbd5e1;
}

/* ==================== 1. 双向联动参数控制组件 ==================== */
.dual-binding-group {
  margin-bottom: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
}

.num-stepper-wrap {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 2px 4px;
}

.btn-step {
  width: 22px;
  height: 22px;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  border-radius: 4px;
  font-weight: bold;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #334155;
  transition: all 0.15s;
  user-select: none;
}

.btn-step:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-step:active {
  background: #cbd5e1;
}

.param-num-input {
  width: 54px;
  height: 22px;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  outline: none;
}

.param-unit {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  margin-left: 2px;
}

/* ==================== 2. 四级递进式思维脚手架 ==================== */
.scaffold-stepper-container {
  margin-top: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px 14px;
}

.scaffold-step-item {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-bottom: 8px;
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.2s;
}

.scaffold-step-item.unlocked {
  border-color: #93c5fd;
}

.scaffold-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  cursor: pointer;
  background: #f8fafc;
  user-select: none;
}

.scaffold-step-item.unlocked .scaffold-step-header {
  background: #eff6ff;
}

.scaffold-step-num {
  font-size: 11px;
  font-weight: 800;
  background: #2563eb;
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
}

.scaffold-step-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #1e293b;
  flex: 1;
}

.scaffold-step-action {
  font-size: 11px;
  color: #2563eb;
  font-weight: 600;
}

.scaffold-step-body {
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.65;
  color: #334155;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

/* ==================== 3. 母题思维认知舱 ==================== */
.sandbox-mindset-card {
  margin-top: 8px;
  background: var(--bg-main, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  padding: 9px 11px;
  overflow-wrap: break-word;
  word-break: break-word;
  text-align: left;
  font-family: var(--font-sans);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.mindset-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.mindset-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark, #1e3a8a);
  line-height: 1.35;
  margin: 0;
  flex: 1;
  text-align: left;
  font-family: var(--font-sans);
}

.mindset-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.mindset-dimension {
  margin-bottom: 5px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 8px;
  text-align: left;
}

.mindset-dimension:last-child {
  margin-bottom: 0;
}

.mindset-dimension-title,
.dimension-title {
  font-size: 12px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.35;
  text-align: left;
  font-family: var(--font-sans);
}

.mindset-dimension-content,
.dimension-desc {
  font-size: 12px;
  line-height: 1.35;
  color: #334155;
  text-align: left;
  font-family: var(--font-sans);
}

.mindset-mnemonic-badge {
  display: block;
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  margin-top: 3px;
  overflow-wrap: break-word;
  text-align: left;
  font-family: var(--font-sans);
}

/* ==================== 4. 打印配置模态框 ==================== */
.print-modal-card {
  background: #ffffff;
  border-radius: 12px;
  max-width: 580px;
  width: 90%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

/* ==================== 5. 管理端题库全景检阅台 ==================== */
.admin-panorama-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-panorama-card {
  background: #f8fafc;
  border-radius: 12px;
  width: 94vw;
  max-width: 1360px;
  height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.admin-panorama-header {
  padding: 12px 20px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.admin-panorama-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px;
  background: #f8fafc;
}

/* 顶部筛选栏卡片 */
.admin-filter-bar {
  background: #ffffff;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.admin-filter-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-filter-label {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}

.admin-select-topic {
  font-size: 12px;
  padding: 5px 8px;
  max-width: 250px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background-color: #fff;
  color: #1e293b;
}

.admin-select-diff {
  font-size: 12px;
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background-color: #fff;
  color: #1e293b;
}

.admin-filter-search {
  flex: 1;
  min-width: 200px;
}

.admin-search-input {
  width: 100%;
  font-size: 12px;
  padding: 6px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #1e293b;
  outline: none;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.admin-search-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.admin-capacity-stat {
  font-size: 12px;
  color: #64748b;
  margin-left: auto;
  white-space: nowrap;
}

/* 10 大前沿时代领域独立筛选胶囊栏 */
.admin-domain-pills-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.admin-domain-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
}

.admin-domain-pills {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.admin-domain-pill {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.4;
}

.admin-domain-pill:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
}

.admin-domain-pill.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.28);
}

/* 试题主列表与试题卡片 */
.admin-q-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-q-empty {
  text-align: center;
  padding: 40px 20px;
  background: #ffffff;
  border-radius: 10px;
  border: 1px dashed #cbd5e1;
}

.admin-q-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.admin-q-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

.admin-q-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
}

.admin-q-meta-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-q-idx-badge {
  font-size: 11.5px;
  font-weight: 800;
  background: #f1f5f9;
  color: #334155;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: monospace;
}

.admin-q-type-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  padding: 2px 7px;
  border-radius: 4px;
}

.admin-q-source-badge,
.exam-source-badge {
  font-size: 11px;
  font-weight: 700;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.admin-q-model-badge {
  font-size: 11px;
  font-weight: 600;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  padding: 2px 7px;
  border-radius: 4px;
}

.admin-q-topic-tag {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

.admin-q-svg-tag {
  font-size: 11px;
  font-weight: 700;
  color: #0284c7;
  background: #e0f2fe;
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

/* 核心图文对齐排版 (左侧题干选项自适应，右侧几何图固定宽度，严格顶齐) */
.admin-q-layout {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  width: 100%;
}

.admin-q-layout.no-diagram {
  display: block;
}

.admin-q-layout.has-diagram .admin-q-text-pane {
  flex: 1 1 auto;
  min-width: 0;
}

.admin-q-layout.no-diagram .admin-q-text-pane {
  width: 100%;
}

.admin-q-stem {
  font-size: 14px;
  line-height: 1.6;
  color: #1e293b;
  margin: 0 0 6px 0;
  word-break: break-word;
}

/* 选项区域: 标准双列紧凑排布，不超过 760px，不横跨大屏 */
.admin-q-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 360px));
  gap: 4px 20px;
  max-width: 760px;
  margin: 6px 0 4px 0;
  font-size: 13.5px;
  color: #334155;
}

.admin-q-opt-item {
  padding: 2px 0;
  line-height: 1.45;
  word-break: break-word;
}

/* 右侧几何矢量图容器 (严格首行顶齐，高精度无拉伸) */
.admin-q-diagram-pane {
  flex: 0 0 260px;
  width: 260px;
  align-self: flex-start;
}

.admin-q-diagram-wrapper {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.admin-q-diagram-wrapper svg {
  max-width: 100%;
  height: auto;
  max-height: 200px;
  display: block;
}

.admin-q-diagram-wrapper .math-diagram-box {
  margin: 0 !important;
  padding: 0 !important;
  width: 100%;
  display: flex;
  justify-content: center;
}


/* 底部答案与深度解析卡片 */
.admin-q-solution-box {
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: 8px;
  border-left: 3px solid #3b82f6;
  border-top: 1px solid #f1f5f9;
}

.admin-q-ans-line {
  font-size: 13px;
  margin-bottom: 4px;
  line-height: 1.5;
}

.admin-q-ans-label {
  font-weight: 700;
  color: #1d4ed8;
}

.admin-q-ans-text {
  font-weight: 700;
  color: #0f172a;
}

.admin-q-analysis-line {
  font-size: 13px;
  color: #334155;
  line-height: 1.55;
}

.admin-q-analysis-label {
  font-weight: 700;
  color: #475569;
}

.admin-q-analysis-text {
  color: #334155;
}

/* 分页控制栏 */
.admin-q-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.admin-pagination-info {
  font-size: 12px;
  color: #64748b;
}

.admin-pagination-btns {
  display: flex;
  gap: 8px;
}

.admin-pagination-btns button {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
}




