/* AI 智能体教学平台 —— 暖象牙主题 */
:root {
  --blue: #b0682f;
  --blue-dark: #8e5324;
  --blue-deep: #f5f1e8;
  --blue-light: rgba(176,104,47,.08);
  --blue-border: rgba(176,104,47,.22);
  --accent: #b0682f;
  --accent-dark: #8e5324;
  --text: #3d392f;
  --muted: #9b9385;
  --bg: #f5f1e8;
  --card: #ffffff;
  --line: rgba(0,0,0,.07);
  --green: #5b8c3e;
  --amber: #c9872b;
  --red: #d14545;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--blue); text-decoration: none; }
button { font-family: inherit; }

/* ---------- 布局：侧边栏 + 内容 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 10; }
.sidebar .logo { padding: 22px 20px 14px; border-bottom: 1px solid var(--line); }
.sidebar .logo h1 { font-size: 17px; color: var(--blue); letter-spacing: 1px; }
.sidebar .logo .sub { font-size: 11px; color: var(--muted); margin-top: 6px; letter-spacing: 2px; }
.sidebar nav { flex: 1; padding: 14px 10px; }
.sidebar nav .nav-label { font-size: 11px; color: var(--muted); letter-spacing: 2px; padding: 0 10px 8px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 8px;
  color: var(--text); font-size: 14px; margin-bottom: 4px; cursor: pointer; }
.sidebar nav a .idx { margin-left: auto; font-size: 11px; color: var(--muted); }
.sidebar nav a .nav-ico {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 15px; margin-right: 0;
}
.sidebar nav a:hover { background: var(--blue-light); }
.sidebar nav a.active { background: linear-gradient(135deg, var(--blue), var(--blue-dark)); color: #fff; font-weight: 600; }
.sidebar nav a.active .idx { color: rgba(255,255,255,.6); }

/* 二级菜单：组织架构 */
.sidebar nav .nav-group-toggle { cursor: pointer; user-select: none; }
.sidebar nav .nav-group-toggle .nav-arrow {
  margin-left: auto;
  font-size: 11px;
  transition: transform .2s ease;
  color: var(--muted);
}
.sidebar nav .nav-group-toggle.expanded .nav-arrow { transform: rotate(180deg); }
.sidebar nav .nav-sub {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
  margin: 2px 0 0 0;
  border-left: 1px dashed rgba(60,90,180,.25);
  margin-left: 22px;
}
.sidebar nav .nav-sub.expanded { max-height: 320px; }
.sidebar nav .nav-sub a { padding: 9px 12px; font-size: 13px; color: var(--muted); }
.sidebar nav .nav-sub a.active { color: #fff; }
.sidebar nav .nav-sub a:hover { color: var(--blue-dark); }
.sidebar .side-foot { margin: 12px 12px 0; background: var(--blue-light); border: 1px solid var(--blue-border); border-radius: 10px; padding: 12px 14px; cursor: default; }
.sidebar .side-icp { display: flex; justify-content: center; padding: 8px 12px 10px; font-size: 11px; }
.sidebar .side-foot b { font-size: 12px; color: var(--blue); }
.sidebar .side-foot p { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.sidebar .side-foot a { cursor: pointer; }

.main { flex: 1; margin-left: 220px; display: flex; flex-direction: column; }
.topbar { background: var(--card); border-bottom: 1px solid var(--line); padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; }
.topbar .crumb { font-size: 11px; color: var(--muted); letter-spacing: 2px; }
.topbar h2 { font-size: 18px; margin-top: 2px; }
.topbar .right { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.user-hover { position: relative; }
.user-pop { position: absolute; top: 100%; right: 0; margin-top: 6px; min-width: 120px;
  background: var(--card); border: 1px solid var(--blue-border); border-radius: 10px; padding: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.3); display: none; z-index: 100; }
.user-pop.show { display: block; }
.user-pop::before { content: ''; position: absolute; top: -6px; right: 16px; width: 10px; height: 10px;
  background: var(--card); border-left: 1px solid var(--blue-border); border-top: 1px solid var(--blue-border);
  transform: rotate(45deg); }
.role-switch { display: flex; background: var(--blue-light); border-radius: 8px; padding: 3px; }
.role-switch span { padding: 5px 14px; border-radius: 6px; font-size: 12px; color: var(--muted); }
.role-switch span.on { background: var(--blue); color: #fff; font-weight: 600; }
.content { padding: 24px 28px 40px; flex: 1; }

/* ---------- 通用组件 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 18px; }
.card h3 { font-size: 15px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card h3::before { content: ""; width: 4px; height: 14px; background: var(--blue); border-radius: 2px; }
.sec-title { font-size: 11px; color: var(--muted); letter-spacing: 2px; margin-bottom: 4px; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; }
.sec-head h2 { font-size: 20px; }
/* 统一文件选择按钮样式 */
input[type="file"] {
  color: var(--muted); font-size: 12px; flex: 1;
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  padding: 5px 8px; cursor: pointer;
}
input[type="file"]::file-selector-button {
  background: var(--blue); color: #fff; border: none; border-radius: 4px;
  padding: 4px 12px; font-size: 12px; font-weight: 600; cursor: pointer; margin-right: 8px;
}
input[type="file"]::file-selector-button:hover { background: var(--blue-dark); }

.btn { display: inline-block; padding: 9px 18px; border: none; border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark)); color: #fff; font-size: 13px; cursor: pointer; font-weight: 600; }
.btn:hover { box-shadow: 0 0 16px rgba(176,104,47,.3); }
.btn:disabled { background: #d9d4c8; color: var(--muted); cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--blue); border: 1px solid var(--blue-border); }
.btn.ghost:hover { background: var(--blue-light); }
.btn.danger { background: transparent; color: var(--red); border: 1px solid rgba(209,69,69,.3); }
.btn.small { padding: 5px 12px; font-size: 12px; }

input[type=text], input[type=password], textarea, select, input[type=number] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--blue-border); border-radius: 8px;
  font-size: 13px; font-family: inherit; outline: none; background: var(--bg); color: var(--text); }
input:focus, input[type=password]:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(176,104,47,.12); }
textarea { resize: vertical; min-height: 80px; }

.tag { display: inline-block; padding: 2px 9px; border-radius: 5px; font-size: 12px; background: var(--blue-light); color: var(--blue); }
.tag.pub { background: rgba(34,197,94,.1); color: var(--green); }
.tag.draft { background: rgba(245,158,11,.1); color: var(--amber); }
.tag.major { background: var(--blue-light); color: var(--blue); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 12px; letter-spacing: 1px; }
tr:hover td { background: var(--blue-light); }

/* ---------- 学习流程 ---------- */
.flow-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.flow-step { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: var(--blue-light); }
.flow-step .no { font-family: Consolas, monospace; color: var(--blue); font-size: 13px; }
.flow-step b { display: block; font-size: 14px; margin: 6px 0; }
.flow-step p { font-size: 12px; color: var(--muted); line-height: 1.7; }

/* ---------- 统计卡 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.stat .num { font-size: 30px; font-weight: 700; color: var(--blue); }
.stat .label { font-size: 13px; margin-top: 4px; }
.stat .sub { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ---------- 专业 chips / 搜索栏 ---------- */
.term-chips { display: flex; gap: 6px; flex-wrap: nowrap; padding: 8px 12px 12px; align-items: center; position: relative;
  border-bottom: 1px dashed var(--blue-border); overflow-x: auto; white-space: nowrap; }
.term-chips::-webkit-scrollbar { height: 6px; }
.term-chips::-webkit-scrollbar-thumb { background: var(--blue-border); border-radius: 3px; }
.term-chips::-webkit-scrollbar-track { background: transparent; }
.term-chips:last-child { border-bottom: none; }
.term-chips .term-label { font-size: 11px; color: #fff; background: var(--blue);
  border: 1px solid var(--blue-dark); border-radius: 5px; padding: 3px 9px; letter-spacing: 1px; font-weight: 600;
  flex-shrink: 0; }
.term-chips button { background: var(--bg); border: 1px dashed var(--blue-border); color: var(--blue);
  border-radius: 14px; padding: 4px 12px; font-size: 12px; cursor: pointer; flex-shrink: 0; }
.term-chips button:hover { background: var(--blue-light); border-style: solid; }
.term-chips .term-toggle { font-size: 11px; color: var(--blue); cursor: pointer; padding: 2px 8px;
  border: 1px solid var(--blue-border); border-radius: 10px; background: var(--bg); white-space: nowrap; }
.term-chips .term-toggle:hover { background: var(--blue-light); }
.term-chips .term-extra { display: none; }
.term-chips.open .term-extra { display: inline-flex; }
/* 分组折叠：默认只显示第1个分类 */
.term-extra-group { display: none; }
.term-group-wrap.open .term-extra-group { display: flex; }
/* 分组展开/收起按钮 */
.term-group-toggle { font-size: 12px; color: var(--blue); cursor: pointer; padding: 4px 12px;
  border: 1px solid var(--blue-border); border-radius: 8px; background: var(--bg); display: inline-block; }
.term-group-toggle:hover { background: var(--blue-light); }
.lib-toolbar { margin-bottom: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lib-toolbar input { flex: 1; max-width: 420px; }

/* ---------- 课程卡片 ---------- */
.course-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.course-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  cursor: pointer; transition: .2s; }
.course-card:hover { border-color: var(--blue); box-shadow: 0 4px 20px rgba(176,104,47,.15); transform: translateY(-2px); }
.course-card .cover { height: 90px; background: linear-gradient(135deg, var(--blue-deep), #ebe5d5);
  display: flex; align-items: center; justify-content: center; color: var(--blue); font-size: 16px; letter-spacing: 2px; position: relative; }
.course-card .cover.img { background: var(--bg); height: auto; aspect-ratio: 1 / 1; }
.course-card .cover.img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.course-card .cover .cover-major { position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.65); backdrop-filter: blur(6px);
  color: #fff; font-size: 11px; letter-spacing: 1px; border-radius: 5px; padding: 2px 8px; }
.cover-prev { width: 56px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--blue-border); }
.course-card .body { padding: 10px 12px; }
.course-card .body b { font-size: 13px; display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.course-card .desc { font-size: 11px; color: var(--muted); margin: 4px 0 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-card .meta { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--muted); gap: 6px; }
.course-card .meta .hint { font-size: 10px; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.skill-tags .tag { font-family: Consolas, monospace; font-size: 10px; padding: 1px 6px; }

/* ---------- 对话区 ---------- */
.chat-wrap { display: grid; grid-template-columns: 1fr 4px 420px; gap: 0; align-items: start; }
.chat-wrap > div:nth-child(1) { padding-right: 9px; }
.chat-wrap > div:nth-child(3) { padding-left: 9px; }
.chat-resizer { width: 4px; cursor: col-resize; background: transparent; position: relative; z-index: 5; flex-shrink: 0; }
.chat-resizer::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 4px; height: 40px; background: var(--line); border-radius: 2px; transition: background .2s; }
.chat-resizer:hover::after, .chat-resizer.dragging::after { background: var(--blue); }
.chat-box { background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  display: flex; flex-direction: column; height: calc(100vh - 100px); min-height: 480px; }
.chat-list { flex: 1; overflow-y: auto; padding: 18px; scrollbar-width: none; -ms-overflow-style: none; }
.chat-list::-webkit-scrollbar { display: none; }
.msg { margin-bottom: 14px; display: flex; }
.msg .bubble { max-width: 86%; padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.8; }
.msg.ai .bubble { background: var(--bg); color: var(--text); border: 1px solid var(--blue-border); border-top-left-radius: 2px; }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: var(--blue-light); color: var(--blue); border-top-right-radius: 2px; }
.chat-input { border-top: 1px solid var(--line); padding: 12px; }
.chat-bar { position: relative; }
.chat-bar textarea {
  display: block; width: 100%; resize: vertical; min-height: 80px; padding: 10px 14px; padding-bottom: 44px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); font-size: 13px; font-family: inherit; line-height: 1.6;
}
.chat-bar textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue-border); }
.chat-bar .btn { position: absolute; right: 5px; bottom: 5px; padding: 6px 16px; }

/* 折叠分组 */
.qs-group { width: 100%; margin-bottom: 6px; }
.qs-head { font-size: 13px; color: var(--text); cursor: pointer; padding: 8px 12px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; user-select: none; }
.qs-head:hover { border-color: var(--blue-border); }
.qs-arrow { display: inline-block; transition: transform .2s; margin-right: 6px; font-size: 11px; color: var(--blue); }
.qs-group.open .qs-arrow { transform: rotate(90deg); }
.qs-body { display: none; flex-wrap: wrap; gap: 6px; padding: 10px 12px 4px; }
.qs-group.open .qs-body { display: flex; }

/* ---------- 专业卡片 ---------- */
.major-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.major-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; cursor: pointer; transition: all .2s; }
.major-card:hover { border-color: var(--blue); box-shadow: 0 4px 20px rgba(176,104,47,.15); transform: translateY(-2px); }
.major-card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; }
.major-card .mc-body { padding: 12px 14px; }
.major-card .mc-body h3 { font-size: 15px; color: var(--text); margin-bottom: 4px; }
.major-card .mc-body p { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ---------- 气泡 loading / 思考内容 ---------- */
.loading-dots { display: inline-flex; gap: 4px; align-items: center; padding: 2px 0; }
.loading-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted);
  animation: dotBlink 1s infinite ease-in-out; }
.loading-dots i:nth-child(2) { animation-delay: .2s; }
.loading-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes dotBlink { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
.msg .bubble .think { font-size: 12px; line-height: 1.7; color: var(--muted);
  border-left: 2px solid var(--blue-border); padding-left: 8px; margin-bottom: 8px;
  max-height: 150px; overflow-y: auto; white-space: pre-wrap; word-break: break-all; }
.msg .bubble .think b { display: block; margin-bottom: 4px; color: var(--muted); letter-spacing: 1px; }

/* ---------- 结构预览 ---------- */
.preview { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px;
  max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.preview::-webkit-scrollbar { display: none; }
.mod { margin-bottom: 16px; }
.mod h4 { font-size: 13px; color: var(--blue); margin-bottom: 8px; letter-spacing: 1px; }
.mod .item { display: flex; gap: 10px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; margin-bottom: 6px; font-size: 12px; background: var(--blue-light); }
.mod .item .no { color: var(--blue); font-family: Consolas, monospace; flex-shrink: 0; }
.mod .item .score { color: var(--amber); font-weight: 600; flex-shrink: 0; }
.empty-tip { text-align: center; color: var(--muted); font-size: 12px; padding: 40px 10px; line-height: 2; }

/* ---------- 模板库 ---------- */
.tpl-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tpl-tabs button { border: 1px solid var(--blue-border); background: var(--bg); color: var(--muted);
  border-radius: 6px; padding: 4px 12px; font-size: 12px; cursor: pointer; }
.tpl-tabs button.on { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 600; }
.tpl-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; cursor: pointer; font-size: 12px; }
.tpl-item:hover { border-color: var(--blue); background: var(--blue-light); }
.tpl-item .code { font-family: Consolas, monospace; color: var(--blue); }
.tpl-item .plus { color: var(--blue); font-size: 14px; }
.tpl-fold-head { padding: 8px 10px; font-size: 12px; color: var(--muted); cursor: pointer; border: 1px dashed var(--line); border-radius: 8px; margin-top: 8px; }
.tpl-fold-head:hover { color: var(--blue); border-color: var(--blue-border); }
.tpl-fold-head .fold-arrow { display: inline-block; margin-right: 4px; }
.tpl-fold-body { margin-top: 4px; }
.skill-picker-list { display: flex; flex-direction: column; gap: 8px; }
.skill-picker-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 13px; position: relative; }
.skill-picker-item[data-tooltip]:hover::after {
  content: attr(data-tooltip); position: absolute; left: 50%; bottom: calc(100% + 6px);
  transform: translateX(-50%); background: #000; color: #fff; padding: 6px 12px;
  border-radius: 6px; font-size: 12px; white-space: pre-wrap; max-width: 360px;
  z-index: 100; pointer-events: none; line-height: 1.6;
}
.skill-picker-item:hover { border-color: var(--blue-border); background: var(--blue-light); }
.skill-picker-item input { margin: 0; }
.skill-picker-item .code { font-family: Consolas, monospace; color: var(--blue); font-size: 12px; }
.skill-picker-item .name { color: var(--text); }
.skill-picker-item .hint { color: var(--muted); font-size: 12px; margin-left: auto; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(4px); display: none;
  align-items: center; justify-content: center; z-index: 1000; overflow-y: auto; padding: 24px 16px; }
.modal-mask.show { display: flex; }
.modal { background: var(--card); border: 1px solid var(--blue-border); border-radius: 14px; width: 50vw; min-width: 360px; max-width: 96vw; max-height: 88vh; overflow: hidden; box-shadow: 0 8px 40px rgba(0,0,0,.12); animation: modalIn .18s ease; }
.modal.modal-fullscreen { width: 96vw; max-width: 96vw; height: 92vh; max-height: 92vh; }
@keyframes modalIn { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal .modal-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 28px; border-bottom: 1px solid var(--line); }
.modal .modal-head h3 { font-size: 16px; }
.modal-body { padding: 24px 28px; overflow-y: auto; max-height: calc(88vh - 120px); scrollbar-width: none; -ms-overflow-style: none; }
.modal.modal-fullscreen .modal-body { max-height: calc(92vh - 120px); }
.modal-body::-webkit-scrollbar { display: none; }
.modal-body p, .modal-body div { line-height: 1.7; }
.modal-foot { padding: 16px 28px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.modal-foot .btn { min-width: 88px; }
#stuDialog .modal-foot { padding-bottom: 36px; align-items: center; }
.score-big { font-size: 34px; font-weight: 700; color: var(--blue); }
.grade-stamp { position: absolute; top: 60px; right: 12px; z-index: 5;
  width: 52px; height: 52px; border: 3px solid var(--red); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: var(--red);
  transform: rotate(-12deg); background: rgba(255,255,255,.6); pointer-events: none; }
.grade-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
.grade-item .g-score { color: var(--amber); font-weight: 600; flex-shrink: 0; }
.grade-comment { flex: 1; min-width: 0; }
.grade-comment h1, .grade-comment h2, .grade-comment h3, .grade-comment h4, .grade-comment h5, .grade-comment h6 { font-size: 13px; margin: 4px 0; }
.grade-comment p { margin: 4px 0; }
.grade-comment ul, .grade-comment ol { margin: 4px 0; padding-left: 18px; }
.grade-comment li { margin: 2px 0; }
.grade-comment pre { font-size: 12px; margin: 4px 0; }
.file-link { color: var(--blue); font-size: 12px; }
img.sub-file { max-width: 220px; border-radius: 8px; display: block; margin-top: 8px; }

/* ---------- 登录 ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at top, #ebe5d5, var(--bg) 60%), var(--bg); }
.login-box { background: var(--card); border: 1px solid var(--blue-border); border-radius: 14px; padding: 38px; width: 400px; box-shadow: 0 8px 40px rgba(0,0,0,.1); }
.login-box h1 { font-size: 21px; text-align: center; color: var(--blue); }
.login-box .sub { text-align: center; color: var(--muted); font-size: 12px; margin: 8px 0 24px; }
.role-group { display: flex; gap: 10px; margin: 14px 0 18px; }
.role-group label { flex: 1; border: 1px solid var(--blue-border); border-radius: 8px; padding: 13px 0;
  text-align: center; cursor: pointer; font-size: 14px; transition: .2s; color: var(--muted); }
.role-group input { display: none; }
.role-group label.on { border-color: var(--blue); background: var(--blue-light); color: var(--blue); font-weight: 600; }
.login-box .btn { width: 100%; padding: 12px; font-size: 15px; }
.error { color: var(--red); font-size: 12px; margin-top: 8px; }

.empty { text-align: center; color: var(--muted); padding: 30px 0; font-size: 13px; }
.flex { display: flex; gap: 8px; align-items: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
/* 学生多选列表 */
.student-pick { display: flex; flex-wrap: wrap; gap: 8px; max-height: 120px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--bg); }
.stu-pick-item { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px;
  border: 1px solid var(--blue-border); border-radius: 16px; font-size: 13px; cursor: pointer;
  background: var(--bg); color: var(--text); transition: all .15s; }
.stu-pick-item:hover { background: var(--blue-light); }
.stu-pick-item input { margin: 0; }
.stu-pick-item:has(input:checked) { background: var(--blue); color: #fff; border-color: var(--blue); }

/* 产物类型多选（FreeCreate） */
.output-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.output-pick-item { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px;
  border: 1px solid var(--blue-border); border-radius: 16px; font-size: 13px; cursor: pointer;
  background: var(--bg); color: var(--text); transition: all .15s; }
.output-pick-item:hover { background: var(--blue-light); }
.output-pick-item input { margin: 0; }
.output-pick-item:has(input:checked) { background: var(--blue); color: #fff; border-color: var(--blue); }

/* 弹框交互补充（遮罩居中、关闭按钮、表单行）—— 样式主体见上方 .modal-mask / .modal */
.modal-close { font-size: 24px; cursor: pointer; color: var(--muted); line-height: 1;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; }
.modal-close:hover { background: var(--blue-light); color: var(--blue); }
.major-filter button { border: 1px solid var(--blue-border); background: var(--bg); color: var(--muted);
  border-radius: 20px; padding: 6px 16px; font-size: 12px; cursor: pointer; transition: all .2s; }
.major-filter button:hover { background: var(--blue-light); border-color: var(--blue); color: var(--blue); }
.major-filter button.on { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 600; }
.major-filter button.on:hover { background: var(--blue-dark); }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); }
.major-filter { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }

/* ---------- 智能体实训操作 ---------- */
.exec-block { border-color: var(--blue-border); }
.exec-cap { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 12px; background: var(--blue-light); }
.exec-cap:last-child { margin-bottom: 0; }
.exec-cap b { font-size: 14px; }

/* 分步实训样式 */
.step-progress-wrap { margin: 0 0 16px; }
.step-progress-info { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.step-progress-bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.step-progress-fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--blue-dark)); border-radius: 4px; transition: width .4s ease; }
.step-prompt-ref { margin: 0 0 16px; padding: 12px 14px; background: var(--blue-light); border: 1px dashed var(--blue-border); border-radius: 10px; }
.step-prompt-ref-title { font-size: 13px; color: var(--blue); margin-bottom: 8px; font-weight: 600; }
.step-prompt-item { margin-bottom: 4px; }
.step-prompt-item summary { cursor: pointer; font-size: 13px; color: var(--text); padding: 6px 0; }
.step-prompt-item[open] summary { color: var(--blue); }
.step-prompt-item .exec-pre { margin-top: 6px; font-size: 12px; }
.step-card { border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 12px; background: var(--card); transition: border-color .2s; }
.step-card.step-completed { border-color: var(--green); background: rgba(91,140,62,.04); }
.step-header { display: flex; align-items: center; gap: 10px; }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  background: var(--blue); color: #fff; border-radius: 50%; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.step-card.step-completed .step-num { background: var(--green); }
.step-title { font-size: 14px; }
.step-status { margin-left: auto; }
.step-done { color: var(--green); font-size: 13px; font-weight: 600; }
.process-records { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--bg); }
.process-records summary { cursor: pointer; }
.process-step { border-left: 3px solid var(--blue-border); padding: 8px 0 8px 14px; margin-bottom: 12px; }
.process-step:last-child { margin-bottom: 0; }
.process-step-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.process-step-head .step-num { width: 22px; height: 22px; font-size: 10px; }
.exec-result { margin-top: 10px; }
/* 参考图预览 */
.ref-image-preview { width: 150px; height: 150px; border-radius: 8px; overflow: hidden; margin-top: 8px; cursor: zoom-in;
  border: 1px solid var(--line); position: relative; }
.ref-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.ref-image-preview:hover::after { content: '🔍 点击放大'; position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,.55); color: #fff; font-size: 11px; text-align: center; padding: 2px 0; }
.image-zoom-mask { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 10000; display: none;
  align-items: center; justify-content: center; cursor: zoom-out; }
.image-zoom-mask img { max-width: 92vw; max-height: 92vh; border-radius: 8px; }
/* 多轮对话区 */
.chat-history { max-height: 400px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); padding: 12px; margin-bottom: 8px; scrollbar-width: thin; }
.chat-history::-webkit-scrollbar { width: 6px; }
.chat-history::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.chat-msg { margin-bottom: 12px; }
.chat-msg:last-child { margin-bottom: 0; }
.chat-msg.user { text-align: right; }
.chat-msg .chat-bubble { display: inline-block; max-width: 85%; padding: 10px 14px; border-radius: 12px;
  font-size: 13px; line-height: 1.7; text-align: left; word-break: break-word; overflow-x: hidden; }
.chat-msg.user .chat-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.ai .chat-bubble { background: var(--card); border: 1px solid var(--line); color: var(--text);
  border-bottom-left-radius: 4px; }
.chat-msg .chat-bubble pre { white-space: pre-wrap; word-break: break-word; overflow-x: hidden; max-width: 100%; }
.chat-msg .chat-bubble code { white-space: pre-wrap; word-break: break-all; }
.chat-msg .chat-bubble p { overflow-x: hidden; word-break: break-word; }
.chat-msg .chat-bubble ul, .chat-msg .chat-bubble ol { padding-left: 20px; }
.chat-msg .chat-bubble img { width: 200px; height: 200px; object-fit: cover; border-radius: 8px; margin: 6px 0; cursor: zoom-in; }
.chat-msg .chat-bubble video { max-width: 100%; border-radius: 8px; margin: 6px 0; }
.chat-input-bar { display: flex; gap: 8px; align-items: flex-end; }
.chat-input-bar textarea { flex: 1; resize: vertical; }
.exec-pre { white-space: pre-wrap; word-break: break-word; background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 12px 14px; font-size: 13px; line-height: 1.8; color: var(--text);
  font-family: inherit; max-height: 340px; overflow: auto; margin: 0; }
/* Markdown 流式渲染 */
.md-stream { background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 16px; font-size: 13px; line-height: 1.8; color: var(--text); max-height: 340px; overflow: auto; margin: 0; }
.md-stream h1, .md-stream h2, .md-stream h3, .md-stream h4, .md-stream h5, .md-stream h6 {
  margin: 12px 0 6px; font-weight: 600; }
.md-stream h1 { font-size: 18px; } .md-stream h2 { font-size: 16px; }
.md-stream h3 { font-size: 15px; } .md-stream h4, .md-stream h5, .md-stream h6 { font-size: 14px; }
.md-stream p { margin: 6px 0; }
.md-stream ul, .md-stream ol { margin: 6px 0; padding-left: 22px; }
.md-stream li { margin: 3px 0; }
.md-stream pre { background: rgba(0,0,0,.06); border-radius: 6px; padding: 10px 12px;
  overflow: auto; font-size: 12px; margin: 8px 0; white-space: pre-wrap; word-break: break-word; }
.md-stream code { font-family: Consolas, monospace; }
.md-stream .md-inline-code { background: rgba(0,0,0,.06); padding: 2px 5px; border-radius: 3px; font-size: 12px; }
.md-stream strong { font-weight: 600; }
.md-stream em { font-style: italic; }
/* TourCopy AIGC 结果展示 */
.aigc-result { margin-top: 12px; }
.aigc-section { margin-bottom: 18px; }
.aigc-section > b { display: block; font-size: 13px; margin-bottom: 8px; color: var(--accent, #1a73e8); }
.aigc-img-wrap { text-align: center; }
.aigc-video-wrap { text-align: center; }
.aigc-video-wrap video { max-width: 100%; max-height: 360px; width: auto; height: auto;
  margin: 0 auto; border-radius: 10px; border: 1px solid var(--line);
  background: #000; box-shadow: 0 2px 8px rgba(0,0,0,0.1); object-fit: contain; }
.aigc-img-wrap img { max-width: 100%; max-height: 420px; width: auto; height: auto;
  margin: 0 auto; border-radius: 10px; border: 1px solid var(--line);
  cursor: zoom-in; box-shadow: 0 2px 8px rgba(0,0,0,0.08); transition: transform .2s; }
.aigc-img-wrap img:hover { transform: scale(1.01); }
.aigc-prompt { margin-top: 8px; }
.aigc-prompt summary { cursor: pointer; color: var(--muted, #666); font-size: 12px; padding: 4px 0; }
.aigc-prompt[open] summary { color: var(--accent, #1a73e8); margin-bottom: 6px; }
.mini-chat { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  background: var(--bg); height: 280px; overflow-y: auto; }
.mini-chat .msg { margin-bottom: 10px; }
.mini-chat .msg .bubble { font-size: 12px; line-height: 1.7; max-width: 88%; padding: 10px 12px; }
.mini-chat .msg .bubble .think { max-height: 110px; font-size: 11px; }

/* ===== 数字人虚拟导游 - 视频区 + 输入区 ===== */
.guide-stage { margin-top: 12px; border-radius: 14px;
  border: 1px solid var(--line); overflow: hidden;
  background: var(--card); }

/* 视频区（1:1 正方形，缩小70%，水平居中，垂直顶部） */
.guide-video-area { position: relative; aspect-ratio: 1 / 1;
  width: 60%; margin: 0 auto;
  background: #000; overflow: hidden;
  border-radius: 0; }

/* 数字人视频（充满视频区） */
.guide-big-avatar { position: absolute; inset: 12px;
  border-radius: 10px; overflow: hidden; }
.guide-video { width: 100%; height: 100%; object-fit: cover;
  object-position: center center; display: block; pointer-events: none; }
.guide-video::-webkit-media-controls { display: none !important; }
.guide-video::-webkit-media-controls-enclosure { display: none !important; }
.guide-video::-webkit-media-controls-panel { display: none !important; }
.guide-video::-webkit-media-controls-play-button { display: none !important; }
.guide-video::-webkit-media-controls-start-playback-button { display: none !important; }

/* 数字人信息（右上角） */
.guide-stage-info { position: absolute; top: 20px; right: 20px; z-index: 2;
  background: rgba(0,0,0,.45); backdrop-filter: blur(8px);
  padding: 8px 12px; border-radius: 8px; text-align: right; }
.guide-stage-name { font-size: 14px; font-weight: 600; color: #fff;
  margin-bottom: 2px; }
.guide-stage-desc { font-size: 11px; color: rgba(255,255,255,.75); }

/* 回复气泡（视频区底部，左右各20px边距，底部5px间距，最大3行） */
.guide-bubble { position: absolute; left: 20px; right: 20px; bottom: 15px; z-index: 3; }
.guide-bubble .bubble-text { background: rgba(0,0,0,.45); backdrop-filter: blur(8px); color: #fff;
  padding: 10px 14px; border-radius: 10px;
  font-size: 13px; line-height: 1.6; box-shadow: 0 4px 16px rgba(0,0,0,.2);
  max-height: calc(1.6em * 5 + 20px); overflow-y: auto; word-break: break-word;
  backdrop-filter: blur(8px); scrollbar-width: none; -ms-overflow-style: none; }
.guide-bubble .bubble-text::-webkit-scrollbar { display: none; }

/* 气泡弹入动画（从下往上弹出） */
.bubble-in { animation: bubble-pop-up 0.3s ease-out; }
@keyframes bubble-pop-up {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* 底部输入框（视频下方，宽度等于视频背景，多行 + 发送按钮在右下角内部） */
.guide-input-bar { position: relative; padding: 8px; background: var(--bg); }
.guide-input-bar textarea { width: 100%; padding: 10px 12px; padding-right: 12px; padding-bottom: 28px;
  border: 1px solid var(--blue-border); border-radius: 12px;
  font-size: 13px; line-height: 1.5; outline: none; resize: none;
  background: var(--card); color: var(--text); font-family: inherit; box-sizing: border-box;
  min-height: 64px; max-height: 120px; transition: border-color .2s; }
.guide-input-bar textarea:focus { border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(176,104,47,.1); }
.guide-input-bar .btn { position: absolute; right: 18px; bottom: 5px;
  padding: 6px 16px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500; line-height: 1; border: none; cursor: pointer;
  transition: background .2s, opacity .2s; box-shadow: 0 2px 12px rgba(176,104,47,.2); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { background: #d9d4c8; color: var(--muted); cursor: not-allowed; opacity: .6; }

/* （已移除说话动画，视频本身循环播放即可） */

/* 打字光标效果 */
.guide-bubble .bubble-text.typing::after { content: '▋'; display: inline-block;
  margin-left: 2px; color: #999; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* 加载点点 */
.guide-bubble .loading-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.guide-bubble .loading-dots i { width: 6px; height: 6px; border-radius: 50%;
  background: #bbb; animation: dot-bounce 1.4s infinite ease-in-out both; }
.guide-bubble .loading-dots i:nth-child(1) { animation-delay: -0.32s; }
.guide-bubble .loading-dots i:nth-child(2) { animation-delay: -0.16s; }
@keyframes dot-bounce {
  0%, 80%, 100% { transform: scale(0); opacity: .4; }
  40% { transform: scale(1); opacity: 1; }
}
.exec-block .chat-bar input { flex: 1; }
/* 对齐 exec 区输入框与按钮高度，避免按钮高于输入框 */
.exec-block .flex input[type=text],
.exec-block .chat-bar input { padding: 8px 12px; line-height: 20px; box-sizing: border-box; }
.exec-block .flex .btn,
.exec-block .chat-bar .btn { padding: 8px 16px; line-height: 20px; box-sizing: border-box; }
