/* 四份制图小样共用一张排版台，右侧纸面上的等高线、切线和剖面依序落位。 */
.figure-feature {
  --selection-blue: #356779;
  padding-block: clamp(3rem, 5vw, 5rem);
  color: var(--ink-primary);
}
.figure-feature-inner { width: var(--site-width); margin-inline: auto; }
.figure-feature-heading {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px 18px; flex-wrap: wrap;
}
.figure-feature-heading h2 { font-size: var(--site-section-size); line-height: 1.2; font-weight: 650; letter-spacing: -.025em; }
.figure-feature-heading .inline-action { min-height: 40px; }
.figure-feature-intro { margin-top: .6rem; max-width: 72ch; color: var(--ink-secondary); }
.figure-feature-intro code { color: var(--ink-primary); font-size: .9em; }
.figure-flow {
  position: relative; display: grid; align-items: center;
  grid-template-columns: minmax(0, .53fr) minmax(0, 1fr); gap: clamp(25px, 3.6vw, 56px);
  border-top: 1px solid #bfc7bf; margin-top: clamp(14px, 2vw, 28px); padding-top: clamp(24px, 2.6vw, 37px);
}
.figure-defs { position: absolute; pointer-events: none; }
.figure-flow-trigger { position: absolute; inset: 18% 0 auto; width: 1px; height: 1px; pointer-events: none; }
.figure-flow h3 { font-size: clamp(1.13rem, 1.4vw, 1.4rem); line-height: 1.3; font-weight: 640; letter-spacing: -.012em; }
.figure-methods {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 1.5vw, 22px) 14px;
  margin: 16px 0 0; padding: 0; list-style: none;
}
.figure-method { min-width: 0; }
.figure-method svg { display: block; width: 100%; aspect-ratio: 1.55; }
.figure-method span { display: block; margin-top: 7px; font-weight: 500; line-height: 1.4; font-size: .8125rem; }
.figure-press { position: relative; min-width: 0; }
.figure-sheet {
  position: relative; width: 100%; isolation: isolate; overflow: hidden; background: #fffef8;
}
.figure-publication { display: block; width: 100%; height: auto; }
.figure-map-transfer { position: absolute; z-index: 2; display: block; pointer-events: none; transform-origin: 0 0; }
.figure-flow.is-transferring .figure-map-art { visibility: hidden; }
.plate-title { font: 500 25px Georgia, 'Songti SC', SimSun, serif; fill: #202f32; letter-spacing: -.02em; }
.plate-equation { font: italic 14px Georgia, serif; fill: #456166; }
.plate-label { font: 600 11px var(--site-font); fill: #203e40; }
.plate-baseline { fill: none; stroke: #668982; stroke-width: .9; }
.plate-axis, .plate-transect-label { font: italic 9px Georgia, serif; fill: #214345; }
.plate-transect-label { paint-order: stroke; stroke: #fffce7; stroke-width: 1.4px; }
.plate-transect { stroke: #ec9354; stroke-width: 1.5; fill: none; }
.plate-point { fill: #9a4625; stroke: #fff6db; stroke-width: .8; }
.plate-selection { stroke: var(--selection-blue); stroke-width: 1; }
.plate-selection > rect:first-child { stroke-opacity: .78; }
.figure-editor-tag {
  /* 标签下沿对齐选框上沿；窄屏也保留独立的阅读空间。 */
  position: absolute; bottom: calc(110 / 364 * 100%); right: calc(19 / 540 * 100% + 4px);
  background: var(--selection-blue); color: #fff; padding: 2px 7px 3px;
  border-radius: 3px 3px 0 0; font-size: clamp(.6875rem, 1vw, .8125rem);
  line-height: 1.3; font-weight: 600; white-space: nowrap;
}
.plate-projection { fill: none; stroke: #ba7144; stroke-width: 1.45; opacity: 0; }
.figure-terrain-slot { position: absolute; left: 39.8148%; top: calc(78 / 364 * 100%); width: 55.7407%; height: calc(141 / 364 * 100%); pointer-events: none; }
.figure-terrain-slot canvas, .figure-terrain-slot .plate-relief-fallback { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.figure-sheet:has(.figure-terrain-slot.is-ready) .plate-relief-fallback { visibility: hidden; }

/* 暗色排版台用浅色线条区分曲线、控制点与测量点。高程色带与地形照明沿用原图。 */
html[data-theme="dark"] .figure-feature { --selection-blue: #a5d1d5; }
html[data-theme="dark"] .figure-flow { border-color: #455251; }
html[data-theme="dark"] .figure-sheet { background: #283438; }
html[data-theme="dark"] :is(.plate-title, .plate-label) { fill: #e8efea; }
html[data-theme="dark"] :is(.plate-equation, .plate-axis) { fill: #c2d7d2; }
html[data-theme="dark"] .plate-baseline { stroke: #8eaaa1; }
html[data-theme="dark"] .plate-profile-fill { fill: #466560; }
html[data-theme="dark"] :is(.figure-profile-line, .method-stroke) { stroke: #a1d5d6; }
html[data-theme="dark"] .figure-editor-tag { color: #1c3739; }
html[data-theme="dark"] :is(.method-axis, .method-tangent) { stroke: #95aaa4; }
html[data-theme="dark"] .method-ribbon { fill: #46635e; }
html[data-theme="dark"] .figure-method--vector circle.method-point { fill: #a7bfb6; }
html[data-theme="dark"] .figure-method--vector rect.method-point { fill: #263d42; stroke: #b9e4e2; }
html[data-theme="dark"] .figure-method--data .method-point { fill: #edb18d; }
html[data-theme="dark"] .method-isoline { stroke: #8dbdb4; }
html[data-theme="dark"] .method-isoline:nth-child(3n + 1) { stroke: #b9dcd6; }

@media screen and (prefers-reduced-motion: no-preference) {
  .home-motion .figure-flow .figure-methods[data-reveal] { opacity: 1; translate: none; scale: none; transition: none; }
  .home-motion .plate-contour,
  .home-motion .plate-transect, .home-motion .figure-profile-line, .home-motion .plate-projection { stroke-dasharray: 1; }
  .home-motion .figure-methods:not(.is-revealed) .figure-method svg { visibility: hidden; }
  .figure-methods.is-revealed :is(.method-stroke, .method-tangent, .method-axis, .method-isoline) {
    stroke-dasharray: 1;
    animation: figure-draw-ink var(--stroke-duration, 620ms) cubic-bezier(.28,.05,.3,1) var(--ink-delay, 0ms) backwards;
  }
  .method-tangent, .method-axis { --stroke-duration: 260ms; }
  .method-isoline { --stroke-duration: 440ms; }
  .figure-methods.is-revealed .method-point {
    transform-box: fill-box; transform-origin: center;
    animation: method-place-point 175ms ease-out var(--ink-delay, 0ms) backwards;
  }
  .figure-methods.is-revealed .method-ribbon { animation: method-scan 570ms ease-out 210ms backwards; }
  .figure-methods.is-revealed .method-scan-row {
    animation: method-scan 410ms cubic-bezier(.35,.08,.23,1) var(--ink-delay) backwards;
  }
  .figure-flow:has(.figure-flow-trigger.is-revealed) .plate-contour { animation: figure-draw-ink 550ms ease-out calc(250ms + var(--band) * 38ms) backwards; }
  .figure-flow:has(.figure-flow-trigger.is-revealed) .figure-terrain-slot { animation: figure-terrain-seats 1810ms cubic-bezier(.3,.06,.12,1) both; }
  .figure-flow:has(.figure-flow-trigger.is-revealed) .plate-panel--map { animation: figure-map-seats 850ms cubic-bezier(.16,1,.3,1) 1030ms backwards; }
  .figure-flow:has(.figure-flow-trigger.is-revealed) .plate-panel--relief { animation: figure-panel-seats 580ms cubic-bezier(.16,1,.3,1) 1260ms backwards; }
  .figure-flow:has(.figure-flow-trigger.is-revealed) .plate-panel--profile { animation: figure-ink-lights 400ms ease-out 1540ms backwards; }
  .figure-flow:has(.figure-flow-trigger.is-revealed) .plate-transect { animation: figure-draw-ink 430ms ease-out 1850ms backwards; }
  .figure-flow:has(.figure-flow-trigger.is-revealed) .plate-relief-fallback .plate-transect { animation-duration: 450ms; animation-delay: 1900ms; animation-timing-function: ease-in-out; }
  .figure-flow:has(.figure-flow-trigger.is-revealed) :is(.plate-point, .plate-transect-label) { animation: figure-ink-lights 220ms ease-out 2020ms backwards; }
  .figure-flow:has(.figure-flow-trigger.is-revealed) .plate-projection { animation: figure-project 740ms ease-in-out 2200ms; }
  .figure-flow:has(.figure-flow-trigger.is-revealed) .plate-profile-fill { animation: figure-fill-section 560ms cubic-bezier(.35,.1,.18,1) 2450ms backwards; }
  .figure-flow:has(.figure-flow-trigger.is-revealed) .figure-profile-line { animation: figure-draw-ink 560ms cubic-bezier(.35,.1,.18,1) 2450ms backwards; }
  .figure-flow:has(.figure-flow-trigger.is-revealed) .plate-selection { animation: figure-select-layer 360ms cubic-bezier(.2,.85,.25,1) 3040ms backwards; }
  .figure-flow:has(.figure-flow-trigger.is-revealed) .figure-editor-tag { animation: figure-label-attaches 260ms ease-out 3140ms backwards; }
  .home-motion .figure-flow:not(:has(.figure-flow-trigger.is-revealed)) .figure-editor-tag { visibility: hidden; }
  .home-motion .figure-flow:not(:has(.figure-flow-trigger.is-revealed)) .figure-terrain-slot { transform: translate(-31%,24%) scale(1.83); }
  .home-motion .figure-flow:not(:has(.figure-flow-trigger.is-revealed)) .plate-profile-fill { clip-path: inset(0 100% 0 0); }
  .home-motion .figure-flow:not(:has(.figure-flow-trigger.is-revealed)) :is(.plate-panel--map,.plate-panel--relief,.plate-panel--profile) { opacity: 0; }
  .home-motion .figure-flow:not(:has(.figure-flow-trigger.is-revealed)) :is(.plate-selection, .plate-transect-label, .plate-point) { opacity: 0; }
  .home-motion .figure-flow:not(:has(.figure-flow-trigger.is-revealed)) :is(.figure-profile-line, .plate-contour, .plate-transect) { stroke-dashoffset: 1; }
  @keyframes method-place-point { from { opacity: 0; transform: scale(.05); } }
  @keyframes method-scan { from { clip-path: inset(0 100% 0 0) fill-box; } to { clip-path: inset(0) fill-box; } }
  @keyframes figure-draw-ink { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
  @keyframes figure-terrain-seats { 0%, 42% { transform: translate(-31%,24%) scale(1.83); } 100% { transform: none; } }
  @keyframes figure-map-seats { from { opacity: 0; transform: translate(-9px, 7px); } }
  @keyframes figure-panel-seats { from { opacity: 0; transform: translate(0, 9px); } }
  @keyframes figure-fill-section { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
  @keyframes figure-ink-lights { from { opacity: 0; } }
  @keyframes figure-project { 0% { opacity: 0; stroke-dashoffset: 1; } 15% { opacity: .86; } 70% { opacity: .86; stroke-dashoffset: 0; } 100% { opacity: 0; stroke-dashoffset: 0; } }
  @keyframes figure-select-layer { from { opacity: 0; transform-origin: 50% 82%; transform: scale(1.025); } to { opacity: 1; transform-origin: 50% 82%; transform: scale(1); } }
  @keyframes figure-label-attaches { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0); } }
}

@media (max-width: 760px) {
  .figure-flow { grid-template-columns: 1fr; gap: 27px; }
  .figure-methods { margin-top: 12px; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
  .figure-method svg { aspect-ratio: 1.4; }
  .figure-method span { font-size: .75rem; margin-top: 5px; }
}
@media (max-width: 420px) {
  .figure-feature { padding-block: 52px; }
  .plate-label { font-size: 15px; }
  .plate-axis { font-size: 13px; }
  .plate-transect-label { font-size: 11px; }
  .figure-methods { gap: 14px 12px; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .figure-method svg { aspect-ratio: 2.15; }
}
