/* 技能樹學習App — 依「技能樹學習App.html」設計（Duolingo 亮色 chunky 風） */

@font-face {
  font-family: 'BpmfZihiSans';
  src: url('../fonts/BpmfZihiSans-Regular.woff2') format('woff2');
  font-display: swap;
}

:root {
  --ui-font: 'Baloo 2', 'BpmfZihiSans', 'Noto Sans TC', sans-serif;
  --body-font: 'BpmfZihiSans', 'Noto Sans TC', sans-serif;
  --cjk-spacing: 0.08em;   /* 注音字較窄，加字距助讀 */
  --cjk-leading: 1.85;
}
/* 一般字模式（Noto Sans TC） */
#app.font-noto {
  --ui-font: 'Baloo 2', 'Noto Sans TC', sans-serif;
  --body-font: 'Noto Sans TC', sans-serif;
  --cjk-spacing: 0;
  --cjk-leading: 1.65;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body { background: #EFEAE2; }

#app {
  position: relative; height: 100dvh; max-width: 430px; margin: 0 auto;
  overflow: hidden; background: #FAF7F0;
  font-family: var(--body-font);   /* 字型掛在 #app：font-noto 的變數覆寫才會生效 */
}
@media (min-width: 431px) {
  #app { box-shadow: 0 0 60px rgba(0,0,0,0.18); border-left: 1px solid #E3DDD2; border-right: 1px solid #E3DDD2; }
}
#screen { position: absolute; inset: 0; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; background: #FAF7F0; }

@keyframes nodePulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes sheetUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* ── 共用 ── */
.h1 { font-family: var(--ui-font); font-weight: 800; font-size: 24px; color: #212529; margin: 20px 0 4px; }
.p-note { font-size: 14.5px; color: #868E96; margin: 0 0 16px; line-height: var(--cjk-leading); letter-spacing: var(--cjk-spacing); }
.fb-explain, .step-d { letter-spacing: var(--cjk-spacing); }
.chip { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.mbar { background: #E9ECEF; border-radius: 99px; overflow: hidden; width: 100%; }
.mbar > div { height: 100%; border-radius: 99px; transition: width .5s ease; }

.btn3d {
  font-family: var(--ui-font); font-weight: 800; font-size: 17px; letter-spacing: 1px;
  padding: 14px 24px; border-radius: 16px; cursor: pointer; min-height: 44px;
  box-shadow: 0 4px 0 var(--press-sh); transition: transform .08s, box-shadow .08s;
}
.btn3d.small { font-size: 15px; padding: 10px 18px; }
.btn3d:active:not(:disabled) { transform: translateY(4px); box-shadow: none; }
.btn3d:disabled { opacity: .55; cursor: default; }

/* ── 技能節點泡泡 ── */
.snode {
  border-radius: 50%; border-style: solid; border-width: 4px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative; flex-shrink: 0;
  font-family: var(--ui-font); font-weight: 800; padding: 0;
}
.snode.pulse { animation: nodePulse 1.6s ease-in-out infinite; }
.snode-mark {
  position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 50%;
  color: #fff; font-size: 15px; display: flex; align-items: center; justify-content: center;
  border: 3px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,.15);
}
.snode-lock { position: absolute; bottom: -6px; right: -4px; font-size: 16px; }

/* ── 技能樹畫面 ── */
.tree-head { background: #fff; border-bottom: 2px solid #F1F3F5; padding: 2px 20px 0; flex-shrink: 0; }
.subj-row { display: flex; gap: 10px; justify-content: center; padding: 10px 0 4px; }
.subj-btn {
  width: 46px; height: 46px; border-radius: 16px; cursor: pointer; border-style: solid; border-width: 3px;
  /* 字型固定：科目圖示不跟注音字切換 */
  font-family: 'Baloo 2', 'Noto Sans TC', sans-serif; font-weight: 800; font-size: 19px;
  display: flex; align-items: center; justify-content: center; transition: all .15s; padding: 0;
}
.subj-btn.active { transform: scale(1.08); }

.tree-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 0; padding-bottom: 10px; background: #fff; }
.tree-head .tree-meta { padding-bottom: 10px; }
.grade-pill { display: flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; padding: 4px 0; white-space: nowrap; }
.grade-pill .subj-name { font-family: var(--ui-font); font-weight: 800; font-size: 18px; color: #212529; }
.grade-pill > span:last-child { font-family: var(--ui-font); font-weight: 800; font-size: 13px; border-radius: 99px; padding: 4px 12px; display: inline-flex; align-items: center; gap: 4px; }
.grade-pill small { font-size: 10px; }
.meta-chips { display: flex; gap: 8px; align-items: center; }
.gear-btn {
  width: 40px; height: 40px; border-radius: 14px; cursor: pointer; padding: 0; font-size: 19px;
  background: #fff; border: 2px solid #DEE2E6; box-shadow: 0 3px 0 #DEE2E6;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.gear-btn:active { transform: translateY(3px); box-shadow: none; }

/* 設定頁字型卡 */
.font-cards { display: flex; flex-direction: column; gap: 12px; }
.font-card {
  background: #fff; border: 2.5px solid #DEE2E6; box-shadow: 0 4px 0 #DEE2E6;
  border-radius: 18px; padding: 14px 16px; cursor: pointer; text-align: left; width: 100%;
}
.font-card.active { border-color: #1C7ED6; box-shadow: 0 4px 0 #A5D8FF; background: #F8FBFF; }
.font-card:active { transform: translateY(3px); box-shadow: none; }
.fc-row { display: flex; gap: 12px; align-items: center; }
.fc-glyph {
  width: 40px; height: 40px; border-radius: 13px; flex-shrink: 0;
  background: #F1F3F5; border: 2.5px solid #DEE2E6; color: #495057;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ui-font); font-weight: 800; font-size: 18px;
}
.fc-name { font-family: var(--ui-font); font-weight: 800; font-size: 16px; color: #343A40; display: flex; align-items: center; gap: 8px; }
.fc-note { font-size: 12.5px; color: #868E96; margin-top: 2px; }
.fc-sample {
  margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: #F8F9FA;
  font-size: 16px; font-weight: 700; color: #343A40;
}

.tree-scroll { flex: 1; overflow-y: auto; padding: 12px 14px 100px; }

.diag-banner {
  background: #FFF5F5; border: 2px solid #FFC9C9; border-radius: 16px; padding: 10px 14px;
  margin-bottom: 6px; display: flex; gap: 10px; align-items: center;
  font-size: 13.5px; color: #C92A2A; font-weight: 700; line-height: 1.5;
}

.unit-banner {
  border-radius: 18px; padding: 14px 18px; color: #fff; margin: 8px 0 4px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.ub-name { font-family: var(--ui-font); font-weight: 800; font-size: 17px; }
.ub-code { font-size: 12px; opacity: .85; margin-top: 2px; }
.ub-count { font-size: 13px; font-weight: 700; background: rgba(255,255,255,.22); padding: 4px 10px; border-radius: 99px; white-space: nowrap; }

.unit-path { position: relative; margin: 10px 0; }
.unit-path svg { position: absolute; inset: 0; pointer-events: none; }
.tnode {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.tnode-label { text-align: center; width: 130px; font-family: var(--ui-font); font-weight: 800; font-size: 14.5px; line-height: 1.25; }
.bp-tag { font-size: 11.5px; color: #E03131; font-weight: 700; margin-top: 2px; }

.empty-tree { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 30px; text-align: center; }
.empty-title { font-family: var(--ui-font); font-weight: 800; font-size: 20px; color: #343A40; }
.empty-note { font-size: 14px; color: #868E96; }

/* ── 彈窗 ── */
.mask { position: absolute; inset: 0; background: rgba(33,37,41,.45); display: flex; align-items: flex-end; z-index: 30; }
.sheet {
  background: #fff; width: 100%; border-radius: 24px 24px 0 0; padding: 20px 20px 28px;
  animation: sheetUp .25s ease; max-height: 80dvh; overflow-y: auto;
}
.sheet-grip { width: 44px; height: 5px; border-radius: 99px; background: #DEE2E6; margin: 0 auto 16px; }
.sheet-row { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.sheet-info { flex: 1; min-width: 0; }
.sheet-title { font-family: var(--ui-font); font-weight: 800; font-size: 20px; color: #212529; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sheet-sub { font-size: 14px; color: #868E96; margin-top: 4px; }
.sheet-desc { margin: 0 0 12px; font-size: 14.5px; color: #495057; line-height: var(--cjk-leading); letter-spacing: var(--cjk-spacing); }
.sheet-mastery { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.sheet-mastery > span { font-size: 13px; font-weight: 700; color: #868E96; white-space: nowrap; }
.sheet-mastery > b { font-family: var(--ui-font); font-weight: 800; font-size: 15px; color: #495057; }

.bubble-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 18px; }
.bubble {
  position: relative; background: #F1F3F5; border-radius: 16px; padding: 12px 16px;
  font-size: 15px; color: #343A40; flex: 1;
  line-height: var(--cjk-leading); letter-spacing: var(--cjk-spacing);
}
.bubble::before {
  content: ''; position: absolute; left: -8px; top: 20px; width: 16px; height: 16px;
  background: inherit; transform: rotate(45deg); border-radius: 3px;
}

.grade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grade-grid-3 { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grade-grid-3 .grade-btn { padding: 10px 4px; min-height: 48px; }
.grade-grid-3 .grade-btn small { font-size: 9.5px; text-align: center; line-height: 1.3; }
.grade-btn {
  border-radius: 16px; padding: 12px 10px; min-height: 52px; cursor: pointer;
  border-style: solid; border-width: 2.5px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.grade-btn:disabled { cursor: not-allowed; }
.grade-btn span { font-family: var(--ui-font); font-weight: 800; font-size: 16px; }
.grade-btn small { font-size: 11px; color: #ADB5BD; }

/* ── 診斷 ── */
.pad-scroll { flex: 1; overflow-y: auto; padding: 18px 20px 100px; }
.step-list { display: flex; flex-direction: column; gap: 10px; }
.step-card {
  background: #fff; border: 2px solid #F1F3F5; border-radius: 18px; padding: 14px 16px;
  display: flex; gap: 14px; align-items: center; box-shadow: 0 3px 0 #F1F3F5;
}
.step-t { font-family: var(--ui-font); font-weight: 800; font-size: 15.5px; color: #343A40; }
.step-d { font-size: 13px; color: #868E96; margin-top: 2px; }
.last-diag { margin-top: 14px; text-align: center; font-size: 13px; color: #868E96; }

.quiz-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 10px; flex-shrink: 0; }
.xbtn { background: none; border: none; font-size: 22px; color: #ADB5BD; cursor: pointer; padding: 6px; }
.segrow { flex: 1; display: flex; gap: 5px; }
.seg { flex: 1; height: 10px; border-radius: 99px; transition: background .3s; }

.quiz-body { flex: 1; overflow-y: auto; padding: 12px 20px 16px; }
.qcard {
  background: #fff; border: 2px solid #F1F3F5; border-radius: 20px; padding: 20px 18px;
  box-shadow: 0 4px 0 #F1F3F5; margin-bottom: 16px;
  font-size: 18.5px; font-weight: 700; color: #212529;
  line-height: var(--cjk-leading); letter-spacing: var(--cjk-spacing);
}
.choice-grid { display: grid; gap: 10px; }
.choice {
  background: #fff; border: 2.5px solid #DEE2E6; color: #343A40; box-shadow: 0 4px 0 #DEE2E6;
  border-radius: 16px; padding: 14px 16px; font-size: 16.5px; font-weight: 700; text-align: left;
  cursor: pointer; min-height: 52px; font-family: var(--body-font);
  letter-spacing: var(--cjk-spacing); line-height: var(--cjk-leading);
}
.choice:disabled { cursor: default; }
.choice.right { background: #EBFBEE; border-color: #51CF66; color: #2B8A3E; box-shadow: 0 4px 0 #B2F2BB; }
.choice.wrong { background: #FFF5F5; border-color: #FA5252; color: #C92A2A; box-shadow: 0 4px 0 #FFC9C9; }

.feedback { flex-shrink: 0; padding: 16px 20px 24px; animation: sheetUp .25s ease; }
.feedback.good { background: #EBFBEE; border-top: 3px solid #51CF66; }
.feedback.bad { background: #FFF5F5; border-top: 3px solid #FA5252; }
.fb-title { font-family: var(--ui-font); font-weight: 800; font-size: 16.5px; }
.fb-explain { font-size: 13px; color: #868E96; margin-top: 2px; line-height: 1.6; }

/* ── 診斷報告 ── */
.report-card {
  background: #fff; border: 2px solid #F1F3F5; border-radius: 20px; padding: 18px 16px;
  box-shadow: 0 4px 0 #F1F3F5; text-align: left;
}
.rc-head { font-family: var(--ui-font); font-weight: 800; font-size: 14px; color: #868E96; margin-bottom: 12px; letter-spacing: 1px; }
.rc-link { width: 4px; height: 22px; border-radius: 99px; margin-left: 36px; }
.rc-row { display: flex; gap: 12px; align-items: center; border: 2px dashed transparent; border-radius: 16px; padding: 6px; }
.rc-row.bp { background: #FFF5F5; border-color: #FA5252; }
.rc-node { width: 62px; flex-shrink: 0; }
.rc-info { flex: 1; min-width: 0; }
.rc-name { font-family: var(--ui-font); font-weight: 800; font-size: 15.5px; }
.rc-sub { font-size: 12.5px; color: #868E96; }
.report-ctas { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }

/* ── 練習完成 ── */
.done-screen {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 30px; text-align: center;
}

/* ── 我的 ── */
.prof-list { display: flex; flex-direction: column; gap: 10px; }
.prof-card { background: #fff; border: 2px solid #F1F3F5; border-radius: 18px; padding: 14px 16px; box-shadow: 0 3px 0 #F1F3F5; }
.prof-row { display: flex; align-items: center; gap: 10px; }
.prof-glyph {
  width: 34px; height: 34px; border-radius: 12px; color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ui-font); font-weight: 800; font-size: 16px;
}
.prof-name { font-family: var(--ui-font); font-weight: 800; font-size: 16px; flex: 1; }
.prof-bar { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.prof-bar span { font-size: 13px; font-weight: 700; color: #868E96; white-space: nowrap; }

/* ── 學習成果 ── */
.results-entry {
  width: 100%; background: #fff; border: 2px solid #F1F3F5; box-shadow: 0 3px 0 #F1F3F5;
  border-radius: 18px; padding: 14px 16px; cursor: pointer; margin-bottom: 18px;
  display: flex; align-items: center; gap: 12px; text-align: left; font-family: var(--body-font);
}
.results-entry:active { transform: translateY(3px); box-shadow: none; }
.re-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.re-text b { font-family: var(--ui-font); font-weight: 800; font-size: 16px; color: #343A40; }
.re-text small { font-size: 12px; color: #868E96; }

.res-summary { display: flex; gap: 10px; margin-bottom: 14px; }
.res-big {
  flex: 1; background: #fff; border: 2px solid #F1F3F5; box-shadow: 0 3px 0 #F1F3F5;
  border-radius: 18px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.res-big b { font-family: var(--ui-font); font-weight: 800; font-size: 24px; color: #1C7ED6; }
.res-big span { font-size: 11px; color: #868E96; text-align: center; line-height: 1.4; }

.star-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.star-chip {
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px;
  border-width: 1.5px; border-style: solid;
}
.res-note { font-size: 12px; color: #ADB5BD; margin-top: 8px; }

/* ── tab bar（縮小版 ~56px，捲動自動收合） ── */
.tabbar2 {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 2px solid #F1F3F5; display: flex;
  padding: 4px 8px calc(8px + env(safe-area-inset-bottom, 6px)); z-index: 20;
  transition: transform .28s ease;
}
.tabbar2.hidden { transform: translateY(115%); }
.tabbar2 button {
  flex: 1; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 2px; min-height: 44px;
}
.tabbar2 .ticon { font-size: 21px; line-height: 1.15; transition: all .15s; }
.tabbar2 .tlabel { font-family: var(--ui-font); font-weight: 800; font-size: 9.5px; }

/* ── 頂欄單列（技能樹頁） ── */
.tree-head2 {
  background: #fff; border-bottom: 2px solid #F1F3F5; padding: 10px 14px; flex-shrink: 0;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.th2-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.th2-subj { display: flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer; padding: 0; }
.th2-glyph {
  width: 32px; height: 32px; border-radius: 11px; color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Baloo 2', 'Noto Sans TC', sans-serif; font-weight: 800; font-size: 15px;
}
.th2-name { font-family: var(--ui-font); font-weight: 800; font-size: 18px; color: #212529; white-space: nowrap; }
.th2-grade {
  font-family: var(--ui-font); font-weight: 800; font-size: 13px; border: none; cursor: pointer;
  border-radius: 99px; padding: 5px 12px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.th2-grade small { font-size: 10px; }

/* ── 頁首（進度／複習） ── */
.page-head { background: #fff; border-bottom: 2px solid #F1F3F5; padding: 10px 14px 12px; flex-shrink: 0; }
.ph-row { display: flex; justify-content: space-between; align-items: center; }
.ph-title { font-family: var(--ui-font); font-weight: 800; font-size: 18px; color: #212529; }
.seg-tabs { display: flex; gap: 4px; background: #F1F3F5; border-radius: 14px; padding: 4px; margin-top: 10px; }
.seg-tabs button {
  flex: 1; border: none; cursor: pointer; border-radius: 11px; padding: 8px 4px; min-height: 36px;
  background: transparent; font-family: var(--ui-font); font-weight: 800; font-size: 13.5px;
  color: #868E96; white-space: nowrap; transition: all .15s;
}
.seg-tabs button.active { background: #fff; box-shadow: 0 2px 0 #DEE2E6; }

.pg-scroll { flex: 1; overflow-y: auto; padding: 14px 14px 88px; display: flex; flex-direction: column; gap: 12px; }
.pg-card { background: #fff; border: 2px solid #F1F3F5; border-radius: 18px; padding: 16px; box-shadow: 0 3px 0 #F1F3F5; }
.pg-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.pg-card-title { font-family: var(--ui-font); font-weight: 800; font-size: 15.5px; color: #343A40; }

/* 學習進度：streak 卡 */
.streak-card { display: flex; align-items: center; gap: 12px; background: #FFF9DB; border-color: #FFE8A1; box-shadow: 0 3px 0 #FFE8A1; }
.streak-flame { position: relative; flex-shrink: 0; font-size: 40px; }
.streak-num {
  position: absolute; bottom: -4px; right: -8px; background: #E8590C; color: #fff;
  font-family: var(--ui-font); font-weight: 800; font-size: 13px;
  border-radius: 99px; padding: 1px 8px; border: 2px solid #fff;
}
.streak-title { font-family: var(--ui-font); font-weight: 800; font-size: 16.5px; color: #E8590C; }
.streak-copy { font-size: 12.5px; color: #A8741A; line-height: 1.5; margin-top: 2px; letter-spacing: var(--cjk-spacing); }

/* 學習進度：長條圖 */
.range-toggle { display: flex; gap: 4px; background: #F1F3F5; border-radius: 10px; padding: 3px; }
.range-toggle button {
  border: none; cursor: pointer; border-radius: 8px; padding: 5px 12px;
  font-family: var(--ui-font); font-weight: 800; font-size: 12.5px; white-space: nowrap;
}
.bar-chart { display: flex; align-items: flex-end; height: 132px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; height: 100%; min-width: 0; }
.bar-val { font-family: var(--ui-font); font-weight: 800; font-size: 10.5px; }
.bar { width: 100%; transition: height .4s ease; }
.bar-label { font-weight: 700; white-space: nowrap; }

/* 學習進度：摘要四卡 */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-tile { padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.st-value { font-family: var(--ui-font); font-weight: 800; font-size: 19px; line-height: 1.1; }
.st-label { font-size: 11.5px; color: #868E96; margin-top: 2px; }

/* 知識點掌握 */
.ring-pct {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--ui-font); font-weight: 800; font-size: 16px;
}
.kp-note { font-size: 12.5px; color: #868E96; line-height: 1.6; margin: 4px 0 0; letter-spacing: var(--cjk-spacing); }
.kp-group-head { font-family: var(--ui-font); font-weight: 800; font-size: 14.5px; color: #495057; padding: 4px 4px 0; margin-bottom: -4px; }
/* 知識點三欄：狀態icon｜分類（技能白話名）｜內容（課綱知識點） */
.kp-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; }
.kp-icon { font-size: 17px; flex-shrink: 0; }
.kp-name { font-size: 14px; font-weight: 700; width: 36%; flex-shrink: 0; line-height: 1.4; }
.kp-plain { font-size: 12.5px; color: #868E96; flex: 1; min-width: 0; line-height: 1.4; }

/* 技能地圖 */
.map-stage { position: relative; margin: 8px auto 0; }
.map-stage svg { position: absolute; inset: 0; pointer-events: none; }
.map-node-wrap {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.map-node {
  width: 44px; height: 44px; border-radius: 50%; position: relative; flex-shrink: 0;
  border: 3px solid; display: flex; align-items: center; justify-content: center;
  font-size: 17px; cursor: pointer; font-family: var(--ui-font); font-weight: 800; padding: 0;
}
.map-node.pulse { animation: nodePulse 1.6s ease-in-out infinite; }
.map-mark {
  position: absolute; top: -7px; right: -7px; width: 19px; height: 19px; border-radius: 50%;
  font-size: 10.5px; display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.map-label { font-size: 10px; font-weight: 700; width: 76px; text-align: center; line-height: 1.2; }
.map-counts { font-size: 11.5px; color: #ADB5BD; white-space: nowrap; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 4px 2px; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: #868E96; }
.legend-dot { width: 13px; height: 13px; border-radius: 50%; border: 2.5px solid; box-sizing: border-box; }

/* 我的：科目選擇卡＋入口列表 */
.section-head { font-family: var(--ui-font); font-weight: 800; font-size: 13.5px; color: #868E96; margin: 0 0 8px; letter-spacing: 1px; }
.subj-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.subj-card {
  border-radius: 16px; padding: 10px 2px 8px; cursor: pointer; min-height: 64px;
  border-width: 2.5px; border-style: solid;
  display: flex; flex-direction: column; align-items: center; gap: 3px; transition: all .15s;
}
.subj-card.active { transform: scale(1.06); }
.sc-glyph { font-family: 'Baloo 2', 'Noto Sans TC', sans-serif; font-weight: 800; font-size: 18px; }
.sc-name { font-family: var(--ui-font); font-weight: 800; font-size: 11.5px; }
.sc-grade { font-size: 9.5px; color: rgba(255,255,255,.85); }
.subj-hint { font-size: 11.5px; color: #ADB5BD; margin: 8px 2px 16px; letter-spacing: var(--cjk-spacing); }
.entry-card {
  background: #fff; border: 2px solid #F1F3F5; border-radius: 18px;
  padding: 2px 16px; box-shadow: 0 3px 0 #F1F3F5; margin-bottom: 16px;
}
.entry-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px;
  background: none; border: none; cursor: pointer; padding: 12px 2px; text-align: left;
  border-bottom: 1.5px dashed #F1F3F5; font-family: var(--body-font);
}
.er-title { flex: 1; font-family: var(--ui-font); font-weight: 800; font-size: 15.5px; color: #343A40; }
.er-note { font-size: 11.5px; color: #ADB5BD; }

/* 複習 */
.rv-count { font-family: var(--ui-font); font-weight: 800; font-size: 15px; white-space: nowrap; flex-shrink: 0; }
.rv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.rv-done-card { background: #EBFBEE; border-color: #B2F2BB; box-shadow: 0 3px 0 #B2F2BB; display: flex; align-items: center; gap: 12px; }
.rv-done-note { font-size: 12.5px; color: #2F9E44; margin-top: 2px; letter-spacing: var(--cjk-spacing); }
.rv-foot { font-size: 11.5px; color: #ADB5BD; line-height: 1.7; margin: 14px 4px 0; letter-spacing: var(--cjk-spacing); }
.rv-qnum { font-family: var(--ui-font); font-weight: 800; font-size: 13px; color: #868E96; white-space: nowrap; }
