/* Community Management Interactive Teaching Software v7 - Modern Style System */

:root {
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "Fira Code", "Cascadia Code", Consolas, Monaco, "Courier New", monospace;

  /* Color Palette - Light Mode */
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #e2e8f0;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  
  --accent-teacher: #059669;
  --accent-teacher-light: #ecfdf5;
  --accent-teacher-border: #a7f3d0;
  
  --accent-amber: #d97706;
  --accent-amber-light: #fffbeb;
  
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  
  --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);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  
  --header-height: 64px;
  --sidebar-width: 290px;
  --toc-width: 240px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-primary: #0b0f17;
  --bg-surface: #131b2e;
  --bg-elevated: #1e293b;
  --bg-subtle: #1e293b;
  --bg-hover: #334155;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;
  
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: rgba(59, 130, 246, 0.15);
  --primary-border: rgba(59, 130, 246, 0.3);
  
  --accent-teacher: #10b981;
  --accent-teacher-light: rgba(16, 185, 129, 0.15);
  --accent-teacher-border: rgba(16, 185, 129, 0.3);
  
  --border-subtle: #243048;
  --border-strong: #334155;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  text-decoration: underline;
}

/* App Header */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

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

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

.brand-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.brand-badge {
  font-size: 11px;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--primary-border);
}

/* Header Switcher */
.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

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

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

.nav-tab-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.nav-tab-btn.teacher-tab.active {
  color: var(--accent-teacher);
}

.nav-tab-btn.tech-tab.active {
  color: var(--primary);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-box-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.search-box-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.shortcut-badge {
  background: var(--bg-surface);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.action-btn.sidebar-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
}

.action-btn.glossary-btn {
  background: var(--accent-teacher-light);
  color: var(--accent-teacher);
  border-color: var(--accent-teacher-border);
}

.action-btn.glossary-btn:hover {
  background: var(--accent-teacher);
  color: white;
}

/* Main Layout */
.app-container {
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  display: flex;
  position: relative;
}

/* View Containers */
.view-container {
  display: none;
  width: 100%;
}

.view-container.active {
  display: block;
}

/* ========================================================
   🍎 TEACHER GUIDE VIEW STYLES
   ======================================================== */
.teacher-guide-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.teacher-hero {
  background: linear-gradient(135deg, #065f46 0%, #047857 50%, #0d9488 100%);
  color: white;
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  margin-bottom: 32px;
  box-shadow: 0 12px 30px rgba(5, 150, 105, 0.25);
  position: relative;
  overflow: hidden;
}

.teacher-hero::after {
  content: "🍎";
  position: absolute;
  right: 20px;
  bottom: -20px;
  font-size: 130px;
  opacity: 0.15;
  pointer-events: none;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
  backdrop-filter: blur(8px);
}

.hero-title {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.hero-lead {
  font-size: 16px;
  line-height: 1.7;
  max-width: 900px;
  color: #e6fffa;
  margin-bottom: 24px;
}

.hero-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.hero-card {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: 18px;
  backdrop-filter: blur(8px);
  transition: var(--transition);
}

.hero-card:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.hero-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.hero-card-desc {
  font-size: 13.5px;
  color: #ccfbf1;
  line-height: 1.55;
}

/* Section Common */
.guide-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-icon-badge {
  width: 42px;
  height: 42px;
  background: var(--accent-teacher-light);
  color: var(--accent-teacher);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.section-h2 {
  font-size: 21px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-sub {
  font-size: 13.5px;
  color: var(--text-muted);
}

/* Visual Diagram Card */
.visual-diagram-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 20px 0;
}

.visual-diagram-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Boundaries Matrix */
.boundary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.boundary-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 18px;
  background: var(--bg-subtle);
  transition: var(--transition);
}

.boundary-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.boundary-topic {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.boundary-can, .boundary-cannot {
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.boundary-can {
  background: var(--accent-teacher-light);
  color: #065f46;
  border-left: 4px solid var(--accent-teacher);
}

[data-theme="dark"] .boundary-can {
  color: #a7f3d0;
}

.boundary-cannot {
  background: #fef2f2;
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

[data-theme="dark"] .boundary-cannot {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

/* Modules Accordion / Tabs */
.modules-tabs-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-subtle);
  padding-bottom: 4px;
  overflow-x: auto;
}

.module-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.module-nav-btn:hover {
  color: var(--accent-teacher);
}

.module-nav-btn.active {
  color: var(--accent-teacher);
  border-bottom-color: var(--accent-teacher);
  background: var(--accent-teacher-light);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.module-detail-box {
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 24px;
}

.module-headline-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 18px;
}

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

.module-badge-tag {
  background: var(--accent-teacher-light);
  color: var(--accent-teacher);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--accent-teacher-border);
}

.module-hours-tag {
  font-size: 13px;
  color: var(--text-muted);
}

.module-metaphor-banner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

[data-theme="dark"] .module-metaphor-banner {
  background: rgba(217, 119, 6, 0.2);
  color: #fde68a;
  border: 1px solid rgba(217, 119, 6, 0.4);
}

.step-roadmap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.step-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  position: relative;
  transition: var(--transition);
}

.step-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent-teacher);
  box-shadow: var(--shadow-sm);
}

.step-num {
  width: 24px;
  height: 24px;
  background: var(--accent-teacher);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.step-title {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.step-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.teacher-tip-callout {
  background: var(--accent-amber-light);
  border-left: 4px solid var(--accent-amber);
  color: #78350f;
  padding: 12px 16px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 13px;
  margin: 16px 0;
  line-height: 1.6;
}

[data-theme="dark"] .teacher-tip-callout {
  background: rgba(217, 119, 6, 0.15);
  color: #fcd34d;
}

.deliverables-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
}

/* Scoring Matrix Table */
.scoring-formula-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.formula-text {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.formula-sub {
  font-size: 12.5px;
  color: #bfdbfe;
  margin-top: 4px;
}

.practice-card-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.practice-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-surface);
}

.practice-card-header {
  padding: 14px 18px;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.practice-title-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.practice-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.practice-score-badge {
  background: #2563eb;
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

.rubric-subtable {
  width: 100%;
  border-collapse: collapse;
}

.rubric-subtable th {
  background: var(--bg-subtle);
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.rubric-subtable td {
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.rubric-subtable tr:last-child td {
  border-bottom: none;
}

/* Review Timeline */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.timeline-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  align-items: flex-start;
}

.timeline-badge {
  background: var(--accent-teacher);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  white-space: nowrap;
}

.timeline-body h4 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.timeline-body p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Interactive Lesson Planner */
.interactive-tool-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 14px;
}

.planner-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.planner-btn {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.planner-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.planner-btn.active {
  background: var(--accent-teacher);
  color: white;
  border-color: var(--accent-teacher);
}

.plan-result-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.plan-result-table th, .plan-result-table td {
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
}

.plan-result-table th {
  background: var(--bg-subtle);
  font-weight: 600;
  text-align: left;
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
}

.faq-question {
  padding: 14px 18px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.faq-question:hover {
  background: var(--bg-subtle);
}

.faq-arrow {
  transition: transform 0.2s ease;
  font-size: 11px;
  color: var(--text-muted);
}

.faq-item.open .faq-arrow {
  transform: rotate(180deg);
}

.faq-answer {
  display: none;
  padding: 14px 18px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-subtle);
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.faq-item.open .faq-answer {
  display: block;
}

/* Personas Browser */
.persona-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.persona-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: var(--transition);
}

.persona-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-teacher);
}

.persona-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.persona-avatar {
  font-size: 28px;
}

.persona-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.persona-type-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.persona-body {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.persona-standpoint {
  margin-top: 8px;
  padding: 6px 10px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  font-style: italic;
  color: var(--text-primary);
  font-size: 12px;
}

/* ========================================================
   💻 TECHNICAL FULL DOCS VIEW & COLLAPSIBLE SIDEBARS
   ======================================================== */
.tech-view-wrapper {
  display: flex;
  width: 100%;
  min-height: calc(100vh - var(--header-height));
  position: relative;
  transition: var(--transition);
}

/* Sidebar */
.tech-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  padding: 16px 12px;
  transition: var(--transition);
  z-index: 100;
}

.tech-sidebar.collapsed {
  width: 0;
  min-width: 0;
  padding: 0;
  border-right: none;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.sidebar-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-header-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.sidebar-collapse-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.sidebar-collapse-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-search-box {
  margin-bottom: 14px;
}

.sidebar-search-input {
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 12.5px;
  outline: none;
  transition: var(--transition);
}

.sidebar-search-input:focus {
  border-color: var(--primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.sidebar-category-group {
  margin-bottom: 18px;
}

.sidebar-cat-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  padding: 4px 8px;
  margin-bottom: 2px;
}

.sidebar-doc-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 8px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  margin-bottom: 2px;
}

.sidebar-doc-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}

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

.sidebar-doc-badge {
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.sidebar-doc-link.active .sidebar-doc-badge {
  background: var(--bg-surface);
  color: var(--primary);
}

/* Center Content & TOC */
.tech-content-area {
  flex: 1;
  padding: 32px 40px 80px;
  max-width: 1000px;
  min-width: 0;
  margin: 0 auto;
  transition: var(--transition);
}

/* When sidebars are collapsed, expand content gracefully */
.tech-view-wrapper.left-collapsed .tech-content-area,
.tech-view-wrapper.right-collapsed .tech-content-area {
  max-width: 1150px;
}

/* Floating Sidebar Expanders */
.floating-sidebar-btn {
  position: fixed;
  left: 12px;
  bottom: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--primary);
  padding: 8px 12px;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  z-index: 990;
  display: none;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.floating-sidebar-btn:hover {
  background: var(--primary-light);
  transform: scale(1.05);
}

.tech-sidebar.collapsed ~ .floating-sidebar-btn,
.tech-view-wrapper.left-collapsed .floating-sidebar-btn {
  display: flex;
}

.floating-toc-btn {
  position: fixed;
  right: 12px;
  bottom: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  z-index: 990;
  display: none;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.floating-toc-btn:hover {
  background: var(--bg-hover);
  transform: scale(1.05);
}

.tech-toc-sidebar.collapsed ~ .floating-toc-btn,
.tech-view-wrapper.right-collapsed .floating-toc-btn {
  display: flex;
}

/* Right TOC Sidebar */
.tech-toc-sidebar {
  width: var(--toc-width);
  min-width: var(--toc-width);
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  padding: 20px 14px;
  border-left: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.tech-toc-sidebar.collapsed {
  width: 0;
  min-width: 0;
  padding: 0;
  border-left: none;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.toc-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.toc-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toc-item a {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  padding: 3px 0;
  line-height: 1.4;
  text-decoration: none;
  transition: var(--transition);
}

.toc-item a:hover {
  color: var(--primary);
}

.toc-item.level-3 a {
  padding-left: 10px;
}

.toc-item.level-4 a {
  padding-left: 20px;
}

/* Markdown Rendered Styles */
.doc-article {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-sm);
}

.doc-meta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 24px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.doc-heading {
  color: var(--text-primary);
  font-weight: 700;
  margin-top: 30px;
  margin-bottom: 14px;
  line-height: 1.35;
  position: relative;
}

.heading-anchor {
  position: absolute;
  left: -20px;
  color: var(--text-muted);
  opacity: 0;
  text-decoration: none;
  transition: var(--transition);
}

.doc-heading:hover .heading-anchor {
  opacity: 1;
}

.doc-h1 { font-size: 26px; border-bottom: 1px solid var(--border-subtle); padding-bottom: 10px; margin-top: 0; }
.doc-h2 { font-size: 20px; border-bottom: 1px solid var(--border-subtle); padding-bottom: 6px; margin-top: 32px; }
.doc-h3 { font-size: 17px; margin-top: 24px; }
.doc-h4 { font-size: 14.5px; margin-top: 18px; }

.doc-p {
  margin-bottom: 14px;
  line-height: 1.75;
  color: var(--text-primary);
}

.doc-quote {
  border-left: 4px solid var(--primary);
  background: var(--primary-light);
  padding: 10px 16px;
  margin: 14px 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-primary);
  font-size: 14px;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13.5px;
}

.table-container {
  overflow-x: auto;
  margin: 16px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.doc-table th {
  background: var(--bg-subtle);
  padding: 10px 12px;
  font-weight: 600;
  border-bottom: 2px solid var(--border-subtle);
  color: var(--text-primary);
}

.doc-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.doc-table tr:nth-child(even) {
  background: var(--bg-primary);
}

.doc-table tr:hover {
  background: var(--bg-hover);
}

.inline-code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--bg-subtle);
  color: #e11d48;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

.doc-image-figure {
  width: fit-content;
  max-width: 100%;
  margin: 20px auto;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.doc-image {
  display: block;
  max-width: min(100%, 1100px);
  height: auto;
  border-radius: calc(var(--radius-lg) - 4px);
}

.doc-image-figure figcaption {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

[data-theme="dark"] .inline-code {
  color: #fb7185;
}

.code-block-wrapper {
  margin: 18px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #0f172a;
}

.code-header {
  background: #1e293b;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #334155;
}

.code-lang {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: var(--transition);
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.code-block-wrapper pre {
  padding: 14px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: #f8fafc;
}

/* Alert Boxes */
.alert-box {
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  margin: 18px 0;
  border: 1px solid transparent;
}

.alert-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.alert-content {
  font-size: 13.5px;
  line-height: 1.6;
}

.alert-note { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert-tip { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-important { background: #f5f3ff; border-color: #ddd6fe; color: #5b21b6; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-caution { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

[data-theme="dark"] .alert-note { background: rgba(37, 99, 235, 0.15); border-color: rgba(37, 99, 235, 0.3); color: #93c5fd; }
[data-theme="dark"] .alert-tip { background: rgba(5, 150, 105, 0.15); border-color: rgba(5, 150, 105, 0.3); color: #6ee7b7; }
[data-theme="dark"] .alert-important { background: rgba(139, 92, 246, 0.15); border-color: rgba(139, 92, 246, 0.3); color: #c4b5fd; }
[data-theme="dark"] .alert-warning { background: rgba(217, 119, 6, 0.15); border-color: rgba(217, 119, 6, 0.3); color: #fde68a; }
[data-theme="dark"] .alert-caution { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.3); color: #fca5a5; }

/* Mermaid Diagrams Rendering */
.mermaid-diagram-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
}

.mermaid-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  background: var(--primary-light);
  padding: 3px 10px;
  border-radius: 12px;
}

.mermaid-canvas {
  overflow-x: auto;
  padding: 12px 6px;
  display: flex;
  justify-content: center;
}

.mermaid {
  max-width: 100%;
  font-family: var(--font-main) !important;
}

.mermaid svg {
  max-width: 100%;
  height: auto;
}

/* Diagrams stay compact in the reading flow, but every rendered SVG is an
   accessible entry point to the full-size pan/zoom viewer. */
.mermaid.diagram-interactive {
  position: relative;
  cursor: zoom-in;
  border-radius: var(--radius-md);
  outline: none;
}

.mermaid.diagram-interactive::after {
  content: '⤢ 点击查看大图';
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0;
  pointer-events: none;
  color: var(--primary);
  background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
  border: 1px solid var(--primary-border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
  transition: opacity .16s ease, transform .16s ease;
  transform: translateY(-2px);
}

.mermaid.diagram-interactive:hover::after,
.mermaid.diagram-interactive:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.mermaid.diagram-interactive:focus-visible {
  box-shadow: 0 0 0 3px var(--primary-border);
}

img.image-interactive {
  cursor: zoom-in;
  outline: none;
  transition: box-shadow .16s ease, transform .16s ease;
}

img.image-interactive:hover {
  box-shadow: 0 0 0 3px var(--primary-border), var(--shadow-md);
}

img.image-interactive:focus-visible {
  box-shadow: 0 0 0 4px var(--primary-border);
}

body.diagram-modal-open {
  overflow: hidden;
}

.diagram-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 2vw, 24px);
  background: rgba(5, 15, 33, .82);
  backdrop-filter: blur(7px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.diagram-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.diagram-modal-dialog {
  width: min(1440px, 100%);
  height: min(900px, 96vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, white 18%, transparent);
  border-radius: clamp(14px, 2vw, 24px);
  background: var(--bg-surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .42);
  transform: scale(.98);
  transition: transform .18s ease;
}

.diagram-modal-overlay.active .diagram-modal-dialog {
  transform: scale(1);
}

.diagram-modal-header {
  min-height: 64px;
  padding: 12px 16px 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.diagram-modal-title-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

.diagram-modal-title-wrap > span { font-size: 21px; }

.diagram-modal-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 800;
}

.diagram-modal-tip {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
}

.diagram-modal-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
}

.diagram-control-btn,
.diagram-download-btn {
  min-height: 32px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-subtle);
  color: var(--text-primary);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  transition: var(--transition);
}

.diagram-control-btn { min-width: 34px; padding: 0 8px; }
.diagram-zoom-label { min-width: 56px; font-size: 12px; }
.diagram-download-btn { padding: 0 10px; color: var(--primary); }

.diagram-control-btn:hover,
.diagram-download-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.diagram-modal-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  touch-action: none;
  cursor: grab;
  background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--text-muted) 22%, transparent) 1px, transparent 0) 0 0 / 20px 20px,
    var(--bg-subtle);
}

.diagram-modal-stage:active { cursor: grabbing; }

.diagram-modal-transform {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center center;
  will-change: transform;
}

.diagram-modal-svg {
  display: block;
  max-width: none !important;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 8px 14px rgba(15, 23, 42, .10));
}

.diagram-modal-image {
  display: block;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 10px 20px rgba(15, 23, 42, .18));
}

/* Mermaid's HTML labels live inside SVG foreignObject elements. Keep the
   readable line-height from the document rather than compressing it in the
   transform layer. */
.diagram-modal-svg foreignObject,
.diagram-modal-svg foreignObject div,
.diagram-modal-svg foreignObject span,
.diagram-modal-svg foreignObject p {
  line-height: 1.25 !important;
}

.diagram-modal-footer {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 20px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  font-size: 11px;
}

.diagram-modal-footer kbd {
  display: inline-flex;
  min-width: 17px;
  margin: 0 2px;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* ========================================================
   📖 GLOSSARY & TOOLTIP SYSTEM
   ======================================================= */
.glossary-term-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--accent-teacher-light);
  color: var(--accent-teacher);
  border-bottom: 1.5px dashed var(--accent-teacher);
  padding: 0 4px;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
}

.glossary-term-badge:hover {
  background: var(--accent-teacher);
  color: white;
  border-bottom-style: solid;
}

.term-tip-icon {
  font-size: 11px;
  opacity: 0.7;
}

/* Glossary Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 780px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-dialog {
  transform: scale(1);
}

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

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

.modal-title {
  font-size: 17px;
  font-weight: 700;
}

.modal-close-btn {
  background: var(--bg-subtle);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

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

.glossary-filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.glossary-cat-btn {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.glossary-cat-btn:hover {
  background: var(--bg-hover);
}

.glossary-cat-btn.active {
  background: var(--accent-teacher);
  color: white;
  border-color: var(--accent-teacher);
}

.glossary-search-input {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 13.5px;
  margin-bottom: 14px;
  outline: none;
}

.glossary-search-input:focus {
  border-color: var(--accent-teacher);
  background: var(--bg-surface);
}

.glossary-cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.glossary-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: var(--transition);
}

.glossary-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.glossary-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.glossary-term-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.glossary-badge-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.glossary-metaphor-box {
  background: var(--accent-teacher-light);
  border: 1px solid var(--accent-teacher-border);
  color: #065f46;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

[data-theme="dark"] .glossary-metaphor-box {
  color: #a7f3d0;
}

.glossary-plain-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 6px;
}

.glossary-usage-text {
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px dashed var(--border-subtle);
  padding-top: 6px;
}

/* Global Search Modal */
.search-modal-dialog {
  max-width: 640px;
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.search-result-item {
  padding: 10px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.search-result-item:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
}

.search-result-title {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.search-result-snippet {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 28px 20px;
  font-size: 12.5px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

/* Responsive */
@media (max-width: 1024px) {
  .tech-toc-sidebar {
    display: none;
  }
  .tech-content-area {
    padding: 24px 20px 60px;
  }
}

@media (max-width: 768px) {
  .tech-sidebar {
    position: fixed;
    left: -100%;
    top: var(--header-height);
    bottom: 0;
    z-index: 900;
    transition: left 0.3s ease;
    box-shadow: var(--shadow-xl);
  }
  .tech-sidebar.mobile-open {
    left: 0;
  }
  .header-brand .brand-title {
    font-size: 14px;
  }
  .teacher-hero {
    padding: 28px 18px;
  }
  .hero-title {
    font-size: 22px;
  }
  .guide-section {
    padding: 18px 14px;
  }
  .header-actions .search-box-btn span {
    display: none;
  }

  .diagram-modal-overlay { padding: 0; }
  .diagram-modal-dialog { width: 100%; height: 100%; max-height: none; border-radius: 0; }
  .diagram-modal-header { min-height: 58px; padding: 9px 10px 9px 14px; }
  .diagram-modal-tip, .diagram-modal-footer { display: none; }
  .diagram-modal-actions { gap: 4px; }
  .diagram-download-btn { width: 34px; overflow: hidden; padding: 0; font-size: 0; }
  .diagram-download-btn::before { content: '⇩'; font-size: 17px; }
  .diagram-control-btn { min-width: 31px; }
}

/* Print Styles */
@media print {
  .app-header, .tech-sidebar, .tech-toc-sidebar, .header-actions, .modal-overlay, .diagram-modal-overlay, .floating-sidebar-btn, .floating-toc-btn {
    display: none !important;
  }
  .app-container {
    margin-top: 0 !important;
  }
  .teacher-guide-wrapper, .tech-content-area {
    max-width: 100% !important;
    padding: 0 !important;
  }
  .doc-article, .guide-section {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
}
