/* 全栈能力：一摞能力板 + 案例面板 */
#stack {
  --stack-depth: 12px;
  --stack-pull: 30px;
  --stack-slab-h: 74px;
}
#stack .hl-lead { max-width: 34em; }
#stack .stack-nb { display: inline-block; }
#stack .stack-grid { position: relative; margin-top: 56px; display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  column-gap: clamp(72px, 9vw, 136px); align-items: start; }
#stack .stack-col { min-width: 0; }

#stack .stack-hint { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-3); margin-bottom: 18px; }
#stack .stack-hint-key { width: 6px; height: 6px; border-radius: 1px; background: var(--amber); }

/* 能力板：正面 + 顶面 + 右侧面，叠出厚度 */
#stack .stack-pile { display: grid; gap: var(--stack-depth); padding: var(--stack-depth) calc(var(--stack-pull) + var(--stack-depth) + 4px) 0 0; }
#stack .stack-slab { position: relative; z-index: 0; width: 100%; height: var(--stack-slab-h); padding: 0 18px 0 16px; border: 0; border-radius: 6px;
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-rows: auto auto; align-content: center; column-gap: 12px; row-gap: 2px;
  text-align: left; cursor: pointer; color: var(--ink-2);
  background: linear-gradient(180deg, #242a30 0%, #1c2025 55%, #181b1f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 -1px 0 rgba(0, 0, 0, 0.35), 0 6px 6px -4px rgba(0, 0, 0, 0.55);
  transition: transform 0.42s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease); }
#stack .stack-slab::before, #stack .stack-slab::after { content: ""; position: absolute; z-index: -1; pointer-events: none; transition: background 0.3s var(--ease); }
#stack .stack-slab::before { left: 0; right: 0; top: calc(var(--stack-depth) * -1); height: var(--stack-depth); border-radius: 4px 4px 0 0;
  transform-origin: bottom; transform: skewX(-45deg); background: linear-gradient(90deg, #2c3239, #262b31); }
#stack .stack-slab::after { top: 0; right: calc(var(--stack-depth) * -1); width: var(--stack-depth); height: 100%; border-radius: 0 3px 3px 0;
  transform-origin: left; transform: skewY(-45deg); background: linear-gradient(180deg, #171a1e, #111316); }
#stack .stack-num { grid-row: 1 / span 2; font-size: 13px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
#stack .stack-nm { font-size: 17px; font-weight: 620; white-space: nowrap; }
#stack .stack-ds { grid-column: 2; grid-row: 2; font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#stack .stack-pips { display: inline-flex; gap: 5px; }
#stack .stack-slab .stack-pips { grid-column: 3; grid-row: 1 / span 2; }
#stack .stack-pips i { width: 9px; height: 9px; border-radius: 2px; border: 1px solid var(--line-strong); }
#stack .stack-pips i.on { background: var(--ink-3); border-color: var(--ink-3); }

#stack .stack-slab:hover { color: var(--ink-1); }
#stack .stack-slab[aria-selected="true"] { transform: translateX(var(--stack-pull)); color: var(--ink-1);
  background: linear-gradient(180deg, #2e2a21 0%, #23221e 50%, #1d1e1f 100%);
  box-shadow: inset 0 1px 0 rgba(242, 179, 61, 0.55), inset 0 -1px 0 rgba(0, 0, 0, 0.35), 0 10px 14px -6px rgba(0, 0, 0, 0.7); }
#stack .stack-slab[aria-selected="true"]::before { background: linear-gradient(90deg, rgba(242, 179, 61, 0.42), rgba(242, 179, 61, 0.2)); }
#stack .stack-slab[aria-selected="true"]::after { background: linear-gradient(180deg, #2a2316, #16140f); }
#stack .stack-slab[aria-selected="true"] .stack-num { color: var(--amber); }
#stack .stack-slab[aria-selected="true"] .stack-ds { color: var(--ink-2); }
#stack .stack-slab[aria-selected="true"] .stack-pips i.on { background: var(--amber); border-color: var(--amber); }
#stack .stack-slab:focus-visible { outline-offset: 4px; }

#stack .stack-through { margin: 32px calc(var(--stack-pull) + var(--stack-depth) + 4px) 0 0; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
#stack .stack-through b { font-size: 14px; font-weight: 600; color: var(--ink-2); }
#stack .stack-through ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
#stack .stack-through li { font-size: 14px; color: var(--ink-2); padding: 4px 12px; border: 1px solid var(--line-strong); border-radius: 999px; }

/* 连线 */
#stack .stack-wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
#stack .stack-wire { fill: none; stroke: rgba(242, 179, 61, 0.55); stroke-width: 1.25; }
#stack .stack-wire.is-off { stroke: var(--line-strong); stroke-dasharray: 2 5; }
#stack .stack-wire-end { fill: var(--amber); }
#stack .stack-pulse { fill: #ffd98a; }
#stack .stack-pulse-glow { fill: rgba(242, 179, 61, 0.5); filter: blur(3px); }

/* 案例面板 */
#stack .stack-panel { position: relative; margin-top: 30px; padding: 26px 28px 22px; border-radius: var(--r-panel); background: var(--bg-raised); border: 1px solid var(--line); }
#stack .stack-panel-kicker { font-size: 13px; color: var(--ink-3); }
#stack .stack-panel-title { margin-top: 4px; font-size: var(--fs-h3); line-height: 1.35; }
#stack .stack-uses { margin: 18px 0 0; padding: 0; list-style: none; }
#stack .stack-uses li { position: relative; padding: 18px 0; border-top: 1px solid var(--line); transition: opacity 0.3s var(--ease); }
#stack .stack-port { position: absolute; left: -34px; top: 27px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--amber);
  box-shadow: 0 0 0 4px var(--amber-soft); }
#stack .stack-uses b { display: inline; font-size: 16px; font-weight: 620; color: var(--ink-1); }
#stack .stack-uses small { display: inline; margin-left: 10px; font-size: 13px; color: var(--ink-3); }
#stack .stack-uses p { margin-top: 6px; font-size: 15px; line-height: 1.75; color: var(--ink-2); }
#stack .stack-uses li.is-off b { color: var(--ink-3); }
#stack .stack-uses li.is-off p { color: var(--ink-4); }
#stack .stack-uses li.is-off .stack-port { border-color: var(--line-strong); box-shadow: none; }
#stack .stack-panel.is-swap .stack-uses p, #stack .stack-panel.is-swap .stack-panel-title { animation: stack-in 0.42s var(--ease) both; }
#stack .stack-legend { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
#stack .stack-legend .stack-pips i.on { background: var(--amber); border-color: var(--amber); }
@keyframes stack-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

@media (max-width: 1000px) {
  #stack { --stack-pull: 14px; --stack-slab-h: 70px; }
  #stack .stack-grid { grid-template-columns: 1fr; margin-top: 36px; }
  #stack .stack-wires, #stack .stack-port { display: none; }
  #stack .stack-panel { margin-top: 28px; padding: 20px 18px 16px; }
  #stack .stack-uses small { display: block; margin: 2px 0 0; }
}
@media (max-width: 520px) {
  #stack { --stack-depth: 9px; }
  #stack .stack-slab { height: auto; min-height: 66px; padding: 12px; column-gap: 10px; grid-template-columns: 18px minmax(0, 1fr) auto; }
  #stack .stack-nm { font-size: 16px; }
  #stack .stack-ds { font-size: 12px; white-space: normal; line-height: 1.5; }
  #stack .stack-uses p { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  #stack .stack-slab { transition: none; }
  #stack .stack-panel.is-swap .stack-uses p, #stack .stack-panel.is-swap .stack-panel-title { animation: none; }
}
