:root {
  --bg: #f3f1ec; --bg2: #e9e6df; --panel: #fbfaf7; --card: #ffffff; --line: #e2ded5; --line2: #d3cec3;
  --text: #24221e; --muted: #7b766c; --accent: #e8553d; --accent-dark: #b8402c; --accent-light: #f39a85;
  --primary: #2f6fed; --ok: #22a36a; --bad: #e5484d; --warn: #d79a14;
  --c-m: #e5484d; --c-v: #3e7bfa; --c-f: #a8a8a8; --c-u: #e0a526; --c-c: #2fb36d; --c-b: #1f2328;
  --stage: radial-gradient(1200px 700px at 50% 35%, #fdfcf9 0%, #ece8e0 70%, #e2ddd3 100%);
  --shadow: 0 1px 2px rgba(40, 30, 10, .06), 0 4px 16px rgba(40, 30, 10, .06);
  --radius: 10px; --top: 56px; --foldbar: 76px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #17181b; --bg2: #202226; --panel: #1c1e22; --card: #24262b; --line: #31343a; --line2: #3c4047;
  --text: #e8e6e1; --muted: #9a978f; --primary: #5b8ff9;
  --stage: radial-gradient(1200px 700px at 50% 35%, #2d3036 0%, #1d1f23 75%, #17181b 100%);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --c-b: #d6d6d6;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 13px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
kbd { display: inline-block; min-width: 18px; padding: 0 5px; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 4px; font: 11px/16px ui-monospace, Menlo, monospace; text-align: center; background: var(--card); color: var(--muted); margin: 0 1px; }
.muted { color: var(--muted); } .small { font-size: 12px; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- layout */
.app { display: grid; grid-template-rows: var(--top) 1fr; height: 100vh; height: 100dvh; overflow: hidden; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 0 14px; background: var(--panel); border-bottom: 1px solid var(--line); z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.logo { width: 30px; height: 30px; stroke: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 16px; letter-spacing: 2px; }
.brand-text span { font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.modes { display: flex; gap: 4px; background: var(--bg2); padding: 4px; border-radius: 10px; margin: 0 auto; }
.mode-tab { display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 14px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 500; white-space: nowrap; }
.mode-tab:hover { color: var(--text); }
.mode-tab.active { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.mode-tab.active svg { color: var(--accent); }
.top-actions { display: flex; gap: 4px; align-items: center; min-width: 200px; justify-content: flex-end; }

.workspace { display: grid; grid-template-columns: 260px 1fr 300px; min-height: 0; }
.panel { background: var(--panel); border-right: 1px solid var(--line); overflow: auto; min-height: 0; }
.panel.right { border-right: 0; border-left: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.stage { position: relative; display: grid; grid-template-rows: 1fr var(--foldbar); min-width: 0; min-height: 0; background: var(--stage); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--line2); background: var(--card); border-radius: 8px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { border-color: var(--muted); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bg2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.icon { width: 32px; padding: 0; }
a.btn { text-decoration: none; color: inherit; }   /* GitHub 等链接式按钮 */
.btn.icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.btn#btnGithub svg { fill: currentColor; stroke: none; width: 17px; height: 17px; }
@media (max-width: 980px) { .btn#btnGithub span { display: none; } .btn#btnGithub { width: 32px; padding: 0; } }
.btn.round { border-radius: 50%; width: 44px; height: 44px; }
.btn.round svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.btn.full, select.full { width: 100%; }
.btn:disabled, .tbtn:disabled { opacity: .4; cursor: default; }
.link { border: 0; background: none; color: var(--primary); cursor: pointer; font-size: 12px; padding: 0; float: right; font-weight: 400; }

/* dropdown menu */
.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .15); padding: 6px; z-index: 50; }
.toolbar .menu { left: 0; right: auto; }
.menu button { display: flex; justify-content: space-between; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.menu button:hover { background: var(--bg2); }
.menu-title { font-size: 11px; color: var(--muted); padding: 6px 10px 2px; letter-spacing: 1px; }

/* ---------------------------------------------------------------- left panel */
.panel-tabs { display: flex; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 2; }
.ptab { flex: 1; border: 0; background: none; padding: 11px 0; cursor: pointer; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; }
.ptab.active { color: var(--text); border-bottom-color: var(--accent); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--bg2); font-size: 11px; line-height: 18px; }
.ptab-body { padding: 10px; }
.search { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line2); border-radius: 8px; padding: 0 8px; background: var(--card); }
.search svg { color: var(--muted); width: 16px; }
.search input { border: 0; outline: 0; background: none; height: 32px; width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0; }
.chip { border: 1px solid var(--line2); background: var(--card); border-radius: 14px; padding: 2px 10px; cursor: pointer; font-size: 12px; color: var(--muted); }
.chip.active { background: var(--text); color: var(--panel); border-color: var(--text); }
.lib-group { font-size: 11px; color: var(--muted); letter-spacing: 1px; margin: 12px 2px 6px; }
.lib-list { display: flex; flex-direction: column; gap: 6px; }
.lib-item { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: center; padding: 6px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; background: none; text-align: left; width: 100%; }
.lib-item:hover { background: var(--card); border-color: var(--line); }
.lib-item.active { background: var(--card); border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent); }
.lib-item canvas, .lib-item img { width: 52px; height: 52px; border-radius: 6px; background: #fff; border: 1px solid var(--line); }
.lib-item .nm { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.lib-item .ds { color: var(--muted); font-size: 11.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stars { color: var(--warn); font-size: 10px; letter-spacing: -1px; }
.lib-item .del { margin-left: auto; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 4px; padding: 0 4px; }
.lib-item .del:hover { color: var(--bad); background: var(--bg2); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* ---------------------------------------------------------------- stage areas */
.viewport, .design-area, .step-area { position: relative; min-height: 0; min-width: 0; }
#glCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; outline: none; }
#glCanvas.grab { cursor: crosshair; }
#glCanvas:active { cursor: grabbing; }
.app[data-mode="sim"] .design-area, .app[data-mode="sim"] .step-area { display: none; }
.app[data-mode="step"] .design-area, .app[data-mode="step"] .viewport, .app[data-mode="step"] .foldbar { display: none; }
.app[data-mode="step"] .stage { grid-template-rows: 1fr; }
.app[data-mode="design"] .step-area { display: none; }
.app[data-mode="design"] .stage { grid-template-rows: 1fr var(--foldbar); grid-template-columns: 1.25fr 1fr; }
.app[data-mode="design"] .design-area { grid-row: 1 / 3; grid-column: 1; border-right: 1px solid var(--line); background: var(--bg); display: flex; flex-direction: column; }
.app[data-mode="design"] .viewport { grid-row: 1; grid-column: 2; }
.app[data-mode="design"] .foldbar { grid-column: 2; }
.app[data-mode="design"] .vbar .vbtn:not(.icon) { display: none; }
.app[data-mode="design"] .fold-labels span:not(:nth-child(2)), .app[data-mode="design"] .fold-ticks { display: none; }
.app[data-mode="design"] .fold-labels { justify-content: center; }
.app[data-mode="design"] .fold-btns .btn[data-fold="50"] { display: none; }
.app[data-mode="design"] .foldbar { gap: 10px; padding: 10px 12px; }
.app[data-mode="step"] .sim-panel { display: none; }
.app:not([data-mode="step"]) .step-panel { display: none; }
.step-area { display: flex; flex-direction: column; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; background: var(--panel); border-bottom: 1px solid var(--line); z-index: 5; }
.tgroup { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.tsep { width: 1px; height: 22px; background: var(--line); margin: 0 2px; }
.tbtn { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 8px; border: 1px solid transparent; background: none; border-radius: 7px; cursor: pointer; color: var(--muted); font-size: 12px; }
.tbtn svg { width: 16px; height: 16px; }
.tbtn:hover { background: var(--bg2); color: var(--text); }
.tbtn.active { background: var(--card); border-color: var(--line2); color: var(--text); box-shadow: var(--shadow); }
.tbtn.active svg { color: var(--accent); }
.tbtn.icon { padding: 0 7px; }
.ltype { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 8px; border: 1px solid var(--line2); background: var(--card); border-radius: 7px; cursor: pointer; font-size: 12px; }
.ltype i { display: inline-block; width: 18px; height: 0; border-top: 2.5px solid var(--c); }
.ltype i.dashed { border-top-style: dashed; } .ltype i.dotted { border-top-style: dotted; }
.ltype i.dashdot { border-image: repeating-linear-gradient(90deg, var(--c) 0 6px, transparent 6px 8px, var(--c) 8px 10px, transparent 10px 12px) 1; }
.ltype.active { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.angle-field, .sel-field { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.angle-field input { width: 54px; height: 28px; border: 1px solid var(--line2); border-radius: 6px; padding: 0 4px; background: var(--card); }
select { height: 28px; border: 1px solid var(--line2); border-radius: 6px; background: var(--card); padding: 0 4px; }
.chk { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; cursor: pointer; user-select: none; }
.seg { display: inline-flex; background: var(--bg2); border-radius: 8px; padding: 2px; }
.seg button { border: 0; background: none; height: 26px; padding: 0 10px; border-radius: 6px; cursor: pointer; font-size: 12px; color: var(--muted); }
.seg button.active { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.seg button[data-kind="valley"].active { color: var(--c-v); } .seg button[data-kind="mountain"].active { color: var(--c-m); }

.design-split { flex: 1; min-height: 0; display: flex; }
.editor-wrap, .step-canvas-wrap { position: relative; flex: 1; min-height: 0; min-width: 0; }
#cpCanvas, #stepCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
.hint { position: absolute; left: 10px; bottom: 10px; right: 10px; pointer-events: none; font-size: 12px; color: var(--muted); background: color-mix(in srgb, var(--panel) 85%, transparent); backdrop-filter: blur(4px); padding: 4px 10px; border-radius: 6px; width: fit-content; max-width: calc(100% - 20px); border: 1px solid var(--line); }

/* viewport overlays */
.vp-overlay { position: absolute; z-index: 3; }
.top-left { left: 14px; top: 12px; pointer-events: none; }
.model-title { display: flex; flex-direction: column; }
.model-title span { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.model-title small { color: var(--muted); }
.top-right { right: 12px; top: 12px; display: flex; gap: 2px; background: color-mix(in srgb, var(--panel) 85%, transparent); backdrop-filter: blur(6px); padding: 3px; border-radius: 9px; border: 1px solid var(--line); }
.vbtn { border: 0; background: none; height: 28px; padding: 0 9px; border-radius: 6px; cursor: pointer; font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; }
.vbtn:hover { background: var(--bg2); color: var(--text); }
.vbtn.icon { padding: 0 6px; } .vbtn svg { width: 16px; height: 16px; }
.bottom-right { right: 12px; bottom: 12px; display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.tog { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--line2); background: color-mix(in srgb, var(--panel) 85%, transparent); backdrop-filter: blur(6px); cursor: pointer; font-size: 12px; color: var(--muted); }
.tog svg { width: 15px; height: 15px; }
.tog.on { background: var(--text); color: var(--panel); border-color: var(--text); }
.bottom-left { left: 14px; bottom: 12px; display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); background: color-mix(in srgb, var(--panel) 85%, transparent); padding: 4px 8px; border-radius: 6px; }
.legend .grad { width: 90px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #2c7bb6, #abd9e9, #ffffbf, #fdae61, #d7191c); }
.loading { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 30px; color: var(--muted); }

/* fold bar */
.foldbar { display: flex; align-items: center; gap: 16px; padding: 10px 18px; background: var(--panel); border-top: 1px solid var(--line); z-index: 4; }
.btn.round .i-pause { display: none; } .playing .btn.round .i-pause { display: block; } .playing .btn.round .i-play { display: none; }
.fold-slider { flex: 1; min-width: 120px; }
.fold-labels, .fold-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.fold-labels b { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.fold-ticks { font-size: 10px; opacity: .8; }
.fold-btns { display: flex; gap: 4px; }
input[type=range] { width: 100%; accent-color: var(--accent); height: 22px; cursor: pointer; }

/* ---------------------------------------------------------------- right panel */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.card.grow { flex: 1; min-height: 140px; overflow: auto; }
.card h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.card h3 small { font-weight: 400; font-size: 11px; margin-left: 4px; }
.cp-thumb { width: 100%; aspect-ratio: 1; border-radius: 6px; background: #fff; border: 1px solid var(--line); cursor: pointer; display: block; }
.validation { margin-top: 8px; font-size: 12px; display: flex; gap: 6px; align-items: flex-start; }
.validation .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; }
.params { display: flex; flex-direction: column; gap: 6px; }
.param { display: grid; grid-template-columns: 76px 1fr 46px; gap: 6px; align-items: center; font-size: 12px; }
.param label { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.param output { text-align: right; font-variant-numeric: tabular-nums; }
.color-row { display: flex; gap: 12px; }
.color-row label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
input[type=color] { width: 34px; height: 24px; border: 1px solid var(--line2); border-radius: 5px; padding: 1px; background: var(--card); cursor: pointer; }
.swatches { display: flex; gap: 5px; margin: 8px 0; flex-wrap: wrap; }
.sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line2); cursor: pointer; background: linear-gradient(135deg, var(--f) 50%, var(--b) 50%); }
.sw:hover { transform: scale(1.12); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.row > label:first-child { color: var(--muted); font-size: 12px; }
.stats { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; font-size: 12px; }
.stats dt { color: var(--muted); } .stats dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.step-panel, .sim-panel { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.step-panel { height: 100%; }
.step-nav { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 6px; }
.step-nav span { font-variant-numeric: tabular-nums; font-weight: 600; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 4px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 24px 1fr; gap: 8px; padding: 6px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.steps li::before { content: counter(s); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--bg2); font-size: 11px; font-weight: 600; }
.steps li.done::before { background: color-mix(in srgb, var(--ok) 20%, var(--card)); color: var(--ok); }
.steps li.current { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
.steps li.current::before { background: var(--accent); color: #fff; }
.steps li b { display: block; font-size: 12.5px; } .steps li span { color: var(--muted); font-size: 11.5px; }
.steps li.user::before { content: '✎'; }

/* toast, modal, drop */
.toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px); background: var(--text); color: var(--panel); padding: 8px 16px; border-radius: 20px; opacity: 0; pointer-events: none; transition: .25s; z-index: 100; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); max-width: 80vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--bad); color: #fff; }
.modal { position: fixed; inset: 0; background: rgba(20, 18, 14, .45); display: grid; place-items: center; z-index: 90; padding: 20px; backdrop-filter: blur(3px); }
.modal-box { position: relative; background: var(--panel); border-radius: 14px; max-width: 920px; width: 100%; max-height: 86vh; overflow: auto; padding: 22px 26px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.modal-box h2 { margin: 0 0 12px; }
.modal-box h4 { margin: 10px 0 4px; }
.modal-box p, .modal-box li { color: var(--text); opacity: .88; }
.modal-box ul { padding-left: 18px; margin: 4px 0; }
.modal-close { position: absolute; right: 12px; top: 10px; border: 0; background: none; font-size: 24px; cursor: pointer; color: var(--muted); }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 28px; }
.drop-mask { position: fixed; inset: 0; background: color-mix(in srgb, var(--accent) 18%, transparent); border: 3px dashed var(--accent); display: none; place-items: center; z-index: 95; font-size: 20px; font-weight: 600; color: var(--accent-dark); pointer-events: none; }
.drop-mask.show { display: grid; }
.dlg-row { display: flex; gap: 8px; align-items: center; margin: 8px 0; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1280px) { .workspace { grid-template-columns: 220px 1fr 270px; } .tbtn span { display: none; } }
@media (max-width: 1000px) {
  .top-actions .btn span { display: none; }
  .brand { min-width: 0; } .brand-text span { display: none; }
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(420px, 62vh) auto auto; overflow: visible; }
  .app { overflow: auto; height: auto; min-height: 100vh; }
  .stage { grid-row: 1; }
  .panel.left { grid-row: 3; border-right: 0; border-top: 1px solid var(--line); max-height: none; }
  .panel.right { grid-row: 2; border-left: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); overflow: visible; }
  .sim-panel, .step-panel { display: contents; }
  .cp-thumb { max-width: 360px; margin: 0 auto; }
  .app[data-mode="design"] .stage { grid-template-columns: 1fr; grid-template-rows: minmax(360px, 1fr) 260px var(--foldbar); }
  .app[data-mode="design"] .design-area { grid-row: 1; grid-column: 1; border-right: 0; }
  .app[data-mode="design"] .viewport { grid-row: 2; grid-column: 1; }
  .app[data-mode="design"] .foldbar { grid-row: 3; grid-column: 1; }
  .app[data-mode="design"] .workspace { grid-template-rows: minmax(700px, 90vh) auto auto; }
  .help-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar { gap: 6px; padding: 0 8px; }
  .brand-text { display: none; }
  .mode-tab { padding: 6px 8px; font-size: 12px; } .mode-tab svg { display: none; }
  .top-actions #btnTheme, .top-actions #btnHelp { display: none; }
  .fold-btns .btn:not(#btnResetSim) { display: none; }
  #btnResetSim { width: 32px; padding: 0; font-size: 0; gap: 0; }
  .vbar .vbtn[data-view="bottom"], .vbar .vbtn[data-view="right"] { display: none; }
  .bottom-right { left: 12px; }
  .bottom-left { bottom: 50px; }
  .top-actions { min-width: 0; gap: 0; }
  .top-actions .btn.icon, .top-actions .btn { width: 32px; padding: 0; }
  .modes { margin: 0 auto 0 4px; }
  .toolbar { gap: 4px; }
  .foldbar { gap: 10px; padding: 8px 10px; }
  .vbar .vbtn:not(.icon) { padding: 0 6px; }
}

/* 步骤列表里的「谷 / 山」切换按钮 */
#stSteps li { position: relative; }
#stSteps li .kbtn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid rgba(80,70,60,.25);
  background: #fff; color: #6b5f52; font-size: 13px; line-height: 1; cursor: pointer; padding: 0; }
#stSteps li .kbtn:hover { background: #e8553d; color: #fff; border-color: #e8553d; }
#stSteps li .kbtn em { font-style: normal; }
