* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Helvetica Neue", sans-serif; background: #f5f5f5; color: #333; }

header { background: #fff; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e0e0e0; position: sticky; top: 0; z-index: 100; }
header h1 { font-size: 18px; font-weight: 600; color: #3C3489; }
nav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.nav-btn { padding: 6px 16px; border: 1px solid #d0d0d0; background: #fff; border-radius: 8px; cursor: pointer; font-size: 14px; color: #666; transition: all 0.2s; }
.nav-btn:hover { border-color: #7F77DD; color: #3C3489; }
.nav-btn.active { background: #3C3489; color: #fff; border-color: #3C3489; }
/* 多了一个「指南」后，窄屏把按钮和头部留白收紧，5 个按钮刚好排一行 */
/* 注意：必须放在 .nav-btn 基础规则之后，否则同优先级下会被它覆盖回去 */
@media (max-width: 520px) {
  header { padding: 12px 14px; }
  nav { gap: 6px; }
  .nav-btn { padding: 5px 11px; font-size: 13px; }
}

main { max-width: 960px; margin: 0 auto; padding: 24px 16px; }

/* 统计卡片 */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 12px; padding: 16px; text-align: center; border: 1px solid #eee; }
.stat-card .num { font-size: 28px; font-weight: 700; }
.stat-card .label { font-size: 13px; color: #888; margin-top: 4px; }
.stat-card.total .num { color: #3C3489; }
.stat-card.review .num { color: #E24B4A; }
.stat-card.done .num { color: #1D9E75; }
.stat-card.clickable { cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; }
.stat-card.clickable:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.08); border-color: #7F77DD; }
.stat-card.clickable .label::after { content: " ›"; color: #B4B2A9; }

/* 科目分布 */
.dist-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.dist-label { width: 60px; font-size: 13px; color: #666; }
.dist-bar { flex: 1; height: 24px; background: #f0f0f0; border-radius: 6px; overflow: hidden; }
.dist-fill { height: 100%; border-radius: 6px; display: flex; align-items: center; padding-left: 8px; color: #fff; font-size: 12px; }
.dist-count { width: 32px; text-align: right; font-size: 13px; color: #888; }

.section-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; color: #444; }
.card { background: #fff; border-radius: 12px; padding: 20px; border: 1px solid #eee; margin-bottom: 16px; }

/* 表单 */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #7F77DD; }
.form-group textarea { resize: vertical; min-height: 60px; }
.form-group textarea.md-editor { min-height: 320px; font-size: 13.5px; line-height: 1.7; font-family: "SF Mono", Menlo, Consolas, "PingFang SC", monospace; background: #fcfcff; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.file-drop { border: 2px dashed #ccc; border-radius: 12px; padding: 24px; text-align: center; cursor: pointer; transition: all 0.2s; }
.file-drop:hover { border-color: #7F77DD; background: #EEEDFE; }
.file-drop.has-file { border-color: #1D9E75; background: #E1F5EE; }
.file-drop input { display: none; }
.file-drop .hint { font-size: 14px; color: #888; }
.pick-status { font-size: 12.5px; color: #1D9E75; font-weight: 600; margin: 4px 0 0; min-height: 16px; }
.file-drop .preview { max-width: 200px; max-height: 200px; border-radius: 8px; margin-top: 8px; }

.btn { padding: 10px 24px; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; transition: all 0.2s; }
.btn-primary { background: #3C3489; color: #fff; }
.btn-primary:hover { background: #534AB7; }
.btn-danger { background: #fff; color: #E24B4A; border: 1px solid #E24B4A; }
.btn-danger:hover { background: #FCEBEB; }
.btn-edit { background: #fff; color: #185FA5; border: 1px solid #185FA5; }
.btn-edit:hover { background: #E6F1FB; }
.btn-sm { padding: 4px 12px; font-size: 13px; }

/* 筛选栏 */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters select, .filters input { padding: 6px 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; }
.filters .search-input { flex: 1; min-width: 120px; }

/* 记录卡片 */
.record-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.record-card { background: #fff; border-radius: 12px; border: 1px solid #eee; overflow: hidden; position: relative; }
/* 多选勾选角标：右上角，选中态高亮 */
.sel-flag { position: absolute; top: 8px; right: 8px; z-index: 5; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: 0 1px 4px rgba(0,0,0,.15); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.sel-flag input { width: 16px; height: 16px; cursor: pointer; accent-color: #3C3489; }
.record-card.sel-on { border-color: #3C3489; box-shadow: 0 0 0 1px #3C3489; }
/* 多选工具条 */
.select-bar { background: #fff; border: 1px solid #eee; border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; }
.select-bar .btn-sm { padding: 4px 10px; }

/* 错题复习入口 */
.review-launch { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: linear-gradient(90deg, #EEEDFE, #E6F1FB); border: 1px solid #D9D5F5; border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; }
.review-launch .rl-txt { font-size: 13px; color: #3C3489; }
.btn-review { background: #3C3489; color: #fff; border: none; }
.btn-review:hover { background: #534AB7; }

/* ==== 错题复习轮播(全屏) ==== */
.review-overlay { position: fixed; inset: 0; background: rgba(12, 12, 24, .95); z-index: 300; display: flex; align-items: center; justify-content: center; }
.review-box { position: relative; width: min(960px, 94vw); height: 94vh; display: flex; flex-direction: column; }
.review-top { display: flex; align-items: center; justify-content: space-between; color: #eee; padding: 4px 0 12px; font-size: 14px; }
.review-top .pos { color: #ccc; }
.review-close { background: none; border: none; color: #eee; font-size: 26px; cursor: pointer; line-height: 1; padding: 0 6px; }
.review-close:hover { color: #fff; }
.review-img-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.03); border-radius: 10px; overflow: hidden; }
.review-img-wrap img { max-width: 100%; max-height: 100%; object-fit: contain; }
.review-nopic { color: #999; font-size: 15px; text-align: center; padding: 40px; }
.review-info { background: rgba(255,255,255,.07); border-radius: 10px; padding: 12px 16px; margin-top: 12px; color: #eee; }
.review-info .rk-tags { margin-bottom: 6px; }
.review-info .rk-tags .tag { margin-right: 6px; }
.review-info .rk-kp { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
/* 挂上了知识点（有 kp_id）→ 做成可点按钮：边复习边翻它的笔记；只是自由文本就照旧当文字 */
.rk-kp-open { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.28); color: #fff; border-radius: 8px; padding: 6px 12px; font-size: 15px; font-weight: 500; font-family: inherit; text-align: left; cursor: pointer; margin-bottom: 6px; transition: background .15s; }
.rk-kp-open:hover { background: rgba(255,255,255,.24); }
.rk-kp-cnt { font-size: 11.5px; font-weight: 400; color: #CECBF6; background: rgba(127,119,221,.35); border-radius: 10px; padding: 1px 8px; white-space: nowrap; }
.review-info .rk-date { font-size: 12px; color: #bbb; margin-bottom: 4px; }
.review-info .rk-note { font-size: 13px; color: #ddd; line-height: 1.5; }
.review-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: none; background: rgba(255,255,255,.14); color: #fff; font-size: 24px; cursor: pointer; line-height: 1; z-index: 5; }
.review-arrow:hover { background: rgba(255,255,255,.28); }
.review-arrow.prev { left: -52px; }
.review-arrow.next { right: -52px; }
.review-foot { text-align: center; margin-top: 10px; color: #999; font-size: 12px; }
@media (max-width: 700px) { .review-arrow.prev { left: -6px; } .review-arrow.next { right: -6px; } }
.record-card .photo { width: 100%; height: 160px; object-fit: cover; cursor: pointer; background: #f0f0f0; }
.record-card .no-photo { height: 160px; display: flex; align-items: center; justify-content: center; color: #ccc; font-size: 13px; background: #f9f9f9; }
.record-card .info { padding: 12px; }
.record-card .tags { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.tag { padding: 2px 8px; border-radius: 4px; font-size: 11px; }
.tag-subject { background: #EEEDFE; color: #3C3489; }
.tag-error { background: #FAEEDA; color: #633806; }
.tag-status-pending { background: #FCEBEB; color: #A32D2D; }
.tag-status-ok { background: #E1F5EE; color: #0F6E56; }
.tag-status-wrong { background: #FAECE7; color: #993C1D; }
.record-card .kp { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.record-card .date { font-size: 12px; color: #999; }
.record-card .rec-in { color: #bbb; font-size: 11px; margin-left: 4px; }
.record-card .note { font-size: 13px; color: #666; margin-top: 4px; line-height: 1.5; }
.record-card .actions { display: flex; gap: 6px; margin-top: 8px; }

.empty { text-align: center; padding: 48px 16px; color: #aaa; font-size: 14px; }

/* 照片弹窗 */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 360; cursor: pointer; }
.modal-overlay img { max-width: 90%; max-height: 90%; border-radius: 8px; }

.tag-note { background: #E6F1FB; color: #185FA5; }
.tag-week { background: #EAF3DE; color: #27500A; }
.tag-mastery { background: #FAEEDA; color: #633806; }
.stat-card.notes .num { color: #185FA5; }
.stat-card.kp .num { color: #854F0B; }
.stat-card.photos .num { color: #534AB7; }

/* tab 切换 */
.upload-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.upload-tab { padding: 8px 20px; border: 1px solid #ddd; background: #fff; border-radius: 8px; cursor: pointer; font-size: 14px; color: #666; }
.upload-tab.active { background: #3C3489; color: #fff; border-color: #3C3489; }

/* 学习阶段 */
.stage-bar { background: linear-gradient(135deg, #3C3489, #534AB7); border-radius: 12px; padding: 16px 20px; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.stage-current { display: flex; align-items: center; gap: 12px; }
.stage-label { font-size: 13px; color: #CECBF6; }
.stage-value { font-size: 18px; font-weight: 600; color: #fff; }
.stage-switch { display: flex; gap: 6px; }
.stage-switch select { padding: 4px 10px; border: none; border-radius: 6px; font-size: 13px; background: #fff; cursor: pointer; }
.stage-history { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tag-history { background: #f0f0f0; color: #888; }

/* 局域网访问提示（含扫码直达二维码） */
.lan-bar { margin-bottom: 16px; }
.lan-inner { background: #E1F5EE; border: 1px solid #BFE8DB; color: #0F6E56; border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.lan-head { font-size: 14px; margin-bottom: 10px; }
.lan-body { display: flex; gap: 14px; align-items: center; }
.lan-qr { flex-shrink: 0; width: 116px; height: 116px; background: #fff; border-radius: 8px; padding: 6px; display: flex; align-items: center; justify-content: center; }
.lan-qr svg { width: 100%; height: 100%; display: block; }
.lan-text { flex: 1; min-width: 0; line-height: 1.7; }
.lan-urls { margin: 2px 0; }
.lan-inner code { background: #fff; border: 1px solid #cfe8df; border-radius: 4px; padding: 1px 6px; font-size: 12.5px; color: #0F6E56; margin: 0 2px 2px 0; display: inline-block; }
.lan-inner .lan-sub { color: #5a9c85; font-size: 12px; display: block; }
.lan-inner .lan-warn { color: #993C1D; background: #FAECE7; border-radius: 6px; padding: 5px 8px; font-size: 12px; margin-top: 6px; }
@media (max-width: 520px) {
  .lan-body { flex-direction: column; align-items: center; }
  .lan-text { width: 100%; }
  .lan-qr { width: 148px; height: 148px; }
  .lan-head { text-align: center; }
}

/* 保存成功等轻提示 */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 14px); background: #27500A; color: #fff; padding: 10px 20px; border-radius: 999px; font-size: 13.5px; opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; z-index: 400; max-width: 88vw; text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 表单按钮区 */
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-next { background: #E1F5EE; color: #0F6E56; border: 1px solid #5DCAA5; }
.btn-next:hover { background: #C9EDE1; }
.btn-cancel { background: #fff; color: #666; border: 1px solid #ddd; }
.btn-cancel:hover { background: #f5f5f5; }

/* 照片区提到表单最前：家长打开页面第一眼就是"传照片" */
.photo-first { background: #FAFAFF; border: 1px solid #E7E6F7; border-radius: 10px; padding: 12px 14px; }
.photo-first label { color: #3C3489; font-weight: 600; }
/* 「保存并录下一题」沿用公共字段的提示 */
.carry-tip { background: #E1F5EE; border: 1px solid #BFE8DB; color: #0F6E56; border-radius: 8px; padding: 8px 12px; font-size: 12.5px; margin-bottom: 12px; }

/* 知识点列表 */
.kp-list { display: flex; flex-direction: column; gap: 8px; }
.kp-item { background: #fff; border: 1px solid #eee; border-radius: 8px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; }
.kp-item .kp-name { font-size: 14px; font-weight: 500; }
.kp-item .kp-meta { font-size: 12px; color: #888; margin-top: 2px; }
.kp-item .kp-actions { display: flex; gap: 6px; }
.mastery-stars { font-size: 14px; color: #FAC775; }

/* 列表工具条（筛选 + 打印按钮） */
.list-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.list-toolbar .filters { margin-bottom: 0; }
.kp-link { background: none; border: none; padding: 0; font-size: 14px; font-weight: 500; color: #185FA5; cursor: pointer; text-align: left; }
.kp-link:hover { text-decoration: underline; }
.hint-line { font-size: 12px; color: #999; margin: 0 0 12px; }
.kp-desc { font-size: 13px; color: #444; line-height: 1.6; padding: 8px 10px; background: #fafafa; border-radius: 6px; }

/* ==== Markdown 渲染正文 ==== */
.md-body { font-size: 13.5px; line-height: 1.7; color: #333; word-break: break-word; }
.md-body > :first-child { margin-top: 0; }
.md-body > :last-child { margin-bottom: 0; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4 { margin: 12px 0 6px; line-height: 1.4; color: #2b2b40; }
.md-body h1 { font-size: 18px; } .md-body h2 { font-size: 16px; } .md-body h3 { font-size: 14.5px; } .md-body h4 { font-size: 13.5px; }
.md-body h1, .md-body h2 { padding-bottom: 4px; border-bottom: 1px solid #eee; }
.md-body p { margin: 6px 0; }
.md-body ul, .md-body ol { margin: 6px 0; padding-left: 22px; }
.md-body li { margin: 3px 0; }
.md-body strong, .md-body b { color: #111; font-weight: 600; }
.md-body em { color: #555; }
.md-body blockquote { margin: 8px 0; padding: 2px 12px; border-left: 3px solid #c5c0ef; color: #555; background: #f7f6fe; border-radius: 0 6px 6px 0; }
.md-body code { background: #f2f2f2; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; font-family: "SF Mono", Menlo, Consolas, monospace; }
.md-body pre { background: #f6f8fa; border: 1px solid #eee; border-radius: 8px; padding: 10px 12px; overflow: auto; margin: 8px 0; }
.md-body pre code { background: none; padding: 0; }
.md-body hr { border: none; border-top: 1px solid #e6e6e6; margin: 12px 0; }
.md-body table { border-collapse: collapse; margin: 8px 0; width: 100%; font-size: 13px; }
.md-body th, .md-body td { border: 1px solid #ddd; padding: 5px 8px; text-align: left; }
.md-body th { background: #f7f7f7; font-weight: 600; }
.md-body a { color: #185FA5; }
.md-body img { max-width: 100%; border-radius: 6px; }

/* 知识点卡片：改为纵向卡片，可展示 MD 正文 */
.kp-card { background: #fff; border: 1px solid #eee; border-radius: 12px; overflow: hidden; }
.kp-card-head { padding: 12px 16px 4px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.kp-card-head .kp-name { font-size: 15px; font-weight: 600; }
.kp-card-head .kp-actions { display: flex; gap: 6px; flex-shrink: 0; }
.kp-card .md-wrap { padding: 0 16px 12px; }
.kp-card .md-preview { max-height: 150px; overflow: hidden; position: relative; }
.kp-card .md-preview::after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 40px; background: linear-gradient(transparent, #fff); }
.kp-card .md-toggle { background: none; border: none; color: #185FA5; font-size: 13px; cursor: pointer; padding: 2px 16px 10px; text-align: left; }
.kp-card .md-toggle:hover { text-decoration: underline; }
.kp-card.no-desc .md-wrap { display: none; }

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .record-list { grid-template-columns: 1fr; }
  header { flex-direction: column; gap: 8px; }
}

/* ==== 错因多选 chips ==== */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 14px; border: 1px solid #ddd; background: #fff; border-radius: 999px; font-size: 13px; color: #555; cursor: pointer; transition: all .15s; }
.chip:hover { border-color: #7F77DD; color: #3C3489; }
.chip.active { background: #FAEEDA; border-color: #EFC88B; color: #854F0B; font-weight: 600; }
.chip-tip { font-size: 11.5px; color: #aaa; margin-top: 6px; }

/* ==== 多图上传网格 ==== */
.photo-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.photo-grid:empty { display: none; }
.ph-item { position: relative; width: 108px; height: 108px; border-radius: 10px; overflow: hidden; border: 1px solid #e5e5e5; background: #fafafa; }
.ph-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-item.new { border-color: #7F77DD; }
.ph-del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: none; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; padding: 0; }
.ph-del:hover { background: #E24B4A; }
.ph-cover, .ph-new { position: absolute; left: 0; bottom: 0; width: 100%; font-size: 10.5px; text-align: center; padding: 2px 0; color: #fff; background: rgba(60,52,137,.78); }
.ph-new { background: rgba(127,119,221,.85); }
.ph-empty { font-size: 12.5px; color: #bbb; padding: 14px 0; }
.photo-count { font-size: 11.5px; color: #aaa; margin-left: 6px; font-weight: 400; }
.file-drop.drag { border-color: #7F77DD; background: #EEEDFE; }

/* 列表卡片：封面 + 多图张数角标 */
.card-photo { position: relative; }
.ph-count { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.62); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; }

/* 复习轮播：一题多图，1 张时放大、2 张并排、3 张以上自动换行，容器内可滚动 */
.review-img-wrap { flex-direction: column; overflow: hidden; }
.review-imgs { flex: 1; min-height: 0; width: 100%; overflow: auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-content: center; align-items: center; justify-items: center; gap: 12px; padding: 8px; }
.review-imgs img { max-width: 100%; max-height: 44vh; object-fit: contain; border-radius: 8px; background: #fff; }
.review-imgs img:only-child { max-height: 68vh; }
.review-img-count { text-align: center; color: #bbb; font-size: 12px; padding: 4px 0 6px; flex-shrink: 0; }

/* ==== 知识点：记录数徽标（一个知识点可挂多条记录）==== */
.kp-count { margin-left: 8px; color: #185FA5; background: #E6F1FB; border-radius: 10px; padding: 1px 8px; font-size: 11.5px; white-space: nowrap; }
.kp-card .kp-meta { display: flex; align-items: center; flex-wrap: wrap; }

/* 知识点详情页头部 */
.ledger-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ledger-title { font-size: 17px; font-weight: 500; color: #2C2C2A; margin-bottom: 4px; }
.ledger-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 知识点下的一条记录 */
.kp-entry { background: #fff; border: 1px solid #eee; border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; }
.kp-entry-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.kp-entry-date { font-size: 12.5px; color: #888; }
.kp-entry-body { font-size: 13.5px; color: #2C2C2A; }
.kp-entry-empty { font-size: 12.5px; color: #bbb; }
.entry-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.entry-photo { max-width: 46%; max-height: 220px; object-fit: contain; border: 1px solid #eee; border-radius: 8px; cursor: zoom-in; background: #fff; }

/* 内联展开的记录表单 */
.entry-form { background: #fbfaf7; border: 1px solid #eee; border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.entry-form-head { font-size: 14px; font-weight: 500; margin-bottom: 10px; color: #444; }
.entry-form textarea.md-editor { min-height: 190px; }

/* 知识点名实时关联提示 */
.kp-hint { font-size: 11.5px; margin-top: 5px; color: #aaa; line-height: 1.5; }
.kp-hint-ok { color: #0F6E56; }
.kp-hint-new { color: #854F0B; }

@media (max-width: 600px) {
  .entry-photo { max-width: 100%; max-height: 260px; }
  .ledger-actions { width: 100%; }
}

/* ============================================================
   系统操作指南（流程图）：把「从拍一道错题到打印一张纸」画成 4 步
   纯 HTML/CSS 绘制，不依赖外网图片；窄屏自动由横排变竖排
   ============================================================ */
.guide-hero { background: linear-gradient(135deg, #3C3489, #534AB7); color: #fff; border-radius: 12px; padding: 18px 20px; margin-bottom: 18px; }
.guide-hero .gh-title { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.guide-hero .gh-sub { font-size: 13px; color: #D9D5F5; line-height: 1.65; }

.flow { display: flex; align-items: stretch; margin-bottom: 18px; }
.flow-step { flex: 1 1 0; min-width: 0; background: #fff; border: 1px solid #eee; border-radius: 12px; padding: 14px 14px 12px; display: flex; flex-direction: column; }
.flow-arrow { flex: 0 0 30px; display: flex; align-items: center; justify-content: center; color: #C2BEEA; font-size: 20px; line-height: 1; }

.fs-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.fs-no { width: 26px; height: 26px; border-radius: 50%; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fs-title { font-size: 14.5px; font-weight: 600; color: #2C2C2A; }
.fs-list { margin: 0; padding-left: 17px; font-size: 12.5px; color: #555; line-height: 1.75; flex: 1; }
.fs-list li { margin: 2px 0; }
.fs-list code { background: #f2f2f2; padding: 1px 5px; border-radius: 4px; font-size: 11.5px; font-family: "SF Mono", Menlo, Consolas, monospace; color: #3C3489; }
.fs-go { margin-top: 12px; align-self: flex-start; padding: 5px 13px; font-size: 12.5px; border: 1px solid #7F77DD; background: #fff; color: #3C3489; border-radius: 8px; cursor: pointer; transition: background .15s; }
.fs-go:hover { background: #EEEDFE; }

/* 四步各自的配色（编号圆标） */
.flow-step.s1 .fs-no { background: #EEEDFE; color: #3C3489; }
.flow-step.s2 .fs-no { background: #E6F1FB; color: #185FA5; }
.flow-step.s3 .fs-no { background: #FAEEDA; color: #854F0B; }
.flow-step.s4 .fs-no { background: #E1F5EE; color: #0F6E56; }
.flow-step.s1 { border-top: 3px solid #7F77DD; }
.flow-step.s2 { border-top: 3px solid #85B7EB; }
.flow-step.s3 { border-top: 3px solid #EFC88B; }
.flow-step.s4 { border-top: 3px solid #5DCAA5; }

/* 图下方的「随时可用」补充说明 */
.guide-extra { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gex { background: #fff; border: 1px solid #eee; border-radius: 12px; padding: 14px 16px; }
.gex-title { font-size: 14px; font-weight: 600; color: #2C2C2A; margin-bottom: 6px; }
.gex-body { font-size: 12.5px; color: #666; line-height: 1.75; }
.gex-body code { background: #f2f2f2; padding: 1px 5px; border-radius: 4px; font-size: 11.5px; font-family: "SF Mono", Menlo, Consolas, monospace; }
.gex-body .kbd { display: inline-block; border: 1px solid #ddd; border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; font-size: 11.5px; background: #fafafa; margin: 0 1px; }

@media (max-width: 860px) {
  .flow { flex-direction: column; }
  .flow-arrow { flex: 0 0 26px; transform: rotate(90deg); }
  .guide-extra { grid-template-columns: 1fr; }
}

/* ============================================================
   知识点列表：按科目分组
   知识点会随学期累积（一学期 3 门 × 20 个 ≈ 60 条），
   分组比翻页更能保住「一屏看全本学期」的全局感
   ============================================================ */
.kp-group { margin-bottom: 18px; }
.kp-group:last-child { margin-bottom: 0; }
.kp-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 0 2px; }
.kp-group-btn { background: none; border: none; padding: 0; cursor: pointer; font-size: 14px; font-weight: 600; color: #3C3489; display: flex; align-items: center; gap: 6px; }
.kp-group-btn:hover { text-decoration: underline; }
.kp-group-cnt { font-size: 11.5px; font-weight: 400; color: #185FA5; background: #E6F1FB; border-radius: 10px; padding: 1px 8px; }
.kp-group-body { display: flex; flex-direction: column; gap: 8px; }

/* ============================================================
   复习时「随手查知识点」：只读浮层
   盖在复习轮播（z-index 300）之上，看完关掉即可接着复习，不打断进度
   z-index 350，toast 400 仍在最上层
   ============================================================ */
.kpview-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.62); z-index: 350; display: flex; align-items: center; justify-content: center; padding: 16px; }
.kpview-box { background: #fff; border-radius: 14px; width: min(760px, 100%); max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; }
.kpview-head { padding: 14px 18px; border-bottom: 1px solid #eee; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-shrink: 0; }
.kpview-title { font-size: 17px; font-weight: 600; color: #2C2C2A; }
.kpview-meta { font-size: 12.5px; color: #888; margin-top: 4px; }
.kpview-close { background: none; border: none; font-size: 22px; line-height: 1; color: #999; cursor: pointer; padding: 0 4px; flex-shrink: 0; }
.kpview-close:hover { color: #333; }
.kpview-body { padding: 14px 18px; overflow: auto; }
.kpview-body .kp-entry:last-child { margin-bottom: 0; }
.kpview-empty { text-align: center; color: #aaa; font-size: 13.5px; padding: 28px 0; }
.kpview-foot { padding: 10px 18px; border-top: 1px solid #eee; font-size: 12px; color: #999; background: #fafafa; flex-shrink: 0; }

@media (max-width: 600px) {
  .kpview-overlay { padding: 10px; }
  .kpview-box { max-height: 92vh; }
  .kpview-head { padding: 12px 14px; }
  .kpview-body { padding: 12px 14px; }
}
