.function-map {
  --map-line: #c9aeb4;
  --map-red: var(--citic-red);
  background: #f5f3f1;
  color: #292629;
  padding: clamp(24px,4vw,62px) 5vw;
}
.map-intro, .map-board, .map-flow { max-width: 1420px; margin: 0 auto; }
.map-intro { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding-bottom: 26px; }
.map-intro a { color: var(--map-red); font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.map-intro h1 { font-size: clamp(29px,3vw,46px); margin: 8px 0 0; }
.map-intro p, .map-leaf p { font-size: 15px; color: #60555a; line-height: 1.8; }
.map-board { padding: 32px clamp(16px,2.5vw,36px); border: 1px solid #ded7d7; background: #fff; }
.map-root { width: fit-content; margin: auto; padding: 12px 26px; background: var(--map-red); color: white; font-size: 21px; font-weight: 600; position: relative; }
.map-root::after, .map-branch::before { content: ''; position: absolute; left: 50%; height: 20px; border-left: 1px solid var(--map-line); }
.map-root::after { top: 100%; }
.map-tree { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); padding-top: 40px; }
.map-branch { position: relative; min-width: 0; padding-inline: 8px; }
.map-branch::before { bottom: 100%; }
.map-branch::after { content: ''; position: absolute; top: -20px; left: 0; right: 0; border-top: 1px solid var(--map-line); }
.map-branch:first-child::after { left: 50%; }
.map-branch:last-child::after { right: 50%; border-top-style: dashed; }
.map-branch header { background: #faeff1; border: 1px solid #d8b5be; padding: 13px 15px; color: #78152a; }
.map-branch header span { font-size: 13px; }
.map-branch h2 { font-size: 21px; line-height: 1.5; }
.map-leaves { margin-left: 12px; padding: 12px 0 0 13px; border-left: 1px solid var(--map-line); }
.map-leaf { position: relative; border-bottom: 1px solid #e8e2e3; background: #fff; }
.map-leaf::before { content: ''; position: absolute; width: 12px; left: -13px; top: 24px; border-top: 1px solid var(--map-line); }
.map-leaf summary { cursor: pointer; padding: 12px 2px; line-height: 1.5; font-size: 16px; }
.map-leaf summary::marker { color: #9f4357; font-size: 12px; }
.map-leaf[open] summary { color: var(--map-red); font-weight: 600; }
.map-leaf a { display: inline-block; color: var(--map-red); margin: 8px 0 12px; font-size: 14px; text-decoration: underline; }
.map-planned header { border-style: dashed; background: #f5f5f5; color: #555; border-color: #888; }
.map-flow { margin-top: 30px; }
.map-flow h2 { font-size: 22px; }
.map-flow ol { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: baseline; list-style: none; padding: 0; }
.map-flow li { font-size: 15px; }
.map-flow li + li::before { content: '→'; margin-right: 16px; color: #97737a; }
.map-flow small { margin-left: 6px; color: #76676a; }
.demo-switcher .structure-entry { margin-left: auto; flex-shrink: 0; font-weight: 600; color: var(--citic-red-deep); text-decoration: underline; text-underline-offset: 3px; }
.demo-switcher .structure-entry + small { margin-left: 0; }
@media(max-width:900px) {
  .map-tree { display: block; border-left: 1px solid var(--map-line); margin-left: 12px; padding: 18px 0 0; }
  .map-root { margin-left: 0; }
  .map-root::after,.map-branch::before { display: none; }
  .map-branch { padding: 0 0 20px 18px; }
  .map-branch::after,.map-branch:first-child::after,.map-branch:last-child::after { left: 0; top: 29px; width: 18px; }
  .map-intro { display: block; }
  .map-intro p { margin-top: 10px; }
}
@media(max-width:760px) {
  .demo-switcher .structure-entry { margin-left: 0; }
  .map-flow ol { display: grid; gap: 8px; border-left: 2px solid var(--map-line); padding-left: 16px; }
  .map-flow li + li::before { display: none; }
}
@media(prefers-reduced-motion:no-preference) {
  @keyframes motion-rise { from { opacity: .12; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes art-settle { from { scale: 1.035; } to { scale: 1; } }
  @keyframes chip-in { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
  [data-view="home"] main h1, .map-intro, .lab-console, .map-leaf[open] > div { animation: motion-rise .55s ease-out both; }
  .gallery-art, .research-photo img { animation: art-settle 1.35s ease-out both; }
  .lab-bench figure img, .exhibit-graphic { animation: chip-in .75s ease-out both; }
  .motion-enter { animation: motion-rise .5s ease-out both; }
  .map-branch { animation: motion-rise .45s ease-out both; }
  .map-branch:nth-child(2) { animation-delay: .06s; }
  .map-branch:nth-child(3) { animation-delay: .12s; }
  .map-branch:nth-child(4) { animation-delay: .18s; }
  .intake-panel .intake-heading { animation: motion-rise .3s ease-out; }
  @media(hover:hover) {
    .btn, .lab-start, .journal-actions a:first-child { transition: translate .18s ease, box-shadow .18s ease; }
    .btn:hover,.lab-start:hover,.journal-actions a:first-child:hover { translate: 0 -2px; box-shadow: 0 4px 12px #29001426; }
  }
}
