:root {
  --bg: #0b0d12;
  --surface: #141821;
  --surface-2: #1b202b;
  --text: #e7e9ee;
  --muted: #9aa3b2;
  --faint: #6b7483;
  --border: rgba(255, 255, 255, .09);
  --border-hover: rgba(255, 255, 255, .2);
  --accent: #a78bfa;
  --card-shadow: none;
}
html[data-theme="light"] {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --text: #1a1d24;
  --muted: #5c6370;
  --faint: #8b93a1;
  --border: rgba(0, 0, 0, .1);
  --border-hover: rgba(0, 0, 0, .25);
  --card-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

.hero { padding: 52px 0 24px; border-bottom: 1px solid var(--border); }
.hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 16px; }
.mark {
  width: 48px; height: 48px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent); color: #0b0d12;
  font-size: 24px; font-weight: 700;
}
h1 { margin: 0; font-size: 26px; font-weight: 650; letter-spacing: -.02em; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.hero-actions { display: flex; gap: 10px; }
.btn {
  border: 1px solid var(--border-hover); background: var(--surface);
  color: var(--text); border-radius: 9px; padding: 9px 16px;
  font: inherit; font-size: 13px; cursor: pointer; transition: .15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.ghost { background: transparent; }
.stats { display: flex; gap: 28px; margin-top: 28px; flex-wrap: wrap; }
.stat { display: flex; align-items: baseline; gap: 8px; }
.stat b { font-size: 22px; font-weight: 650; }
.stat span { font-size: 12px; color: var(--muted); }

main { padding-top: 28px; }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-icon {
  position: absolute; left: 16px; width: 18px; height: 18px;
  fill: none; stroke: var(--faint); stroke-width: 1.8; stroke-linecap: round;
}
#search {
  width: 100%; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 48px 14px 46px; font: inherit; font-size: 15px; outline: none;
}
#search:focus { border-color: var(--accent); }
#search::placeholder { color: var(--faint); }
kbd {
  position: absolute; right: 14px; border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 7px; font-size: 12px; color: var(--faint);
}

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.chip {
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  border-radius: 999px; padding: 6px 13px; font: inherit; font-size: 12px;
  cursor: pointer; transition: .15s;
}
.chip:hover { color: var(--text); border-color: var(--border-hover); }
.chip.active { color: #0b0d12; border-color: transparent; font-weight: 600; }

.result-bar { display: flex; justify-content: space-between; margin: 24px 0 14px; font-size: 12px; color: var(--faint); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(278px, 1fr)); gap: 14px; }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: 13px; padding: 18px 18px 16px; cursor: pointer;
  transition: transform .15s, border-color .15s; overflow: hidden;
  box-shadow: var(--card-shadow);
}
.card:hover { transform: translateY(-2px); border-color: var(--border-hover); }
.card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--cat-color); }
.card-cat { font-size: 11px; color: var(--cat-color); letter-spacing: .04em; }
.card h3 { margin: 6px 0 2px; font-size: 17px; font-weight: 620; line-height: 1.35; }
.card-en { margin: 0 0 10px; font-size: 11px; color: var(--faint); }
.card-one { margin: 0; font-size: 13px; color: var(--muted); min-height: 42px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 11px; color: var(--faint); }
.card-foot .more { color: var(--cat-color); }
mark { background: rgba(167, 139, 250, .28); color: inherit; border-radius: 2px; padding: 0 1px; }
.empty { text-align: center; padding: 60px 0; color: var(--muted); }

footer { margin-top: 64px; padding-top: 20px; padding-bottom: 40px; border-top: 1px solid var(--border); }
.footer-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; flex: none; }
.footer-sub { font-size: 12px; color: var(--faint); margin: 8px 0 0; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; background: var(--surface-2); padding: 2px 5px; border-radius: 4px; }

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .68); }
.modal-card {
  position: relative; width: min(640px, 100%); max-height: 86vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-hover);
  border-radius: 16px; padding: 28px;
}
.close { position: absolute; top: 16px; right: 18px; background: none; border: 0; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; }
.close:hover { color: var(--text); }
.cat-badge { display: inline-block; font-size: 11px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--cat-color); }
.modal-head h2 { margin: 10px 0 2px; font-size: 25px; font-weight: 650; }
.modal-en { margin: 0; color: var(--faint); font-size: 12px; }
.modal-one { font-size: 15px; line-height: 1.7; color: var(--text); margin: 18px 0 12px; }
.detail { margin-top: 20px; }
.detail h3 { font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; margin: 0 0 10px; }
.detail ul { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 8px; }
.detail li { position: relative; padding-left: 18px; font-size: 13px; color: var(--text); }
.detail li::before { content: ""; position: absolute; left: 3px; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: var(--cat-color); }
.prompt-box { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 80px 14px 16px; }
.prompt-box pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 13px; line-height: 1.7; }
.copy { position: absolute; top: 10px; right: 10px; background: var(--surface); border: 1px solid var(--border-hover); color: var(--muted); border-radius: 7px; padding: 4px 12px; font: inherit; font-size: 11px; cursor: pointer; }
.copy:hover { color: var(--accent); border-color: var(--accent); }
.caution { margin: 0; font-size: 13px; color: #fbbf24; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 24px; }
.tag { font-size: 11px; color: var(--faint); background: var(--surface-2); border-radius: 5px; padding: 3px 8px; }

.viz-svg { display: block; }
.viz-node { fill: var(--surface-2); stroke: var(--border-hover); stroke-width: 1; }
.viz-accent { fill: rgba(167, 139, 250, .12); stroke: var(--accent); stroke-width: 1.5; }
.viz-text, .viz-muted, .viz-bad-label, .viz-good-label { font-family: inherit; }
.viz-text { fill: var(--text); }
.viz-muted { fill: var(--muted); }
.viz-arrow { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.viz-arrow-head { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.viz-bad { fill: rgba(248, 113, 113, .07); stroke: rgba(248, 113, 113, .45); stroke-width: 1; }
.viz-good { fill: rgba(52, 211, 153, .07); stroke: rgba(52, 211, 153, .5); stroke-width: 1; }
.viz-bad-label { fill: #f87171; }
.viz-good-label { fill: #34d399; }
.viz-outer { fill: none; stroke: var(--border-hover); stroke-width: 1; stroke-dasharray: 4 4; }
.viz-middle { fill: rgba(167, 139, 250, .06); stroke: var(--accent); stroke-width: 1; }
.viz-inner { fill: rgba(167, 139, 250, .18); stroke: var(--accent); stroke-width: 1.5; }
.viz-line { stroke: var(--border-hover); stroke-width: 1.5; stroke-dasharray: 5 5; }

.viz-gallery { margin-top: 26px; }
.gallery-head h2 { margin: 0; font-size: 17px; font-weight: 620; }
.gallery-head p { margin: 3px 0 12px; font-size: 12px; color: var(--muted); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.gallery-card { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px 12px; cursor: pointer; color: inherit; font: inherit; transition: .15s; }
.gallery-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.gallery-card h3 { margin: 4px 0 0; font-size: 13px; font-weight: 600; }
.gallery-card p { margin: 0; font-size: 11px; color: var(--faint); }
.viz-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 14px 0 4px; }
.viz-caption { margin: 0 0 6px 2px; font-size: 11px; color: var(--muted); }

.view-tabs { display: flex; gap: 8px; margin-top: 22px; border-bottom: 1px solid var(--border); }
.view-tab {
  background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted);
  padding: 10px 16px 12px; font: inherit; font-size: 14px; cursor: pointer;
  display: flex; align-items: baseline; gap: 8px;
}
.view-tab small { font-size: 11px; color: var(--faint); font-weight: 400; }
.view-tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.view-tab.active small { color: var(--accent); }

.how { margin-top: 26px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px 24px; }
.how-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.how-head h2 { margin: 0; font-size: 17px; font-weight: 620; }
.how-head p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.btn.small { padding: 6px 12px; font-size: 11px; white-space: nowrap; }
.how-stage { display: grid; grid-template-columns: minmax(150px, 1fr) 120px minmax(210px, 1.3fr); align-items: center; gap: 16px; margin: 22px 0 14px; }
.stage-label { font-size: 11px; color: var(--faint); margin-bottom: 8px; }
.term-badge { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--accent); border-radius: 11px; padding: 14px 16px; }
.term-badge b { font-size: 16px; }
.term-badge span { font-size: 11px; color: var(--faint); }
.stage-flow { text-align: center; }
.stage-flow svg { width: 100%; height: 40px; }
.flow-path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 7; }
.how-stage.playing .flow-path { animation: flow 1s linear infinite; }
.flow-caption { display: block; font-size: 10px; color: var(--faint); margin-top: -4px; }
.rule-list { display: grid; gap: 8px; }
.rule-chip { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 12px; }
.how-stage.playing .term-badge { animation: badgePulse 1.4s ease-in-out infinite; }
.how-stage.playing .rule-chip { animation: ruleIn .45s ease both; animation-delay: calc(.45s + var(--i) * .28s); }
@keyframes flow { to { stroke-dashoffset: -24; } }
@keyframes badgePulse { 50% { box-shadow: 0 0 0 6px rgba(167, 139, 250, .13); } }
@keyframes ruleIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.how-steps { display: flex; gap: 18px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); }

.need-block { margin-top: 30px; }
.section-title { font-size: 18px; font-weight: 620; margin: 0; }
.section-sub { margin: 3px 0 14px; font-size: 12px; color: var(--muted); }
.need-input-wrap { position: relative; }
#needInput {
  width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 12px; padding: 15px 18px 15px 46px; font: inherit; font-size: 15px; outline: none;
}
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; }
#needInput:focus { border-color: var(--accent); }
#needInput::placeholder { color: var(--faint); }
#needInput.shake { animation: shake .4s; border-color: #f87171; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }
.quick-scenes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.scene-chip { border: 1px solid var(--border); background: transparent; color: var(--muted); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 12px; cursor: pointer; }
.scene-chip:hover { border-color: var(--accent); color: var(--accent); }

/* ===== AI 需求分析工作台 ===== */
.wb-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.model-picker { display: flex; align-items: center; gap: 8px; }
.model-picker label { font-size: 11px; color: var(--faint); }
.model-picker select {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 12px; outline: none; max-width: 180px;
}
.model-picker select:focus { border-color: var(--accent); }
.wb-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.btn.primary { background: var(--accent); color: #0b0d12; border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); color: #0b0d12; }
.btn.primary:disabled { opacity: .6; cursor: not-allowed; }
.btn.loading { opacity: .75; }
.ai-hint { font-size: 11px; color: var(--faint); }
.scenes-label { margin-top: 20px; font-size: 11px; letter-spacing: .04em; color: var(--faint); }

.ai-results { margin-top: 26px; }
.ai-loading, .ai-error { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.ai-loading-head { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.spinner { width: 15px; height: 15px; border: 2px solid var(--border-hover); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.ai-stream { margin: 0; max-height: 160px; overflow: auto; font: 11px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--faint); white-space: pre-wrap; word-break: break-all; }
.ai-error p { margin: 0 0 12px; font-size: 13px; color: #f87171; }

.ai-result { animation: fadeUp .35s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.res-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.res-badge { font-size: 11px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 999px; padding: 3px 11px; }
.res-type { font-size: 12px; color: var(--text); font-weight: 600; }
.res-model { font-size: 11px; color: var(--faint); margin-left: auto; }
.res-cols { display: grid; grid-template-columns: minmax(260px, 5fr) minmax(320px, 7fr); gap: 14px; }
.res-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.res-card h3 { margin: 0 0 14px; font-size: 12px; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.res-field { margin-bottom: 14px; }
.res-field:last-child { margin-bottom: 0; }
.res-field > span { display: block; font-size: 11px; color: var(--faint); margin-bottom: 4px; }
.res-field p { margin: 0; font-size: 13px; line-height: 1.7; color: var(--text); }
.res-field.why { background: var(--surface-2); border-radius: 9px; padding: 10px 12px; }
.res-card-head { display: flex; justify-content: space-between; align-items: center; }
.res-card-head h3 { margin-bottom: 14px; }
.res-card-head .copy { position: static; }
.res-b .prompt-box, .res-b pre { position: relative; }
#aiPromptText {
  margin: 0; white-space: pre-wrap; word-break: break-word; font: 13px/1.75 inherit;
  color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 16px;
  max-height: 420px; overflow: auto;
}
.used-anchors { margin-top: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.ua-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ua-head h3 { margin: 0; font-size: 12px; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.ua-head span { font-size: 11px; color: var(--faint); }
.ua-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.used-anchor { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--cat-color); border-radius: 10px; padding: 12px; color: var(--text); font: inherit; cursor: pointer; transition: .15s; }
.used-anchor:hover { border-color: var(--cat-color); transform: translateY(-2px); }
.ua-idx { font: 11px ui-monospace, monospace; color: var(--faint); }
.ua-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ua-body b { font-size: 13px; font-weight: 600; }
.ua-body em { font-size: 11px; color: var(--faint); font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.ua-go { margin-left: auto; font-size: 11px; color: var(--cat-color); white-space: nowrap; }
.ua-empty { font-size: 12px; color: var(--muted); margin: 0; }

.scenario-results { margin-top: 26px; }
.results-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 12px; color: var(--faint); }
.link-btn { background: none; border: 0; color: var(--accent); font: inherit; font-size: 12px; cursor: pointer; }
.scene-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.scene-card { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; cursor: pointer; transition: .15s; color: inherit; font: inherit; }
.scene-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.scene-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); color: var(--accent); font-size: 15px; }
.scene-card h3 { margin: 10px 0 4px; font-size: 15px; font-weight: 600; }
.scene-card p { margin: 0; font-size: 12px; color: var(--muted); min-height: 38px; }
.scene-preview { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.scene-preview span { font-size: 11px; background: var(--surface-2); color: var(--text); border-radius: 5px; padding: 3px 8px; }
.scene-detail { background: var(--surface); border: 1px solid var(--border-hover); border-radius: 14px; padding: 22px; }
.scene-detail-head { display: flex; align-items: center; gap: 12px; }
.scene-detail h2 { margin: 0; font-size: 19px; font-weight: 640; }
.scene-detail .sc-desc { margin: 10px 0 18px; color: var(--muted); font-size: 13px; }
.term-group { margin-top: 16px; }
.term-group h3, .scene-prompt h3 { font-size: 11px; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; font-weight: 600; text-transform: uppercase; }
.term-row { display: flex; gap: 8px; flex-wrap: wrap; }
.term-pill { display: flex; flex-direction: column; gap: 1px; text-align: left; background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--cat-color); border-radius: 9px; padding: 9px 12px; color: var(--text); font: inherit; cursor: pointer; min-width: 132px; }
.term-pill:hover { border-color: var(--cat-color); }
.term-pill b { font-size: 13px; font-weight: 600; }
.term-pill span { font-size: 11px; color: var(--faint); }
.term-pill.secondary { opacity: .82; }
.why-box { margin-top: 16px; font-size: 12px; color: var(--muted); background: var(--surface-2); border-radius: 9px; padding: 10px 13px; }
.scene-prompt { margin-top: 18px; }

/* ===== 无 AI 版：本地场景匹配结果 ===== */
.offline-badge { font-size: 11px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); border-radius: 999px; padding: 5px 12px; white-space: nowrap; }
.sc-empty { background: var(--surface); border: 1px dashed var(--border); border-radius: 12px; padding: 22px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.scene-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 20px; margin-bottom: 12px; cursor: default; animation: fadeUp .35s ease;
}
.sc-head { display: flex; align-items: flex-start; gap: 14px; }
.sc-rank { font: 12px ui-monospace, monospace; color: var(--faint); padding-top: 2px; }
.sc-head h3 { margin: 0; font-size: 15px; font-weight: 620; }
.sc-head p { margin: 4px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.sc-anchors { margin-top: 14px; display: grid; gap: 10px; }
.ma-group { display: flex; align-items: flex-start; gap: 12px; }
.ma-label { flex: none; width: 116px; font-size: 11px; color: var(--faint); padding-top: 7px; }
.ma-row { display: flex; gap: 8px; flex-wrap: wrap; }
.matched-anchor {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-left: 3px solid var(--cat-color); border-radius: 9px; padding: 6px 11px;
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: .15s;
}
.matched-anchor span { font-size: 10px; font-weight: 400; color: var(--cat-color); margin-left: 4px; }
.matched-anchor:hover { border-color: var(--cat-color); transform: translateY(-1px); }
.sc-why { margin: 14px 0 0; font-size: 12px; line-height: 1.7; color: var(--muted); background: var(--surface-2); border-radius: 9px; padding: 10px 13px; }
.sc-why b { color: var(--text); }
.sc-prompt { margin-top: 14px; }
.sc-prompt-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; font-size: 11px; color: var(--faint); letter-spacing: .03em; }
.sc-prompt .copy { position: static; }
#scenarioResults pre {
  margin: 0; white-space: pre-wrap; word-break: break-word; font: 12px/1.7 inherit;
  color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px;
  max-height: 300px; overflow: auto;
}

.unpack-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.unpack-term { background: var(--surface-2); border: 1px solid var(--cat-color); color: var(--cat-color); border-radius: 7px; padding: 3px 10px; font-size: 12px; font-weight: 600; }
.unpack-arrow { font-size: 11px; color: var(--faint); }
.replay-mini { margin-left: auto; background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 6px; padding: 3px 9px; font: inherit; font-size: 11px; cursor: pointer; }
.replay-mini:hover { color: var(--accent); border-color: var(--accent); }
#modalRules.playing li { animation: ruleIn .42s ease both; animation-delay: calc(var(--i) * .14s); }

@media (max-width: 760px) {
  .how-stage { grid-template-columns: 1fr; }
  .stage-flow svg { transform: rotate(90deg); width: 40px; height: 54px; }
  .view-tab small { display: none; }
  .res-cols { grid-template-columns: 1fr; }
  .wb-head { flex-direction: column; }
  .res-model { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .hero { padding-top: 32px; }
  h1 { font-size: 22px; }
  .stats { gap: 18px; }
  .grid { grid-template-columns: 1fr; }
  .modal-card { padding: 22px 18px; }
}
