/* ============ 设计令牌 ============ */
:root {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --line: #e8eaf1;
  --line-strong: #d5d9e5;
  --text: #171a24;
  --muted: #676e82;
  --faint: #9aa1b3;
  --brand: #4f46e5;
  --brand-hover: #4338ca;
  --brand-weak: #eef0ff;
  --ok: #0b8a4b;
  --ok-soft: #e6f6ec;
  --warn: #a15c07;
  --warn-soft: #fdf3e3;
  --danger: #c8302a;
  --danger-soft: #fdeceb;
  --info: #1d4ed8;
  --info-soft: #eaf0ff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .05), 0 1px 3px rgba(17, 24, 39, .04);
  --shadow-lg: 0 18px 45px rgba(17, 24, 39, .13);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
svg { width: 16px; height: 16px; flex: 0 0 auto; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }
a { color: var(--brand); text-decoration: none; }

/* ============ 登录 ============ */
.auth {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 12% -10%, #e9ebff 0%, transparent 55%),
    radial-gradient(700px 420px at 100% 110%, #e6f4f0 0%, transparent 55%),
    var(--bg);
}
.auth-panel {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px 28px 26px;
  box-shadow: var(--shadow-lg);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.mark {
  width: 40px; height: 40px; flex: 0 0 40px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #5b52ea, #4338ca);
  color: #fff; border-radius: 12px;
  font-size: 19px; font-weight: 700;
  box-shadow: 0 6px 14px rgba(79, 70, 229, .28);
}
.auth-brand strong { display: block; font-size: 16px; letter-spacing: .5px; }
.auth-sub { color: var(--faint); font-size: 12px; }
.auth-panel h1 { font-size: 19px; margin: 0 0 6px; }
.auth-hint { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.auth-err { color: var(--danger); font-size: 13px; min-height: 20px; margin: 10px 0 0; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}
.field textarea { resize: vertical; min-height: 72px; line-height: 1.6; }

/* ============ 布局 ============ */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 186px; flex: 0 0 186px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 20px 10px 16px;
  position: sticky; top: 0; height: 100vh;
  transition: width .18s ease, flex-basis .18s ease;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 0 6px 18px; }
.logo .mark { width: 34px; height: 34px; flex-basis: 34px; font-size: 16px; border-radius: 10px; }
.logo-text strong { display: block; font-size: 15px; letter-spacing: .4px; line-height: 1.25; }
.logo-text span { color: var(--faint); font-size: 11.5px; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 8px; border-radius: 9px;
  color: var(--muted); font-size: 13.5px; font-weight: 500;
  transition: background .13s, color .13s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.on { background: var(--brand-weak); color: var(--brand); font-weight: 600; }
.nav a svg { width: 17px; height: 17px; flex: 0 0 17px; stroke-width: 1.7; }
.nav .badge {
  margin-left: auto; background: var(--brand); color: #fff;
  font-size: 11px; padding: 0 6px; border-radius: 20px; line-height: 17px; min-width: 17px; text-align: center;
}
.sidebar-foot { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.who { font-size: 12px; color: var(--faint); padding: 0 2px; }

/* 导航栏收起 / 展开 */
.nav-collapse-btn {
  position: absolute; top: 14px; right: 6px; z-index: 5;
  width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--surface-2); color: var(--muted); font-size: 13px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
.nav-collapse-btn:hover { background: var(--brand-weak); color: var(--brand); border-color: var(--brand-weak); }
.app.nav-collapsed .sidebar { width: 0; flex: 0 0 0; padding-left: 0; padding-right: 0; border-right-color: transparent; overflow: hidden; }
.app.nav-collapsed .main { padding-left: 20px; }
.nav-expand-btn {
  display: none; position: fixed; left: 0; top: 18px; z-index: 40;
  width: 26px; height: 42px; border: 1px solid var(--line); border-left: 0; border-radius: 0 10px 10px 0;
  background: var(--surface); color: var(--muted); font-size: 14px;
  cursor: pointer; align-items: center; justify-content: center; padding: 0;
  box-shadow: 2px 2px 8px rgba(0,0,0,.06);
}
.nav-expand-btn:hover { background: var(--brand-weak); color: var(--brand); }
#app.nav-collapsed + .nav-expand-btn { display: flex; }

.main { flex: 1; min-width: 0; padding: 26px 30px 52px; }
.view { max-width: 1180px; margin: 0 auto; }

/* ============ 页头 ============ */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; margin: 0 0 3px; letter-spacing: -.2px; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text);
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: background .13s, border-color .13s, color .13s, transform .06s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; stroke-width: 1.8; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(79, 70, 229, .3); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { color: var(--danger); border-color: #f0cdcb; background: #fff; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============ 卡片 ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 14.5px; margin: 0; font-weight: 600; }
.card-head .sub { font-size: 12px; color: var(--faint); }
.card-body { padding: 16px 20px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.cols-2r { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1080px) { .cols-2, .cols-2r, .cols-3 { grid-template-columns: 1fr; } }

/* ============ 统计 ============ */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 17px; box-shadow: var(--shadow); }
.stat .k { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 25px; font-weight: 650; letter-spacing: -.6px; margin-top: 4px; line-height: 1.2; }
.stat .v small { font-size: 13px; color: var(--faint); font-weight: 500; margin-left: 3px; }
.stat .d { font-size: 12px; color: var(--faint); margin-top: 2px; }

/* ============ 列表行 ============ */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: flex-start; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .title {
  font-size: 14px; font-weight: 550; line-height: 1.5;
  white-space: normal; overflow-wrap: anywhere; word-break: break-word;
}
.item .meta { font-size: 12px; color: var(--faint); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.item.done .title { color: var(--faint); text-decoration: line-through; }
.time-tag { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); padding: 2px 7px; border-radius: 6px; }

/* ============ 状态 ============ */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 9px; border-radius: 20px; font-weight: 500; }
.pill.gray { background: #f1f2f6; color: var(--muted); }
.pill.green { background: var(--ok-soft); color: var(--ok); }
.pill.amber { background: var(--warn-soft); color: var(--warn); }
.pill.red { background: var(--danger-soft); color: var(--danger); }
.pill.blue { background: var(--info-soft); color: var(--info); }
.pill.violet { background: var(--brand-weak); color: var(--brand); }
.pill.teal { background: #e6f7f4; color: #0f9d8f; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 5px 11px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); font-size: 12.5px; color: var(--muted); cursor: pointer;
  transition: all .13s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.on.green { background: var(--ok); border-color: var(--ok); }
.chip.on.amber { background: #c77a09; border-color: #c77a09; }
.chip.on.red { background: var(--danger); border-color: var(--danger); }

/* ============ 表格 ============ */
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
table.tb td { padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.tb tr:last-child td { border-bottom: 0; }
table.tb tr:hover td { background: #fcfcfe; }
.num { font-variant-numeric: tabular-nums; }

/* ============ 空状态 ============ */
.empty { padding: 34px 20px; text-align: center; color: var(--faint); font-size: 13px; }
.empty strong { display: block; color: var(--muted); font-size: 13.5px; margin-bottom: 4px; font-weight: 550; }

/* ============ 进度条 ============ */
.bar { height: 6px; border-radius: 6px; background: #edeef4; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: var(--brand); transition: width .3s; }
.bar > i.green { background: #16a34a; }
.bar > i.amber { background: #e39a12; }
.bar > i.red { background: #dc4a40; }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20, 23, 33, .38);
  display: grid; place-items: center; padding: 24px; z-index: 60;
  animation: fade .14s ease;
}
.modal {
  width: 100%; max-width: 520px; max-height: 86vh; overflow: auto;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg);
  animation: pop .16s ease;
}
.modal.wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 17px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99) } }

/* ============ 提示 ============ */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 20px);
  background: #1d2230; color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: all .22s; z-index: 90;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .22); max-width: 80vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ 分段标签 ============ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button {
  border: 0; background: none; padding: 9px 13px; font-size: 13.5px; color: var(--muted);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ============ 徽标/科目 ============ */
.subject-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.subject-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 20px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 13px; cursor: pointer; }
.subject-chip.on { border-color: var(--brand); background: var(--brand-weak); color: var(--brand); font-weight: 600; }
.subject-chip .sw { width: 8px; height: 8px; border-radius: 50%; }

/* ============ 文本工具 ============ */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.mono { font-variant-numeric: tabular-nums; }
.clip { overflow-wrap: anywhere; word-break: break-word; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.mt8 { margin-top: 8px } .mt12 { margin-top: 12px } .mt16 { margin-top: 16px } .mt24 { margin-top: 24px }
.mb0 { margin-bottom: 0 } .mb8 { margin-bottom: 8px } .mb12 { margin-bottom: 12px } .mb16 { margin-bottom: 16px }
.preline { white-space: pre-line; }
.hint { font-size: 12.5px; color: var(--faint); line-height: 1.6; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

/* ============ 知识点树 ============ */
.unit { border: 1px solid var(--line); border-radius: 11px; margin-bottom: 10px; overflow: hidden; background: var(--surface); }
.unit-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: var(--surface-2); cursor: pointer; }
.unit-head strong { font-size: 13.5px; font-weight: 600; }
.topic-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.topic-row:hover { background: #fbfbfe; }
.topic-row.on { background: var(--brand-weak); }
.topic-row .name { font-size: 13.5px; min-width: 0; }

/* 单元下的小节（二级目录） */
.sec-block { border-top: 1px solid var(--line); }
.sec-head { display: flex; align-items: center; gap: 8px; padding: 8px 14px 6px 12px; }
.sec-tick { width: 7px; height: 7px; border-radius: 2px; background: var(--brand, #4f46e5); opacity: .55; flex: 0 0 auto; transform: rotate(45deg); }
.sec-head strong { font-size: 12.5px; font-weight: 600; color: #4b5060; }
.sec-block .topic-row { padding-left: 26px; background: transparent; }
.sec-block .topic-row:hover { background: #fbfbfe; }
.sec-block .topic-row.on { background: var(--brand-weak); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; }
.s-todo { background: #cbd0dc; }
.s-doing { background: #e39a12; }
.s-done { background: #16a34a; }
.s-review { background: #dc4a40; }

/* 应知应会 checklist */
.check { display: flex; align-items: flex-start; gap: 9px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.check:last-child { border-bottom: 0; }
.check input { margin-top: 3px; width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.check .t { flex: 1; font-size: 13.5px; line-height: 1.5; }
.check.ok .t { color: var(--faint); text-decoration: line-through; }

/* 图表 */
.chart-wrap { padding: 6px 0 0; }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }

/* 日记 */
.diary-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; }
.diary-layout.full { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) { .diary-layout { grid-template-columns: 1fr; } }
.diary-list { max-height: 640px; overflow: auto; }
.diary-entry { padding: 11px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.diary-entry:hover { background: var(--surface-2); }
.diary-entry.on { background: var(--brand-weak); }
.diary-entry .d { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.diary-entry .x { font-size: 13px; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
textarea.diary-text { min-height: 320px; line-height: 1.9; font-size: 14.5px; }

/* 机构学习 */
.org-layout { display: grid; grid-template-columns: 258px minmax(0, 1fr); gap: 16px; align-items: start; }
.org-layout.full { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1000px) { .org-layout { grid-template-columns: 1fr; } }
.org-list { max-height: 760px; overflow: auto; }
.org-list-body { padding: 10px 12px; }
.org-list .unit { margin-bottom: 8px; }
.org-list .unit:last-child { margin-bottom: 0; }
.org-list .unit-head { padding: 9px 10px; gap: 4px; }
.org-list .unit-head strong { font-size: 13px; }
.org-list .unit-head .btn.icon-only { padding: 4px 5px; }
.org-list .unit-head .btn.icon-only svg { width: 13px; height: 13px; }
.org-list .topic-row { padding: 8px 10px; gap: 8px; }
.org-list .topic-row .name { font-size: 13px; }
.org-add-course { padding: 8px 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.org-add-course input, .org-add-course select { width: 100%; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 7px; font-size: 12.5px; background: var(--surface); }
.org-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* 上课记录 */
.lesson-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.lesson-item:last-child { border-bottom: 0; }
.lesson-day { flex: 0 0 46px; text-align: center; font-variant-numeric: tabular-nums; padding-top: 1px; }
.lesson-day strong { display: block; font-size: 13.5px; font-weight: 600; }
.lesson-day span { font-size: 11px; color: var(--faint); }
.lesson-title { font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.lesson-fb { margin-top: 6px; font-size: 12.5px; color: var(--muted); background: var(--surface-2); border-left: 3px solid #ddd8fb; padding: 6px 9px; border-radius: 0 7px 7px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.lesson-ops { display: flex; gap: 2px; flex: 0 0 auto; }

/* 薄弱点：可调整错题归属 */
.weak-row { margin-bottom: 9px; }
.weak-head { display: flex; align-items: center; gap: 6px; font-size: 12.5px; margin-bottom: 4px; }
.weak-head .btn.icon-only { padding: 2px 4px; margin-left: 2px; }
.weak-head .btn.icon-only svg { width: 13px; height: 13px; }

/* 打印 A4 预览 */
.sheet {
  background: #fff; color: #000;
  width: 210mm; min-height: 297mm;
  padding: 16mm 16mm 14mm;
  margin: 0 auto;
  box-sizing: border-box;
  font-family: "Songti SC", "SimSun", "Microsoft YaHei", serif;
  font-size: 11.5pt; line-height: 1.75;
}
.sheet h1 { font-size: 19pt; text-align: center; margin: 0 0 4mm; font-family: "PingFang SC", "Microsoft YaHei", sans-serif; }
.sheet .sheet-meta { text-align: center; font-size: 9.5pt; color: #333; margin-bottom: 7mm; }
.sheet h2 { font-size: 13pt; margin: 6mm 0 2mm; padding-bottom: 1.5mm; border-bottom: 1px solid #000; font-family: "PingFang SC", "Microsoft YaHei", sans-serif; }
.sheet table { width: 100%; border-collapse: collapse; font-size: 10.5pt; }
.sheet table th, .sheet table td { border: 1px solid #444; padding: 2mm 2.4mm; text-align: left; vertical-align: top; }
.sheet table th { background: #f1f1f1; font-weight: 600; }
.sheet .blank-line { height: 9mm; border-bottom: 1px dashed #999; }
.sheet .q { margin-bottom: 5mm; page-break-inside: avoid; }
.sheet .q .qn { font-weight: 700; }
.sheet .foot { margin-top: 8mm; font-size: 9pt; color: #555; text-align: center; }
/* 多页（练习 + 附件）：每张 sheet 独占一页 */
.sheet + .sheet { page-break-before: always; break-before: page; }
.sheet .att-head { font-size: 9.5pt; color: #444; margin-bottom: 3mm; font-family: "PingFang SC", "Microsoft YaHei", sans-serif; }
.sheet .att-page { text-align: center; page-break-inside: avoid; }
.sheet .att-page img { max-width: 100%; max-height: 258mm; object-fit: contain; display: block; margin: 0 auto; }
/* 纯原文件页：不加标题，整页铺满 */
.sheet .att-page.att-full { padding: 0; }
.sheet .att-page.att-full img { width: 100%; max-height: 268mm; }

/* ---------- 目录拖拽排序 ---------- */
[data-drag] { cursor: grab; }
[data-drag]:active { cursor: grabbing; }
.dragging { opacity: .45; }
.drag-over { box-shadow: inset 0 2px 0 0 #4f46e5; }

/* ---------- 知识点多选下拉 ---------- */
.msel { position: relative; }
.msel-toggle {
  width: 100%; display: flex; align-items: center; gap: 8px; justify-content: space-between;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 9px;
  padding: 9px 11px; font-size: 13px; color: var(--ink); cursor: pointer; text-align: left;
}
.msel-toggle:hover { border-color: #b9bdd0; }
.msel.open .msel-toggle { border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.msel-toggle svg { width: 14px; height: 14px; color: #8b90a3; }
.msel.open .msel-chev { transform: rotate(180deg); }

/* ---------- 单元收缩 / 展开 ---------- */
.unit-chev { display: inline-flex; align-items: center; cursor: pointer; color: #8a8a8a; transition: transform .15s ease; flex: 0 0 auto; transform: rotate(-90deg); }
.unit-chev svg { width: 14px; height: 14px; }
.unit-chev.open { transform: none; }
.unit-head strong[data-act] { cursor: pointer; }
.msel-panel {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid var(--line-strong); border-radius: 10px;
  box-shadow: 0 18px 40px rgba(24,28,48,.14); overflow: hidden;
}
.msel-search { padding: 8px; border-bottom: 1px solid var(--line); }
.msel-search input { width: 100%; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 12.5px; }
.msel-list { max-height: 208px; overflow: auto; padding: 4px; }
.msel-item {
  width: 100%; display: flex; align-items: center; gap: 8px; background: none; border: 0;
  padding: 7px 8px; border-radius: 8px; font-size: 12.8px; color: var(--ink); cursor: pointer; text-align: left;
}
.msel-item:hover { background: #f4f5fa; }
.msel-item.on { background: #eef0ff; color: #3b32c9; font-weight: 600; }
.msel-tick { width: 15px; height: 15px; flex: 0 0 15px; display: flex; align-items: center; justify-content: center; }
.msel-tick svg { width: 14px; height: 14px; }
.msel-new { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); background: #fafbfe; }
.msel-new input { flex: 1; min-width: 0; width: auto; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 12.5px; }

/* ---------- 练习记录 ---------- */
.drill-ops { display: flex; gap: 2px; flex: 0 0 auto; align-items: center; }
.drill-ops .btn.icon-only { padding: 4px 5px; }
.drill-ops .btn.icon-only svg { width: 14px; height: 14px; }
/* 历次练习记录 */
.drill-sessions { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 6px; display: grid; gap: 4px; }
.drill-session { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 2px 0; }
.drill-session .grow { color: var(--muted); }
.drill-session .btn.icon-only { opacity: 0; transition: opacity .12s; padding: 2px 4px; }
.drill-session:hover .btn.icon-only { opacity: 1; }
/* 目录知识点行上的练习统计 */
.drill-badge {
  flex: 0 0 auto; font-size: 11.5px; color: #0f9d8f; background: #e6f7f4;
  border-radius: 10px; padding: 1px 7px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
/* 知识点详情关联练习条目 */
.topic-drill {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 8px; margin-bottom: 6px; cursor: pointer; transition: background .12s, border-color .12s;
}
.topic-drill:hover { background: var(--brand-weak); border-color: var(--brand); }
.topic-drill .name { font-size: 12.5px; font-weight: 500; }
/* 跳转高亮 */
.item.drill-hl { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-weak); border-radius: 10px; }
@keyframes drillFlash { 0% { background: var(--brand-weak); } 100% { background: transparent; } }
.item.drill-hl-flash { animation: drillFlash 2.4s ease-out; }
.att-chip { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.att-chip svg { width: 12px; height: 12px; color: #6b7280; }

/* 题目 / 答案附件 */
.att-kind { font-size: 10.5px; font-weight: 600; padding: 1px 5px; border-radius: 5px; line-height: 1.4; }
.att-q .att-kind, .chip.att-q > .att-kind { background: #eef2ff; color: #4f46e5; }
.att-ans .att-kind, .chip.att-ans > .att-kind { background: #ecfdf5; color: #059669; }
.att-ans svg { color: #059669; }
.att-two { display: grid; grid-template-columns: 1fr; gap: 12px; }
.att-block { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg-soft, #fafafc); }
.att-label { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.att-label b { font-size: 12.5px; color: var(--text, #1f2430); }
.att-label .hint { font-size: 11px; }
.check-row { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 8px; font-size: 13px; cursor: pointer; }
.check-row:hover { border-color: var(--line-strong); }
.check-row input[type="checkbox"] { width: 15px; height: 15px; accent-color: #4f46e5; }

/* ============ 打印 ============ */
.print-root { display: none; }
@media print {
  body { background: #fff; }
  /* overflow-x:hidden 会让打印引擎把根元素当滚动容器，忽略强制分页 */
  html, body { overflow: visible !important; height: auto !important; }
  #auth, #app, #modalRoot, #toast { display: none !important; }
  .print-root { display: block !important; }
  .sheet { width: auto; min-height: 0; padding: 0; box-shadow: none; }
  @page { size: A4; margin: 14mm; }
  .sheet { padding: 0; }
}

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d9dce5; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #c3c8d6; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 满月感恩：LOGO 与导航层级 ============ */
html, body { overflow-x: hidden; }

/* 月亮 LOGO */
.moon-mark {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; overflow: visible;
  background: linear-gradient(160deg, #1e2447 0%, #2b2f63 55%, #3a3070 100%);
  box-shadow: 0 2px 10px rgba(42, 48, 99, .35), inset 0 0 0 1px rgba(255,255,255,.06);
}
.moon-mark svg { width: 78%; height: 78%; }
.auth .moon-mark { width: 38px; height: 38px; flex-basis: 38px; }
.logo .moon-mark { width: 36px; height: 36px; flex-basis: 36px; }
.mark { display: inline-flex; align-items: center; justify-content: center; }

/* 侧边栏导航：分组标题 + 子项层级 */
.nav-group {
  display: flex; align-items: center; gap: 7px;
  margin: 16px 12px 4px;
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
  color: var(--muted);
  user-select: none;
}
.nav-group::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}
.nav-group svg { width: 13px; height: 13px; stroke-width: 2; }
.nav-sep { height: 1px; margin: 10px 12px 10px; background: var(--line); }
.nav a.sub { padding-left: 22px; font-size: 13.2px; position: relative; }
.nav a.sub::before {
  content: ''; position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--faint); opacity: .6;
}
.nav a.sub.on::before { background: var(--brand); opacity: 1; }

/* LOGO 下的签名文字 */
.logo-text .logo-sign { display: block; }

/* 今日页布局：上排任务+快速记录，下方孩子学习任务大区域 */
.grid.today-top { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: stretch; }
.grid.today-top > .card { display: flex; flex-direction: column; }
.grid.today-top > .card > .list { flex: 1; }
@media (max-width: 960px) { .grid.today-top { grid-template-columns: 1fr; } }
.kid-zone { margin-top: 16px; }
.kid-zone-grid { display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) { .kid-zone-grid { grid-template-columns: 1fr; } .kid-zone-grid > section:nth-child(odd) { border-right: 0; } }
.kid-zone-grid > section { padding: 2px 16px 14px; min-width: 0; border-top: 1px solid var(--line); }
.kid-zone-grid > section:nth-child(odd) { border-right: 1px solid var(--line); }
.kid-zone-grid h3 {
  display: flex; align-items: center; gap: 7px;
  margin: 12px 0 4px; font-size: 13.5px; font-weight: 700;
}
.kid-zone-grid h3 svg { width: 14px; height: 14px; stroke-width: 2; color: var(--brand); }
.kid-zone-grid h3 .sub { font-weight: 400; font-size: 11.5px; color: var(--faint); }
.plan-block { padding: 8px 0 10px; border-bottom: 1px dashed var(--line); }
.plan-block:last-child { border-bottom: 0; padding-bottom: 2px; }
.plan-child { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 4px; font-size: 13px; }
.plan-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 6px 2px; font-size: 12.8px;
  border-bottom: 1px dashed transparent;
}
.plan-item + .plan-item { border-bottom-color: rgba(0,0,0,.04); }
.plan-item.muted { color: var(--faint); }

/* 孩子切换条 */

/* 今日驾驶舱：自适应、无横向滚动 */
.stats-auto { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.stat.click { cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.stat.click:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: 0 6px 18px rgba(79, 70, 229, .12);
}
.grid.dash { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); align-items: start; }
@media (max-width: 860px) { .grid.dash { grid-template-columns: 1fr; } }

/* 孩子切换条 */
.child-chips { flex-wrap: wrap; }
.child-chips .chip { display: inline-flex; align-items: center; gap: 4px; }
.child-chips .chip svg { width: 12px; height: 12px; }

/* 孩子学习提醒条（校内/机构/课外作业页共用） */
.remind-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px;
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface-2); font-size: 12.5px; color: var(--muted);
}
.remind-bar .rb-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--text, #1f2430); font-size: 13px; }
.remind-bar .rb-title svg { width: 14px; height: 14px; color: var(--brand); }
.remind-bar .rb-item b { color: var(--text, #1f2430); font-variant-numeric: tabular-nums; margin-left: 2px; }
.remind-bar .hint { flex-basis: 100%; }

/* 仅图标的小按钮 */
.btn.icon-only { padding: 5px 7px; }
.btn.icon-only svg { width: 15px; height: 15px; }

/* 任务列表内联调整：类别 / 重复方式 */
.mini-field { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--faint); white-space: nowrap; }
.mini-select {
  font-size: 12px; padding: 2px 6px; border: 1px solid var(--line-strong);
  border-radius: 7px; background: var(--surface, #fff); color: var(--muted);
  cursor: pointer; font-family: inherit; max-width: 160px;
}
.mini-select:hover, .mini-select:focus { border-color: var(--brand); color: var(--text, #1f2430); outline: none; }
.inline-days { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.inline-days .chip { padding: 1px 8px; font-size: 11.5px; }
.chip.remind-toggle { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 2px 9px; }
.chip.remind-toggle svg { width: 12px; height: 12px; }
.task-dates { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 11.5px; color: var(--faint); }

/* ============ 任务页：卡片内展开编辑 ============ */
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.seg-btn {
  border: 0; background: transparent; cursor: pointer; font-family: inherit;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  padding: 5px 14px; border-radius: 8px; transition: all .15s;
}
.seg-btn:hover { color: var(--text, #1f2430); }
.seg-btn.on { background: var(--surface, #fff); color: var(--brand); box-shadow: 0 1px 4px rgba(20, 24, 50, .1); }

.task-row { border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-row > .item { border-bottom: 0; }
.task-row:hover { background: #fcfcfe; }

/* 任务行：左侧内容 + 右侧控制面板（设置项全部靠右，每行两个属性） */
.task-item { align-items: flex-start; flex-wrap: wrap; row-gap: 10px; padding: 12px 18px; }
.task-item .task-main { flex: 1 1 220px; min-width: 190px; display: flex; flex-direction: column; gap: 3px; }
textarea.task-title-input {
  width: 100%; border: 1px solid transparent; background: transparent; resize: none; overflow: hidden;
  field-sizing: content; min-height: 28px;
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--text, #1f2430);
  padding: 2px 6px; border-radius: 7px; line-height: 1.5; transition: border-color .14s, background .14s;
}
textarea.task-title-input::placeholder { color: var(--faint); font-weight: 500; }
textarea.task-title-input:hover { border-color: var(--line-strong); background: var(--surface, #fff); }
textarea.task-title-input:focus { outline: none; border-color: var(--brand); background: var(--surface, #fff); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }
textarea.task-note-input {
  width: 100%; border: 1px solid transparent; background: transparent; resize: none; overflow: hidden;
  field-sizing: content; min-height: 22px;
  font-family: inherit; font-size: 12px; color: var(--muted); padding: 1px 6px; border-radius: 7px; line-height: 1.55;
}
textarea.task-note-input::placeholder { color: var(--faint); }
textarea.task-note-input:hover { border-color: var(--line); background: var(--surface, #fff); }
textarea.task-note-input:focus { outline: none; border-color: var(--brand); background: var(--surface, #fff); }
.task-main .meta { margin-top: 3px; padding-left: 6px; }

.task-ctl {
  flex: 0 0 auto; width: 330px; margin-left: auto;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 10px; align-content: start;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2);
}
.ctl { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 11px; color: var(--faint); white-space: nowrap; }
.ctl > span { flex-shrink: 0; }
.ctl .mini-select, .ctl .mini-input { flex: 1 1 auto; min-width: 0; }
.mini-input {
  font-size: 11.5px; padding: 3px 5px; border: 1px solid var(--line-strong);
  border-radius: 7px; background: var(--surface, #fff); color: var(--muted);
  font-family: inherit; max-width: 100%;
}
.mini-input:hover, .mini-input:focus { border-color: var(--brand); color: var(--text, #1f2430); outline: none; }
.ctl-toggles { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 1px; }
.ctl-toggles .chip { padding: 2px 8px; font-size: 11px; }
.ctl-toggles .inline-days { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.ctl-toggles .inline-days .chip { padding: 1px 7px; font-size: 11px; }

/* 实际日期：属性名称完整换行显示（标签在上、输入框在下，各占一整行） */
.ctl.ctl-date { flex-direction: column; align-items: stretch; gap: 3px; white-space: normal; grid-column: 1 / -1; }
.ctl.ctl-date > span { line-height: 1.25; white-space: normal; }

/* 属性面板下方操作按钮行 */
.ctl-actions {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end;
  gap: 2px; margin-top: 2px; padding-top: 2px; border-top: 1px dashed var(--line);
}

@media (max-width: 980px) {
  .task-ctl { width: 100%; margin-left: 0; order: 3; }
}
.form-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.form-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 900px) {
  .form-3, .form-4 { grid-template-columns: 1fr 1fr; }
}

/* 弹窗里的「提醒设置」区域 */
.remind-box {
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2);
  padding: 12px 14px 10px; margin: 4px 0 12px;
}
.remind-box-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 650; color: var(--muted);
  margin-bottom: 10px;
}
.remind-box-title svg { width: 14px; height: 14px; color: var(--brand); }

/* 今日页：状态竖排（一行一个），任务内容占更多宽度 */
.chips.status-col { flex-direction: column; align-items: stretch; gap: 4px; min-width: 92px; }
.chips.status-col .chip { justify-content: center; white-space: nowrap; padding: 3px 8px; font-size: 11.5px; }

/* 今日页第一行：两卡等高，快速记录输入框随任务卡高度拉伸 */
.grid.today-top > .card .card-body { flex: 1; display: flex; flex-direction: column; }
.grid.today-top > .card .card-body textarea { flex: 1; min-height: 120px; }
.grid.today-top > .card .card-body .row { margin-top: auto; }
.check-row {
  gap: 8px; margin: 0 0 12px; font-size: 12.8px; cursor: pointer; align-items: center;
}
.check-row input[type=checkbox] { width: 15px; height: 15px; accent-color: #4f46e5; }

/* 列表工具条（搜索） */
.list-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--surface, #fff);
}
.tb-search {
  display: inline-flex; align-items: center; gap: 7px;
  flex: 0 1 340px; min-width: 180px;
  padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--surface-2); color: var(--faint);
}
.tb-search svg { width: 14px; height: 14px; flex-shrink: 0; }
.tb-search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 12.8px; font-family: inherit; color: var(--text, #1f2430);
}
.tb-search:focus-within { border-color: var(--brand); background: var(--surface, #fff); }

/* 孩子信息卡片 */
.kid-card {
  border: 1px solid var(--line); border-radius: 11px;
  padding: 11px 13px; margin-bottom: 10px; background: var(--surface-2);
}
.kid-card .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 12.5px; color: var(--muted); }

/* 打卡菜单页按钮已在服务端内联 */

/* ---------- 单词表 ---------- */
.word-table { border-collapse: collapse; width: 100%; font-size: 12.5px; table-layout: fixed; }
.word-table thead th {
  position: relative; text-align: left; font-weight: 600; font-size: 12px; color: var(--muted);
  padding: 8px 10px; border-bottom: 2px solid var(--line-strong); background: var(--surface-2);
  user-select: none; cursor: pointer; white-space: normal; word-break: break-all; overflow: hidden;
}
.word-table thead th .col-grip {
  position: absolute; top: 0; right: -3px; width: 7px; height: 100%; cursor: col-resize; z-index: 2;
}
.word-table thead th .col-grip:hover { background: var(--brand-weak); }
/* 表头拖动调整列顺序 */
.word-table thead th[draggable="true"] { cursor: grab; }
.word-table thead th[draggable="true"]:active { cursor: grabbing; }
.word-table thead th.dragging { opacity: .45; }
.word-table thead th.drag-over { box-shadow: inset 3px 0 0 0 var(--brand), inset 0 2px 0 0 var(--brand); background: var(--brand-weak); }
.word-table .filter-row td { padding: 4px 6px; border-bottom: 1px solid var(--line); background: #fcfcfe; }
.word-table .word-filter { width: 100%; padding: 4px 7px; font-size: 11.5px; border: 1px solid var(--line-strong); border-radius: 6px; }
.word-table tbody td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; word-break: break-word; overflow-wrap: anywhere; }
/* 单元格内容可换行展示（覆盖 .clip 的单行省略） */
.word-table td.clip { white-space: normal; overflow: visible; text-overflow: clip; }
.word-table tbody tr:hover { background: #fbfbfe; }
.word-table td.num { font-variant-numeric: tabular-nums; }
.word-table td.warn-num { color: var(--danger); font-weight: 600; }
.word-table .row-ops { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.word-table .row-ops .btn { padding: 2px 6px; }
/* 打印 / Word 输出中的表格 */
.word-print-table { border-collapse: collapse; width: 100%; font-size: 10.5pt; }
.word-print-table th, .word-print-table td { border: 1px solid #999; padding: 4pt 6pt; text-align: left; vertical-align: top; }
.word-print-table th { background: #f0f0f0; }
.word-print-table td.blank { height: 11mm; }
/* 应知应会贴图 */
.mk-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 2px 26px; align-items: flex-start; }
.mk-img { position: relative; display: inline-block; }
.mk-img img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; display: block; }
.mk-img-x { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; border: none; background: #ef4444; color: #fff; font-size: 12px; line-height: 17px; cursor: pointer; padding: 0; text-align: center; }
.word-imp-table { border-collapse: collapse; min-width: max-content; width: 100%; font-size: 12px; }
.word-imp-table th, .word-imp-table td { border-bottom: 1px solid var(--line); padding: 5px 6px; text-align: left; }
.word-imp-table td input { width: 100%; min-width: 84px; box-sizing: border-box; padding: 4px 6px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: 12px; }
/* 导入列映射 */
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 8px 0 10px; }
.map-item { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.map-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 4px; }
.map-head .small { max-width: 60%; color: var(--muted); overflow-wrap: anywhere; }
.map-sel { width: 100%; padding: 4px 6px; font-size: 12px; border: 1px solid var(--line-strong); border-radius: 6px; }
.map-sample { margin-top: 4px; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.word-imp-table .merge-tag { color: var(--warn); font-weight: 600; }

/* 机构学习：顶部机构与课程选择 / 记课关联多选 / 科目总览 */
.org-pick-row { padding: 6px 0 10px; border-bottom: 1px dashed var(--line); }
.org-pick-row:last-child { border-bottom: 0; }
.lnk-group { display: flex; gap: 8px; align-items: flex-start; margin-top: 7px; }
.lnk-label { flex: 0 0 42px; font-size: 12px; color: var(--muted); padding-top: 5px; }
.lnk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lnk-chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line-strong); border-radius: 16px; padding: 3px 10px;
  font-size: 12px; cursor: pointer; user-select: none; background: var(--surface);
}
.lnk-chip:has(input:checked) { border-color: var(--brand); background: var(--brand-weak); color: var(--brand); font-weight: 600; }
.lnk-chip input { accent-color: #4f46e5; margin: 0; }
.ov-sub-card { margin-bottom: 14px; }
.ov-unit { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.ov-unit:last-child { border-bottom: 0; }
.ov-unit-head { display: flex; gap: 10px; align-items: center; padding: 2px 0 6px; }
.ov-sec { padding: 4px 0 4px 18px; }
.ov-sec-head { display: flex; gap: 10px; align-items: center; font-size: 13px; padding: 2px 0; }
.ov-topic { display: flex; gap: 8px; align-items: center; padding: 4px 0 4px 18px; font-size: 13px; }

/* 目录与进度：单元 / 小节 / 知识点 展示与输入区域颜色区分（仅校内目录页生效） */
.catalog-tree .unit { border-color: #dfe3f9; background: #fdfdff; }
.catalog-tree .unit-head { background: #eef2ff; }
.catalog-tree .unit-head:hover { background: #e6ebff; }
.catalog-tree .unit-head strong { color: #3f4470; }
.catalog-tree .sec-block { background: #f6fbf9; border-top: 1px solid #ddeee8; }
.catalog-tree .sec-head { background: #e3f4ed; border-radius: 8px; margin: 2px 6px 0; padding: 8px 10px 6px 6px; }
.catalog-tree .sec-head:hover { background: #d9efe5; }
.catalog-tree .sec-head strong { color: #3d6b57; }
.catalog-tree .topic-row { background: #fffcf2; }
.catalog-tree .topic-row:hover,
.catalog-tree .sec-block .topic-row:hover { background: #fbf2d7; }
.catalog-tree .topic-row.on,
.catalog-tree .sec-block .topic-row.on { background: var(--brand-weak); }
.catalog-tree .cat-input-row { background: #f7f9fc; border-top: 1px dashed #c6cfdf; }
.catalog-tree .cat-input-row input { background: #ffffff; }

/* 全局支持换行展示：长文本自动换行，不再单行截断（.btn 等微标签保持单行） */
body { overflow-wrap: break-word; }

/* 重要知识点：列表中红色加粗 + 开头小红旗（打印目录同样样式） */
.imp-flag { font-size: 12px; }
.imp-name { color: #d40000; font-weight: 700; }

/* 快速新建行：标记为重要的小红旗开关（输入框左侧） */
.imp-toggle { border: none; background: none; cursor: pointer; font-size: 14px; line-height: 1; padding: 4px 2px; filter: grayscale(1); opacity: .38; transition: filter .15s, opacity .15s, transform .15s; }
.imp-toggle:hover { opacity: .7; }
.imp-toggle.on { filter: none; opacity: 1; transform: scale(1.12); }
