/* ===================== 基础重置 ===================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #0f4c3a;
  --primary-dark: #0a3a2d;
  --primary-light: #d1fae5;
  --primary-tint: #ecfdf5;
  --accent: #b45309;
  --accent-light: #fef3c7;
  --bg: #f4f6f5;
  --bg-soft: #f8faf9;
  --card: #ffffff;
  --text: #1a2e2a;
  --text-mid: #4b5d57;
  --text-light: #8a9b94;
  --border: #dfe7e3;
  --border-light: #ecf1ee;
  --shadow: 0 1px 2px rgba(15,76,58,.04), 0 2px 12px rgba(15,76,58,.05);
  --shadow-md: 0 4px 24px rgba(15,76,58,.08);
  --shadow-lg: 0 12px 40px rgba(15,76,58,.12);
  --radius: 10px;
  --radius-sm: 6px;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===================== 顶部栏 ===================== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 60px;
  background: var(--primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 2px 12px rgba(15,76,58,.15);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 38px; height: 38px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; letter-spacing: 1px;
}
.brand-text h1 { font-size: 17px; font-weight: 600; letter-spacing: .3px; }
.brand-text p { font-size: 11.5px; opacity: .7; letter-spacing: .2px; margin-top: 1px; }
.topbar-actions { display: flex; gap: 8px; }
.topbar-actions .btn { color: #fff; border-color: rgba(255,255,255,.2); font-size: 13px; }
.topbar-actions .btn:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.4); }

/* ===================== 按钮 ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
  background: var(--card);
  color: var(--text);
  white-space: nowrap;
  letter-spacing: .2px;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); box-shadow: 0 2px 8px rgba(15,76,58,.25); }
.btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-accent:hover { background: #92400e; border-color: #92400e; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn-block { width: 100%; justify-content: center; padding: 11px; font-size: 14px; margin-top: 4px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 生成模式切换 */
.mode-switch { border-radius: 8px; overflow: hidden; border: 1px solid var(--border); display: flex; }
.mode-btn {
  flex: 1; padding: 9px 8px; border: none; cursor: pointer; font-size: 13px;
  background: transparent; color: var(--text-mid); transition: all .15s;
}
.mode-btn:hover { background: var(--primary-tint); }
.mode-btn-active { background: var(--primary); color: #fff; }
.mode-btn-active:hover { background: var(--primary-dark); }

/* AI 状态点 */
.ai-status-dot { font-size: 14px; margin-left: 4px; cursor: pointer; }
.ai-status-dot.ai-ready { color: #10b981; }

/* 预设服务按钮 */
.btn-preset { transition: all .15s; }
.btn-preset:hover { border-color: var(--primary) !important; }
.btn-preset-active:hover { opacity: .9; }

/* Loading spinner */
.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== 页面容器与过渡 ===================== */
.page {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.page.page-active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}
.page.page-leaving {
  opacity: 0;
  transform: translateY(-8px);
}

/* ===================== 页面1：参数设置 ===================== */
.layout-setup {
  flex: 1;
  padding: 28px 20px 56px;
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
}

.setup-container {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  padding: 36px 40px;
}

.setup-header {
  margin-bottom: 28px;
  text-align: center;
}
.setup-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 14px;
}

.setup-section {
  margin-bottom: 28px;
}
.setup-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 8px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.5px;
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: border-color .2s;
}
.setup-section-title:hover { border-bottom-color: var(--primary); }
.setup-section-title::before {
  content: '';
  width: 4px;
  height: 18px;
  background: var(--primary);
  border-radius: 2px;
  flex-shrink: 0;
}
.setup-section-title::after {
  content: '▾';
  margin-left: auto;
  font-size: 14px;
  color: var(--text-light);
  transition: transform .25s ease;
}
.setup-section.collapsed .setup-section-title { margin-bottom: 0; border-bottom-color: transparent; }
.setup-section.collapsed .setup-section-title::after { transform: rotate(-90deg); }
.setup-section.collapsed > *:not(.setup-section-title) { display: none; }

.setup-actions {
  display: flex;
  gap: 10px;
  padding-top: 8px;
}
.setup-actions .btn {
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
}
.setup-actions .btn-accent {
  flex: 0 0 auto;
}

/* ===================== 页面2：教案展示 ===================== */
.layout-result {
  flex: 1;
  padding: 24px 32px 80px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.result-container {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  padding: 36px 44px;
  min-height: 600px;
}

.result-loading {
  text-align: center;
  padding: 80px 20px;
}

/* ===================== 顶部栏适配 ===================== */
.topbar-setup,
.topbar-result {
  /* 继承 .topbar 基础样式 */
}

.topbar-result .btn-back {
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.08);
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  transition: all .15s;
}
.topbar-result .btn-back:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.5);
}

/* ===================== 底部浮动操作栏 ===================== */
.floating-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  padding: 10px 16px;
  z-index: 90;
  justify-content: center;
  gap: 12px;
}
.floating-bar .btn {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
}

/* AI 教案区域 */
.ai-content h2 { font-size: 17px; color: var(--primary); margin: 24px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border-light); }
.ai-badge {
  display: inline-block; background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; vertical-align: middle; margin-left: 8px;
}

/* 练习示意图 */
.drill-diagrams-section { margin-top: 10px; }
.drill-diagram-item svg { max-width: 100%; height: auto; }
.drill-diagram-item { position: relative; }
.drill-diagram-item .diagram-toolbar {
  position: absolute; top: 4px; right: 4px; display: flex; gap: 4px; opacity: 0; transition: opacity .2s;
}
.drill-diagram-item:hover .diagram-toolbar { opacity: 1; }
.diagram-toolbar button {
  background: rgba(0,0,0,.6); color: #fff; border: none; border-radius: 4px;
  padding: 2px 8px; font-size: 11px; cursor: pointer;
}
.diagram-toolbar button:hover { background: rgba(0,0,0,.85); }

/* ========== 练习图编辑器 ========== */
.drill-editor-modal { z-index: 10000; }
.drill-editor-box {
  width: 95vw; max-width: 1400px; height: 90vh; display: flex; flex-direction: column;
}
.drill-editor-box .modal-head {
  display: flex; align-items: center; justify-content: space-between;
}
.drill-editor-actions { display: flex; gap: 8px; }
.drill-editor-body {
  flex: 1; display: flex; gap: 12px; padding: 12px !important; overflow: hidden;
  min-height: 0;
}
.drill-toolbar {
  width: 90px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px;
  padding: 8px; background: var(--bg, #f8f9fa); border-radius: 8px;
  border: 1px solid var(--border-light, #e5e7eb); overflow-y: auto;
}
.drill-tool-group {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.drill-tool-label {
  width: 100%; font-size: 10px; color: var(--text-light); font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
}
.drill-tool {
  width: 36px; height: 36px; border: 1px solid var(--border, #d0d5dd);
  border-radius: 6px; background: #fff; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center; padding: 0;
  transition: all .15s;
}
.drill-tool:hover { background: var(--primary-light, #eef2ff); border-color: var(--primary); }
.drill-tool.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.drill-canvas-wrap {
  flex: 1; min-width: 0; background: #fff; border: 1px solid var(--border-light);
  border-radius: 8px; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
#drillCanvas { display: block; }
.drill-loading {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; background: rgba(255,255,255,.9); z-index: 2;
}
.drill-props {
  width: 180px; flex-shrink: 0; padding: 12px; background: var(--bg, #f8f9fa);
  border-radius: 8px; border: 1px solid var(--border-light); overflow-y: auto;
}
.drill-props h4 { font-size: 13px; margin-bottom: 10px; color: var(--text-light); }
.drill-props .form-group { margin-bottom: 10px; }
.drill-props .form-group label { font-size: 11px; }
.drill-props .form-group input { font-size: 12px; padding: 6px 8px; }

/* 已插入教案的图示标记 */
.diagram-editable-badge {
  display: inline-block; background: #f59e0b; color: #fff; font-size: 10px;
  padding: 1px 6px; border-radius: 8px; vertical-align: middle; margin-left: 6px;
}
.drill-editor-tip {
  font-size: 11px; color: var(--text-light); margin-top: 4px;
  padding: 6px 8px; background: #fef3c7; border-radius: 4px; display: none;
}
.drill-editor-tip.show { display: block; }

/* ===================== 布局 ===================== */
.layout {
  /* 保留选择器以兼容旧引用，实际布局由 .page 容器接管 */
}
.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
}
.panel-form { padding: 22px 20px; }
.panel-form::-webkit-scrollbar { width: 4px; }
.panel-form::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.panel-title {
  font-size: 14px; font-weight: 700; letter-spacing: .5px;
  margin-bottom: 18px; color: var(--primary);
  padding-bottom: 10px; border-bottom: 1px solid var(--border-light);
  text-transform: uppercase;
}
.panel-result { }

/* ===================== 表单 ===================== */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 5px;
  letter-spacing: .3px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-soft);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15,76,58,.08);
}
.form-group textarea { resize: vertical; line-height: 1.5; }
.form-group select { cursor: pointer; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%238a9b94' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 11px; color: var(--text-light); margin-top: 4px; }

.input-cond { margin-top: 6px; }
.select-sm { font-size: 11.5px; padding: 5px 8px; }
.quick-fill { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.quick-fill-label { font-size: 11px; color: var(--text-light); white-space: nowrap; }
.quick-fill select { flex: 1; }

.lesson-row { display: flex; align-items: center; gap: 8px; }
.lesson-prefix, .lesson-suffix { font-size: 13px; color: var(--text-mid); white-space: nowrap; }
.inp-lesson { width: 60px !important; text-align: center; }
.inp-total { width: 56px !important; }

/* combobox 可编辑下拉 */
.combobox-wrap { flex: 1; position: relative; }
.combobox-input {
  width: 100% !important;
  padding: 5px 28px 5px 8px !important;
  font-size: 11.5px !important;
}
.input-clear-wrap { flex: 1; position: relative; }
.input-clear { padding-right: 28px !important; }
.btn-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  border: none; border-radius: 50%;
  background: #d0d0d0; color: #fff;
  font-size: 14px; line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center; justify-content: center;
  padding: 0;
}
.btn-clear:hover { background: #f0a0a0; }
.btn-clear.show { display: flex; }

/* 按钮小号 */
.btn-sm { padding: 4px 10px; font-size: 11.5px; border-radius: 4px; }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-tint); }

/* 跨学科选科 */
.cross-disc-row {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.cd-pe-badge {
  display: inline-flex; align-items: center;
  background: var(--primary); color: #fff;
  padding: 4px 10px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600;
  white-space: nowrap;
}
.cd-plus { color: var(--text-light); font-weight: 700; font-size: 14px; }
.cd-select { width: auto !important; min-width: 120px; flex: 1; }
.label-note { font-weight: 400; font-size: 10px; color: var(--text-light); }

.tips {
  margin-top: 20px;
  padding: 12px 14px;
  background: var(--primary-tint);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}
.tips-title { font-size: 12px; font-weight: 700; color: var(--primary); margin-bottom: 5px; letter-spacing: .3px; }
.tips ul { list-style: none; font-size: 11.5px; color: var(--text-mid); }
.tips li { padding: 2px 0; padding-left: 12px; position: relative; line-height: 1.5; }
.tips li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 4px; height: 4px; border-radius: 50%; background: var(--primary); }

/* ===================== 空状态 ===================== */
.empty-state {
  text-align: center;
  padding: 100px 20px;
  color: var(--text-light);
}
.empty-icon-wrap {
  width: 72px; height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--primary-tint);
  border: 2px solid var(--primary-light);
  display: flex; align-items: center; justify-content: center;
}
.empty-icon-text { font-size: 18px; font-weight: 700; color: var(--primary); letter-spacing: 1px; }
.empty-state h2 { font-size: 18px; color: var(--text); margin-bottom: 6px; font-weight: 600; }
.empty-state p { font-size: 13px; }
.empty-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin-top: 28px;
  font-size: 12px;
  color: var(--primary);
}
.empty-features span {
  padding: 4px 12px;
  background: var(--primary-tint);
  border-radius: 14px;
  border: 1px solid var(--primary-light);
}

/* ===================== 教案文档 ===================== */
.lesson-doc { color: var(--text); }
.lesson-doc .doc-header {
  text-align: center;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 18px;
  margin-bottom: 26px;
}
.lesson-doc .doc-header h1 {
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 6px;
  font-weight: 700;
}
.lesson-doc .doc-header .subtitle { font-size: 13px; color: var(--text-light); }
.lesson-doc .doc-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 16px;
  background: var(--bg-soft);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 26px;
  font-size: 13px;
  border: 1px solid var(--border-light);
}
.lesson-doc .doc-meta div { display: flex; flex-direction: column; }
.lesson-doc .doc-meta .lbl { color: var(--text-light); font-size: 11px; }
.lesson-doc .doc-meta .val { font-weight: 600; color: var(--text); }

.lesson-doc section { margin-bottom: 24px; }
.lesson-doc h2 {
  font-size: 15px;
  color: var(--primary);
  border-left: 3px solid var(--primary);
  padding-left: 10px;
  margin-bottom: 12px;
  font-weight: 700;
}
.lesson-doc h3 { font-size: 14px; color: var(--primary-dark); margin: 14px 0 8px; border-left: 3px solid var(--accent); padding-left: 8px; }

/* 目标列表 */
.obj-list { list-style: none; }
.obj-list li {
  padding: 8px 12px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 14px;
  border-left: 3px solid var(--primary);
}
.obj-list .obj-dim { font-weight: 600; color: var(--primary-dark); margin-right: 6px; }

/* 重点难点 */
.focus-box { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.focus-card {
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.focus-card.key { background: var(--accent-light); border-left: 4px solid var(--accent); }
.focus-card.diff { background: #fef2f2; border-left: 4px solid #ef4444; }
.focus-card .focus-title { font-weight: 700; margin-bottom: 4px; font-size: 13px; }
.focus-card.key .focus-title { color: #92400e; }
.focus-card.diff .focus-title { color: #b91c1c; }

/* 教学过程表格 */
.process-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  overflow: hidden;
}
.process-block .block-head {
  background: var(--primary-tint);
  padding: 8px 14px;
  font-weight: 600;
  color: var(--primary-dark);
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}
.process-block .block-head .time-tag {
  background: var(--primary);
  color: #fff;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
}
.step-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.step-table th, .step-table td { padding: 8px 10px; border-top: 1px solid var(--border-light); text-align: left; vertical-align: top; }
.step-table th { background: var(--bg-soft); font-weight: 600; color: var(--text-light); font-size: 11px; width: auto; white-space: nowrap; }
.step-table .col-content { width: 18%; font-weight: 600; color: var(--text); }
.step-table .col-time { width: 7%; text-align: center; color: var(--accent); font-weight: 600; }
.step-table .col-org { width: 14%; color: var(--text-light); }
.step-table .col-method { width: 14%; color: var(--text-light); }

/* 新表格样式（含师生活动列，参考第九届全国教案集） */
.step-table-new .col-content { width: 16%; }
.step-table-new .col-teacher { width: 18%; font-size: 11.5px; color: var(--text-mid); line-height: 1.5; }
.step-table-new .col-student { width: 18%; font-size: 11.5px; color: var(--text-mid); line-height: 1.5; }
.step-table-new .col-form { width: 16%; font-size: 10.5px; color: var(--text-light); line-height: 1.5; }
.step-table-new .col-reps { width: 8%; text-align: center; color: var(--accent); font-weight: 600; font-size: 11.5px; }
.step-table-new .col-hr { width: 8%; text-align: center; color: #dc2626; font-weight: 500; font-size: 11px; }
.step-table-new .step-detail { font-size: 11.5px; color: var(--text-light); margin-top: 3px; line-height: 1.5; }
.step-table-new .step-key { font-size: 11px; color: var(--primary); margin-top: 2px; font-weight: 500; }
.process-table-wrap { overflow-x: auto; margin: 0; padding: 0; }

/* ===== 基本部分·国赛级7列表格（学练赛评渐进式练习链） ===== */
.step-table-xlsp { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.step-table-xlsp th, .step-table-xlsp td {
  padding: 7px 8px; border-bottom: 1px solid var(--border-light);
  text-align: left; vertical-align: top;
}
.step-table-xlsp thead th {
  background: var(--primary); color: #fff;
  font-size: 11.5px; font-weight: 600; letter-spacing: .3px;
  white-space: nowrap; padding: 8px 8px;
}
.step-table-xlsp .col-seq { width: 5%; text-align: center; }
.step-table-xlsp .col-content { width: 17%; font-weight: 500; color: var(--text); }
.step-table-xlsp .col-teacher { width: 18%; font-size: 11.5px; color: var(--text-mid); line-height: 1.55; }
.step-table-xlsp .col-student { width: 18%; font-size: 11.5px; color: var(--text-mid); line-height: 1.55; }
.step-table-xlsp .col-form { width: 16%; font-size: 10.5px; color: var(--text-light); line-height: 1.5; }
.step-table-xlsp .col-reps { width: 8%; text-align: center; color: var(--accent); font-weight: 600; font-size: 11px; }
.step-table-xlsp .col-hr { width: 7%; text-align: center; color: #dc2626; font-weight: 500; font-size: 11px; }
.step-table-xlsp .step-detail { font-size: 11px; color: var(--text-light); margin-top: 3px; line-height: 1.55; }
.step-table-xlsp .step-key { font-size: 11px; color: var(--primary); margin-top: 3px; font-weight: 600; background: var(--primary-tint); padding: 2px 6px; border-radius: 3px; display: inline-block; }
.step-table-xlsp .key-icon { font-size: 10px; margin-right: 2px; }

/* 序号圆圈 */
.seq-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
}

/* 环节分隔条 */
.row-phase-sep td { padding: 2px 8px !important; border-bottom: none; }
.phase-sep-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px; margin: 2px 0; border-radius: var(--radius-sm);
  color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .5px;
}
.phase-sep-name { font-size: 14px; font-weight: 700; }
.phase-sep-label { font-size: 11px; opacity: .9; font-weight: 400; }

/* 步骤行 */
.row-step { background: #fff; }
.row-step:hover { background: var(--bg-soft); }
.row-step td { padding: 8px 8px; }

/* 扩展行（达成标准/学练思考） */
.row-extra td { padding: 2px 8px 6px !important; border-bottom: 1px dashed var(--border); }
.extra-criteria, .extra-reflection {
  font-size: 11.5px; line-height: 1.55; padding: 5px 10px;
  border-radius: var(--radius-sm); margin: 1px 0;
}
.extra-criteria {
  background: #f0fdf4; border-left: 3px solid #22c55e;
  color: #166534;
}
.extra-reflection {
  background: #eff6ff; border-left: 3px solid #3b82f6;
  color: #1e40af;
}
.extra-icon { font-size: 11px; margin-right: 4px; }

/* 教学方法标签（组织队形列内） */
.form-method { margin-top: 4px; }
.method-tag {
  display: inline-block;
  padding: 1px 7px; border-radius: 10px;
  background: #f0fdf4; color: #166534;
  font-size: 10.5px; font-weight: 500;
  border: 1px solid #bbf7d0;
}

/* ===== SVG 渐进式练习链流程图 ===== */
.svg-flow-wrap {
  padding: 10px 12px 6px;
  background: linear-gradient(135deg, #f8faf9 0%, #f0fdf4 100%);
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
}
.svg-flow-diagram {
  display: block; width: 100%; max-width: 900px;
  height: auto; margin: 0 auto;
}
@media print {
  .svg-flow-wrap { background: #fff; border: 1px solid #ddd; }
}

/* 适应窄屏：调整列宽 */
@media (max-width: 1100px) {
  .step-table-xlsp { font-size: 11px; }
  .step-table-xlsp .col-teacher, .step-table-xlsp .col-student { font-size: 10.5px; }
  .step-table-xlsp .col-form { font-size: 10px; }
}

/* 师生活动标签 */
.sub-activities { margin: 6px 0; display: flex; flex-direction: column; gap: 3px; }
.sub-act { font-size: 12px; color: var(--text-mid); line-height: 1.5; padding-left: 0; }
.act-label { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 700; margin-right: 4px; vertical-align: 1px; }
.act-label.act-t { background: #dbeafe; color: #1d4ed8; }
.act-label.act-s { background: #dcfce7; color: #15803d; }

/* meta icons for sub-meta */
.meta-icon { font-size: 10px; margin-right: 1px; }

/* 通用列表卡片 */
.info-card {
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 14px;
  border: 1px solid var(--border-light);
}
.info-card ul { padding-left: 20px; }
.info-card li { padding: 3px 0; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  background: var(--primary-tint);
  color: var(--primary-dark);
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 500;
}

/* 大单元元数据 */
.bu-theme { background: linear-gradient(135deg, #ede9fe, #fae8ff); padding: 1px 6px; border-radius: 4px; font-size:12px; color:#7c3aed; }

/* ===================== 大单元概览卡片 ===================== */
.bu-card { background: linear-gradient(135deg, #faf5ff, #fdf2f8); border: 1px solid #e9d5ff; }
.bu-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bu-theme-badge {
  background: #7c3aed; color: #fff;
  padding: 4px 12px; border-radius: 14px;
  font-size: 14px; font-weight: 600;
}
.bu-slogan { font-size: 14px; color: #a855f7; font-style: italic; }
.bu-phases { display: flex; gap: 2px; margin-top: 10px; border-radius: var(--radius-sm); overflow: hidden; }
.bu-phase {
  text-align: center; padding: 8px 4px;
  background: #f3f4f6; color: #9ca3af;
  font-size: 11px; transition: all .25s;
}
.bu-phase-current {
  background: #ede9fe; color: #7c3aed;
  box-shadow: 0 0 0 2px #a855f7 inset;
  font-weight: 600;
}
.bu-phase-name { font-weight: 600; margin-bottom: 2px; font-size: 12px; }
.bu-phase-info { font-size: 10px; opacity: .8; }
.bu-phase-bar { height: 4px; background: #e5e7eb; border-radius: 2px; margin-top: 4px; }
.bu-phase-fill { height: 100%; background: #7c3aed; opacity: .3; border-radius: 2px; }
.bu-phase-current .bu-phase-fill { background: #7c3aed; opacity: 1; }

/* ===================== 学练赛评标签 ===================== */
.xlsp-badge {
  display: inline-block;
  font-size: 11px !important;
  padding: 2px 7px !important;
  border-radius: 3px !important;
  color: #fff !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
}
.phase-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

/* 练环节子步骤 */
.step-card-subs { margin: 6px 0 4px; }
.sub-item {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 8px 10px; margin-bottom: 5px;
  background: var(--primary-tint); border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
  font-size: 12px;
}
.sub-item:last-child { margin-bottom: 0; }
.sub-dot {
  flex-shrink: 0;
  width: 8px; height: 8px;
  margin-top: 4px;
  background: var(--primary); border-radius: 50%;
}
.sub-body { flex: 1; min-width: 0; }
.sub-head { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.sub-type {
  font-size: 10px; color: var(--text-mid);
  background: var(--border-light); padding: 1px 5px; border-radius: 8px;
  white-space: nowrap;
}
.sub-detail { color: var(--text-mid); line-height: 1.6; margin-bottom: 3px; }
.sub-meta { color: var(--text-light); font-size: 10.5px; display: flex; flex-wrap: wrap; gap: 4px 8px; }

/* 负荷 */
.load-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.load-item { background: var(--accent-light); border-radius: var(--radius-sm); padding: 12px; text-align: center; }
.load-item .load-val { font-size: 18px; font-weight: 700; color: var(--accent); }
.load-item .load-lbl { font-size: 12px; color: var(--text-light); }

/* ===== 时间核算表（体育课时间层级模型 层1~层5） ===== */
.time-audit { margin-top: 14px; }
.time-audit-title {
  font-weight: 700;
  color: var(--primary);
  font-size: 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.time-audit-badge {
  background: var(--primary-tint);
  color: var(--primary);
  border-radius: 10px;
  padding: 1px 9px;
  font-size: 11.5px;
  font-weight: 600;
}
.ta-table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
.ta-table th, .ta-table td {
  border: 1px solid var(--border-light);
  padding: 6px 10px;
  text-align: left;
  vertical-align: middle;
}
.ta-table th {
  background: var(--bg-soft);
  color: var(--text-mid);
  font-weight: 600;
  width: 110px;
  white-space: nowrap;
}
.ta-table td { color: var(--text-mid); }
.ta-seg { display: inline-block; margin-right: 14px; white-space: nowrap; }
.ta-seg b { color: var(--accent); font-weight: 700; }
.ta-seg .ta-pct { color: var(--text-light); font-size: 11.5px; }
.ta-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; margin-top: 6px; background: var(--bg-soft); }
.ta-bar span { display: block; height: 100%; }
.ta-bar .ta-b1 { background: #f6c667; }
.ta-bar .ta-b2 { background: #6c8ebf; }
.ta-bar .ta-b3 { background: #82b366; }
.ta-audit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.ta-note {
  font-size: 11.5px;
  color: var(--text-light);
  margin-top: 8px;
  line-height: 1.6;
  padding-left: 2px;
}

/* ===== 时间配比（高级）折叠区 ===== */
.tm-adv {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  margin-bottom: 14px;
}
.tm-adv > summary {
  cursor: pointer;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tm-adv > summary::-webkit-details-marker { display: none; }
.tm-adv > summary::before {
  content: '▸';
  color: var(--text-light);
  font-size: 11px;
}
.tm-adv[open] > summary::before { content: '▾'; }
.tm-adv-note { font-weight: 400; font-size: 10.5px; color: var(--text-light); }
.tm-adv-body { padding: 4px 12px 12px; }
.tm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tm-field label { display: block; font-size: 11px; color: var(--text-light); margin-bottom: 3px; }
.tm-field input {
  width: 100%;
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-mid);
  box-sizing: border-box;
}
.tm-field input:focus { outline: none; border-color: var(--primary); }
.tm-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.tm-preview { font-size: 11.5px; color: var(--text-light); line-height: 1.5; }

/* 课后小结 */
.summary-box {
  background: linear-gradient(135deg, var(--primary-tint), var(--accent-light));
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.8;
}

/* AI 标记 */
.ai-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ===================== 弹窗 ===================== */
.modal {
  position: fixed; inset: 0;
  background: rgba(15,76,58,.35);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-box {
  background: #fff;
  border-radius: var(--radius);
  width: 100%; max-width: 460px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-box-lg { max-width: 640px; max-height: 85vh; overflow-y: auto; }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}
.modal-head h3 { font-size: 15px; color: var(--text); font-weight: 600; }
.modal-close {
  border: none; background: var(--bg-soft); width: 28px; height: 28px;
  border-radius: 50%; cursor: pointer; font-size: 13px; color: var(--text-light);
}
.modal-close:hover { background: var(--border-light); }
.modal-body { padding: 20px; }
.modal-body p { font-size: 13px; color: var(--text-light); margin-bottom: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.setup-divider { height: 1px; background: var(--border); margin: 16px 0 12px; }
.hint code { background: rgba(0,0,0,.05); padding: 1px 5px; border-radius: 4px; font-size: 11px; }
.ai-status {
  margin-top: 14px; padding: 12px; border-radius: var(--radius-sm);
  font-size: 13px; background: var(--primary-tint); color: var(--primary-dark);
  border-left: 3px solid var(--primary);
}

/* ===================== Toast ===================== */
.toast {
  position: fixed; bottom: 30px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--primary); color: #fff;
  padding: 10px 24px; border-radius: 24px;
  font-size: 13px; opacity: 0; pointer-events: none;
  transition: all .3s; z-index: 2000;
  box-shadow: var(--shadow-md);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===================== 教材详情 ===================== */
.textbook-detail {
  margin-top: 6px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.4;
}
.textbook-detail .tb-title {
  font-weight: 600;
  color: var(--primary);
  display: block;
  margin-bottom: 2px;
}
.textbook-detail .tb-meta {
  font-size: 11px;
  color: #9ca3af;
}
/* 教案元数据中的教师用书行 */
.doc-meta .tb-book { color: var(--primary); font-size: 12px; }

/* ===================== TOC 课时选择器 ===================== */
#gTOCSelector select {
  font-size: 13px;
}
.toc-lesson-info {
  margin-top: 6px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.toc-lesson-info .toc-unit-badge {
  background: var(--primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.toc-lesson-info .toc-lesson-title {
  font-weight: 600;
  color: #1f2937;
  font-size: 13px;
}
.toc-lesson-info .toc-hint {
  font-size: 11px;
  color: var(--accent);
  margin-left: auto;
}

/* ===================== 响应式 ===================== */
@media (max-width: 960px) {
  .setup-container { padding: 24px 20px; }
  .setup-actions { flex-direction: column; }
  .layout-result { padding: 16px 12px 110px; }
  .result-container { padding: 24px 20px; }
  .floating-bar { display: flex; }
  .lesson-doc .doc-meta { grid-template-columns: 1fr 1fr; }
  .focus-box { grid-template-columns: 1fr; }
  .load-grid { grid-template-columns: 1fr; }
}

/* 桌面端隐藏浮动栏 */
@media (min-width: 961px) {
  .floating-bar { display: none !important; }
}

/* ===================== 动作动画卡片 ===================== */
.step-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px; background: var(--bg-soft); }
.step-card {
  display: flex; gap: 12px; align-items: stretch;
  background: #fff; border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 12px;
  transition: box-shadow .2s, transform .2s;
}
.step-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--primary); }
.step-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.step-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 6px; }
.step-card-title { font-weight: 600; font-size: 14px; color: var(--text); }
.step-card-time { background: var(--accent); color:#fff; font-size: 11px; padding: 1px 9px; border-radius: 10px; white-space: nowrap; flex-shrink: 0; }
.step-card-detail { font-size: 12.5px; color: var(--text-light); line-height: 1.6; margin-bottom: 6px; }
.step-card-key { font-size: 12px; color: var(--accent); font-weight: 600; margin-bottom: 6px; background: var(--accent-light); padding: 3px 8px; border-radius: var(--radius-sm); align-self: flex-start; }
.step-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.mini-tag { font-size: 11px; color: var(--text-light); background: var(--bg-soft); padding: 2px 8px; border-radius: 10px; }
.step-card-anim { flex-shrink: 0; }

.anim-card {
  width: 138px; background: linear-gradient(160deg, var(--primary-tint), var(--bg-soft));
  border: 1px solid var(--primary-light); border-radius: var(--radius); padding: 8px;
  display: flex; flex-direction: column; align-items: center;
}
.anim-stage { position: relative; width: 116px; height: 116px; background: #fff; border-radius: var(--radius-sm); }
.anim-frame { position: absolute; inset: 0; opacity: 0; transition: opacity .06s linear; }
.anim-frame.active { opacity: 1; }
.anim-svg { width: 100%; height: 100%; display: block; }
.anim-meta { width: 100%; margin-top: 6px; }
.anim-name { font-size: 12px; font-weight: 600; color: var(--primary-dark); text-align: center; }
.anim-tips { font-size: 10.5px; color: var(--text-light); text-align: center; line-height: 1.45; margin-top: 2px; min-height: 30px; }
.anim-controls { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 4px; }
.anim-btn { border: 1px solid var(--border); background: #fff; border-radius: var(--radius-sm); padding: 2px 8px; font-size: 11px; cursor: pointer; color: var(--text); line-height: 1.4; }
.anim-btn:hover { background: var(--primary-tint); border-color: var(--primary); color: var(--primary-dark); }
.anim-frame-info { font-size: 9.5px; color: var(--text-light); }

@media (max-width: 960px) { .step-cards { grid-template-columns: 1fr; } }

/* ===================== 高中模块教学样式 ===================== */
.sm-card { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); border: 1px solid #bfdbfe; }
.sm-header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.sm-badge { background: #2563eb; color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 700; }
.sm-title { font-weight: 700; font-size: 15px; color: #1e3a5f; }
.sm-credits { font-size: 12px; color: #6b7280; background: #fff; padding: 1px 8px; border-radius: 10px; border: 1px solid #d1d5db; }
.sm-modules { margin-top: 10px; }
.sm-table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 12px; }
.sm-table th { background: #2563eb; color: #fff; padding: 4px 8px; text-align: left; font-weight: 600; }
.sm-table td { padding: 4px 8px; border-bottom: 1px solid #dbeafe; vertical-align: top; }
.sm-table tr:nth-child(even) td { background: #f0f7ff; }

/* ===================== 跨学科融合样式 ===================== */
.cd-card { background: linear-gradient(135deg, #fdf4ff 0%, #fae8ff 50%, #fce7f3 100%); border: 1px solid #f0abfc; }
.cd-header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.cd-badge { background: #a855f7; color: #fff; font-size: 12px; padding: 3px 10px; border-radius: var(--radius-sm); font-weight: 700; }
.cd-dynamic-tag { background: #10b981; color: #fff; font-size: 11px; padding: 2px 8px; border-radius: var(--radius-sm); font-weight: 600; margin-left: 6px; }
.cd-title { font-weight: 700; font-size: 16px; color: #581c87; }
.cd-subjects { font-size: 12px; color: #7c3aed; background: #f3e8ff; padding: 2px 8px; border-radius: 10px; border: 1px solid #d8b4fe; }
.cd-design-proc { margin-bottom: 12px; }
.cd-proc-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.cd-proc-step { font-size: 11px; padding: 4px 10px; background: #fff; border-radius: var(--radius-sm); border: 1px solid #e9d5ff; color: #4c1d95; flex: 1; min-width: 150px; }
.cd-drive-q { margin-bottom: 12px; padding: 10px; background: #fef3c7; border-radius: var(--radius-sm); border: 1px solid #fcd34d; font-size: 13px; color: #92400e; }
.cd-problems { margin-bottom: 12px; }
.cd-problems ol { margin: 6px 0 0 20px; font-size: 13px; color: #374151; }
.cd-problems li { margin-bottom: 3px; }
.cd-scenario { margin-bottom: 12px; }
.cd-scenario dl { margin: 6px 0; }
.cd-scenario dt { font-weight: 700; font-size: 12px; color: #7c3aed; margin-top: 6px; }
.cd-scenario dd { font-size: 13px; color: #374151; margin-left: 0; margin-bottom: 4px; }
.cd-obj { margin-bottom: 12px; padding: 10px; background: #fff; border-radius: var(--radius-sm); border: 1px solid #e9d5ff; }
.cd-obj dl { margin-top: 6px; }
.cd-obj dt { font-weight: 700; font-size: 12px; color: #a855f7; margin-top: 4px; }
.cd-obj dd { font-size: 13px; color: #374151; margin-left: 0; margin-bottom: 2px; }
.cd-eval { margin-bottom: 12px; }
.cd-eval ul { margin: 6px 0 0 18px; font-size: 13px; color: #374151; }
.cd-note { padding: 8px 12px; background: #fef3c7; border-radius: var(--radius-sm); border: 1px solid #fcd34d; font-size: 12px; }
.cd-note ul { margin: 4px 0 0 16px; color: #92400e; }

/* ===================== 打印样式 ===================== */
@media print {
  body { background: #fff; }
  .topbar, .topbar-setup, .topbar-result,
  .floating-bar, .layout-setup, #pageSetup,
  .topbar-actions, .btn-back { display: none !important; }
  #pageResult {
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .layout-result { padding: 0; max-width: none; }
  .result-container { box-shadow: none; border: none; padding: 0; min-height: auto; }
  .lesson-doc h2 { border-left-color: #333 !important; color: #333 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .lesson-doc .doc-header { border-bottom: 2px solid #333; }
  .lesson-doc .doc-header h1 { color: #333; }
  .process-block, .step-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .empty-state { display: none; }
  .anim-controls { display: none !important; }
  .anim-card { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .step-card { break-inside: avoid; }
  .anim-stage { background: #fff !important; }

  /* 打印时隐藏跨学科和模块详情（保留标题） */
  .cd-design-proc, .cd-drive-q, .cd-problems, .cd-scenario, .cd-obj, .cd-eval, .cd-note,
  .sm-modules { display: none; }
}

/* ===================== 模板导入弹窗 ===================== */
.tpl-list { display: flex; flex-direction: column; gap: 10px; }
.tpl-card {
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: all .15s;
}
.tpl-card:hover { border-color: var(--primary-light); background: var(--primary-tint); }
.tpl-card-active { border-color: var(--primary); background: var(--primary-tint); }
.tpl-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.tpl-card-name { font-size: 14px; font-weight: 600; color: var(--text); }
.tpl-card-warn { font-size: 11px; color: var(--accent); background: var(--accent-light); padding: 2px 8px; border-radius: 10px; }
.tpl-card-source { font-size: 12px; color: var(--text-light); margin-bottom: 4px; }
.tpl-card-desc { font-size: 13px; color: var(--text-mid); line-height: 1.5; margin-bottom: 6px; }
.tpl-card-meta { display: flex; gap: 12px; }
.tpl-card-meta span { font-size: 11px; color: var(--primary); background: var(--primary-light); padding: 2px 8px; border-radius: 10px; }

.tpl-detail {
  margin-top: 16px; padding: 14px; background: var(--bg-soft); border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}
.tpl-detail-title { font-size: 14px; font-weight: 600; color: var(--primary-dark); margin-bottom: 8px; }
.tpl-detail-row { font-size: 13px; color: var(--text-mid); margin-bottom: 4px; line-height: 1.6; }
.tpl-detail-row strong { color: var(--text); }
.tpl-detail-note { font-size: 12px; color: var(--text-light); margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }

/* Tab 切换 */
.tpl-tabs { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 2px solid var(--border); }
.tpl-tab { padding: 8px 20px; border: none; background: none; cursor: pointer; font-size: 14px; color: var(--text-light); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .2s; }
.tpl-tab:hover { color: var(--text); }
.tpl-tab-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tpl-panel { min-height: 200px; }

/* 参考教案导入 */
.ref-plan-input { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 12px; font-size: 13px; line-height: 1.6; resize: vertical; font-family: inherit; transition: border-color .2s; }
.ref-plan-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }
.ref-plan-actions { display: flex; gap: 8px; margin-top: 10px; }

/* 文件上传区 */
.ref-file-drop-zone { border: 2px dashed var(--border); border-radius: 10px; padding: 28px 16px; text-align: center; cursor: pointer; transition: all .2s; background: var(--bg-alt); margin-bottom: 8px; }
.ref-file-drop-zone:hover { border-color: var(--primary); background: var(--primary-tint, rgba(15,76,58,0.06)); }
.ref-file-drop-zone.dragover { border-color: var(--primary); background: var(--primary-tint, rgba(15,76,58,0.1)); transform: scale(1.01); }
.ref-file-icon { font-size: 36px; margin-bottom: 8px; }
.ref-file-hint { font-size: 14px; color: var(--text, #333); margin-bottom: 4px; font-weight: 500; }
.ref-file-formats { font-size: 12px; color: var(--text-muted, #999); }
.ref-file-name { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; background: var(--primary-tint, rgba(15,76,58,0.08)); border: 1px solid var(--primary); margin-bottom: 8px; font-size: 13px; color: var(--primary); font-weight: 500; }
.ref-file-name .ref-file-status { margin-left: auto; font-size: 11px; padding: 2px 8px; border-radius: 4px; background: var(--primary); color: #fff; font-weight: 400; }
.ref-file-name .ref-file-status.loading { background: var(--text-muted, #999); animation: pulse 1.2s infinite; }
.ref-file-name .ref-file-remove { cursor: pointer; font-size: 16px; color: var(--text-muted, #999); margin-left: 4px; }
.ref-file-name .ref-file-remove:hover { color: #e74c3c; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

.ref-divider { text-align: center; margin: 12px 0; position: relative; }
.ref-divider::before { content: ''; position: absolute; left: 0; top: 50%; width: 100%; height: 1px; background: var(--border); }
.ref-divider span { position: relative; background: var(--bg, #fff); padding: 0 12px; font-size: 12px; color: var(--text-muted, #999); }

.ref-parse-result { margin-top: 16px; border: 1px solid var(--border); border-radius: 8px; padding: 16px; background: var(--bg-alt); }
.ref-parse-title { font-size: 14px; font-weight: 600; color: var(--primary-dark); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.ref-parse-title .check-icon { color: #22c55e; font-size: 18px; }
.ref-parse-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.ref-parse-item { font-size: 13px; color: var(--text-mid); line-height: 1.6; }
.ref-parse-item strong { color: var(--text); }
.ref-parse-section { font-size: 13px; margin: 8px 0; padding: 8px 12px; background: #fff; border-radius: 6px; border-left: 3px solid var(--primary); }
.ref-parse-section-name { font-weight: 600; color: var(--primary-dark); }
.ref-parse-section-meta { color: var(--text-light); font-size: 12px; margin-top: 2px; }
.ref-parse-section-steps { margin-top: 6px; padding-left: 8px; }
.ref-parse-step { font-size: 12px; color: var(--text-mid); line-height: 1.5; padding: 2px 0; }
.ref-parse-step .step-tag { display: inline-block; padding: 1px 6px; border-radius: 8px; font-size: 10px; font-weight: 600; margin-right: 4px; }
.ref-parse-step .tag-xue { background: #dbeafe; color: #2563eb; }
.ref-parse-step .tag-lian { background: #dcfce7; color: #16a34a; }
.ref-parse-step .tag-sai { background: #fef3c7; color: #d97706; }
.ref-parse-step .tag-ping { background: #ede9fe; color: #7c3aed; }
.ref-parse-note { font-size: 12px; color: var(--text-light); margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.ref-parse-error { color: #ef4444; font-size: 13px; padding: 8px 12px; background: #fef2f2; border-radius: 6px; }

/* combobox 输入框在跨学科行中的样式 */

/* ===================== 大单元课时计划 ===================== */

/* —— 文档头部 —— */
.up-header h1 { font-size: 24px !important; }
.up-header .subtitle { font-size: 13px; color: var(--text-light); }

/* —— 元信息卡片 —— */
.up-meta {
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 10px 20px !important;
  padding: 16px 20px !important;
}
.up-meta .val { font-size: 13px; line-height: 1.6; }
.up-meta .bu-theme {
  font-size: 15px;
  color: var(--primary);
  font-weight: 700;
}

/* —— 技能 chip —— */
.up-skill-chip {
  display: inline-block;
  padding: 2px 10px;
  margin: 2px 4px 2px 0;
  background: var(--primary-tint);
  color: var(--primary-dark);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--primary-light);
}

/* —— 区块间距 —— */
.up-section { margin-bottom: 28px; }
.up-section h2 {
  font-size: 15px;
  color: var(--primary);
  border-left: 3px solid var(--primary);
  padding-left: 10px;
  margin-bottom: 14px;
  font-weight: 700;
}

/* —— 概览卡片 —— */
.up-overview-card { padding: 18px 20px; }

/* —— 阶段图例 —— */
.up-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border);
}
.up-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-mid);
  font-weight: 500;
}
.up-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* —— 情境链进阶 —— */
.up-schain-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
.up-schain {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.up-schain-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}
.up-schain-bar {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.up-schain-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  line-height: 1.4;
}
.up-schain-lessons {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 4px;
}
.up-schain-desc {
  font-size: 11px;
  color: var(--text-mid);
  line-height: 1.5;
}
.up-schain-note {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  line-height: 1.6;
}

/* —— 阶段块 —— */
.up-phase-block {
  margin-bottom: 22px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.up-phase-block:last-child { margin-bottom: 0; }

.up-phase-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--bg-soft);
}
.up-phase-icon { font-size: 18px; }
.up-phase-name {
  font-size: 15px;
  font-weight: 700;
}
.up-phase-range {
  font-size: 12px;
  color: var(--text-light);
  background: #fff;
  padding: 2px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.up-phase-desc {
  font-size: 12px;
  color: var(--text-mid);
  flex: 1;
  min-width: 200px;
}

/* —— 课时表格 —— */
.up-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.up-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  table-layout: fixed;
}
.up-table thead th {
  background: var(--primary-tint);
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 12px;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid var(--primary-light);
  white-space: nowrap;
}
.up-table tbody td {
  padding: 10px;
  vertical-align: top;
  border-bottom: 1px solid var(--border-light);
  line-height: 1.6;
  color: var(--text-mid);
  word-break: break-word;
}
.up-table tbody tr:last-child td { border-bottom: none; }
.up-row:hover { background: var(--bg-soft); }

/* 列宽 */
.up-col-no { width: 52px; text-align: center; }
.up-col-obj { width: 22%; }
.up-col-task { width: 13%; }
.up-col-sit { width: 14%; }
.up-col-content { width: 18%; }
.up-col-eval-c { width: 15%; }
.up-col-eval-m { width: 14%; }

/* 课次徽章 */
.up-no-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

/* 评价方式标签 */
.up-eval-tag {
  display: inline-block;
  padding: 1px 8px;
  margin: 1px 2px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  background: #f3f4f6;
  color: var(--text-mid);
  border: 1px solid var(--border-light);
  white-space: nowrap;
}

/* —— 评价统计 —— */
.up-eval-card { padding: 16px 20px; }
.up-eval-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 24px;
}
.up-eval-stat {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 2px 8px;
  align-items: center;
}
.up-eval-stat-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.up-eval-stat-count {
  font-size: 12px;
  color: var(--text-light);
  text-align: right;
}
.up-eval-stat-bar {
  grid-column: 1 / -1;
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}
.up-eval-stat-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--primary);
  transition: width .4s ease;
}

/* —— 设计说明 —— */
.up-note-card { padding: 16px 20px; }
.up-note-list {
  list-style: none;
  padding-left: 0;
}
.up-note-list li {
  padding: 6px 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-mid);
  border-bottom: 1px dashed var(--border-light);
}
.up-note-list li:last-child { border-bottom: none; }
.up-note-list li strong {
  color: var(--primary-dark);
  font-weight: 600;
}

/* —— 响应式：平板 —— */
@media (max-width: 1024px) {
  .up-meta { grid-template-columns: repeat(2, 1fr) !important; }
  .up-eval-stats { grid-template-columns: 1fr; }
  .up-schain-desc { display: none; }
  .up-col-content { width: 16%; }
  .up-col-obj { width: 24%; }
}

/* —— 响应式：手机 —— */
@media (max-width: 640px) {
  .up-meta { grid-template-columns: 1fr !important; }
  .up-legend { gap: 8px; }
  .up-legend-item { font-size: 12px; }
  .up-schain { flex-direction: column; gap: 10px; }
  .up-schain-item { flex-direction: row !important; flex: none !important; width: 100%; align-items: center; text-align: left; }
  .up-schain-bar { width: 6px; height: auto; min-height: 32px; align-self: stretch; }
  .up-schain-desc { display: block; }
  .up-phase-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .up-phase-desc { min-width: 0; }
  .up-table { font-size: 11.5px; }
  .up-table thead th { padding: 6px 6px; }
  .up-table tbody td { padding: 6px; }
  .up-no-badge { width: 24px; height: 24px; font-size: 11px; }
  .setup-actions { flex-direction: column; }
  .topbar .brand-text p { display: none; }
}

/* —— 打印：大单元课时计划 —— */
@media print {
  .up-header h1 { color: #333 !important; }
  .up-section h2 { border-left-color: #333 !important; color: #333 !important; }
  .up-table thead th {
    background: #f0f0f0 !important;
    color: #333 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .up-no-badge,
  .up-schain-bar,
  .up-eval-stat-fill,
  .up-phase-range,
  .up-skill-chip,
  .up-eval-tag {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .up-phase-block { break-inside: avoid; page-break-inside: avoid; }
  .up-row { break-inside: avoid; page-break-inside: avoid; }
  .up-table-wrap { overflow: visible; }
  .up-schain-desc { display: block !important; }
}
.cd-input { flex: 1; min-width: 80px; }

/* ===================== 标准教案表（紧凑格式） ===================== */
.std-meta {
  background: var(--bg-soft);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
}
.std-meta-row {
  display: flex;
  align-items: baseline;
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border-light);
}
.std-meta-row .lbl {
  flex: 0 0 64px;
  color: var(--text-light);
  font-weight: 600;
}
.std-meta-row .val {
  font-weight: 600;
  color: var(--text);
}

.std-process {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-top: 6px;
  table-layout: fixed;
}
.std-process th {
  background: var(--primary);
  color: #fff;
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.3px;
}
.std-process td {
  border: 1px solid var(--border-light);
  padding: 8px 10px;
  vertical-align: top;
  line-height: 1.6;
}
.std-process tr:hover { background: var(--bg-soft); }
.std-process .std-phase {
  background: var(--primary-tint);
  text-align: center;
  width: 96px;
}
.std-phase-name {
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 13px;
  line-height: 1.3;
}
.std-phase-time {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 3px;
}
.std-process .std-content { width: 26%; }
.std-process .std-content strong { color: var(--text); }
.std-process .std-method { width: 34%; }
.std-process .std-org {
  width: 16%;
  color: var(--text-light);
  font-size: 11.5px;
}
.std-process .std-load {
  width: 11%;
  text-align: center;
  color: var(--accent);
  font-weight: 600;
  font-size: 11.5px;
}
.std-detail {
  font-size: 11.5px;
  color: var(--text-light);
  margin-top: 3px;
  line-height: 1.55;
}
.std-t {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 3px;
  vertical-align: middle;
}
@media (max-width: 960px) {
  .std-meta { grid-template-columns: 1fr; gap: 0; }
  .std-process { font-size: 11px; }
  .std-process th, .std-process td { padding: 6px 7px; }
  .std-process .std-org { font-size: 10.5px; }
}
@media print {
  .std-process th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .std-process .std-phase { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .std-t { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ===================== 教学图（draw.io 嵌入） ===================== */
.diagram-card {
  margin-top: 24px;
  background: #fff;
  border: 1px solid var(--border, #e3e8ef);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.diagram-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.diagram-head h2 {
  margin: 0;
  font-size: 17px;
  color: #1a7a4c;
}
.diagram-type-switch {
  display: inline-flex;
  border: 1px solid var(--border, #d0d5dd);
  border-radius: 8px;
  overflow: hidden;
}
.dt-btn {
  background: transparent;
  border: none;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
  color: #475467;
  transition: background .15s, color .15s;
}
.dt-btn:hover { background: #f0f5f2; }
.dt-btn.active {
  background: var(--primary, #1a7a4c);
  color: #fff;
}
.diagram-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.diagram-status {
  font-size: 12px;
  color: #667085;
  margin: 0 0 10px;
  min-height: 16px;
}
.diagram-embed-host {
  position: relative;
  width: 100%;
  min-height: 640px;
  background: #f7f9fb;
  border: 1px dashed #cdd5df;
  border-radius: 8px;
  overflow: hidden;
}
.diagram-iframe {
  width: 100%;
  height: 78vh;
  min-height: 640px;
  max-height: 900px;
  border: 0;
  display: block;
}
.diagram-embed-tip {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #98a2b3;
  font-size: 13px;
  padding: 20px;
  text-align: center;
  line-height: 1.7;
}
@media (max-width: 640px) {
  .diagram-head { gap: 8px; }
  .diagram-actions { margin-left: 0; width: 100%; }
  .diagram-iframe { height: 50vh; min-height: 420px; }
  .diagram-fallback-actions { flex-direction: column; align-items: center; }
}

.diagram-fallback {
  margin-top: 10px;
  padding: 28px 20px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  text-align: center;
  color: #7c2d12;
}
.diagram-fallback p { margin: 0 0 14px; font-size: 13px; line-height: 1.6; }
.diagram-fallback-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* ===== 教学图样式切换（每种图的排版变体） ===== */
.diagram-style-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.diagram-style-switch:empty { margin: 0; }
.ds-btn {
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 14px;
  background: #fff;
  color: #475467;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.ds-btn:hover { border-color: #1a7a4c; color: #1a7a4c; }
.ds-btn.active { background: #1a7a4c; border-color: #1a7a4c; color: #fff; }

/* ===================== 生成进度可视化 ===================== */
.gen-progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
  margin: 0 auto;
  text-align: left;
}
.gen-progress-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-light);
  transition: color .3s;
}
.gen-progress-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--border-light);
  color: var(--text-light);
  font-size: 14px;
  flex-shrink: 0;
  transition: all .3s;
}
.gen-progress-active {
  color: var(--primary);
  font-weight: 600;
}
.gen-progress-active .gen-progress-icon {
  background: var(--primary-light);
  color: var(--primary);
  animation: pulse 1.2s ease-in-out infinite;
}
.gen-progress-done {
  color: var(--text-mid);
}
.gen-progress-done .gen-progress-icon {
  background: #d1fae5;
  color: #059669;
}
.gen-progress-error .gen-progress-icon {
  background: #fef2f2;
  color: #dc2626;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ===================== 报告页标签切换 ===================== */
.result-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}
.result-tab-btn {
  padding: 10px 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .2s, border-color .2s;
  letter-spacing: .3px;
}
.result-tab-btn:hover { color: var(--text-mid); }
.result-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

