/* ==========================================================================
   大班图形语言（lib/figures/）的样式。图里只写类名，颜色全在这里，取 main.css 的品牌令牌
   - 品牌蓝 --primary：连线、重点卡描边、序号
   - 深海蓝 --deep-900：整张图最多一处的「最关键」卡（em）
   - 点缀橙 --accent：只用在路线图的「你在这里」
   - 其余都是中性灰阶，卡片白底细边，图底一层很浅的品牌蓝灰
   ========================================================================== */
.kf {
  --kf-bg: #f6f8fc;
  --kf-line: #dfe5ee;
  --kf-edge: #8fb0f0;
  margin: 18px 0; padding: 18px 16px 12px;
  background: var(--kf-bg); border: 1px solid #e8edf5; border-radius: 16px;
}
.kf__narrow { display: none; }
@media (max-width: 640px) {
  .kf { padding: 14px 10px 10px; margin: 14px -2px; }
  .kf__wide { display: none; }
  .kf__narrow { display: block; }
}
.kf-svg { display: block; height: auto; overflow: visible; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif; }
.kf__cap { margin-top: 10px; font-size: 13px; line-height: 1.6; color: var(--ink-3); text-align: center; }

/* 卡片 */
.kf-box { stroke-width: 1.5; }
.kf-box--plain { fill: #fff; stroke: var(--kf-line); }
.kf-box--hl { fill: var(--primary-050); stroke: var(--primary); }
.kf-box--em { fill: var(--deep-900); stroke: var(--deep-900); }
.kf-box--ghost { fill: rgba(255, 255, 255, .6); stroke: #b9c4d3; stroke-dasharray: 5 4; }
.kf-t { fill: var(--ink); font-weight: 650; }
.kf-t--hl { fill: var(--primary-700); }
.kf-t--em { fill: #fff; }
.kf-t--ghost { fill: var(--ink-2); }
.kf-d { fill: var(--ink-3); }
.kf-d--em { fill: rgba(255, 255, 255, .78); }
.kf-d--hl { fill: var(--ink-2); }
.kf-loop { fill: var(--primary-600); }
.kf-axis { fill: var(--ink-3); font-weight: 600; }

/* 序号 */
.kf-badge--plain { fill: var(--primary); }
.kf-badge--em { fill: #fff; }
.kf-badge__t { fill: #fff; font-weight: 700; }
.kf-badge__t--em { fill: var(--deep-900); }

/* 线 */
.kf-edge { fill: none; stroke: var(--kf-edge); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.kf-edge--dash { stroke-dasharray: 5 5; }
.kf-arrowhead { fill: var(--kf-edge); }
.kf-link { fill: none; stroke: var(--kf-line); stroke-width: 1.6; }
.kf-sep { fill: none; stroke: var(--kf-line); stroke-width: 1.2; stroke-dasharray: 3 4; }
.kf-sep--em { stroke: rgba(255, 255, 255, .25); }
.kf-sep--hl { stroke: var(--primary-100); }
.kf-rail { fill: none; stroke: var(--kf-line); stroke-width: 2; }
.kf-dot--plain { fill: #fff; stroke: var(--primary); stroke-width: 2; }
.kf-dot--hl, .kf-dot--em { fill: var(--primary); stroke: var(--primary-050); stroke-width: 3; }
.kf-head--plain { fill: #f1f4f8; }
.kf-head--hl { fill: var(--primary-050); }
.kf-head--em { fill: var(--deep-900); }
.kf-bullet--plain { fill: #b9c4d3; }
.kf-bullet--hl, .kf-bullet--em { fill: var(--primary); }
.kf-core { fill: var(--deep-900); }

/* ---------- 站点层：章节封面、关卡路线、阶段路径、模块页头、空状态 ---------- */
.kf-route, .kf-stages { display: block; width: 100%; height: auto; }
.kf-routebox { margin: 4px 0 16px; padding: 14px 12px 6px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.kf-routebox__narrow { display: none; }
@media (max-width: 640px) { .kf-routebox__wide { display: none; } .kf-routebox__narrow { display: block; } }
.kf-route__node { fill: #fff; stroke: #c9d3e1; stroke-width: 1.5; }
.kf-route__node--passed { fill: var(--primary); stroke: var(--primary); }
.kf-route__node--current { fill: #fff; stroke: var(--accent); stroke-width: 2.5; }
.kf-route__node--soon { stroke-dasharray: 4 3; }
.kf-route__num { fill: var(--ink-3); font-weight: 700; }
.kf-route__num--passed { fill: #fff; }
.kf-route__num--current { fill: var(--accent); }
.kf-route__label { fill: var(--ink-2); font-weight: 600; }
.kf-route__label--current { fill: var(--ink); }
.kf-route__sub { fill: var(--ink-4); }
.kf-route__path { fill: none; stroke: #dfe5ee; stroke-width: 3; stroke-linecap: round; }
.kf-route__path--done { stroke: var(--primary); }
.kf-route__halo { fill: var(--accent-050); }

.kf-art { flex: none; width: 64px; height: 64px; }
.ke-pagehead--art { display: flex; align-items: center; gap: 16px; }
.ke-pagehead--art > div { min-width: 0; }
@media (max-width: 640px) { .kf-art { width: 48px; height: 48px; } .ke-pagehead--art { gap: 12px; } }
.kf-art__bg { fill: var(--primary-050); }
.kf-art__ring { fill: none; stroke: var(--primary-100); stroke-width: 1.5; }
.kf-glyph { fill: none; stroke: var(--primary); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kf-glyph--fill { fill: var(--primary); stroke: none; }
.kf-glyph__dot { fill: var(--accent); }

.kf-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 18px 8px 6px; }
.kf-empty svg { width: 132px; height: auto; }
.kf-empty__t { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.kf-empty__d { font-size: 13.5px; color: var(--ink-3); line-height: 1.7; max-width: 30em; }
.kf-empty__card { fill: #fff; stroke: #c9d3e1; stroke-width: 1.5; stroke-dasharray: 5 4; }
.kf-empty__soft { fill: var(--primary-050); }

/* 章节封面插画（第二版）：深海蓝底 + 点阵 + 一团品牌蓝的光；白 / 浅蓝细线、品牌蓝半透明面，全图一个橙点 */
.kf-cover--art { display: block; width: 100%; height: 100%; }
.kc-bg0 { stop-color: #081733; }
.kc-bg1 { stop-color: #143572; }
.kc-glow0 { stop-color: rgba(47, 107, 229, .5); }
.kc-glow1 { stop-color: rgba(47, 107, 229, 0); }
.kc-scrim0 { stop-color: rgba(8, 23, 51, .92); }
.kc-scrim1 { stop-color: rgba(8, 23, 51, 0); }
.kc-dot { fill: rgba(255, 255, 255, .08); }
.kc-art path, .kc-art circle, .kc-art rect { vector-effect: non-scaling-stroke; }
.kc-l, .kc-l2, .kc-l3 { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.kc-l { stroke: rgba(255, 255, 255, .82); stroke-width: 1.7; }
.kc-l2 { stroke: rgba(140, 185, 255, .62); stroke-width: 1.5; }
.kc-l3 { stroke: rgba(255, 255, 255, .15); stroke-width: 1.2; }
.kc-dash { stroke-dasharray: 4 5; }
.kc-f { fill: rgba(107, 165, 255, .13); }
.kc-f2 { fill: rgba(107, 165, 255, .24); }
.kc-plate { fill: rgba(64, 124, 240, .62); }
.kc-page { fill: rgba(255, 255, 255, .05); }
.kc-page--front { fill: rgba(255, 255, 255, .1); }
.kc-bubble { fill: rgba(47, 107, 229, .58); }
.kc-hl { fill: rgba(107, 165, 255, .32); stroke: rgba(160, 200, 255, .85); stroke-width: 1.2; }
.kc-sweep { fill: rgba(107, 165, 255, .2); }
.kc-track { stroke: rgba(255, 255, 255, .1); stroke-width: 6; stroke-linecap: round; fill: none; }
.kc-bar { stroke: rgba(107, 165, 255, .9); stroke-width: 6; stroke-linecap: round; fill: none; }
.kc-w { fill: rgba(255, 255, 255, .94); }
.kc-w2 { fill: rgba(255, 255, 255, .5); }
.kc-n { fill: #0d2350; stroke: rgba(255, 255, 255, .8); stroke-width: 1.5; }
.kc-t { fill: rgba(255, 255, 255, .9); font-weight: 800; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; }
.kc-a { fill: var(--accent); }
.kc-ah { fill: rgba(255, 101, 52, .2); }
.kc-cube path { stroke: rgba(255, 255, 255, .55); stroke-width: 1; stroke-linejoin: round; }
.kc-cube__t { fill: rgba(150, 192, 255, .6); }
.kc-cube__l { fill: rgba(47, 107, 229, .5); }
.kc-cube__r { fill: rgba(18, 54, 128, .75); }
.kc-cube--hi .kc-cube__t { fill: rgba(255, 255, 255, .9); }
.kc-cube--hi .kc-cube__l { fill: rgba(140, 185, 255, .85); }
.kc-cube--hi .kc-cube__r { fill: rgba(64, 124, 240, .9); }
.m-path-routes .kf-routebox { border: 0; padding: 4px 0 0; margin: 0; }
.m-path-routes__t { margin: 14px 0 0; font-size: 15px; font-weight: 650; color: var(--ink); }
.ke-card .kf-routebox { border: 0; padding: 4px 0 0; margin: 0 0 6px; }
.kf-top .kf:first-child { margin-top: 0; }
/* 仪表盘卡片只有半宽：路线图用竖屏那一版，字不会被缩小 */
.ke-dash .kf-routebox__wide { display: none; }
.ke-dash .kf-routebox__narrow { display: block; }

/* ---------- 成长树（lib/figures/tree.js，设计第 2.1 节）：深海蓝底，品牌蓝的光，全图唯一的橙色是「正在长」 ---------- */
.kt { overflow: visible; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
.kt-trunk { fill: none; stroke: #cfe0ff; stroke-linecap: round; }
.kt-trunk--future { stroke: rgba(207, 224, 255, .28); stroke-dasharray: 2 7; }
.kt-branch { fill: none; stroke: rgba(207, 224, 255, .55); stroke-width: 2; stroke-linecap: round; }
.kt-branch--future { stroke: rgba(207, 224, 255, .18); stroke-dasharray: 2 5; }
.kt-leaf--none { fill: none; stroke: rgba(207, 224, 255, .35); stroke-width: 1; stroke-dasharray: 2 2; }
.kt-leaf--viewed { fill: rgba(123, 227, 182, .45); stroke: #7be3b6; stroke-width: 1; }
.kt-leaf--done, .kt-leaf--reviewed { fill: #7be3b6; stroke: #a8f0cf; stroke-width: 1; }
.kt-leafdot { fill: #fff; }
.kt-node--passed { fill: var(--primary); stroke: #9cc0ff; stroke-width: 2; }
.kt-node--current { fill: var(--deep-900); stroke: var(--accent); stroke-width: 3; }
.kt-node--locked { fill: var(--deep-900); stroke: rgba(207, 224, 255, .4); stroke-width: 1.5; stroke-dasharray: 3 3; }
.kt-nodetxt { fill: #fff; font-weight: 700; font-size: 9px; }
.kt-nodetxt--locked { fill: rgba(207, 224, 255, .6); }
.kt-pulse { fill: none; stroke: var(--accent); stroke-width: 2; opacity: .6; transform-box: fill-box; transform-origin: center; animation: kt-pulse 2.2s var(--ease) infinite; }
@keyframes kt-pulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(2.1); opacity: 0; } }
.kt-fruit--growing { fill: rgba(255, 255, 255, .08); stroke: #fff; stroke-width: 1.5; }
.kt-fruit--locked { fill: none; stroke: rgba(207, 224, 255, .35); stroke-width: 1.2; stroke-dasharray: 3 3; }
.kt-fruithl { fill: rgba(255, 255, 255, .55); }
.kt-bite { fill: #0b2145; }
.kt-slot { fill: none; stroke: rgba(207, 224, 255, .55); stroke-width: 1; stroke-dasharray: 2 2; }
.kt-label { fill: #fff; font-weight: 650; font-size: 12.5px; }
.kt-label--locked { fill: rgba(207, 224, 255, .55); }
.kt-sub { fill: #9fb7dd; font-size: 11px; }
.kt-sub--hot { fill: #ffb59a; }
.kt-ver { fill: var(--accent); }
.kt-vertxt { fill: #fff; font-size: 9px; font-weight: 700; }
.kt-root { fill: none; stroke: rgba(207, 224, 255, .45); stroke-width: 2; stroke-linecap: round; }
.kt-rootlbl { fill: #cfe0ff; font-size: 11px; }
.kt-ground { stroke: rgba(207, 224, 255, .16); stroke-width: 1; }
.kt-stage { stroke: rgba(207, 224, 255, .14); stroke-width: 1; stroke-dasharray: 2 4; }
.kt-stagelbl { fill: #6f8bb8; font-size: 10.5px; letter-spacing: .06em; }
.kt-star { fill: rgba(207, 224, 255, .12); stroke: rgba(207, 224, 255, .45); stroke-width: 1.2; stroke-dasharray: 3 3; }
.kt-star--on { fill: #ffd36b; stroke: #ffe7a8; stroke-dasharray: none; }
.kt-demo { fill: rgba(207, 224, 255, .7); font-size: 11px; letter-spacing: .2em; }
.kt--demo .kt-pulse { animation: none; opacity: 0; }
.kt--demo { opacity: .85; }
/* 生长：刚长出来的那一节播一次 600ms（叶子展开、果实变色），只播一次由服务端记状态 */
.kt-n.is-new { transform-box: fill-box; transform-origin: 50% 100%; animation: kt-grow .6s var(--ease-out) both; }
.kt-n.is-new .kt-leaf, .kt-n.is-new [class^="kt-fruit"] { transform-box: fill-box; transform-origin: center; animation: kt-bloom .6s var(--ease-out) .15s both; }
@keyframes kt-grow { from { opacity: .2; } to { opacity: 1; } }
@keyframes kt-bloom { from { transform: scale(.2); } to { transform: scale(1); } }
.kt-n[data-sheet] { cursor: pointer; }
.kt-n.is-current .kt-label { text-decoration: none; }
@media (prefers-reduced-motion: reduce) { .kt-pulse, .kt-n.is-new, .kt-n.is-new .kt-leaf, .kt-n.is-new [class^="kt-fruit"] { animation: none; } }
