/* 学习平台组件：教程/答疑/考试/看板（配合 style.css 使用） */

/* 纪要章节里的画面帧 */
.chapter .ch-imgs { display: grid; gap: 10px; padding: 0 14px 12px; }
.chapter .ch-imgs img {
  width: 100%; border-radius: 10px; border: 1px solid var(--line-soft);
  background: var(--bg-soft); cursor: zoom-in;
}
.slide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.slide-grid figure { margin: 0; }
.slide-grid img { width: 100%; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--bg-soft); cursor: zoom-in; }
.slide-grid figcaption { font-size: 0.78rem; color: var(--muted-2); margin-top: 6px; line-height: 1.5; }

/* 通用 tab */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  padding: 8px 18px; border-radius: 999px; cursor: pointer; font-size: 0.9rem;
  border: 1px solid var(--line); color: var(--muted); background: var(--bg-soft); transition: 0.15s; user-select: none;
}
.tab.active { color: #fff; background: var(--grad); border-color: transparent; font-weight: 600; }

/* 教程详情 */
.tut-head { margin-bottom: 20px; }
.tut-head .r-title { font-size: 1.4rem; font-weight: 800; }
.tut-sec { border: 1px solid var(--line-soft); border-radius: 12px; padding: 20px; margin-bottom: 16px; background: var(--bg-soft); }
.tut-sec h4 { color: var(--accent); font-size: 1rem; margin-bottom: 10px; }
.tut-sec p { font-size: 0.94rem; color: var(--text); white-space: pre-wrap; }
.tut-sec img { max-width: 100%; border-radius: 10px; border: 1px solid var(--line-soft); margin-top: 12px; background: var(--bg-soft); }
.tut-sec .cap { font-size: 0.78rem; color: var(--muted-2); margin-top: 6px; }

/* 答疑对话 */
.chat { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); display: flex; flex-direction: column; height: 520px; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 86%; padding: 12px 16px; border-radius: 14px; font-size: 0.92rem; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.msg.user { align-self: flex-end; background: rgba(108, 140, 255, 0.16); border: 1px solid rgba(108, 140, 255, 0.3); }
.msg.bot { align-self: flex-start; background: var(--bg-soft); border: 1px solid var(--line-soft); }
.msg .refs { margin-top: 12px; display: grid; gap: 8px; }
.ref-card {
  border: 1px solid var(--line-soft); border-left: 3px solid var(--accent-2); border-radius: 8px;
  padding: 10px 12px; cursor: pointer; background: rgba(53, 208, 192, 0.05);
}
.ref-card:hover { border-color: var(--accent-2); }
.ref-card .rt { font-size: 0.8rem; color: var(--accent-2); font-weight: 600; }
.ref-card .rs { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.ref-card img { max-height: 84px; border-radius: 6px; margin-top: 8px; border: 1px solid var(--line-soft); }
.chat-input { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line-soft); }
.chat-input input {
  flex: 1; background: var(--bg-soft); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 11px 14px; font: inherit; font-size: 0.92rem;
}
.chat-input input:focus { outline: none; border-color: var(--accent); }

/* 学习者身份卡 */
.learner-bar {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); margin-bottom: 20px; flex-wrap: wrap;
}
.learner-bar .avatar {
  width: 40px; height: 40px; border-radius: 12px; background: var(--grad);
  display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 1.1rem; flex: none;
}
.learner-bar .who b { font-size: 0.98rem; }
.learner-bar .who span { color: var(--muted); font-size: 0.8rem; margin-left: 8px; }
.learner-bar .btn { margin-left: auto; }
.learner-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.learner-form input, .learner-form select {
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 10px 14px; font: inherit; font-size: 0.9rem;
}

/* 看板 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2)); text-align: center;
}
.stat-card .num { font-size: 1.9rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-card .lbl { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 160px 1fr 60px; gap: 12px; align-items: center; font-size: 0.86rem; }
.bar-row .name { color: var(--muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .track { height: 14px; background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: 999px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--grad); border-radius: 999px; }
.bar-row .val { color: var(--muted-2); font-family: ui-monospace, Menlo, Consolas, monospace; }

/* 考试附加 */
.q-meta-line { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.mini-btn {
  padding: 6px 14px; font-size: 0.8rem; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--muted); font-family: inherit;
}
.mini-btn:hover { color: var(--text); border-color: var(--accent); }
.ai-expl {
  margin-top: 12px; padding: 12px 16px; border-radius: 10px; font-size: 0.88rem; line-height: 1.7;
  background: rgba(53, 208, 192, 0.06); border: 1px solid rgba(53, 208, 192, 0.25); color: var(--muted); white-space: pre-wrap;
}
.hist .h-kp { font-size: 0.72rem; color: var(--accent-2); }
.hist .del-btn {
  flex: none; cursor: pointer; font-size: 0.95rem; padding: 4px 6px; border-radius: 7px;
  opacity: 0.45; transition: 0.15s; user-select: none;
}
.hist .del-btn:hover { opacity: 1; background: rgba(255, 107, 122, 0.15); }
img.zoom { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.86);
  display: none; place-items: center; padding: 30px; cursor: zoom-out;
}
.lightbox.show { display: grid; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }
