/* 法考检索系统 · 样式 */
:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --accent: #1d4ed8;
  --accent-soft: #eff4ff;
  --mark: #fde68a;
  --border: #e5e7eb;
  --ok: #15803d;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.6;
}
.hidden { display: none !important; }

.topbar { background: linear-gradient(135deg, #1e3a8a, #1d4ed8); color: #fff; }
.topbar-inner { max-width: 960px; margin: 0 auto; padding: 18px 20px; }
.topbar h1 { margin: 0; font-size: 22px; letter-spacing: 2px; }
.topbar .sub { font-size: 12px; opacity: .85; margin-left: 10px; }

main { max-width: 960px; margin: 0 auto; padding: 18px 20px 40px; }

.search-box { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.input-row { display: flex; gap: 8px; }
#q { flex: 1; padding: 11px 14px; font-size: 15px; border: 1px solid var(--border); border-radius: 8px; outline: none; }
#q:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#btn-search { padding: 11px 26px; font-size: 15px; background: var(--accent); color: #fff; border: 0; border-radius: 8px; cursor: pointer; }
#btn-search:hover { background: #1e40af; }

.options { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 12px; align-items: center; }
.opt-group { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.opt-label { color: var(--muted); margin-right: 2px; }
.opt-group label { display: inline-flex; align-items: center; gap: 3px; cursor: pointer; }
.opt-group input[type=radio] { accent-color: var(--accent); }
#subject { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }

.examples { margin-top: 12px; font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { border: 1px solid var(--border); background: #f9fafb; border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; color: var(--ink); }
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.result-info { margin: 16px 0 8px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.result-info .modes { display: inline-flex; gap: 4px; }
.mode-tag { background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 1px 6px; font-size: 12px; }

.results { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.card h3 { margin: 0 0 6px; font-size: 15px; }
.card h3 .id { color: var(--muted); font-size: 12px; font-weight: normal; margin-left: 6px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; font-size: 12px; }
.badge { border-radius: 4px; padding: 1px 7px; background: #f3f4f6; color: #374151; }
.badge.subject { background: var(--accent-soft); color: var(--accent); }
.badge.type { background: #fef3c7; color: #92400e; }
.badge.law { background: #dcfce7; color: var(--ok); }
.snippet { font-size: 13.5px; color: #374151; }
.snippet mark { background: var(--mark); border-radius: 2px; padding: 0 1px; }
.source { margin-top: 8px; font-size: 12px; color: var(--muted); }
.terms { margin-top: 6px; font-size: 12px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.term-chip { background: #eef2ff; color: #3730a3; border-radius: 4px; padding: 0 6px; }
.term-chip.ext { background: #f0fdf4; color: #166534; }
.knowledge { margin-top: 8px; font-size: 12.5px; border-top: 1px dashed var(--border); padding-top: 8px; }
.knowledge .kn { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 3px; }
.kn-link { color: var(--accent); cursor: pointer; text-decoration: none; border-bottom: 1px dotted var(--accent); }
.kn-link:hover { color: #1e40af; }
.rel { color: var(--muted); font-size: 12px; }
.detail-btn { margin-top: 8px; font-size: 12px; color: var(--accent); background: none; border: 1px solid var(--border); border-radius: 6px; padding: 3px 10px; cursor: pointer; }
.detail-btn:hover { background: var(--accent-soft); }

.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 18px; }
.pager button { padding: 6px 16px; border: 1px solid var(--border); background: var(--card); border-radius: 6px; cursor: pointer; font-size: 13px; }
.pager button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pager button:disabled { opacity: .45; cursor: default; }
#page-info { font-size: 13px; color: var(--muted); }

.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }
.empty .hint { margin-top: 8px; font-size: 13px; }
.empty .hint button { border: 0; background: none; color: var(--accent); cursor: pointer; text-decoration: underline; }

.footer { max-width: 960px; margin: 0 auto; padding: 0 20px 24px; font-size: 12px; color: var(--muted); }

.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-body { background: var(--card); width: min(880px, 92vw); max-height: 84vh; border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; }
#modal-close { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); }
#modal-content { padding: 16px 18px; overflow-y: auto; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
#modal-content .m-head { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }

/* ========================================================== 页签 */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tab {
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
  border-radius: 8px; padding: 7px 20px; font-size: 14px; cursor: pointer;
}
.tab:hover { color: var(--accent); }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ========================================================== 问答 */
#qa-q { flex: 1; padding: 10px 14px; font-size: 15px; border: 1px solid var(--border); border-radius: 8px; outline: none; resize: vertical; font-family: inherit; line-height: 1.5; }
#qa-q:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#btn-qa { padding: 11px 26px; font-size: 15px; background: var(--accent); color: #fff; border: 0; border-radius: 8px; cursor: pointer; align-self: stretch; }
#btn-qa:hover { background: #1e40af; }
.qa-state { font-size: 12px; color: var(--muted); }
.qa-note { margin-top: 10px; font-size: 12px; color: var(--muted); background: #f8fafc; border: 1px dashed var(--border); border-radius: 6px; padding: 8px 10px; }

.qa-result { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.qa-loading { text-align: center; color: var(--muted); padding: 30px 0; font-size: 13px; }
.qa-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; border-radius: 8px; padding: 12px 14px; font-size: 14px; }
.qa-q { font-size: 15px; font-weight: 600; padding: 4px 2px; display: flex; align-items: center; gap: 8px; }

.qa-banner { border-radius: 10px; padding: 12px 16px; font-size: 13.5px; }
.qa-banner-title { font-weight: 600; margin-bottom: 4px; }
.qa-banner-text { line-height: 1.7; }
.qa-banner-sub { margin-top: 4px; font-size: 12.5px; opacity: .85; line-height: 1.6; }
.qa-banner.refused { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.qa-banner.evidence { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.qa-banner.ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }

.qa-warn { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 8px; padding: 10px 14px; font-size: 13px; line-height: 1.7; }

.qa-section { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; }
.qa-section-name { font-size: 13px; font-weight: 700; color: var(--accent); border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-bottom: 8px; }
.qa-section-content { font-size: 14px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.qa-section-cites { margin-top: 8px; font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); }
.cite-chip { display: inline-block; border: 1px solid #bfdbfe; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 1px 8px; font-size: 12px; cursor: pointer; text-decoration: none; }
.cite-chip:hover { background: #dbeafe; }
.qa-cite { font-size: 12.5px; color: #374151; margin-top: 4px; line-height: 1.7; }
.cite-tag { display: inline-block; background: #eef2ff; color: #3730a3; border-radius: 4px; padding: 0 6px; margin-right: 4px; }

.qa-md, .qa-evlist { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; font-size: 13px; }
.qa-md summary, .qa-evlist summary { cursor: pointer; color: var(--muted); }
.qa-md pre { white-space: pre-wrap; word-break: break-word; background: #f8fafc; border-radius: 6px; padding: 10px; font-size: 12.5px; line-height: 1.7; margin-top: 8px; }

.qa-evs { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.qa-ev { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; }
.qa-ev-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-weight: 600; }
.qa-ev-src { color: var(--muted); font-weight: normal; }
.qa-ev-law { color: var(--ok); font-size: 11.5px; }
.qa-ev-ans { color: #b45309; margin-top: 3px; }
.qa-ev-snip { color: #374151; margin-top: 4px; line-height: 1.6; }
.qa-ev-meta { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.qa-ev .detail-btn { margin-top: 6px; }

/* ========================================================== 出题 */
.qg-form { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; padding-bottom: 10px; }
.qg-form .opt-group select, .qg-form .opt-group input { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
#qg-kp { width: 190px; }
#btn-qg { padding: 9px 24px; font-size: 14px; background: var(--accent); color: #fff; border: 0; border-radius: 8px; cursor: pointer; margin-left: auto; }
#btn-qg:hover { background: #1e40af; }
.qg-card .qa-section-name { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qg-opts { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.qg-opt { font-size: 13.5px; line-height: 1.7; padding-left: 4px; }
.qg-ans { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 8px; }
.qg-ans-label { font-size: 14px; }
.qg-ans-label b { color: var(--ok); }
.qg-exp { margin-top: 5px; background: #f0fdf4; border-radius: 6px; padding: 8px 10px; font-size: 13px; color: #166534; line-height: 1.7; }
.qg-trap { margin-top: 5px; font-size: 12.5px; color: #92400e; background: #fffbeb; border-radius: 6px; padding: 6px 10px; }
.qg-btns { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------- LLM 调用页 ---------------- */
.qa-ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; border-radius: 8px; padding: 12px 14px; font-size: 13.5px; line-height: 1.7; }
.llm-head { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: space-between; padding-bottom: 10px; }
.llm-head-tip { flex: 1 1 420px; font-size: 12.5px; color: var(--muted); background: #f8fafc; border: 1px dashed var(--border); border-radius: 6px; padding: 8px 10px; line-height: 1.7; }
.llm-head-tip b { color: var(--ink); }
.llm-modules { display: flex; flex-wrap: wrap; gap: 6px; }
.llm-mod { display: inline-block; border-radius: 999px; padding: 2px 12px; font-size: 12px; border: 1px solid var(--border); background: #f3f4f6; color: var(--muted); }
.llm-mod.ok { background: #f0fdf4; border-color: #bbf7d0; color: var(--ok); }
.llm-mod.off { background: #fffbeb; border-color: #fde68a; color: #92400e; }
#llm-chat-prompt { flex: 1; padding: 10px 14px; font-size: 14px; border: 1px solid var(--border); border-radius: 8px; outline: none; resize: vertical; font-family: inherit; line-height: 1.5; }
#btn-llm-chat { padding: 10px 22px; font-size: 14px; border: 0; background: var(--accent); color: #fff; border-radius: 8px; cursor: pointer; }
#btn-llm-chat:disabled, #btn-llm-save:disabled, #btn-llm-test:disabled, #btn-llm-models:disabled { opacity: .55; cursor: not-allowed; }
#llm-chat-result .qa-section-content { font-size: 13.5px; }

/* ========================================================== 检索框联想（L6） */
.search-wrap { flex: 1; position: relative; display: flex; }
.search-wrap #q { width: 100%; flex: 1; }
.suggest {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12); max-height: 280px; overflow-y: auto;
}
.suggest-item { padding: 8px 12px; font-size: 13.5px; cursor: pointer; line-height: 1.5; }
.suggest-item:hover, .suggest-item.active { background: var(--accent-soft); color: var(--accent); }

/* ========================================================== 标记记录撤销（L10） */
.qg-undo-wrap { margin-top: 12px; }
.qg-undo-body { margin-top: 8px; }
.qg-undo-row {
  display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center;
  padding: 6px 2px; border-bottom: 1px dashed var(--border); font-size: 13px;
}
.qg-undo-row:last-of-type { border-bottom: 0; }
.qg-undo-point { flex: 1 1 auto; min-width: 120px; }
.qg-undo-time { color: var(--muted); font-size: 12px; }
.qg-undo-row .detail-btn { margin-top: 0; }

/* ========================================================== 窄屏适配（L10） */
@media (max-width: 720px) {
  .topbar-inner { padding: 14px; }
  .topbar h1 { font-size: 19px; }
  .topbar .sub { display: block; margin: 4px 0 0; }
  main { padding: 12px 12px 32px; }
  .search-box { padding: 12px; }
  .tabs { flex-wrap: wrap; gap: 5px; }
  .tab { flex: 1 1 auto; padding: 7px 12px; text-align: center; }
  .input-row { flex-direction: column; }
  #btn-search, #btn-qa, #btn-llm-chat { width: 100%; }
  #btn-qa, #btn-llm-chat { align-self: auto; }
  .options { gap: 6px 14px; }
  .opt-group { flex-wrap: wrap; }
  .qg-form { flex-direction: column; align-items: stretch; gap: 8px; }
  #qg-kp { width: 100%; }
  #btn-qg { width: 100%; margin-left: 0; }
  .result-info { font-size: 12px; }
  .modal-body { width: 96vw; max-height: 90vh; border-radius: 10px; }
  .modal-head { padding: 10px 12px; }
  #modal-content { padding: 12px; }
  .footer { padding: 0 12px 20px; }

  /* 窄屏：首页两栏变单栏 */
  .home-grid { grid-template-columns: 1fr; }
  .home-quick { grid-template-columns: 1fr; }
  .home-flow-steps { display: none; }
}

/* ========================================================== 首页（需求 10） */
.home-hero { display: flex; flex-direction: column; gap: 12px; }
.home-hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.ov-item { background: var(--accent-soft); border: 1px solid #dbe6ff; border-radius: 10px; padding: 8px 10px; text-align: center; }
.ov-num { font-size: 20px; font-weight: 700; color: var(--accent); }
.ov-label { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.home-quick { display: grid; grid-template-columns: 1.2fr 1.2fr 1fr; gap: 12px; }
.home-quick-item { display: flex; flex-direction: column; gap: 5px; }
.home-quick-row { display: flex; gap: 6px; }
.home-quick-row input[type="text"] { flex: 1; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; min-width: 0; }
.home-quick-row input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.home-quick-row select { padding: 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.home-quick-row button { padding: 8px 16px; font-size: 13px; background: var(--accent); color: #fff; border: 0; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.home-quick-row button:hover { background: #1e40af; }
.home-quick-row button:disabled { opacity: .6; cursor: default; }

.home-flow { border-left: 4px solid var(--accent); }
.home-flow-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 10px; }
.home-flow-head b { font-size: 14px; }
.home-flow-steps { display: flex; flex-wrap: wrap; gap: 4px; }
.fstep { font-size: 11.5px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; background: #f8fafc; }
.fstep.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.fstep.done { background: #f0fdf4; border-color: #bbf7d0; color: var(--ok); }
#btn-flow-start, #btn-flow-record { padding: 9px 22px; font-size: 13.5px; background: var(--accent); color: #fff; border: 0; border-radius: 8px; cursor: pointer; align-self: center; }
#btn-flow-start:hover, #btn-flow-record:hover { background: #1e40af; }
#btn-flow-start:disabled, #btn-flow-record:disabled { opacity: .6; cursor: default; }
.flow-opt { display: flex; gap: 6px; align-items: flex-start; font-size: 13.5px; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.flow-opt:hover { background: var(--accent-soft); }
.flow-opt input { margin-top: 3px; }
.flow-verdict { margin-top: 8px; }

.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.home-card { padding: 14px 16px; }
.home-card-wide { grid-column: 1 / -1; }
.home-card-head { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 10px; }
.home-card-head b { font-size: 14px; }
.home-card-body { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.home-row { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; justify-content: space-between; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: #fbfcfe; }
.home-row-main { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 13.5px; }
.home-row-sub { flex-basis: 100%; font-size: 12px; color: var(--muted); }
.home-row-btns { display: flex; gap: 6px; }
.home-row-btns .detail-btn { margin-top: 0; }
.home-more { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding-top: 4px; font-size: 12.5px; }
.home-more a { color: var(--accent); text-decoration: none; }
.home-more a:hover { text-decoration: underline; }
.home-subj-overall { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.home-subj-row { cursor: pointer; }
.home-subj-row:hover { border-color: var(--accent); background: var(--accent-soft); }
.home-subj-row .prog-mastery { flex-basis: 100%; margin-top: 2px; }

.home-subject-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.home-subject-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.home-browse-body { display: flex; flex-direction: column; gap: 8px; }
.home-chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.home-chapter { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; justify-content: space-between; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px; cursor: pointer; background: #fbfcfe; }
.home-chapter:hover { border-color: var(--accent); background: var(--accent-soft); }
.home-pts-head { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.home-points { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 6px; }
.home-point { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; justify-content: space-between; border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px; font-size: 13px; background: #fbfcfe; }
.home-point-name { flex: 1 1 auto; min-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ========================================================== 讲解（需求 8） */
.jj-mode-row { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding-bottom: 10px; }
.jj-mode-row label { font-size: 13.5px; color: #374151; cursor: pointer; }
.jj-mode-row label input { margin-right: 3px; }
.qg-form .opt-group.wide { flex-basis: 100%; }
.qg-form .opt-group.wide textarea { width: 100%; box-sizing: border-box; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; font-family: inherit; }
#jj-topic { width: 220px; }
#btn-jj { padding: 9px 24px; font-size: 14px; background: var(--accent); color: #fff; border: 0; border-radius: 8px; cursor: pointer; }
#btn-jj:hover { background: #1e40af; }
.jj-layers { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: #374151; }
.jj-layers label { cursor: pointer; }
.jj-layer { background: #fef2f2; color: #b91c1c; }
#jj-socratic { max-height: 70vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.soc-input { display: flex; gap: 8px; align-items: center; padding: 10px 2px; position: sticky; bottom: 0; background: var(--bg); }
#jj-soc-ans { flex: 1; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; }
#btn-jj-soc { padding: 8px 20px; font-size: 13.5px; background: var(--accent); color: #fff; border: 0; border-radius: 8px; cursor: pointer; }
#btn-jj-soc:hover { background: #1e40af; }
.soc-msg { border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; font-size: 13.5px; line-height: 1.75; background: var(--card); }
.soc-msg.user { border-color: #bfdbfe; background: #eff6ff; }
.soc-msg.teacher { border-color: #fde68a; background: #fffbeb; font-weight: 600; }
.soc-msg.system { color: #374151; }
.soc-msg.done { border-color: #bbf7d0; background: #f0fdf4; white-space: pre-wrap; word-break: break-word; }
.soc-who { display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--muted); margin-right: 6px; }

/* ========================================================== 学习进度（需求 9） */
.prog-summary { display: flex; flex-direction: column; gap: 6px; margin: 14px 0 8px; }
.prog-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.prog-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.prog-num { font-size: 24px; font-weight: 700; color: var(--accent); }
.prog-label { font-size: 13px; color: #374151; margin-top: 2px; }
.prog-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.prog-by-subj { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.prog-card-det { border-left: 4px solid transparent; }
.prog-card-det.due { border-left-color: #dc2626; background: #fffafa; }
.prog-chip { border-radius: 4px; padding: 1px 6px; background: #f3f4f6; color: #374151; font-size: 12px; }
.prog-chip.ok { background: #dcfce7; color: var(--ok); }
.prog-chip.bad { background: #fef2f2; color: #b91c1c; }
.prog-due { background: #dc2626; color: #fff; }
.prog-mastery { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.prog-bar { flex: 1; height: 8px; border-radius: 999px; background: #e5e7eb; overflow: hidden; min-width: 90px; }
.prog-bar-fill { height: 100%; border-radius: 999px; transition: width .2s; }
.prog-pct { font-size: 13px; font-weight: 600; min-width: 36px; }
.prog-next { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.prog-main { margin-top: 4px; font-size: 12.5px; color: #b45309; background: #fffbeb; border-radius: 6px; padding: 4px 8px; }
.prog-btn.bad { color: #b91c1c; border-color: #fecaca; }
.prog-btn.bad:hover { background: #fef2f2; }
}

/* ========================================================== 法律原文（法条模块） */
.law-chip { border-style: dashed; }
.law-card .law-snippet { white-space: pre-wrap; word-break: break-word; }
.law-refs { margin-top: 10px; }
.law-details { border: 1px solid #bbf7d0; background: #f0fdf4; border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.law-details summary { cursor: pointer; color: #166534; font-weight: 600; user-select: none; }
.law-ref-item { padding: 8px 2px 2px; }
.law-ref-item + .law-ref-item { border-top: 1px dashed #bbf7d0; margin-top: 8px; }
.law-ref-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.law-art-link { color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: none; }
.law-art-link:hover { text-decoration: underline; }
.law-ref-text { color: #374151; line-height: 1.7; margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.law-article { white-space: pre-wrap; word-break: break-word; line-height: 2; font-size: 14px; padding: 10px 2px; }
.law-nav-row { display: flex; gap: 14px; justify-content: space-between; padding-top: 8px; border-top: 1px dashed var(--border); }
.law-nav { color: var(--accent); cursor: pointer; text-decoration: none; font-size: 13.5px; }
.law-nav:hover { text-decoration: underline; }
