/* 教学与申请组件复用现有主题变量，明暗主题下保持一致。 */
[hidden] { display: none !important; }
.topbar { gap: 18px; }
.brand { flex-shrink: 0; }
.brand-mark { background: linear-gradient(145deg, #387969, #195548); box-shadow: 0 5px 16px #18554722; font-size: 18px; }
.brand strong { font-size: 16px; }
.brand small { letter-spacing: .7px; font-size: 10px; text-transform: none; }
.version-badge { margin-left: 0; }
.topbar-actions { gap: 7px; }
.button { text-decoration: none; }
.application-top-button { white-space: nowrap; }
.workshop-banner { display: flex; align-items: center; gap: 14px; margin: 0; padding: 13px 28px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.workshop-banner p { flex: 1; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.workshop-banner strong { color: var(--text); font-weight: 600; }
.backtest-badge { flex: 0 0 auto; padding: 4px 9px; color: var(--success); background: var(--success-soft); border: 1px solid color-mix(in srgb, var(--success) 22%, var(--border)); border-radius: 5px; font-size: 11px; font-weight: 650; }
.banner-help-button { flex: 0 0 auto; padding: 6px 0; color: var(--primary); background: none; border: 0; font-size: 12px; }
.learning-rail { margin: 24px 0 18px; padding: 18px 14px; border: 1px solid var(--border); border-radius: 10px; background: linear-gradient(145deg, var(--primary-soft), var(--surface)); }
.learning-kicker { margin: 0; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 1px; }
.learning-rail h2 { margin: 9px 0; font-size: 18px; font-weight: 650; letter-spacing: -.5px; }
.learning-rail p { margin: 0 0 15px; font-size: 12px; color: var(--muted); line-height: 1.8; }
.lesson-launch { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 10px 11px; color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border)); border-radius: 6px; background: var(--surface); font-size: 12px; font-weight: 600; }
.lesson-launch:hover { background: var(--primary-soft); }
.learning-rail > a { display: block; margin: 12px 0 0; color: var(--muted); font-size: 11px; text-decoration: none; }
.learning-rail > a:hover { color: var(--primary); }
.learning-rail > a span { float: right; }
.sidebar-note { margin-top: auto; }
.step-coach { margin: 0 0 22px; padding: 15px 18px; border: 1px solid color-mix(in srgb, var(--primary) 14%, var(--border)); border-radius: 9px; background: color-mix(in srgb, var(--primary-soft) 45%, var(--surface)); }
.view-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 18px; }
.view-switch { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.view-switch button { padding: 7px 13px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 12px; }
.view-switch button[aria-pressed="true"] { color: var(--primary); background: var(--surface); box-shadow: 0 1px 4px #0001; font-weight: 600; }
#viewModeHint { font-size: 11px; color: var(--muted); }
.optional-settings { min-width: 0; margin: 0 0 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.optional-settings > summary { padding: 13px 15px; color: var(--text); font-size: 13px; line-height: 1.7; cursor: pointer; }
.optional-settings > summary small { display: block; margin-left: 16px; color: var(--muted); font-size: 11px; font-weight: 400; }
.optional-settings > summary:hover { color: var(--primary); }
.optional-settings > summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 6px; }
.optional-settings > .section-block { padding: 16px; margin: 0; border-top: 1px solid var(--border); }
.optional-settings > .section-block > .section-heading h2 { font-size: 14px; }
.optional-field { margin-bottom: 0; align-self: start; }
.optional-field > .field { display: block; padding: 0 15px 15px; }
.optional-condition-list { display: grid; gap: 10px; padding: 0 12px 12px; }
.optional-params { margin: 0; background: transparent; border: 0; }
.optional-params > summary { padding: 3px 0; font-size: 11px; color: var(--primary); }
.optional-params > summary small { display: none; }
.optional-params > .signal-params { padding: 8px 0 0; justify-content: flex-start; }
[data-workshop-view="simple"] .signal-row { grid-template-columns: minmax(0, 1fr) auto; }
[data-workshop-view="simple"] .optional-params[open] { grid-column: 1 / -1; }
[data-workshop-view="simple"] .signal-copy > span { font-size: 12px; line-height: 1.75; }
[data-workshop-view="all"] .optional-settings,
[data-workshop-view="all"] .optional-condition-list { display: contents; }
[data-workshop-view="all"] .optional-settings > summary { display: none; }
[data-workshop-view="all"] .optional-settings > .section-block,
[data-workshop-view="all"] .optional-field > .field,
[data-workshop-view="all"] .optional-params > .signal-params { padding: revert; border-top: 0; }
[data-workshop-view="all"] .optional-settings > .section-block { margin-bottom: 26px; }
[data-workshop-view="all"] .optional-params > .signal-params { justify-content: flex-end; }
@media (max-width: 720px) { .view-toolbar { gap: 8px; } #viewModeHint { flex-basis: 100%; } [data-workshop-view="simple"] .signal-row { grid-template-columns: minmax(0, 1fr); } .optional-settings > summary { padding: 12px; } }
.coach-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.coach-label { color: var(--primary); font-size: 11px; font-weight: 600; letter-spacing: .6px; }
.coach-toggle { padding: 2px; background: none; border: 0; color: var(--muted); font-size: 11px; }
.step-coach h2 { margin: 9px 0 5px; font-size: 15px; font-weight: 600; }
.step-coach p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.85; }
.coach-actions { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 10px; }
.text-link { padding: 0; color: var(--primary); border: 0; background: none; font-size: 12px; text-decoration: none; }
.text-link:hover, .banner-help-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.environment-card { margin-top: 20px; padding: 18px 0; border-top: 1px solid var(--border); }
.environment-card h2 { margin: 8px 0; font-size: 15px; }
.environment-card p { margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.environment-card .button { width: 100%; }
.environment-note { display: block; margin-top: 8px; color: var(--subtle); font-size: 11px; text-align: center; }
.field-help-action { display: inline-flex; justify-content: flex-end; margin-top: 6px; }
.field-explain-button { padding: 2px 6px; color: var(--primary); border: 1px solid transparent; border-radius: 4px; background: transparent; font-size: 11px; line-height: 1.5; }
.field-explain-button:hover { background: var(--primary-soft); border-color: var(--border); }
/* 问号只占一小格；解释浮在表单外，不会撑开布局或被折叠区裁掉。 */
.parameter-help-trigger { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 24px; height: 24px; margin-inline-start: 5px; border: 1px solid var(--border-strong); border-radius: 50%; color: var(--muted); background: var(--surface); font: 600 13px/1 "Segoe UI", sans-serif; vertical-align: middle; text-decoration: none; cursor: help; touch-action: manipulation; transition: color .14s ease, border-color .14s ease, background .14s ease; }
.parameter-help-trigger:hover, .parameter-help-trigger[data-help-active] { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); text-decoration: none; }
.parameter-help-trigger:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.parameter-help-trigger > span { display: inline; margin: 0; color: inherit; font: inherit; }
.parameter-tooltip { position: fixed; z-index: 3000; width: min(340px, calc(100vw - 24px)); max-height: min(390px, calc(100dvh - 24px)); overflow: auto; box-sizing: border-box; padding: 17px 18px 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 11px; box-shadow: 0 12px 42px #0003; line-height: 1.7; overflow-wrap: anywhere; user-select: text; }
.parameter-tooltip > strong { display: block; color: var(--text); font-size: 15px; font-weight: 650; }
.parameter-tooltip > p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.parameter-tooltip > .parameter-tooltip-example { margin-top: 12px; padding: 10px 12px; color: var(--primary); border-radius: 6px; background: var(--primary-soft); font-size: 13px; }
.parameter-tooltip-usage { display: block; margin-top: 10px; color: var(--muted); font-size: 12px; }
.parameter-help-intro { margin-left: auto; color: var(--muted); font-size: 12px; }
.parameter-help-intro > span { display: inline-flex; justify-content: center; align-items: center; width: 17px; height: 17px; color: var(--primary); border: 1px solid var(--border-strong); border-radius: 50%; }
.field-label, .toggle-copy strong, .signal-copy strong, .option-copy strong { font-size: 14px; }
.mini-field { flex-wrap: wrap; row-gap: 5px; font-size: 12px; }
.mini-field > span:first-child { white-space: nowrap; }
.mini-field .parameter-help-trigger { width: 22px; height: 22px; font-size: 12px; margin-inline-start: 3px; }
.toggle-row.has-inline-params { flex-wrap: wrap; align-items: center; padding: 16px; background: var(--surface); border-color: var(--border-strong); }
.exit-inline-fields { flex: 1 0 100%; min-width: 0; margin-top: 5px; padding-top: 14px; border-top: 1px solid var(--border); }
.exit-inline-fields > .field:only-child { grid-column: 1 / -1; max-width: 360px; }
.financial-field { min-width: 0; }
.financial-field > .field-label { display: flex; align-items: center; gap: 2px; margin-bottom: 7px; line-height: 1.6; }
.financial-field .input, .financial-field .select { width: 100%; }
.rule-row:has(.financial-field) { align-items: end; }
@media (max-width: 720px) { .coach-heading { flex-wrap: wrap; gap: 7px 12px; } .parameter-help-intro { order: 3; width: 100%; margin: 0; } .coach-toggle { margin-left: auto; } .exit-inline-fields { grid-template-columns: minmax(0, 1fr); } .exit-inline-fields > .field:only-child { max-width: none; } .parameter-help-trigger, .mini-field .parameter-help-trigger { width: 28px; height: 28px; } .parameter-tooltip { padding: 15px; } }
@media (prefers-reduced-motion: reduce) { .parameter-help-trigger { transition: none; } }
/* 原生 dialog 提供焦点隔离、Esc 关闭与背景遮罩，避免自制模态框遗漏键盘行为。 */
.workshop-dialog { color: var(--text); background: var(--surface); width: min(680px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); margin: auto; padding: 0; border: 1px solid var(--border-strong); border-radius: 15px; box-shadow: 0 30px 100px #0005; overflow: auto; overscroll-behavior: contain; }
.workshop-dialog::backdrop { background: #070d19aa; backdrop-filter: blur(6px); }
.workshop-dialog[open] { animation: help-enter .18s ease-out; }
.help-dialog-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; padding: 25px 28px 20px; border-bottom: 1px solid var(--border); }
.help-dialog-heading h2 { margin: 7px 0 0; font-size: 23px; letter-spacing: -.5px; font-weight: 650; }
.help-close { padding: 6px 9px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; font-size: 12px; }
.help-close:hover { color: var(--text); border-color: var(--border-strong); }
.help-dialog-body { padding: 23px 28px 26px; }
.dialog-lead { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.9; }
.application-steps { display: grid; gap: 17px; margin: 0 0 24px; padding: 0; list-style: none; counter-reset: application-step; }
.application-steps li { display: grid; grid-template-columns: 27px 1fr; column-gap: 12px; counter-increment: application-step; }
.application-steps li::before { content: counter(application-step); grid-row: 1 / 3; align-self: start; display: grid; place-items: center; width: 27px; height: 27px; color: var(--primary); background: var(--primary-soft); border-radius: 50%; font-size: 12px; }
.application-steps strong { font-size: 14px; font-weight: 600; }
.application-steps li > span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.application-placeholder { padding: 13px 15px; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 8px; font-size: 13px; line-height: 1.8; background: var(--surface-2); }
.application-request { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 23px; }
.application-request label { width: 100%; color: var(--muted); font-size: 12px; }
.application-request textarea { width: 100%; min-height: 95px; padding: 12px; font-size: 13px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; line-height: 1.8; resize: vertical; }
.application-request [role="status"] { font-size: 12px; color: var(--primary); }
.help-footnote { margin: 16px 0 0; color: var(--subtle); font-size: 12px; line-height: 1.75; }
.tutorial-dialog { width: min(960px, calc(100vw - 32px)); }
.tutorial-player-shell { background: #0b1420; line-height: 0; }
.tutorial-player-shell video { display: block; width: 100%; max-height: 57vh; aspect-ratio: 16 / 9; object-fit: contain; }
.tutorial-dialog .help-dialog-body { padding-top: 16px; }
.tutorial-caption { margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.tutorial-caption small { display: block; margin-top: 7px; color: var(--subtle); font-size: 10px; }
.tutorial-resources { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.tutorial-chapters { display: flex; flex-wrap: wrap; gap: 8px; }
.chapter-button { padding: 7px 10px; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); font-size: 11px; }
.chapter-button:hover, .chapter-button[aria-current="true"] { color: var(--primary); background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.chapter-button time { margin-right: 6px; opacity: .8; font-variant-numeric: tabular-nums; }
.glossary-list { margin: 0; }
.glossary-entry + .glossary-entry { margin-top: 23px; padding-top: 21px; border-top: 1px solid var(--border); }
.glossary-entry dt { margin: 0 0 8px; font-size: 15px; font-weight: 650; }
.glossary-entry dd { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.9; }
.glossary-example { display: block; margin-top: 8px; color: var(--primary); font-size: 13px; }
.glossary-entry.is-highlighted { padding: 15px; border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border)); border-radius: 8px; background: var(--primary-soft); }
a:focus-visible, .field-explain-button:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
@keyframes help-enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1390px) { .topbar .save-state, .topbar .version-badge { display: none; } .topbar { padding-inline: 20px; } .topbar .brand { gap: 8px; } .topbar-actions { gap: 5px; } .topbar .button-compact { padding-inline: 10px; } }
@media (max-width: 1180px) { .topbar .help-top-link, #exportTopButton { display: none; } .learning-rail { padding: 13px 10px; } }
@media (max-width: 980px) { .workshop-banner { padding: 12px 20px; gap: 10px; } .workshop-banner p { font-size: 11px; } .environment-card { margin-top: 0; } }
@media (max-width: 720px) { .topbar { min-height: 64px; height: auto; padding: 11px 14px; gap: 8px; } .brand strong { font-size: 14px; } .brand small { display: none; } .topbar .brand-mark { width: 30px; height: 30px; font-size: 16px; } .topbar-actions { gap: 5px; } .topbar #themeToggle { display: none; } .topbar .application-top-button { display: inline-flex; padding-inline: 9px; font-size: 11px; } .workshop-banner { align-items: flex-start; padding: 12px 16px; } .banner-help-button { display: none; } .backtest-badge { font-size: 10px; padding: 3px 7px; } .learning-rail { display: none; } .step-coach { margin-bottom: 18px; padding: 13px 14px; } .help-dialog-heading { padding: 19px 20px 16px; } .help-dialog-heading h2 { font-size: 20px; } .help-dialog-body { padding: 20px; } .workshop-dialog { max-height: calc(100dvh - 26px); width: calc(100vw - 24px); } .tutorial-resources .button { flex: 1 1 auto; font-size: 12px; } .environment-card { padding: 10px 0; } }
@media (max-width: 380px) { .brand strong { font-size: 12px; } .topbar .brand-mark { display: none; } .topbar .application-top-button { font-size: 10px; } }
@media (prefers-reduced-motion: reduce) { .workshop-dialog[open] { animation: none; } }
@media (max-width: 720px) { .topbar #themeToggle { display: inline-flex; width: 30px; height: 32px; min-width: 30px; padding: 4px; } }

/* 简洁布局：说明只在首页，后续步骤是一张连续的填写工作区。 */
:root { --topbar-height: 64px; --sidebar-width: 204px; }
.topbar { height: var(--topbar-height); min-height: var(--topbar-height); padding: 0 28px; gap: 20px; background: var(--surface); backdrop-filter: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--primary); box-shadow: none; }
.brand strong { font-size: 16px; letter-spacing: 0; }
.topbar-actions { gap: 14px; }
.topbar .save-state { display: inline; font-size: 12px; }
.progress-track { height: 2px; }
.progress-fill { background: var(--primary); }
.app-layout { width: min(1240px, 100%); grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: calc(100vh - var(--topbar-height) - 2px); }
.step-sidebar { padding: 30px 16px 20px; height: calc(100vh - var(--topbar-height) - 2px); top: calc(var(--topbar-height) + 2px); border-right: 0; }
.sidebar-heading { margin: 0 10px 18px; font-size: 12px; }
.step-nav { gap: 6px; }
.step-button { min-height: 46px; padding: 9px 10px; border-radius: 7px; gap: 8px; grid-template-columns: 24px minmax(0, 1fr) auto; }
.step-index { width: 24px; height: 24px; background: transparent; border-radius: 50%; font-size: 12px; }
.step-label { font-size: 14px; }
.step-button[aria-current="step"] .step-index { background: var(--primary); color: var(--surface); }
.sidebar-note { padding: 18px 10px 0; background: none; border-radius: 0; line-height: 1.9; font-size: 12px; }
.wizard-panel { padding: 34px clamp(24px, 4vw, 48px) 24px; border-inline: 1px solid var(--border); min-height: calc(100vh - var(--topbar-height) - 2px); }
.wizard-heading { margin-bottom: 24px; }
.wizard-heading h1 { font-size: 27px; font-weight: 650; letter-spacing: -.5px; }
.wizard-heading .eyebrow { margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 500; }
#stepDescription { max-width: 680px; font-size: 14px; line-height: 1.8; }
.view-toolbar { gap: 10px 14px; margin-bottom: 8px; padding-bottom: 17px; border-bottom: 1px solid var(--border); }
.view-switch { border-radius: 7px; }
.view-switch button { padding: 7px 12px; font-size: 13px; }
#viewModeHint { color: var(--muted); font-size: 12px; }
.step-glossary-link { margin-left: auto; font-size: 12px; white-space: nowrap; }
.step-content { min-height: 0; gap: 8px; }
.step-content > .section-block:first-child { border-top: 0; }
.section-block { padding: 22px 0; }
.section-heading { margin-bottom: 18px; }
.section-heading h2 { font-size: 16px; font-weight: 600; }
.section-heading p { margin-top: 5px; font-size: 13px; line-height: 1.75; }
.field-grid { gap: 20px; }
.field-label { font-size: 14px; line-height: 1.75; }
.input, .select { min-height: 42px; border-radius: 7px; }
.optional-settings { margin-bottom: 8px; border-color: var(--border); background: var(--surface-2); box-shadow: none; }
.optional-settings > summary { padding: 13px 15px; }
.optional-settings > summary small { display: inline; margin-left: 10px; font-size: 12px; }
.optional-params { margin: 0; background: none; }
.optional-params > summary { padding: 3px 0; }
.optional-params > summary small { display: none; }
.toggle-row.has-inline-params { border-radius: 8px; }
.wizard-footer { margin: 24px 0 -12px; padding: 16px 0; background: var(--surface); }
.wizard-footer .button { min-height: 42px; padding-inline: 22px; }
.footer-hint { font-size: 12px; }

.config-menu { position: relative; }
.config-menu > summary { list-style: none; padding: 8px 13px; border: 1px solid var(--border-strong); border-radius: 7px; color: var(--text); font-size: 13px; cursor: pointer; background: var(--surface); white-space: nowrap; }
.config-menu > summary::-webkit-details-marker { display: none; }
.config-menu > summary::after { content: "⌄"; margin-left: 10px; color: var(--muted); }
.config-menu[open] > summary { border-color: var(--primary); }
.config-menu-content { position: absolute; top: calc(100% + 9px); right: 0; z-index: 60; width: min(340px, calc(100vw - 32px)); max-height: calc(100dvh - 100px); overflow-y: auto; overscroll-behavior: contain; padding: 7px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); box-shadow: 0 10px 28px #0002; }
#configMenu .button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; min-height: 40px; height: auto; padding: 12px; justify-content: flex-start; text-align: left; white-space: normal; color: var(--text); border: 0; border-radius: 5px; background: transparent; font-size: 14px; }
#configMenu .config-menu-label { font-size: 14px; font-weight: 600; line-height: 1.6; }
#configMenu .button small { display: block; color: var(--muted); font-size: 14px; font-weight: 400; line-height: 1.65; overflow-wrap: anywhere; }
#configMenu .button:hover { background: var(--surface-3); }
#configMenu .config-reset { margin-top: 5px; border-top: 1px solid var(--border); border-radius: 0; color: var(--danger); }
.config-menu > summary:focus-visible, .config-summary > summary:focus-visible, .tutorial-index > summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }

.welcome-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 350px); align-items: start; gap: 28px; margin: 0 0 28px; padding: 24px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.welcome-kicker { font-size: 12px; color: var(--primary); font-weight: 600; }
.welcome-copy h2 { margin: 9px 0 14px; font-size: 22px; font-weight: 650; letter-spacing: -.4px; line-height: 1.4; }
.welcome-copy p { margin: 0 0 14px; color: var(--muted); font-size: 15px; line-height: 1.85; }
.welcome-copy .welcome-boundary { font-size: 13px; }
.welcome-links { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: 18px; }
.welcome-links a, .welcome-links button { padding: 0; color: var(--primary); border: 0; background: transparent; text-decoration: none; font-size: 14px; }
.welcome-links a:hover, .welcome-links button:hover { text-decoration: underline; text-underline-offset: 3px; }
.welcome-copy .welcome-tip { margin: 18px 0 0; font-size: 12px; color: var(--muted); }
.welcome-tutorial { min-width: 0; }
.welcome-video-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 12px; }
.welcome-video-heading h3 { margin: 0; font-size: 14px; font-weight: 600; }
.welcome-video-heading > span { font-size: 12px; color: var(--muted); }
.welcome-tutorial .tutorial-player-shell { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.welcome-tutorial video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #111d2b; }
.tutorial-index { margin-top: 10px; }
.tutorial-index > summary { padding: 6px 0; cursor: pointer; font-size: 13px; color: var(--text); }
.tutorial-index > summary > span { margin-left: 8px; color: var(--muted); font-size: 12px; }
.tutorial-index .tutorial-chapters { display: grid; grid-template-columns: 1fr; gap: 5px; margin: 8px 0 12px; max-height: 245px; overflow: auto; }
.tutorial-index .chapter-button { padding: 9px 10px; font-size: 12px; text-align: left; }
.welcome-video-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.welcome-video-footer a { color: var(--primary); text-decoration: none; }
#tutorialPlaybackStatus:empty { display: none; }

.config-summary { margin-top: 22px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.config-summary > summary { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 15px 0; cursor: pointer; color: var(--muted); font-size: 13px; list-style: none; }
.config-summary > summary::-webkit-details-marker { display: none; }
.config-summary > summary > span:first-child::before { content: "+"; display: inline-block; width: 20px; color: var(--text); }
.config-summary[open] > summary > span:first-child::before { content: "−"; }
.config-summary .api-guard { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--muted); font-size: 12px; }
.config-summary .api-guard.has-warning { color: var(--warning); }
.config-summary .api-guard.has-error { color: var(--danger); }
.config-summary .summary-content { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; margin: 0 0 18px; padding-top: 6px; }
.config-summary .summary-group { border: 0; padding: 0; }
.config-summary .summary-group > span { font-size: 12px; font-weight: 400; }
.config-summary .summary-group > strong { font-size: 14px; font-weight: 600; }
.config-summary .summary-group p { font-size: 12px; line-height: 1.8; }

@media (max-width: 1060px) {
  :root { --sidebar-width: 184px; }
  .wizard-panel { padding-inline: 26px; }
  .welcome-panel { grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); padding: 20px; gap: 20px; }
  .welcome-copy h2 { font-size: 20px; }
  .welcome-copy p { font-size: 14px; }
}
@media (max-width: 850px) {
  .welcome-panel { grid-template-columns: minmax(0, 1fr); }
  .welcome-tutorial { width: 100%; max-width: 460px; }
  #viewModeHint { display: none; }
}
@media (max-width: 720px) {
  :root { --topbar-height: 60px; }
  .topbar { padding: 0 16px; gap: 8px; }
  .brand { gap: 8px; }
  .brand strong { font-size: 14px; }
  .brand-mark { width: 28px; height: 28px; }
  .topbar .save-state { display: none; }
  .topbar-actions { gap: 7px; }
  .config-menu > summary { padding: 7px 10px; font-size: 12px; }
  .app-layout { display: block; }
  .step-sidebar { height: auto; padding: 8px 12px; top: var(--topbar-height); }
  .step-nav { gap: 5px; }
  .step-button { min-height: 38px; padding: 6px 9px; display: inline-flex; width: auto; }
  .step-label { font-size: 13px; }
  .step-index { width: 22px; height: 22px; }
  .wizard-panel { padding: 24px 18px; border: 0; }
  .wizard-heading { margin-bottom: 20px; }
  .wizard-heading h1 { font-size: 24px; }
  .welcome-panel { padding: 18px; margin-bottom: 24px; }
  .view-toolbar { flex-wrap: nowrap; }
  .step-glossary-link { margin-left: auto; }
  .field-grid { gap: 16px; }
  .optional-settings > summary small { display: block; margin-left: 16px; }
  .optional-params > summary small { display: none; }
  .wizard-footer { margin-bottom: -16px; gap: 8px; }
  .wizard-footer .button { padding-inline: 14px; }
  .footer-hint { font-size: 12px; }
}
@media (max-width: 400px) {
  .topbar { padding-inline: 12px; }
  .brand-mark { display: none; }
  .brand strong { font-size: 13px; }
  .config-menu > summary::after { margin-left: 5px; }
  .config-summary .summary-content { grid-template-columns: minmax(0, 1fr); }
}

/* 前导与填写分开：保留同一份草稿和同一个播放器。 */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.intro-page { width: min(1120px, 100%); margin: 0 auto; padding: 50px 36px 30px; }
.intro-page .welcome-panel { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 52px; padding: 0 0 38px; margin: 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; }
.intro-page .welcome-kicker { display: block; font-size: 14px; font-weight: 500; }
.welcome-copy h1 { margin: 16px 0 20px; font-size: clamp(28px, 3.1vw, 38px); font-weight: 650; letter-spacing: -.8px; line-height: 1.4; }
.intro-page .welcome-copy p { font-size: 16px; line-height: 1.9; }
.intro-page .welcome-copy .welcome-boundary { margin: 20px 0 0; font-size: 13px; line-height: 1.8; }
.intro-start { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 24px; }
.intro-start .button { min-height: 48px; gap: 26px; padding: 12px 22px; font-size: 16px; }
.intro-start > span { color: var(--muted); font-size: 13px; line-height: 1.8; }
.intro-return { white-space: nowrap; font-size: 14px; }
.intro-page .welcome-tutorial { align-self: center; max-width: none; padding: 20px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.intro-page .welcome-video-heading { margin-bottom: 14px; }
.welcome-video-heading h2 { margin: 0; font-size: 16px; font-weight: 600; }
.intro-page .tutorial-index > summary { font-size: 14px; }
.intro-page .chapter-button { font-size: 14px; }
.intro-examples { padding-top: 30px; }
.intro-section-heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 20px; }
.intro-section-heading h2 { margin: 0 0 8px; font-size: 20px; font-weight: 600; }
.intro-section-heading p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.intro-selection { align-self: center; color: var(--primary); font-size: 14px; }
.example-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.example-card { min-width: 0; padding: 19px 21px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; text-align: left; transition: border-color .15s, background .15s; }
.example-card:hover { border-color: var(--primary); }
.example-card[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.example-card:last-child { grid-column: 1 / -1; }
.example-card-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.example-card-heading strong { font-size: 16px; font-weight: 600; }
.example-number { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.example-choice { margin-left: auto; color: var(--muted); font-size: 13px; }
.example-card[aria-pressed="true"] .example-choice { color: var(--primary); }
.example-description { display: block; margin: 10px 0 0 27px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.intro-footnote { margin: 24px 0 0; color: var(--muted); font-size: 13px; text-align: center; line-height: 1.8; }
.selected-example { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0 5px; color: var(--muted); font-size: 14px; }
.selected-example strong { margin-left: 10px; color: var(--text); font-weight: 600; }
.selected-example .text-link { font-size: 14px; }

/* 生成只反映本地文件状态，不展示虚构回测进度或结果。 */
:root[data-workshop-step="7"] .view-toolbar { display: none; }
.code-result { margin-top: 12px; scroll-margin-top: 90px; }
.generation-card { padding: 34px clamp(18px, 4vw, 42px) 28px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-2); text-align: center; }
.generation-symbol { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 17px; color: var(--primary); background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 17%, var(--border)); border-radius: 17px; font-size: 23px; font-weight: 500; }
.generation-label { display: block; color: var(--primary); font-size: 13px; font-weight: 500; }
.generation-card h2 { margin: 10px 0 12px; font-size: clamp(23px, 2.5vw, 28px); font-weight: 650; line-height: 1.45; letter-spacing: -.3px; }
.generation-card > p { margin: 0 auto 20px; max-width: 540px; font-size: 16px; line-height: 1.85; color: var(--muted); }
.download-file { display: flex; align-items: center; gap: 15px; width: min(100%, 490px); margin: 24px auto; padding: 17px 20px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); text-align: left; }
.file-extension { display: grid; place-items: center; flex: 0 0 39px; height: 46px; border-radius: 7px; background: var(--primary-soft); color: var(--primary); font-size: 13px; font-weight: 650; }
.download-file > div { min-width: 0; }
.download-file strong { display: block; font-size: 15px; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
.download-file div > span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.generation-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin: 22px 0 12px; }
.generation-actions .button { min-height: 46px; padding-inline: 22px; gap: 20px; font-size: 15px; }
.generation-card > .generation-boundary { margin: 18px 0 0; font-size: 13px; }
.generation-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 28px auto 8px; padding: 22px 0 0; max-width: 520px; list-style: none; border-top: 1px solid var(--border); }
.generation-steps li { display: flex; flex-direction: column; align-items: center; gap: 7px; color: var(--muted); font-size: 14px; }
.generation-step-icon { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--border-strong); border-radius: 50%; font-size: 13px; font-variant-numeric: tabular-nums; }
.generation-steps small { font-size: 12px; color: var(--muted); }
.generation-steps .is-active { color: var(--primary); }
.generation-steps .is-active .generation-step-icon { color: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.generation-steps .is-done .generation-step-icon { background: var(--success-soft); color: var(--success); border-color: transparent; }
.generation-spinner { width: 27px; height: 27px; border: 2px solid color-mix(in srgb, var(--primary) 20%, transparent); border-top-color: var(--primary); border-radius: 50%; animation: file-working .85s linear infinite; }
.generation-card.is-working > .button { margin-top: 16px; font-size: 14px; }
.generation-card.is-ready { background: var(--surface); border-color: color-mix(in srgb, var(--success) 35%, var(--border)); animation: file-ready .22s ease-out; }
.is-ready .generation-symbol { background: var(--success-soft); color: var(--success); border-color: transparent; }
.is-ready .generation-label { color: var(--success); }
.generation-card.is-blocked { text-align: left; }
.is-blocked .generation-symbol { margin-left: 0; color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.generation-card.is-blocked > p { max-width: none; }
.generation-card.is-blocked .platform-checklist { margin-bottom: 20px; }
.generation-card .generation-error { color: var(--danger); overflow-wrap: anywhere; }
.code-disclosure { margin-top: 22px; border: 1px solid var(--border); border-radius: 9px; }
.code-disclosure > summary { padding: 15px 18px; font-size: 14px; cursor: pointer; }
.code-disclosure > summary > span { margin-left: 12px; color: var(--muted); font-size: 12px; }
.code-disclosure .code-shell { border: 0; border-radius: 0 0 8px 8px; box-shadow: none; }
.code-disclosure .code-toolbar .button { color: #dfe7f5; font-size: 13px; padding: 6px 10px; min-height: 34px; }
.code-disclosure .code-toolbar .button:hover { background: #25364e; }
.generation-secondary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin-top: 13px; font-size: 13px; color: var(--muted); }
.generation-secondary .text-link { font-size: 14px; }
.review-next-step { margin: 18px 0 6px; font-size: 14px; color: var(--muted); line-height: 1.8; }
.review-details { margin-top: 8px; padding-block: 18px; }
.review-details > summary { font-size: 14px; }
.review-details small { font-size: 12px; }
.review-warnings > summary { color: var(--warning); }
.code-disclosure > summary:focus-visible, .review-details > summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
@keyframes file-working { to { transform: rotate(360deg); } }
@keyframes file-ready { from { opacity: .6; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 850px) {
  .intro-page { padding: 32px 24px 24px; }
  .intro-page .welcome-panel { gap: 28px; grid-template-columns: minmax(0, 1fr); }
  .intro-page .welcome-tutorial { width: 100%; max-width: 620px; }
  .welcome-copy h1 br { display: none; }
}
@media (max-width: 720px) {
  .intro-return { font-size: 12px; }
  :root[data-workshop-page="configure"] .topbar .brand-mark { display: none; }
  .intro-page { padding: 27px 18px 24px; }
  .intro-page .welcome-tutorial { padding: 15px; }
  .example-grid { grid-template-columns: minmax(0, 1fr); }
  .example-card { padding: 17px; }
  .selected-example { flex-wrap: wrap; }
  .generation-card { padding: 25px 18px; border-radius: 12px; }
  .generation-steps { gap: 8px; }
  .generation-steps li { font-size: 13px; }
  .download-file { padding: 15px; }
  .code-disclosure > summary > span { display: block; margin-top: 5px; margin-left: 17px; }
  .review-details small { display: block; margin-top: 6px; margin-left: 17px; }
}
@media (max-width: 420px) {
  .generation-actions .button { width: 100%; }
  .generation-steps { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .generation-steps li { flex-direction: row; gap: 10px; }
  .generation-steps small { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .generation-spinner, .generation-card.is-ready { animation: none; }
  .example-card { transition: none; }
}

/* 明确套用与继续的区别，保护本地草稿。 */
.intro-selection { max-width: 100%; overflow-wrap: anywhere; }
.intro-continue { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; margin-top: 22px; padding: 22px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.intro-continue > div { min-width: 0; }
.intro-continue strong { display: block; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.intro-continue > div > span { display: block; margin-top: 7px; font-size: 14px; color: var(--muted); }
.intro-continue .button { min-height: 46px; gap: 24px; font-size: 15px; }
.draft-recovery { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 18px; margin-top: 15px; font-size: 13px; color: var(--muted); }
.draft-recovery > span { overflow-wrap: anywhere; }
.draft-recovery .text-link { font-size: 14px; }
.example-choice { font-size: 14px; }
.required-rule-toggle { flex: 1 0 100%; min-width: 0; }
.required-rule-toggle .toggle-row { padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.required-rule-toggle .toggle-copy span { font-size: 13px; line-height: 1.8; }
.template-change-dialog { width: min(660px, calc(100vw - 32px)); }
.template-change-dialog .help-dialog-heading h2 { margin: 0; font-size: 22px; }
.template-change-dialog .dialog-lead { font-size: 16px; line-height: 1.8; }
.template-impact { padding: 17px 20px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.template-impact > strong { display: block; font-size: 15px; margin-bottom: 5px; }
.template-backup-note { margin: 18px 0 14px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.template-change-error { padding: 12px 15px; color: var(--danger); background: var(--danger-soft); border-radius: 7px; font-size: 14px; line-height: 1.8; }
.template-change-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.template-change-actions .button { font-size: 14px; min-height: 44px; }
.plain-review { margin-top: 10px; padding: 20px 22px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.plain-review-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 15px; margin-bottom: 4px; }
.plain-review-heading h2 { margin: 0; font-size: 18px; font-weight: 600; }
.plain-review-heading > span { color: var(--muted); font-size: 12px; }
.plain-rules { margin: 0; }
.plain-rules > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 14px 0; }
.plain-rules > div + div { border-top: 1px solid var(--border); }
.plain-rules dt { font-size: 14px; color: var(--text); font-weight: 600; }
.plain-rules dd { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.85; overflow-wrap: anywhere; }
.plain-review > p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.template-impact .plain-rules > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
@media (max-width: 720px) {
  .intro-continue { padding: 18px; }
  .intro-continue .button { width: 100%; justify-content: space-between; }
  .plain-review { padding: 18px; }
  .plain-rules > div { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .template-impact { padding: 15px; }
}
