/* ==========================================================================
   朝阳薪传 v6.3 · 新增样式
   --------------------------------------------------------------------------
   本文件只放 v6.3 的新组件，原 style.css 不做改动：
     1) 首页 · 朝朝复盘 CTA（呼吸 + 招手动画）
     2) 课后复盘弹窗（7 题 · 语音 · AI 追问 · 识别确认）
     3) 经验库 · 思维树（桌面横向 SVG / 移动端纵向）
   配色与字体全部沿用 style.css 的 CSS 变量，保证与手账 / 水彩风一致。
   ========================================================================== */

/* ==========================================================================
   1. 首页 · 朝朝复盘 CTA
   ========================================================================== */
.cat-cta {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 16px 20px 16px 16px;
  text-align: left;
  background: linear-gradient(180deg, #FFFDF8 0%, var(--bg-card) 62%, #FBF3E4 100%);
  border: 1.5px solid var(--ink-line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  overflow: hidden;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
/* 右下角卷角，与其它 CTA 保持同一套纸片语言 */
.cat-cta::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, transparent 50%, var(--bg) 50%);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.cat-cta:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-card-hover);
}
.cat-cta:active { transform: translateY(0); }

/* 圆底衬托：极浅米白，让朝朝从纸面浮起来 */
.cat-badge {
  position: relative;
  flex: 0 0 112px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 42%, #FFFEFB 0%, #FCF5E7 58%, #F3E7D0 100%);
  border: 1px solid #F1E5CE;
  box-shadow: inset 0 -5px 12px rgba(201, 112, 56, .07), 0 2px 10px rgba(74, 63, 53, .05);
}
/* 猫脚下的落地阴影 */
.cat-badge::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 20px;
  width: 62px;
  height: 9px;
  margin-left: -31px;
  border-radius: 50%;
  background: rgba(201, 112, 56, .13);
  filter: blur(1px);
}
.cat-wave {
  position: relative;
  z-index: 1;
  display: block;
  width: 104px;
  height: 104px;
  transform-origin: 42% 88%;          /* 支点放在身体下缘，挥爪才自然 */
  animation: catWave 3.6s ease-in-out infinite;
  will-change: transform;
}
.cat-wave img {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: 50% 64%;
  animation: catBreath 3.6s ease-in-out infinite;
  user-select: none;
  -webkit-user-drag: none;
}
/* 爪子旁的挥手弧线：只在"挥"的那一下出现 */
.cat-motion {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.cat-motion path {
  opacity: 0;
  stroke: var(--accent-deep);
  animation: catMotion 3.6s ease-in-out infinite;
}
.cat-motion path.m2 { animation-delay: .08s; }

/* 呼吸 */
@keyframes catBreath {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.032); }
}
/* 每 3.6s 挥一次爪：幅度小而自然 */
@keyframes catWave {
  0%, 68%, 100% { transform: rotate(0deg); }
  74%           { transform: rotate(-5.5deg); }
  80%           { transform: rotate(3.4deg); }
  86%           { transform: rotate(-3deg); }
  92%           { transform: rotate(1.4deg); }
}
@keyframes catMotion {
  0%, 68%, 100% { opacity: 0; }
  76%           { opacity: .85; }
  86%           { opacity: .5; }
  94%           { opacity: 0; }
}
/* hover：动作幅度加大、节奏加快，像"快来" */
.cat-cta:hover .cat-wave { animation: catWaveBig 1.3s ease-in-out infinite; }
.cat-cta:hover .cat-wave img { animation: catBreathBig 1.3s ease-in-out infinite; }
.cat-cta:hover .cat-motion path { animation: catMotionBig 1.3s ease-in-out infinite; }
@keyframes catWaveBig {
  0%, 40%, 100% { transform: rotate(0deg); }
  55%           { transform: rotate(-10deg); }
  70%           { transform: rotate(6.5deg); }
  85%           { transform: rotate(-6deg); }
}
@keyframes catBreathBig {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}
@keyframes catMotionBig {
  0%, 30%, 100% { opacity: 0; }
  60%           { opacity: 1; }
}

.cat-cta-text { flex: 1; min-width: 0; padding-right: 6px; }
.cat-cta .ttl {
  display: block;
  font-family: var(--font-hand);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--ink);
  margin-bottom: 6px;
}
.cat-cta .ttl .seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 8px;
  vertical-align: 2px;
  font-size: 12px;
  font-style: normal;
  letter-spacing: 0;
  color: #FBF6E7;
  background: var(--accent);
  border-radius: 3px;
}
.cat-cta .sub {
  display: block;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.cat-cta.is-done { border-color: var(--secondary-soft); }
.cat-cta.is-done .ttl .seal { background: var(--secondary-deep); }
.cat-cta.is-done .sub { color: var(--secondary-deep); }

/* 用户开启了"减少动态效果"时停止一切循环动画 */
@media (prefers-reduced-motion: reduce) {
  .cat-wave,
  .cat-wave img,
  .cat-motion path { animation: none !important; }
}

/* ==========================================================================
   2. 课后复盘弹窗
   ========================================================================== */
body.modal-open { overflow: hidden; }

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(74, 63, 53, .38);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: v63Fade .18s ease;
}
@keyframes v63Fade { from { opacity: 0; } to { opacity: 1; } }
/* 兜底：遮罩层被清空后不得继续糊在屏幕上（正常关闭走 v63CloseLayer 撤 class，
   这行是防止将来任何一条关闭路径漏掉那一步，导致页面变暗模糊 + 点击被吃掉） */
.modal-layer:empty { display: none; }

.modal-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(720px, 100%);
  max-height: 90vh;
  background: var(--bg-card);
  border: 1.5px solid var(--ink-line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  overflow: hidden;
  animation: v63Up .24s cubic-bezier(.2, .85, .3, 1);
}
@keyframes v63Up {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #FFFDF8, #FCF7EC);
  border-bottom: 1px dashed var(--line);
}
.modal-head-cat {
  position: relative;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 42%, #FFFEFB, #F7ECD8);
  border: 1px solid #F2E5CD;
  overflow: hidden;
}
.modal-head-cat .cat-wave { width: 62px; height: 62px; }
.modal-head-cat .cat-motion { display: none; }
.modal-head-text { flex: 1; min-width: 0; }
.modal-head-text h2 {
  margin: 0;
  font-family: var(--font-hand);
  font-size: 19px;
  letter-spacing: 2px;
  color: var(--ink);
}
.modal-head-text p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.modal-x {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: all .15s;
}
.modal-x:hover { background: var(--bg-warm); color: var(--ink); border-color: var(--accent-soft); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px 6px;
}
.modal-body .progress { margin-bottom: 6px; }

.modal-foot {
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  background: #FCF8EF;
  border-top: 1px dashed var(--line);
}
.modal-foot .foot-note {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.6;
}
.modal-foot .draft-note {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--ink-faint);
  text-align: center;
}
.modal-foot .big-submit {
  width: 100%;
  padding: 15px;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-hand);
  letter-spacing: 2px;
  color: #FBF6E7;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border: none;
  border-radius: var(--r-md);
  box-shadow: 0 4px 14px rgba(201, 112, 56, .28);
  cursor: pointer;
  transition: all .18s;
}
.modal-foot .big-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(201, 112, 56, .34); }
.modal-foot .big-submit[disabled] { background: var(--line); color: var(--ink-faint); box-shadow: none; cursor: not-allowed; transform: none; }

/* 弹窗里的题目卡收紧一点，一屏能看到更多 */
.modal-body .q-block { padding: 18px 16px 16px; margin-bottom: 12px; }
.modal-body .q-no { margin-left: 14px; min-width: 84px; font-size: 12px; }
.modal-body .q-text { font-size: 16.5px; margin-left: 14px; }
.modal-body .q-hint { margin-left: 14px; margin-bottom: 10px; }
.modal-body .input-wrap { margin-left: 14px; }
.modal-body .input-wrap textarea { min-height: 84px; font-size: 15px; }
.modal-body .status-text { margin-left: 14px; }

/* 识别中 */
.modal-busy {
  padding: 54px 24px 58px;
  text-align: center;
}
.modal-busy .orb {
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, var(--gold-soft), var(--accent));
  box-shadow: 0 0 0 0 rgba(201, 112, 56, .35);
  animation: v63Orb 1.6s ease-out infinite;
}
@keyframes v63Orb {
  0%   { box-shadow: 0 0 0 0 rgba(201, 112, 56, .35); transform: scale(.96); }
  70%  { box-shadow: 0 0 0 18px rgba(201, 112, 56, 0); transform: scale(1.02); }
  100% { box-shadow: 0 0 0 0 rgba(201, 112, 56, 0); transform: scale(.96); }
}
.modal-busy h3 { margin: 0 0 6px; font-family: var(--font-hand); font-size: 18px; letter-spacing: 2px; }
.modal-busy p { margin: 0; font-size: 13px; color: var(--ink-soft); }

/* AI 追问气泡 */
.fu-slot:empty { display: none; }
.fu-bubble {
  display: flex;
  gap: 10px;
  margin: 10px 0 0 14px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #FFFBF2, #FDF4E4);
  border: 1px dashed var(--accent-soft);
  border-radius: 12px 12px 12px 4px;
  animation: v63Bubble .26s ease;
}
@keyframes v63Bubble {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.fu-avatar {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  background: #FDF6E8;
  border: 1px solid #F2E4CB;
}
.fu-avatar img { display: block; width: 100%; height: 100%; }
.fu-main { flex: 1; min-width: 0; }
.fu-text { font-size: 13.5px; line-height: 1.65; color: var(--ink); }
.fu-actions { display: flex; gap: 8px; margin-top: 9px; }
.fu-btn {
  padding: 4px 12px;
  font-size: 12.5px;
  font-family: var(--font-body);
  color: var(--accent-deep);
  background: #fff;
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s;
}
.fu-btn:hover { background: var(--accent-tint); }
.fu-btn.ghost { color: var(--ink-soft); border-color: var(--line); background: transparent; }
.fu-btn.ghost:hover { background: var(--bg-warm); }

/* 采纳追问后，提示语留在题下当"填空提示" */
.q-cue {
  margin: 8px 0 0 14px;
  padding-left: 14px;
  position: relative;
  font-size: 12.5px;
  font-style: italic;
  color: var(--accent-deep);
  line-height: 1.6;
}
.q-cue::before {
  content: "🐱";
  position: absolute;
  left: -2px;
  font-style: normal;
}

/* 识别结果确认 */
.recog-lead {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.7;
}
.recog-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.recog-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  font-size: 13px;
  color: var(--ink);
  background: var(--bg-warm);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.recog-chip em { font-style: normal; color: var(--ink-soft); font-size: 12px; }
.recog-chip .x {
  cursor: pointer;
  color: var(--ink-faint);
  font-size: 14px;
  line-height: 1;
}
.recog-chip .x:hover { color: var(--danger); }
.recog-chip.empty { background: transparent; border-style: dashed; color: var(--ink-faint); }
.recog-chip.ai { background: var(--accent-tint); border-color: var(--accent-soft); }
.recog-sec { margin-top: 16px; }
.recog-sec-title {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  padding: 4px 12px;
  font-size: 12.5px;
  font-family: var(--font-body);
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: all .14s;
}
.pill:hover { border-color: var(--accent-soft); color: var(--ink); }
.pill.on {
  color: #FBF6E7;
  background: var(--accent);
  border-color: var(--accent-deep);
  font-weight: 600;
}
.pill.on.green { background: var(--secondary-deep); border-color: var(--secondary-deep); }
.recog-actions { display: flex; gap: 10px; margin-top: 18px; }
.recog-actions .big-submit { flex: 2; }
.recog-actions .back-btn {
  flex: 1;
  padding: 15px;
  font-size: 15px;
  font-family: var(--font-hand);
  letter-spacing: 2px;
  color: var(--ink-soft);
  background: var(--bg-warm);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
}
.recog-actions .back-btn:hover { background: var(--bg-deep); color: var(--ink); }
.recog-advice {
  margin-top: 16px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink);
  background: linear-gradient(180deg, #FFFBF2, #FDF4E4);
  border: 1px dashed var(--accent-soft);
  border-radius: 12px 12px 12px 4px;
}

/* ==========================================================================
   3. 经验库 · 思维树
   ========================================================================== */
/* 树比卡片列表宽，经验库页放开一点版心 */
body.page-library #app { max-width: 1180px; }

.tree-card {
  position: relative;
  padding: 8px 8px 14px;
  background: linear-gradient(180deg, #FFFDF8, var(--bg-card));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}
.tree-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
}
.tree-svg { display: block; }
.tree-svg text { font-family: var(--font-body); }

/* 树枝画入动画（用 pathLength=1 归一化，长短枝同速） */
.tree-svg .branch {
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 1;
  animation: v63Draw .95s ease forwards;
}
@keyframes v63Draw {
  from { stroke-dashoffset: 1; }
  to   { stroke-dashoffset: 0; }
}
.tree-svg .trunk { stroke: var(--accent-deep); }
.tree-svg .br-type { stroke: var(--accent-deep); }
.tree-svg .br-grade { stroke: var(--secondary); }
.tree-svg .br-leaf { stroke: var(--secondary-soft); }

/* 节点 */
.tree-svg .node { cursor: pointer; }
.tree-svg .node:hover .node-ring { opacity: 1; }
.tree-svg .node-ring { opacity: 0; transition: opacity .16s; }
.tree-svg .type-label,
.tree-svg .grade-label,
.tree-svg .leaf-label { user-select: none; }
.tree-svg .type-node.collapsed .count-badge { fill: var(--bg-deep); }

/* 叶子：默认轻轻淡入；新入库的叶子从芽点"长"出来 */
.tree-svg .leaf {
  cursor: pointer;
  transform-box: fill-box;
  transform-origin: center;
  animation: v63Leaf .55s ease backwards;
}
@keyframes v63Leaf {
  from { opacity: 0; transform: scale(.4); }
  to   { opacity: 1; transform: scale(1); }
}
.tree-svg .leaf.new { animation: v63Sprout 1.15s cubic-bezier(.2, 1.5, .4, 1) backwards; }
@keyframes v63Sprout {
  0%   { opacity: 0; transform: scale(0) rotate(-24deg); }
  55%  { opacity: 1; transform: scale(1.28) rotate(6deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
.tree-svg .leaf.new .leaf-halo {
  animation: v63Halo 2.2s ease-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes v63Halo {
  0%   { opacity: .85; transform: scale(.7); }
  70%  { opacity: 0; transform: scale(1.9); }
  100% { opacity: 0; transform: scale(1.9); }
}
.tree-svg .leaf:hover .petal { fill: #F0D77F; }
.tree-svg .leaf.dim { opacity: .2; }
.tree-svg .leaf.hit .petal { fill: var(--gold); }
.tree-svg .leaf-label.hit { fill: var(--accent-deep); font-weight: 600; }
.tree-svg .node-dim { opacity: .26; }
/* 搜索时未命中的枝干 / 标签一起压暗，命中路径才突出 */
.tree-svg .dim-text { opacity: .3; }
.tree-svg.searching .branch:not(.on-path) { opacity: .3; }

/* 树根处的搜索条 */
.tree-root-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px auto 0;
  max-width: 560px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
}
.tree-root-bar .root-icon {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-hand);
  font-size: 14px;
  color: #FBF6E7;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
}
.tree-root-bar svg.ico { flex: 0 0 18px; color: var(--ink-faint); }
.tree-root-bar input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--ink);
}
.tree-root-bar input::placeholder { color: var(--ink-faint); font-style: italic; }
.tree-root-bar .root-clear {
  border: none;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.tree-root-bar .root-clear:hover { color: var(--danger); }

/* 树的工具条：展开 / 收起 / 图例 */
.tree-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 4px 4px;
}
/* 卡片内部纵向排布：桌面端搜索条贴着树根（树下方），移动端树根在顶部（树上方） */
.tree-card { display: flex; flex-direction: column; }
.tree-tools { order: 0; }
.tree-count-line { order: 1; }
.tree-scroll, .tree-tall { order: 2; }
.tree-root-bar { order: 3; }
@media (max-width: 720px) {
  .tree-root-bar { order: 2; }
  .tree-scroll, .tree-tall { order: 3; }
}
.tree-tool {
  padding: 5px 12px;
  font-size: 12.5px;
  font-family: var(--font-body);
  color: var(--ink-soft);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s;
}
.tree-tool:hover { border-color: var(--accent-soft); color: var(--ink); }
.tree-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  font-size: 11.5px;
  color: var(--ink-soft);
}
.tree-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: -1px;
  border: 2px solid transparent;
}
.tree-legend .lg-ok i { border-color: var(--secondary-deep); background: #fff; }
.tree-legend .lg-part i { border-color: var(--gold); background: #fff; }
.tree-legend .lg-new i { border-color: var(--accent-deep); background: #fff; }
.tree-legend .lg-none i { border-color: var(--line); background: #fff; }

.tree-count-line {
  margin: 2px 4px 10px;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.tree-count-line b { color: var(--accent-deep); }

/* 空库：小树苗 */
.sapling-block {
  padding: 34px 20px 40px;
  text-align: center;
  background: linear-gradient(180deg, #FFFDF8, var(--bg-card));
  border: 1px dashed var(--line-dashed);
  border-radius: var(--r-lg);
}
.sapling-block .big {
  font-family: var(--font-hand);
  font-size: 20px;
  letter-spacing: 3px;
  color: var(--ink);
  margin: 16px 0 6px;
}
.sapling-block p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}
.sapling-block .sapling-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 13px 26px;
  font-family: var(--font-hand);
  font-size: 16px;
  letter-spacing: 2px;
  color: #FBF6E7;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border: none;
  border-radius: var(--r-md);
  box-shadow: 0 4px 14px rgba(201, 112, 56, .26);
  cursor: pointer;
}
.sapling-block .sapling-cta img { width: 30px; height: 30px; }

/* 叶子详情浮层 */
.leaf-pop {
  width: min(600px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  padding: 20px 20px 26px;
  background: var(--bg-card);
  border: 1.5px solid var(--ink-line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  animation: v63Up .24s cubic-bezier(.2, .85, .3, 1);
}
.leaf-pop-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px dashed var(--line);
}
.leaf-pop-head .leaf-pop-title { flex: 1; min-width: 0; }
.leaf-pop-head h3 {
  margin: 0 0 6px;
  font-family: var(--font-hand);
  font-size: 20px;
  letter-spacing: 1px;
  color: var(--ink);
}
.leaf-pop-head .muted { font-size: 13px; color: var(--ink-soft); }
.leaf-pop .detail-page { padding: 0; }
.leaf-pop .cta-stack { margin-top: 18px; }

/* ==========================================================================
   4. 移动端：树的纵向布局
   ========================================================================== */
.tree-tall { padding: 6px 2px 2px; }
.tall-root {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #FFFDF8, #FBF2E0);
  border: 1.5px solid var(--accent-soft);
  border-radius: var(--r-md);
  font-family: var(--font-hand);
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--ink);
}
.tall-root .root-icon {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #FBF6E7;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
}
.tall-root .cnt { margin-left: auto; font-family: var(--font-body); font-size: 12.5px; color: var(--ink-soft); letter-spacing: 0; }

.tall-branches {
  margin-left: 16px;
  padding-left: 12px;
  border-left: 2px dashed var(--line-dashed);
}
.tall-type { position: relative; margin-top: 12px; }
.tall-type::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 22px;
  width: 12px;
  height: 2px;
  background: var(--line-dashed);
}
.tall-node {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  font-family: var(--font-hand);
  font-size: 15.5px;
  letter-spacing: 1px;
  color: var(--ink);
  background: linear-gradient(180deg, #FFFDF8, var(--bg-card));
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}
.tall-node:active { background: var(--bg-warm); }
.tall-node .caret { color: var(--ink-faint); font-size: 12px; transition: transform .2s; }
.tall-node.open .caret { transform: rotate(90deg); }
.tall-node .cnt { margin-left: auto; font-family: var(--font-body); font-size: 12px; color: var(--ink-soft); letter-spacing: 0; }
.tall-node.hit { border-color: var(--accent); background: var(--accent-tint); }
.tall-node.dim { opacity: .4; }

.tall-grades {
  margin: 8px 0 0 10px;
  padding-left: 12px;
  border-left: 2px dashed var(--secondary-soft);
  overflow: hidden;
}
.tall-grades[hidden] { display: none; }
.tall-grade { position: relative; margin-top: 10px; }
.tall-grade::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 18px;
  width: 12px;
  height: 2px;
  background: var(--secondary-soft);
}
.tall-grade-node {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  text-align: left;
  font-size: 13.5px;
  font-family: var(--font-body);
  color: var(--secondary-deep);
  background: var(--secondary-tint);
  border: 1px solid var(--secondary-soft);
  border-radius: 10px;
  cursor: pointer;
}
.tall-grade-node .cnt { margin-left: auto; font-size: 12px; color: var(--secondary-deep); opacity: .8; }
.tall-grade-node.dim { opacity: .4; }

.tall-leaves { list-style: none; margin: 6px 0 0; padding: 0 0 0 16px; }
.tall-leaves[hidden] { display: none; }
.tall-leaves li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0 9px 18px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink);
  border-bottom: 1px dotted var(--line-soft);
  cursor: pointer;
}
.tall-leaves li:active { background: var(--bg-warm); }
.tall-leaves li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--sun);
  border: 1.5px solid var(--accent-deep);
}
.tall-leaves li .txt { flex: 1; min-width: 0; }
.tall-leaves li .txt small { display: block; font-size: 11.5px; color: var(--ink-soft); }
.tall-leaves li .v-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: #fff;
}
.tall-leaves li .v-dot.ok { border-color: var(--secondary-deep); }
.tall-leaves li .v-dot.part { border-color: var(--gold); }
.tall-leaves li.dim { opacity: .35; }
.tall-leaves li.hit { background: var(--accent-tint); }
.tall-leaves li.new-leaf { animation: v63Sprout .9s cubic-bezier(.2, 1.5, .4, 1) backwards; }
.tall-leaves li.new-leaf::after {
  content: "新";
  position: absolute;
  right: 0;
  top: 6px;
  font-size: 10px;
  padding: 0 5px;
  border-radius: 6px;
  color: #FBF6E7;
  background: var(--accent);
}
.tall-empty {
  padding: 14px 0;
  font-size: 13px;
  color: var(--ink-faint);
  font-style: italic;
}

@media (max-width: 720px) {
  body.page-library #app { max-width: 720px; }
  .tree-card { padding: 6px 6px 12px; }
  .tree-legend { width: 100%; margin: 4px 0 0; justify-content: flex-start; }
  .cat-cta { padding: 14px 16px 14px 12px; gap: 14px; }
  .cat-badge { flex-basis: 92px; width: 92px; height: 92px; }
  .cat-wave { width: 86px; height: 86px; }
  .cat-cta .ttl { font-size: 19px; }
  .modal-layer { padding: 0; align-items: flex-end; }
  .modal-dialog {
    width: 100%;
    max-height: 94vh;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    border-bottom: none;
  }
  .leaf-pop {
    width: 100%;
    max-height: 92vh;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    border-bottom: none;
  }
}
@media (max-width: 380px) {
  .cat-badge { flex-basis: 80px; width: 80px; height: 80px; }
  .cat-wave { width: 74px; height: 74px; }
  .cat-cta .ttl { font-size: 17.5px; letter-spacing: 1px; }
  .cat-cta .sub { font-size: 11.5px; }
}

/* ==========================================================================
   v7.12 经验树 AI 语义检索：小结卡片 + 命中节点浅橙高亮
   卡片走正常文档流（不遮挡任何页面元素），米白暖橙圆角，沿用手账美学
   ========================================================================== */
#tree-ai-slot:empty { display: none; }
.tree-ai-card {
  background: linear-gradient(180deg, #FFFDF7, #FFF6E7);
  border: 1.5px solid #F0DCB8;
  border-radius: 16px;
  padding: 12px 14px;
  margin: 0 0 10px;
  box-shadow: 0 2px 8px rgba(201, 112, 56, .08);
}
.tai-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tai-tag {
  font-family: ZCOOL KuaiLe, KaiTi, serif;
  font-size: 12px; line-height: 1;
  color: #FFFCF6; background: #E8925A;
  border-radius: 8px; padding: 4px 8px 5px;
}
.tai-title { font-weight: 700; color: #4A3F35; font-size: 14px; }
.tai-body { color: #6E6055; font-size: 13px; line-height: 1.65; display: flex; align-items: center; gap: 8px; }
.tai-foot { margin-top: 6px; font-size: 12px; color: #B0793F; }
.tai-spin {
  width: 14px; height: 14px; flex: 0 0 14px;
  border-radius: 50%;
  border: 2px solid #F2DDB8; border-top-color: #E8925A;
  animation: tai-rotate .9s linear infinite;
}
@keyframes tai-rotate { to { transform: rotate(360deg); } }
.tai-tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.tai-tag-btn {
  border: 1px solid #E8CFA4; background: #FFF9EC; color: #8A5A2B;
  border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer;
}
.tai-tag-btn:hover { background: #FBEFD2; }
/* AI 命中的果实 / 叶子：浅橙底色高亮圆盘 */
.tree-svg .leaf-ai-bg { animation: none; }
/* 搜索框：放大镜图标可点击 */
.tree-root-bar .root-icon { cursor: pointer; }
.tree-root-bar svg.ico { cursor: pointer; }
@media (prefers-reduced-motion: reduce) {
  .tai-spin { animation: none; }
}
