/* ============================================================
   橙壹 · 教学工作台  —  UI 改版 2026-09-10
   设计语言：暖色深侧栏 + 橙色品牌主色 + 轻盈浅色内容区
   ============================================================ */

:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #f6f4ef;
  --border: #ebe7df;
  --border-strong: #ddd8cd;
  --text: #292524;
  --muted: #8a8378;

  --primary: #f2661d;
  --primary-dark: #d9530f;
  --primary-deep: #b8440b;
  --primary-soft: #fdeee2;
  --primary-glow: rgba(242, 102, 29, 0.22);

  --sidebar-bg: #211d19;
  --sidebar-bg-2: #191512;
  --sidebar-text: #b3aaa0;
  --sidebar-text-strong: #f5f1ea;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: linear-gradient(135deg, #f2661d, #e04e0a);

  --success: #199a62;
  --success-soft: #e3f5ec;
  --warning: #d98a17;
  --warning-soft: #fdf3df;
  --danger: #dd4343;
  --danger-soft: #fdecec;

  --shadow: 0 1px 2px rgba(41, 37, 36, 0.04), 0 4px 14px rgba(41, 37, 36, 0.05);
  --shadow-lg: 0 4px 10px rgba(41, 37, 36, 0.06), 0 14px 34px rgba(41, 37, 36, 0.09);
  --radius: 14px;
  --radius-sm: 10px;
  --bg-hover: #f0ede6;
}

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

html { scrollbar-color: #d6d1c6 transparent; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* 细滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d6d1c6; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #c2bcae; }
::-webkit-scrollbar-track { background: transparent; }

::selection { background: var(--primary-glow); }

#app { display: flex; min-height: 100vh; }

/* ---------- 侧边栏（深色暖调） ---------- */
.sidebar {
  width: 236px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 24px 22px 18px;
  font-size: 19px;
  font-weight: 800;
  color: var(--sidebar-text-strong);
  letter-spacing: 1px;
}
.brand-logo {
  font-size: 22px;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f2661d, #ff9440);
  border-radius: 11px;
  box-shadow: 0 4px 12px rgba(242, 102, 29, 0.35);
}
.nav { flex: 1; padding: 6px 14px 10px; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10.5px 13px;
  border-radius: 10px;
  color: var(--sidebar-text);
  cursor: pointer;
  margin-bottom: 3px;
  font-weight: 500;
  font-size: 13.5px;
  transition: background 0.16s, color 0.16s, transform 0.1s;
  user-select: none;
  position: relative;
}
.nav-item:hover { background: var(--sidebar-hover); color: var(--sidebar-text-strong); }
.nav-item:active { transform: scale(0.985); }
.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(224, 78, 10, 0.4);
}
.nav-icon { font-size: 16px; width: 22px; text-align: center; }
.sidebar-foot {
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.side-btn {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--sidebar-text);
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
}
.side-btn:hover { color: var(--sidebar-text-strong); background: rgba(255, 255, 255, 0.09); }

/* ---------- 主区域 ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 62px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar h1 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar h1::before {
  content: "";
  width: 4px; height: 18px;
  border-radius: 4px;
  background: linear-gradient(180deg, #f2661d, #ff9440);
  display: inline-block;
}
.icon-btn {
  border: none; background: transparent; font-size: 20px; cursor: pointer;
  color: var(--muted); display: none;
  transition: transform 0.12s;
}
.icon-btn:hover { transform: scale(1.12); }
.today { color: var(--muted); font-size: 12.5px; }
.content { padding: 26px 28px 48px; flex: 1; overflow-y: auto; max-width: 1440px; width: 100%; margin: 0 auto; }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.card-title {
  font-size: 15px; font-weight: 700; margin-bottom: 15px;
  display: flex; align-items: center; justify-content: space-between;
}

.btn {
  border: none; border-radius: 10px; padding: 9px 17px; cursor: pointer;
  font-size: 13px; font-weight: 600; font-family: inherit;
  transition: filter 0.15s, background 0.15s, transform 0.1s, box-shadow 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, #f2661d, #e04e0a);
  color: #fff;
  box-shadow: 0 3px 10px rgba(224, 78, 10, 0.28);
}
.btn-primary:hover { filter: brightness(1.07); box-shadow: 0 5px 14px rgba(224, 78, 10, 0.35); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.btn-ghost:hover { border-color: #b9b2a3; background: var(--surface-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #f9d9d9; }
.btn-warning { background: #fdf3d9; color: #96690a; border: 1px solid #efd990; }
.btn-warning:hover { background: #fbeab5; }
.form-section-title { font-weight: 600; font-size: 14px; color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 44px 0; font-size: 13.5px; }
.tag {
  display: inline-block; padding: 2.5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
  background: var(--primary-soft); color: var(--primary-dark);
}
.tag.green { background: var(--success-soft); color: var(--success); }
.tag.orange { background: var(--warning-soft); color: var(--warning); }
.tag.red { background: var(--danger-soft); color: var(--danger); }
.tag.gray { background: var(--surface-2); color: var(--muted); }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--border); }
.table th {
  color: var(--muted); font-weight: 600;
  background: var(--surface-2);
  position: sticky; top: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.table tr:hover td { background: #faf8f4; }
.table td.total { font-weight: 700; background: var(--surface-2); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table-wrap .table { border-collapse: separate; border-spacing: 0; }
.table-wrap .table th, .table-wrap .table td { border-bottom: 1px solid var(--border); }
.table-wrap .table tr:last-child td { border-bottom: none; }

/* 表单 */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 9.5px 12px; border: 1px solid var(--border-strong);
  border-radius: 10px; font-size: 14px; font-family: inherit; background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3.5px var(--primary-glow);
}
.form-row textarea { min-height: 80px; resize: vertical; }
.form-row input.invalid, .form-row select.invalid { border-color: var(--danger); }

/* 表单分节（偏好设置里的「视觉模型」块等） */
.form-section { margin: 20px 0 14px; padding-top: 16px; border-top: 1px dashed var(--border-strong); font-size: 13px; font-weight: 700; color: var(--text); }
.form-section:first-child, .form-section.first { margin-top: 0; padding-top: 0; border-top: 0; }
.form-section .form-section-hint { display: block; margin-top: 4px; font-size: 11.5px; font-weight: 400; line-height: 1.6; color: var(--muted); }
.form-row .form-hint { margin: -1px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.form-row .form-hint code { padding: 1px 5px; font-size: 11px; background: var(--surface-2); border-radius: 4px; }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

/* 模态框 */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(24, 19, 14, 0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
  animation: fadeIn 0.16s ease;
}
.modal {
  background: var(--surface); border-radius: 18px; width: 100%; max-width: 480px;
  max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 70px rgba(24, 19, 14, 0.3);
  animation: popIn 0.2s cubic-bezier(0.2, 0.9, 0.35, 1.2);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 16px;
}
.modal-close {
  border: none; background: transparent; font-size: 22px; cursor: pointer;
  color: var(--muted); line-height: 1;
  width: 32px; height: 32px; border-radius: 50%;
  transition: background 0.15s;
}
.modal-close:hover { background: var(--bg-hover); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: none; } }

/* Toast */
#toast-root { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: #292524; color: #fff; padding: 11px 17px; border-radius: 11px;
  font-size: 13px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  animation: slideIn 0.22s ease;
  max-width: 320px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* 仪表盘 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 19px 21px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3.5px;
  background: linear-gradient(180deg, #f2661d, #ff9440);
  opacity: 0.85;
}
.stat .num {
  font-size: 30px; font-weight: 800;
  background: linear-gradient(135deg, #d9530f, #f28c4a);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat .label { color: var(--muted); font-size: 12.5px; margin-top: 4px; font-weight: 500; }
.stat .ico {
  font-size: 21px; float: right; opacity: 0.85;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); border-radius: 12px;
  box-sizing: border-box;
}
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .dash-cols { grid-template-columns: 1fr; } }

/* 课程表网格 */
.tt-grid { display: grid; gap: 7px; }
.tt-cell {
  border: 1px solid var(--border); border-radius: 10px; min-height: 58px; padding: 7px 9px;
  background: var(--surface); cursor: pointer; font-size: 12px; overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tt-cell.head {
  background: var(--surface-2); font-weight: 700; text-align: center; cursor: default;
  color: var(--muted); font-size: 12px; letter-spacing: 0.5px;
}
.tt-cell.empty-cell {
  background: var(--surface-2); border-style: dashed; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.tt-cell:hover:not(.head) { border-color: var(--primary); box-shadow: 0 3px 10px var(--primary-glow); }
.tt-cell .subj { font-weight: 700; color: var(--primary-dark); }
.tt-cell .meta { color: var(--muted); }
.tt-cell.odd { background: #fff; }
.tt-cell.even { background: #fdf9f4; }

/* 段标题 */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 15px; }
.section-head h2 { font-size: 16px; }

/* 列表卡片(作业/资料) */
.list-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 17px 18px;
  margin-bottom: 12px; background: var(--surface); box-shadow: var(--shadow);
  transition: transform 0.14s, box-shadow 0.14s;
}
.list-card:hover { transform: translateY(-1.5px); box-shadow: var(--shadow-lg); }
.list-card.done { opacity: 0.6; }
.list-card.overdue { border-color: var(--danger); }
.list-card .lc-title { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.list-card .lc-meta { color: var(--muted); font-size: 12px; margin-bottom: 8px; }

/* 考勤 */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.att-stu {
  border: 1.5px solid var(--border); border-radius: 12px; padding: 11px 13px; cursor: pointer;
  background: var(--surface);
  transition: border-color 0.13s, background 0.13s, transform 0.1s;
}
.att-stu:hover { border-color: var(--border-strong); }
.att-stu:active { transform: scale(0.98); }
.att-stu .nm { font-weight: 600; }
.att-stu.sel-present { border-color: var(--success); background: var(--success-soft); }
.att-stu.sel-late { border-color: var(--warning); background: var(--warning-soft); }
.att-stu.sel-leave { border-color: var(--primary); background: var(--primary-soft); }
.att-stu.sel-absent { border-color: var(--danger); background: var(--danger-soft); }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.bar-label { width: 90px; color: var(--muted); font-size: 12px; }
.bar-track { flex: 1; background: var(--surface-2); border-radius: 6px; height: 18px; overflow: hidden; }
.bar-fill {
  height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, #f2661d, #ff9440);
  transition: width 0.35s ease;
}
.bar-val { width: 70px; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  .sidebar { position: fixed; left: -250px; z-index: 50; transition: left 0.22s; box-shadow: 0 0 46px rgba(0, 0, 0, 0.28); }
  .sidebar.open { left: 0; }
  .icon-btn { display: block; }
  .content { padding: 18px 16px 40px; }
}
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 17px; }
.input, select.input {
  padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 10px;
  font-size: 13px; background: var(--surface); font-family: inherit; color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

/* AI 备课 */
.btn-ai { background: linear-gradient(135deg, #8b5cf6, #6d4df0); color: #fff; box-shadow: 0 3px 10px rgba(109, 77, 240, 0.28); }
.btn-ai:hover { filter: brightness(1.07); }
.ai-result {
  margin-top: 14px; padding: 15px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface-2); color: var(--text);
  font-size: 13px; line-height: 1.75; white-space: pre-wrap;
  max-height: 460px; overflow-y: auto;
}
.ai-preview-hint { font-size: 12.5px; color: var(--primary-dark); margin-bottom: 8px; font-weight: 600; }
.ai-raw { font-family: inherit; white-space: pre-wrap; }
.ai-result-scroll { overflow-x: auto; }
.ai-result .lesson5-template { background: var(--surface); }
.ai-result .l5-section { margin-bottom: 12px; }
.ai-result .l5-textarea-sm, .ai-result .l5-input { pointer-events: none; background: var(--surface-2); color: var(--text); resize: none; }

/* ---------- 幻灯片放映(PPT 模式) ---------- */
.slideshow {
  position: fixed; inset: 0; z-index: 2000; background: #0f0d0b; color: #e7e2d9;
  display: flex; align-items: center; justify-content: center; overflow: hidden; font-family: inherit;
}
.ss-title { position: absolute; top: 18px; left: 24px; font-size: 14px; color: #97907f; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-close { position: absolute; top: 14px; right: 18px; background: rgba(255, 255, 255, .1); border: none; color: #e7e2d9; font-size: 20px; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; line-height: 1; }
.ss-close:hover { background: rgba(255, 255, 255, .22); }
.ss-index { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); font-size: 13px; color: #97907f; }
.ss-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, .08); border: none; color: #e7e2d9; font-size: 40px; width: 60px; height: 96px; cursor: pointer; border-radius: 12px; line-height: 1; }
.ss-nav:hover:not(:disabled) { background: rgba(255, 255, 255, .2); }
.ss-prev { left: 16px; } .ss-next { right: 16px; }
.ss-nav:disabled { opacity: .25; cursor: default; }
.ss-slide { max-width: 920px; width: 78%; max-height: 80%; padding: 40px; overflow: auto; }
.ss-h { font-size: 34px; margin: 0 0 26px; color: #fff; font-weight: 700; line-height: 1.3; }
.ss-body { font-size: 22px; line-height: 1.75; white-space: normal; }

/* ============ 资料详情面板 ============ */
.res-card { transition: box-shadow 0.15s, transform 0.12s; }
.res-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.btn-accent { background: linear-gradient(135deg, #e8743b, #d9530f); color: #fff; }
.btn-accent:hover { filter: brightness(1.07); }

.resource-detail { padding: 0 !important; overflow: hidden; }
.rd-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.rd-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--muted); width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.rd-close:hover { background: var(--bg-hover); color: var(--text); }

.rd-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); flex-shrink: 0; background: var(--surface-2); }
.rd-tab { padding: 11px 21px; border: none; background: none; cursor: pointer; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; transition: all 0.15s; font-family: inherit; }
.rd-tab:hover { color: var(--text); background: var(--bg-hover); }
.rd-tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); font-weight: 600; }

.rd-body { padding: 20px 24px; min-height: 300px; }
.rd-content pre { margin: 0; }

/* 导出面板 */
.rd-export h3 { margin: 0 0 16px; font-size: 17px; }
.export-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.export-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2);
  transition: border-color 0.15s, background 0.15s;
}
.export-item:hover { border-color: var(--primary); background: var(--primary-soft); }
.export-icon { font-size: 28px; flex-shrink: 0; }
.export-info { flex: 1; min-width: 0; }
.export-info b { display: block; font-size: 14px; margin-bottom: 2px; }
.export-info p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.4; }

/* 内嵌幻灯片预览 */
.es-viewer { display: flex; flex-direction: column; height: 100%; min-height: 380px; }
.es-slide {
  flex: 1; background: linear-gradient(135deg, #221d18, #12100d);
  border-radius: 12px; padding: 36px 40px; overflow: auto; color: #e7e2d9; min-height: 320px;
}
.es-h { font-size: 26px; margin: 0 0 18px; color: #fff; font-weight: 700; line-height: 1.35; }
.es-body { font-size: 17px; line-height: 1.75; white-space: normal; }
.es-ctrl { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 0 4px; }
.es-btn { padding: 7px 16px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 9px; cursor: pointer; font-size: 13px; color: var(--text); transition: all 0.12s; font-family: inherit; }
.es-btn:hover:not(:disabled) { background: var(--primary); color: #fff; border-color: var(--primary); }
.es-btn:disabled { opacity: .35; cursor: default; }
.es-idx { font-size: 13px; color: var(--muted); min-width: 60px; text-align: center; }
.es-fs { margin-left: auto; }

/* 批量生成进度 */
.batch-prog { border: 1px solid var(--border); border-radius: 12px; padding: 15px; background: var(--surface-2); }
.prog-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.prog-fill { height: 100%; background: linear-gradient(90deg, #f2661d, #ff9440); border-radius: 4px; transition: width 0.3s; width: 0%; }
.prog-text { font-size: 13px; color: var(--muted); margin-top: 7px; text-align: center; }
.prog-log { max-height: 160px; overflow-y: auto; margin-top: 8px; font-size: 12px; line-height: 1.6; }

/* ---- 多用户：顶栏用户名 / 资料库分段 / 用户管理 ---- */
.user-name {
  font-size: 13px; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 4px 12px; border-radius: 20px; margin-right: 4px;
  max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.seg-bar { display: flex; gap: 8px; margin-bottom: 15px; }
.seg {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted);
  padding: 7.5px 18px; border-radius: 999px; cursor: pointer; font-size: 13.5px;
  transition: all 0.15s; font-family: inherit; font-weight: 500;
}
.seg:hover { border-color: var(--primary); color: var(--primary-dark); }
.seg.active {
  background: linear-gradient(135deg, #f2661d, #e04e0a); border-color: transparent; color: #fff;
  box-shadow: 0 3px 10px rgba(224, 78, 10, 0.3);
}
.tag-shared { background: #fdeee2; color: #c2410c; border: 1px solid #f6d3ba; }
.rd-head-actions { display: flex; align-items: center; gap: 10px; }
.rd-head-actions .rd-close { margin-left: 0; }
.user-list { display: flex; flex-direction: column; gap: 10px; }
.user-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 15px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  transition: box-shadow 0.14s;
}
.user-row:hover { box-shadow: var(--shadow); }
.user-info { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.tag-danger { background: #fdecec; color: #dd4343; border: 1px solid #f5c6c6; }

/* ---- 五全教案表格模板 ---- */
.lesson5-template { padding: 4px 0; }
.l5-header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; padding: 11px 15px; background: var(--surface-2); border-radius: 10px; font-size: 14px; }
.l5-header span { color: var(--muted); font-size: 13px; }
.l5-section { margin-bottom: 18px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.l5-section-title {
  font-weight: bold; font-size: 14.5px; padding: 11px 15px;
  background: linear-gradient(135deg, #fdeee2, #fef6ee);
  border-bottom: 1px solid var(--border); color: var(--primary-deep);
  letter-spacing: 0.4px;
}
.l5-subtitle { font-size: 13px; color: var(--muted); padding: 9px 15px 4px; font-style: italic; }
.l5-row { display: flex; flex-direction: column; padding: 9px 15px; gap: 6px; border-bottom: 1px solid #f2efe9; }
.l5-row:last-child { border-bottom: none; }
.l5-label { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.6; }
.l5-label-block { margin-bottom: 4px; }
.l5-input {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: 8px;
  font-size: 13.5px; font-family: inherit; background: #fdfcfa;
  transition: border-color 0.2s; box-sizing: border-box; min-height: 36px;
}
.l5-input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-glow); }
.l5-textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: 8px;
  font-size: 13.5px; font-family: inherit; background: #fdfcfa; resize: vertical;
  min-height: 72px; line-height: 1.7; box-sizing: border-box; transition: border-color 0.2s;
}
.l5-textarea:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-glow); }
.l5-sm { width: auto; min-width: 100px; max-width: 160px; }
.l5-fields-nested { display: flex; flex-direction: column; gap: 8px; padding-left: 8px; }
.l5-nested-item { display: flex; align-items: flex-start; gap: 8px; }
.l5-nested-label { font-size: 13px; font-weight: 600; color: var(--primary-dark); white-space: nowrap; min-width: 150px; padding-top: 7px; }
.l5-textarea-sm {
  flex: 1; padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: 8px;
  font-size: 13px; font-family: inherit; background: #fdfcfa; resize: vertical;
  min-height: 48px; line-height: 1.6; box-sizing: border-box; transition: border-color 0.2s;
}
.l5-textarea-sm:focus { outline: none; border-color: var(--primary); background: #fff; }

/* ---- AI 双师协同教学（测试版） ---- */
.dual-wrap { max-width: 1000px; margin: 0 auto; }
.dual-scenes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.dual-scenes .btn { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.dual-scenes .btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.dual-scenes .btn.active { background: linear-gradient(135deg, #f2661d, #e04e0a); color: #fff; border-color: transparent; }
.dual-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 860px) { .dual-grid { grid-template-columns: 1fr; } }

/* ============================================================
   2026-09-10 新增：注册提示 / 学校总览 / 意见箱
   ============================================================ */

/* ---- 注册表单动态提示 ---- */
.reg-hint {
  margin-top: 4px; padding: 9px 12px; font-size: 12.5px; line-height: 1.6;
  background: var(--primary-soft); color: var(--primary-deep);
  border-radius: var(--radius-sm); border-left: 3px solid var(--primary);
}

/* ---- 通用提示条 ---- */
.notice {
  padding: 12px 15px; margin-bottom: 16px; font-size: 13px; line-height: 1.65;
  background: var(--warning-soft); color: #8a5a10;
  border: 1px solid #f0e0bd; border-radius: var(--radius-sm);
  border-left: 3px solid var(--warning);
}

/* 仪表盘顶部的「可见范围」提示条：一行放不下时自动换行，按钮贴右 */
.scope-tip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.scope-tip .tag { flex: 0 0 auto; }

/* ---- 侧栏红点 ---- */
.side-btn { position: relative; }.dot-badge {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--sidebar-bg-2);
}

/* ---- 意见箱 ---- */
.fb-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.fb-wrap { width: 100%; }
.fb-tip {
  margin-top: 12px; padding: 10px 13px; font-size: 12.5px; line-height: 1.65;
  background: var(--surface-2); color: var(--muted); border-radius: var(--radius-sm);
}
.fb-err { min-height: 18px; margin-top: 6px; font-size: 13px; color: var(--danger); }

.fb-item {
  padding: 14px 16px; margin-bottom: 12px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.fb-item.has-reply { border-left: 3px solid var(--success); }
.fb-item-head { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 7px; }
.fb-item-title { font-size: 14px; font-weight: 700; }
.fb-item-body {
  font-size: 13px; line-height: 1.7; color: #4a443d;
  white-space: pre-wrap; word-break: break-word;
}
.fb-reply {
  margin-top: 11px; padding: 11px 13px; border-radius: var(--radius-sm);
  background: var(--success-soft); border-left: 3px solid var(--success);
  font-size: 13px; line-height: 1.7; color: #26503c;
}
.fb-reply-head { font-size: 12px; font-weight: 700; color: var(--success); margin-bottom: 5px; }

/* ---- 学校总览 ---- */
.toolbar .muted { font-size: 12.5px; }

/* ============================================================
   通用 AI 助手（悬浮按钮 + 抽屉 + 整页对话）
   ============================================================ */
.ai-fab {
  position: fixed; right: 26px; bottom: 26px; z-index: 900;
  width: 56px; height: 56px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, #f2661d, #e04e0a);
  color: #fff; font-size: 24px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(242, 102, 29, 0.42);
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.ai-fab:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 10px 26px rgba(242, 102, 29, 0.5); }
.ai-fab.hidden { opacity: 0; pointer-events: none; transform: scale(.6); }

.ai-drawer {
  position: fixed; right: 22px; bottom: 22px; z-index: 901;
  width: 420px; max-width: calc(100vw - 32px); height: 620px; max-height: calc(100vh - 44px);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(16px) scale(.97); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.ai-drawer.open { opacity: 1; transform: none; pointer-events: auto; }
.ai-drawer-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 600;
}

.chat-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.chat-panel.compact { padding: 0; }
.chat-list {
  flex: 1; min-height: 0; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.chat-msg { display: flex; gap: 8px; align-items: flex-start; }
.chat-msg.me { flex-direction: row-reverse; }
.chat-avatar {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; background: var(--primary-soft); color: var(--primary-deep);
}
.chat-msg.me .chat-avatar { background: var(--surface-2); color: var(--muted); }
.chat-bubble {
  max-width: 78%; padding: 10px 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 14px; line-height: 1.72; word-break: break-word;
}
.chat-msg.me .chat-bubble {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.chat-welcome { padding: 4px 2px; }
.chat-typing { color: var(--muted); font-size: 13px; }
.chat-err { color: var(--danger); font-size: 13px; }
.chat-demo {
  margin-top: 8px; padding: 5px 8px; border-radius: 8px;
  background: var(--warning-soft); color: var(--warning);
  font-size: 12px; display: inline-block;
}
.ai-h { font-weight: 700; margin: 8px 0 4px; color: var(--text); }
.ai-p { margin: 4px 0; }
.ai-li { margin: 2px 0 2px 4px; }
.ai-code {
  background: #2c2825; color: #f0ebe4; padding: 10px 12px;
  border-radius: 10px; overflow-x: auto; margin: 6px 0;
  font-size: 12.5px; font-family: Consolas, Menlo, monospace;
}
.chat-quick {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px;
}
.chip {
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--muted); border-radius: 999px; padding: 5px 11px;
  font-size: 12px; cursor: pointer; transition: all .15s ease;
}
.chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.chat-compose { padding: 10px 14px 14px; border-top: 1px solid var(--border); }
.chat-input {
  width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 9px 11px; font-size: 14px; font-family: inherit; resize: none;
  background: var(--surface); color: var(--text);
}
.chat-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.chat-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }

@media (max-width: 720px) {
  .ai-drawer { right: 8px; left: 8px; bottom: 8px; width: auto; height: 78vh; }
  .ai-fab { right: 16px; bottom: 16px; }
}
