/* ── 阶段样图导出工作区：全屏，左侧阶段缩略图、中间大图、右侧设置（阶段样图 §1） ── */
.sm-work { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100vh; height: 100dvh; background: var(--surface); }
.sm-head { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 8px 20px 8px 12px; border-bottom: 0.5px solid var(--border-soft); background: var(--bg); }
.sm-title { margin: 0; font-size: var(--text-dialog-title); font-weight: 600; overflow-wrap: anywhere; }
.sm-title:focus, .sm-title:focus-visible { outline: none; box-shadow: none; } /* 进入时程序聚焦标题供读屏播报，标题不可操作，不显示焦点环 */
.sm-range { min-width: 0; color: var(--fg-2); font-size: var(--text-table); overflow-wrap: anywhere; }
.sm-proto { margin-left: auto; white-space: nowrap; }
.sm-body { display: grid; grid-template-columns: 232px minmax(0, 1fr) 280px; min-height: 0; }
.sm-groups { min-height: 0; overflow: auto; padding: 16px; border-right: 0.5px solid var(--border-soft); background: var(--bg); }
.sm-groups ol { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.sm-group { display: grid; gap: 2px; }
.sm-thumb { display: block; width: 100%; aspect-ratio: 420 / 297; padding: 0; border: 0; border-radius: var(--radius-sm); background: var(--bg); box-shadow: var(--elev-ring); overflow: hidden; cursor: pointer; transition: box-shadow var(--motion-fast) var(--ease-standard), background var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard); }
.sm-thumb svg { display: block; width: 100%; height: 100%; }
.sm-thumb[aria-current="true"] { box-shadow: 0 0 0 2px var(--accent); }
.sm-thumb:active { background: var(--fill-soft); transform: scale(.98); transition-duration: 0s; } /* 按下即时反馈（AD-04）；减少动态效果只留底色 */
.sm-thumb:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.sm-check { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; min-height: 44px; font-size: var(--text-table); } /* 窄栏大字号时宗数换到下一行，名称不逐字折行 */
.sm-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.sm-check .sm-n { margin-left: auto; color: var(--fg-2); white-space: nowrap; }
.sm-check:has(input:disabled) { color: var(--muted); }
.sm-mode { display: flex; gap: 6px; align-items: flex-start; margin: 0; color: var(--fg-2); }
.sm-mode .i { flex: none; width: 14px; height: 14px; margin-top: 2px; }
.sm-stage { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; align-content: start; justify-items: center; gap: 10px; min-width: 0; min-height: 0; padding: 20px 24px; }
.sm-notes { display: grid; gap: 8px; justify-self: stretch; }
.sm-sheet-box { grid-row: 2; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); place-items: center; width: 100%; height: 100%; min-height: 0; container-type: size; }
.sm-sheet { max-width: 100%; min-width: 0; width: min(100%, 100cqh * 420 / 297); aspect-ratio: 420 / 297; background: var(--bg); box-shadow: var(--glass-shadow-sm); } /* 纸面等比放进可用区域 */
.sm-sheet svg { display: block; width: 100%; height: 100%; }
.sm-foot { grid-row: 3; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; min-width: 0; }
.sm-caption { margin: 0; text-align: center; overflow-wrap: anywhere; }
.sm-side { display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow: auto; padding: 20px; border-left: 0.5px solid var(--border-soft); background: var(--bg); }
.sm-side-title { margin: 0; font-size: var(--text-card-title); font-weight: 600; }
.sm-form { display: grid; gap: 16px; }
.sm-form .field p { margin: 0; }
.sm-form .field-label .muted, .sm-form label .muted { font-weight: 400; }
.sm-actions { display: grid; gap: 6px; margin-top: auto; }
.sm-actions p { margin: 0; text-align: center; }
@media (max-width: 1180px) { .sm-body { grid-template-columns: 196px minmax(0, 1fr) 240px; } }


/* 独立工作区不继承外壳边栏；原生控件以真实44px命中区验收。 */
.sm-head { flex-wrap: wrap; }
.sm-head > .btn { flex: none; }
.sm-head .sm-range { margin-left: auto; }
.sm-work { animation: sm-enter var(--motion-base) var(--ease-standard); }
.sm-work.is-leaving { animation: sm-exit var(--motion-base) var(--ease-exit) forwards; }
.sm-work :is(.btn,.seg button) { height: auto; min-height: 44px; min-width: 44px; white-space: normal; }
.sm-work .input-shell { min-height: 44px; height: auto; }
.sm-work .input-shell :is(input,select) { min-height: 44px; }
.sm-settings,.sm-radio { min-width: 0; border: 0; padding: 0; margin: 0; }
.sm-settings { display: grid; gap: 16px; }
.sm-radio legend { font-size: var(--text-label); color: var(--fg-2); margin-bottom: 6px; }
.sm-radio .seg { display: flex; width: 100%; }
.sm-radio .seg label { flex: 1; }
.sm-radio .seg-radio span { white-space: normal; text-align: center; }
.sm-empty { align-self: center; text-align: center; display: grid; justify-items: center; gap: 12px; max-width: 100%; }
.sm-notes { overflow-wrap: anywhere; }
.sm-stage { overflow: auto; }
.sm-sheet-box { min-height: 140px; }
.sm-work .sm-sheet { aspect-ratio: 420 / 297; }
.sm-foot .seg { flex-wrap: wrap; justify-content: center; }
.sm-check:has(:focus-visible) { border-radius: var(--radius-sm); box-shadow: var(--focus-ring); }
.sm-check:active { background: var(--fill-soft); }
.ledger-page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ledger-page-actions > .btn { min-height: 44px; height: auto; white-space: normal; }
@keyframes sm-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sm-exit { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  @keyframes sm-enter { from { opacity: 0; } to { opacity: 1; } }
  @keyframes sm-exit { from { opacity: 1; } to { opacity: 0; } }
  .sm-thumb:active { transform: none; }
}
@media (max-width: 800px) {
  .sm-work { height: auto; min-height: 100dvh; }
  .sm-body { grid-template-columns: minmax(0, 1fr); }
  .sm-side { grid-row: 1; border-left: 0; border-bottom: 1px solid var(--border-soft); }
  .sm-groups { border-right: 0; }
  .sm-groups ol { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .sm-stage { min-height: 420px; padding: 16px; }
  .sm-sheet-box { height: 260px; }
}

.sm-radio .seg-radio label { position: relative; display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 6px 10px; border-radius: var(--radius-pill); color: var(--fg-2); font-size: var(--text-table); cursor: pointer; }
.sm-radio .seg-radio input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sm-radio .seg-radio label:has(input:checked) { background: var(--bg); color: var(--fg); box-shadow: var(--glass-shadow-sm); }
.sm-radio .seg-radio label:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.sm-radio .seg-radio label:active { background: var(--fill-accent-soft); }
.sm-radio .seg-radio label:has(input:disabled) { color: var(--muted); cursor: not-allowed; }

.sm-work svg { font-synthesis: none; }
