:root {
  --ink: #f4f7f2;
  --muted: #9aa5a1;
  --paper: #070909;
  --paper-soft: #101617;
  --paper-warm: #18201e;
  --line: rgba(232, 241, 236, 0.14);
  --accent: #ffb234;
  --accent-deep: #ff6a22;
  --accent-soft: rgba(255, 178, 52, 0.13);
  --button-metal: rgba(244, 247, 242, 0.075);
  --button-metal-strong: rgba(244, 247, 242, 0.115);
  --green: #20392a;
  --red: #ff6b55;
  --panel: rgba(15, 21, 22, 0.86);
  --panel-strong: rgba(20, 27, 28, 0.96);
  --panel-soft: rgba(244, 247, 242, 0.045);
  --shadow: 0 32px 110px rgba(0, 0, 0, 0.46);
  --soft-shadow: 0 16px 44px rgba(0, 0, 0, 0.32);
  --fs-h1: 22px;
  --fs-h2: 14px;
  --fs-body: 13px;
  --fs-meta: 11px;
  --lh-ui: 1.56;
  font-family: Inter, "Arial", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-size: var(--fs-body);
  line-height: var(--lh-ui);
  background-color: #070909;
  background-image:
    linear-gradient(116deg, rgba(255, 178, 52, 0.12) 0%, rgba(255, 178, 52, 0.04) 21%, transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 34%),
    repeating-linear-gradient(90deg, rgba(232, 241, 236, 0.045) 0 1px, transparent 1px 112px),
    repeating-linear-gradient(0deg, rgba(232, 241, 236, 0.035) 0 1px, transparent 1px 112px),
    linear-gradient(135deg, #050606 0%, #0b1011 42%, #121818 100%);
  background-attachment: fixed;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: min(1280px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px 20px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0 14px;
  backdrop-filter: blur(18px);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 4px -8px 8px;
  z-index: -1;
  border: 1px solid rgba(232, 241, 236, 0.08);
  border-radius: 16px;
  background: rgba(7, 9, 9, 0.64);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.26);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(255, 178, 52, 0.46);
  background:
    linear-gradient(145deg, rgba(255, 178, 52, 0.2), rgba(244, 247, 242, 0.035) 42%),
    rgba(7, 9, 9, 0.72);
  display: grid;
  place-items: center;
  color: #ffd28a;
  font-size: 22px;
  font-weight: 950;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset, 0 12px 26px rgba(0, 0, 0, 0.28);
}

.brand strong,
.brand small {
  display: block;
  white-space: nowrap;
}

.brand strong {
  font-size: var(--fs-h1);
  font-weight: 950;
  line-height: 1.1;
}

.brand small {
  margin-top: 2px;
  color: rgba(244, 247, 242, 0.58);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
}

.ghost-button,
.primary-button,
.dark-button,
.stage-button,
.quick-row button {
  min-height: 38px;
  border: 1px solid rgba(244, 247, 242, 0.18);
  border-radius: 10px;
  padding: 0 14px;
  background:
    linear-gradient(180deg, var(--button-metal-strong), rgba(244, 247, 242, 0.045));
  color: var(--ink);
  font-size: var(--fs-body);
  font-weight: 850;
  letter-spacing: 0;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.ghost-button:hover,
.primary-button:hover,
.dark-button:hover,
.stage-button:hover,
.quick-row button:hover {
  border-color: rgba(255, 178, 52, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 178, 52, 0.13), rgba(244, 247, 242, 0.06));
}

.primary-button,
.stage-button {
  background:
    linear-gradient(180deg, rgba(255, 178, 52, 0.18) 0%, rgba(244, 247, 242, 0.065) 100%),
    rgba(7, 9, 9, 0.74);
  color: #fff4dc;
  border-color: rgba(255, 178, 52, 0.38);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.075) inset;
}

.ghost-button {
  background:
    linear-gradient(180deg, var(--button-metal), rgba(244, 247, 242, 0.035));
  color: rgba(244, 247, 242, 0.86);
}

.dark-button {
  width: 100%;
  margin-top: 14px;
  background:
    linear-gradient(180deg, rgba(255, 178, 52, 0.17), rgba(244, 247, 242, 0.06)),
    rgba(7, 9, 9, 0.8);
  color: #fff4dc;
  border-color: rgba(255, 178, 52, 0.34);
}

body[data-step="intro"] .step-back,
body:not([data-step="program"]) #exportBtn {
  display: none;
}

.flow-main {
  min-height: calc(100vh - 74px);
}

.flow-stage {
  position: relative;
  isolation: isolate;
  display: none;
  min-height: calc(100vh - 86px);
  animation: stageIn 160ms ease both;
}

.command-stage::before,
.fit-stage::before,
.choose-stage::before,
.recipe-stage::before,
.program-stage::before {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
  border: 1px solid rgba(232, 241, 236, 0.08);
  border-radius: 28px;
  background-size: cover;
  background-position: center;
  filter: saturate(0.74) contrast(1.08);
  opacity: 0.14;
  box-shadow: 0 34px 120px rgba(0, 0, 0, 0.34);
  mask-image: linear-gradient(90deg, transparent 0%, #000 18%, #000 78%, transparent 100%);
}

.command-stage::before {
  top: 11vh;
  right: 0;
  width: min(54vw, 760px);
  height: min(68vh, 620px);
  background-image:
    linear-gradient(90deg, rgba(7, 9, 9, 0.82), rgba(7, 9, 9, 0.18) 46%, rgba(7, 9, 9, 0.82)),
    url("./assets/product-kitchen-line.jpg");
}

.fit-stage::before,
.choose-stage::before {
  top: 7vh;
  left: 0;
  width: min(52vw, 760px);
  height: min(66vh, 600px);
  background-image:
    linear-gradient(90deg, rgba(7, 9, 9, 0.72), rgba(7, 9, 9, 0.28) 56%, rgba(7, 9, 9, 0.88)),
    url("./assets/product-kitchen-line.jpg");
  opacity: 0.1;
}

.recipe-stage::before,
.program-stage::before {
  top: 4vh;
  right: 0;
  width: min(56vw, 780px);
  height: min(54vh, 520px);
  background-image:
    linear-gradient(90deg, rgba(7, 9, 9, 0.9), rgba(7, 9, 9, 0.2) 52%, rgba(7, 9, 9, 0.92)),
    url("./assets/product-ai-workflow.jpg");
  opacity: 0.12;
}

body[data-step="intro"] [data-stage="intro"],
body[data-step="command"] [data-stage="command"],
body[data-step="fit"] [data-stage="fit"],
body[data-step="choose"] [data-stage="choose"],
body[data-step="recipe"] [data-stage="recipe"],
body[data-step="program"] [data-stage="program"] {
  display: block;
}

@keyframes stageIn {
  from {
    opacity: 0.92;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.intro-stage {
  position: relative;
  overflow: hidden;
  display: none;
  border: 1px solid rgba(232, 241, 236, 0.11);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(244, 247, 242, 0.09), rgba(244, 247, 242, 0.035)),
    linear-gradient(135deg, rgba(20, 28, 29, 0.96), rgba(8, 11, 11, 0.9));
  box-shadow: var(--shadow);
}

.intro-stage::before {
  content: "";
  position: absolute;
  inset: 58px 26px 26px;
  border: 1px solid rgba(232, 241, 236, 0.08);
  border-radius: 22px;
  background:
    linear-gradient(90deg, rgba(255, 178, 52, 0.2), transparent 28%, transparent 70%, rgba(255, 178, 52, 0.08)),
    repeating-linear-gradient(90deg, rgba(232, 241, 236, 0.035) 0 1px, transparent 1px 82px);
  pointer-events: none;
}

.intro-stage::after {
  content: "";
  position: absolute;
  right: 8%;
  bottom: 13%;
  width: 48%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 178, 52, 0.84), transparent);
  box-shadow: 0 0 34px rgba(255, 178, 52, 0.56);
  pointer-events: none;
}

body[data-step="intro"] .intro-stage {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(360px, 1.08fr);
  align-items: center;
  gap: 10px;
  padding: clamp(28px, 4.2vw, 64px);
}

.intro-copy {
  position: relative;
  z-index: 2;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 12px;
  color: rgba(255, 178, 52, 0.86);
  font-size: var(--fs-meta);
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(58px, 8vw, 120px);
  line-height: 0.86;
  font-weight: 950;
}

h2 {
  margin: 0;
  font-size: var(--fs-h1);
  line-height: 1.18;
  font-weight: 950;
}

h3 {
  margin: 0;
  font-size: var(--fs-h2);
  line-height: 1.25;
  font-weight: 950;
}

.hero-text,
.stage-copy p {
  max-width: 680px;
  color: rgba(244, 247, 242, 0.72);
  font-size: var(--fs-body);
  line-height: var(--lh-ui);
  font-weight: 430;
}

.hero-text {
  margin: 24px 0 0;
}

.intro-button {
  min-height: 48px;
  margin-top: 26px;
  padding: 0 22px;
  font-size: 15px;
  border-radius: 12px;
}

.machine-figure {
  position: relative;
  z-index: 1;
  width: min(60vw, 780px);
  aspect-ratio: 1.333 / 1;
  margin: 0 -2% 0 0;
  justify-self: end;
  overflow: hidden;
  border: 1px solid rgba(85, 129, 184, 0.28);
  border-radius: 22px;
  background: #041026;
  box-shadow: 0 42px 88px rgba(0, 0, 0, 0.58);
}

.machine-figure::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(5, 7, 7, 0.06), transparent 42%, rgba(17, 93, 180, 0.08));
  pointer-events: none;
}

.machine-figure::after {
  content: "";
  position: absolute;
  left: 9%;
  right: 9%;
  bottom: 8%;
  z-index: 2;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 178, 52, 0.88), transparent);
  box-shadow: 0 0 26px rgba(49, 151, 255, 0.42);
  opacity: 0.46;
  pointer-events: none;
}

.machine-figure img {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.02) contrast(1.04) brightness(0.94);
}

.intro-badge {
  position: absolute;
  right: clamp(22px, 4vw, 54px);
  top: clamp(22px, 4vw, 54px);
  z-index: 3;
  min-width: 116px;
  border: 1px solid rgba(255, 178, 52, 0.34);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 178, 52, 0.17), rgba(244, 247, 242, 0.055)),
    rgba(7, 9, 9, 0.76);
  padding: 12px 15px;
  color: #fff4dc;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28), 0 0 32px rgba(255, 178, 52, 0.08);
}

.intro-badge strong,
.intro-badge span {
  display: block;
}

.intro-badge strong {
  font-size: 30px;
  line-height: 1;
  font-weight: 950;
}

.intro-badge span {
  margin-top: 6px;
  color: rgba(255, 244, 220, 0.66);
  font-size: 12px;
  font-weight: 900;
}

.stage-shell {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 86px);
  display: grid;
  grid-template-columns: minmax(240px, 0.58fr) minmax(430px, 0.95fr);
  gap: clamp(20px, 3.5vw, 48px);
  align-items: center;
  padding: clamp(20px, 3.4vw, 44px);
}

.narrow-shell {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}

.center-copy {
  text-align: center;
}

.command-panel,
.judgement-board,
.match-panel,
.result-panel,
.program-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.command-panel {
  max-width: 760px;
  padding: clamp(22px, 2.8vw, 32px);
}

.command-field {
  display: block;
  text-align: left;
}

.command-field span,
.field span {
  display: block;
  margin-bottom: 8px;
  color: rgba(244, 247, 242, 0.62);
  font-size: var(--fs-meta);
  font-weight: 950;
}

.command-field span {
  color: rgba(244, 247, 242, 0.46);
  font-weight: 760;
}

textarea,
select {
  width: 100%;
  border: 1px solid rgba(232, 241, 236, 0.16);
  border-radius: 12px;
  background: rgba(5, 7, 7, 0.7);
  color: var(--ink);
  outline: none;
}

textarea {
  min-height: 132px;
  padding: 15px;
  resize: vertical;
  font-size: var(--fs-body);
  line-height: 1.55;
  font-weight: 680;
}

textarea::placeholder {
  color: rgba(244, 247, 242, 0.32);
  font-weight: 620;
}

select {
  min-height: 48px;
  padding: 0 14px;
  font-size: var(--fs-body);
  font-weight: 850;
}

textarea:focus,
select:focus {
  border-color: rgba(255, 178, 52, 0.82);
  box-shadow: 0 0 0 4px rgba(255, 178, 52, 0.14), 0 0 32px rgba(255, 178, 52, 0.12);
}

.quick-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 14px 0 12px;
}

.quick-row button {
  min-height: 34px;
  padding: 0 12px;
  border-color: rgba(232, 241, 236, 0.18);
  background: transparent;
  color: rgba(244, 247, 242, 0.66);
  font-size: var(--fs-body);
  border-radius: 8px;
}

.more-options {
  margin: 8px 0 16px;
  text-align: left;
}

.more-options summary {
  width: fit-content;
  padding: 8px 0;
  color: rgba(244, 247, 242, 0.72);
  font-weight: 950;
  cursor: pointer;
}

.light-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.generate-button {
  width: 100%;
  min-height: 46px;
  font-size: 15px;
}

.command-message {
  min-height: 20px;
  margin: 12px 0 0;
  color: rgba(255, 178, 52, 0.88);
  font-size: var(--fs-body);
  line-height: var(--lh-ui);
  font-weight: 760;
  text-align: left;
}

.judgement-board,
.match-panel,
.result-panel,
.program-card {
  padding: clamp(22px, 2.8vw, 34px);
}

.judgement-head,
.match-summary,
.block-title,
.match-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.fit-summary {
  margin: 14px 0;
  color: rgba(244, 247, 242, 0.72);
  font-size: var(--fs-body);
  line-height: var(--lh-ui);
  font-weight: 520;
}

.thinking-console {
  display: none;
  margin: 16px 0;
  border: 1px solid rgba(255, 178, 52, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 178, 52, 0.08), rgba(244, 247, 242, 0.035)),
    rgba(5, 7, 7, 0.44);
  padding: 14px;
}

.thinking-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 13px;
  margin-bottom: 12px;
}

.thinking-core {
  position: relative;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(255, 178, 52, 0.38);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 178, 52, 0.28), rgba(255, 178, 52, 0.05) 46%, rgba(6, 10, 10, 0.86) 72%),
    rgba(5, 7, 7, 0.76);
  box-shadow: 0 0 32px rgba(255, 178, 52, 0.14);
}

.thinking-core::before,
.thinking-core::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1px solid rgba(255, 178, 52, 0.18);
  border-radius: 18px;
  opacity: 0.64;
}

.thinking-core::after {
  inset: -14px;
  border-color: rgba(49, 151, 255, 0.12);
  opacity: 0.4;
}

.thinking-console.active .thinking-core {
  animation: corePulse 1.25s ease-in-out infinite;
}

.thinking-core span {
  position: relative;
  z-index: 1;
  color: #ffd28a;
  font-size: var(--fs-meta);
  font-weight: 950;
}

.thinking-copy strong,
.thinking-copy span {
  display: block;
}

.thinking-copy strong {
  color: rgba(244, 247, 242, 0.92);
  font-size: var(--fs-h2);
  line-height: 1.3;
  font-weight: 950;
}

.thinking-copy span {
  margin-top: 3px;
  color: rgba(244, 247, 242, 0.48);
  font-size: var(--fs-meta);
  line-height: 1.5;
  font-weight: 520;
}

.thinking-console.active,
.thinking-console.complete {
  display: block;
}

.thinking-meter {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(244, 247, 242, 0.1);
}

.thinking-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 178, 52, 0.42), rgba(255, 207, 112, 0.98));
  box-shadow: 0 0 22px rgba(255, 178, 52, 0.22);
  transition: width 260ms ease;
}

.thinking-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.thinking-step {
  border: 1px solid rgba(232, 241, 236, 0.1);
  border-radius: 8px;
  background: rgba(244, 247, 242, 0.045);
  padding: 10px;
}

.thinking-step strong,
.thinking-step span {
  display: block;
}

.thinking-step strong {
  color: rgba(244, 247, 242, 0.66);
  font-size: var(--fs-body);
  line-height: 1.35;
  font-weight: 900;
}

.thinking-step span {
  margin-top: 5px;
  color: rgba(244, 247, 242, 0.45);
  font-size: var(--fs-meta);
  line-height: 1.5;
  font-weight: 480;
}

.thinking-step.active {
  border-color: rgba(255, 178, 52, 0.34);
  background: rgba(255, 178, 52, 0.08);
}

.thinking-step.active strong {
  color: #ffd28a;
}

.thinking-step.done {
  border-color: rgba(146, 214, 122, 0.22);
}

.thinking-step.done strong {
  color: #92d67a;
}

.thinking-code-stream {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  border-top: 1px solid rgba(232, 241, 236, 0.08);
  padding-top: 11px;
  color: rgba(146, 214, 122, 0.76);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.45;
}

.thinking-code-stream span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  opacity: 0.72;
}

@keyframes corePulse {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(255, 178, 52, 0.12), 0 0 0 rgba(49, 151, 255, 0);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 38px rgba(255, 178, 52, 0.26), 0 0 34px rgba(49, 151, 255, 0.12);
    transform: scale(1.018);
  }
}

.fit-chip-row,
.reason-chips,
.technique-chips,
.state-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fit-chip-row span,
.reason-chips span,
.technique-chips span,
.state-stack span,
.block-title span,
.match-head span,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(232, 241, 236, 0.14);
  border-radius: 5px;
  background: rgba(244, 247, 242, 0.06);
  padding: 0 11px;
  color: rgba(244, 247, 242, 0.76);
  font-size: var(--fs-meta);
  font-weight: 850;
}

#machineFitStatus.fit-pass {
  color: #92d67a;
}

#machineFitStatus.fit-warn {
  color: #ffbd6b;
}

#machineFitStatus.fit-block {
  color: var(--red);
}

.fit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 20px;
}

.fit-grid > div,
.mini-item,
.review-item,
.liquid-box,
.capability-list div,
.warning-list p,
.normalize-list p,
.command-item {
  border: 1px solid rgba(232, 241, 236, 0.12);
  border-radius: 12px;
  background: rgba(244, 247, 242, 0.055);
  padding: 16px;
}

.fit-grid strong {
  display: block;
  margin-bottom: 10px;
  font-size: var(--fs-h2);
  font-weight: 950;
}

.fit-grid p,
.warning-list p,
.normalize-list p,
.technique-reasons p {
  margin: 0 0 8px;
  color: rgba(244, 247, 242, 0.72);
  font-size: var(--fs-body);
  line-height: var(--lh-ui);
  font-weight: 440;
}

.risk-block {
  color: var(--red) !important;
}

.risk-warn {
  color: #ffbd6b !important;
}

.match-panel {
  max-width: 1000px;
}

.match-summary {
  align-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(32, 57, 42, 0.92), rgba(18, 33, 29, 0.82));
  border: 1px solid rgba(146, 214, 122, 0.24);
  padding: 18px;
}

.match-summary h3 {
  font-size: var(--fs-h1);
  line-height: 1.22;
}

.match-summary p {
  margin: 8px 0 0;
  color: rgba(244, 247, 242, 0.72);
  font-size: var(--fs-body);
  line-height: var(--lh-ui);
  font-weight: 430;
}

.score-ring {
  width: 112px;
  min-height: 82px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 178, 52, 0.34);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 178, 52, 0.17), rgba(244, 247, 242, 0.055)),
    rgba(7, 9, 9, 0.8);
  display: grid;
  place-items: center;
  text-align: center;
  color: #fff4dc;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.26), 0 0 28px rgba(255, 178, 52, 0.08);
}

.score-ring strong,
.score-ring span {
  display: block;
}

.score-ring strong {
  font-size: 34px;
  line-height: 1;
  font-weight: 950;
}

.score-ring span {
  margin-top: 4px;
  font-size: var(--fs-meta);
  font-weight: 950;
  color: rgba(255, 244, 220, 0.64);
}

.match-head {
  align-items: center;
  margin: 18px 0 12px;
}

.match-head small {
  color: rgba(244, 247, 242, 0.56);
  font-size: var(--fs-meta);
  font-weight: 850;
}

.match-list {
  display: grid;
  gap: 10px;
}

.match-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  border: 1px solid rgba(232, 241, 236, 0.12);
  border-radius: 12px;
  background: rgba(244, 247, 242, 0.055);
  padding: 16px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.match-item:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 178, 52, 0.7);
  box-shadow: var(--soft-shadow);
}

.match-item.featured {
  background: linear-gradient(135deg, rgba(255, 178, 52, 0.16), rgba(244, 247, 242, 0.06));
  border-color: rgba(255, 178, 52, 0.34);
}

.match-item strong,
.match-item small {
  display: block;
}

.match-item strong {
  font-size: var(--fs-body);
  font-weight: 950;
}

.match-item small {
  margin-top: 4px;
  color: rgba(244, 247, 242, 0.56);
  font-size: var(--fs-meta);
  font-weight: 800;
}

.match-item b {
  width: 52px;
  height: 46px;
  border-radius: 8px;
  border: 1px solid rgba(255, 178, 52, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 178, 52, 0.16), rgba(244, 247, 242, 0.055));
  color: #ffd28a;
  display: grid;
  place-items: center;
  font-size: 24px;
  line-height: 1;
}

.reason-chips {
  grid-column: 1 / -1;
}

.program-shell {
  display: block;
  padding-top: clamp(18px, 4vw, 44px);
}

.program-copy {
  margin-bottom: 18px;
}

.result-panel {
  margin-bottom: 16px;
}

.result-hero {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.dish-image-frame {
  width: 150px;
  height: 116px;
  border-radius: 10px;
  border: 1px solid rgba(232, 241, 236, 0.12);
  overflow: hidden;
  position: relative;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 178, 52, 0.18), transparent 36%),
    linear-gradient(135deg, rgba(244, 247, 242, 0.08), rgba(244, 247, 242, 0.025));
}

.dish-image-frame::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 178, 52, 0.22);
  border-radius: 8px;
  animation: imagePulse 1.7s ease-in-out infinite;
}

.dish-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dish-image-frame.has-image::before,
.dish-image-frame.has-image .dish-image-placeholder {
  display: none;
}

.dish-image-placeholder {
  position: relative;
  z-index: 1;
  color: rgba(255, 210, 138, 0.92);
  font-size: var(--fs-body);
  font-weight: 950;
  letter-spacing: 0;
}

@keyframes imagePulse {
  0%,
  100% {
    opacity: 0.42;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.result-hero h3 {
  margin-bottom: 8px;
}

.result-hero p:last-child {
  margin-bottom: 0;
  color: rgba(244, 247, 242, 0.72);
  font-size: var(--fs-body);
  line-height: var(--lh-ui);
  font-weight: 430;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.hero-actions .ghost-button {
  border-color: rgba(255, 178, 52, 0.28);
  background: rgba(255, 178, 52, 0.075);
  color: rgba(255, 214, 154, 0.92);
}

.hero-actions .ghost-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.hero-actions span {
  color: rgba(244, 247, 242, 0.45);
  font-size: var(--fs-meta);
  line-height: 1.3;
}

.recipe-technique-brief {
  margin-top: 18px;
  border-top: 1px solid rgba(232, 241, 236, 0.1);
  padding-top: 16px;
}

.technique-brief-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.technique-brief-head span {
  min-width: 48px;
  border: 1px solid rgba(255, 178, 52, 0.34);
  border-radius: 7px;
  background: rgba(255, 178, 52, 0.08);
  padding: 4px 10px;
  color: #ffd28a;
  font-size: var(--fs-body);
  font-weight: 950;
  text-align: center;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.metrics div {
  border-radius: 10px;
  background: rgba(244, 247, 242, 0.06);
  border: 1px solid rgba(232, 241, 236, 0.1);
  padding: 16px;
}

.metric-label,
.metric-value,
.metric-meta {
  display: block;
}

.metric-label {
  color: rgba(244, 247, 242, 0.48);
  font-size: var(--fs-meta);
  font-weight: 950;
  line-height: 1.2;
}

.metric-value {
  margin-top: 6px;
  color: #fff6df;
  font-size: clamp(24px, 2.2vw, 30px);
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0;
}

.metric-value small {
  margin-left: 2px;
  color: rgba(255, 244, 220, 0.62);
  font-size: 12px;
  font-weight: 850;
}

.metric-meta {
  margin-top: 8px;
  color: rgba(244, 247, 242, 0.42);
  font-size: var(--fs-meta);
  font-style: normal;
  line-height: 1.25;
}

.program-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.program-code-card,
.liquid-plan-panel,
.chart-block,
.mobile-entry-card,
.sop-card,
.export-docs-card,
.program-detail {
  grid-column: 1 / -1;
}

.program-detail {
  overflow: hidden;
  padding: 0;
}

.program-detail summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  list-style: none;
  cursor: pointer;
  padding: 18px 20px;
}

.program-detail summary::-webkit-details-marker {
  display: none;
}

.program-detail summary h3,
.program-detail summary small {
  display: block;
}

.program-detail summary h3 {
  color: #ffd28a;
  font-size: var(--fs-h2);
  line-height: 1.25;
  font-weight: 950;
}

.program-detail summary small {
  margin-top: 5px;
  color: rgba(244, 247, 242, 0.48);
  font-size: var(--fs-meta);
  line-height: 1.35;
  font-weight: 520;
}

.program-detail summary b {
  flex: 0 0 auto;
  border: 1px solid rgba(232, 241, 236, 0.16);
  border-radius: 7px;
  background: rgba(244, 247, 242, 0.055);
  padding: 5px 10px;
  color: rgba(244, 247, 242, 0.82);
  font-size: var(--fs-meta);
  font-weight: 950;
}

.program-detail summary::after {
  content: "展开";
  flex: 0 0 auto;
  color: rgba(255, 178, 52, 0.82);
  font-size: var(--fs-meta);
  font-weight: 950;
}

.program-detail[open] summary::after {
  content: "收起";
}

.program-detail-content {
  border-top: 1px solid rgba(232, 241, 236, 0.08);
  padding: 18px 20px 20px;
}

.block-title {
  align-items: center;
  margin-bottom: 16px;
}

.block-title h3 {
  color: #ffd28a;
  font-size: var(--fs-h2);
  line-height: 1.25;
  font-weight: 950;
}

.sop-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.sop-info-item {
  border: 1px solid rgba(232, 241, 236, 0.1);
  border-radius: 8px;
  background: rgba(244, 247, 242, 0.045);
  padding: 11px 12px;
}

.sop-info-item.wide {
  grid-column: span 2;
}

.sop-info-item strong,
.sop-info-item span {
  display: block;
}

.sop-info-item strong {
  color: rgba(244, 247, 242, 0.46);
  font-size: var(--fs-meta);
  line-height: 1.2;
  font-weight: 950;
}

.sop-info-item span {
  margin-top: 5px;
  color: rgba(244, 247, 242, 0.82);
  font-size: var(--fs-body);
  line-height: var(--lh-ui);
  font-weight: 560;
}

.sop-table-wrap {
  border: 1px solid rgba(232, 241, 236, 0.12);
  border-radius: 10px;
  background: rgba(5, 7, 7, 0.32);
}

.sop-table {
  min-width: 760px;
}

.sop-table th,
.sop-table td {
  border-right: 1px solid rgba(232, 241, 236, 0.08);
}

.sop-lower-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.15fr);
  gap: 14px;
  margin-top: 14px;
}

.sop-lower-grid > div {
  border: 1px solid rgba(232, 241, 236, 0.1);
  border-radius: 10px;
  background: rgba(244, 247, 242, 0.045);
  padding: 14px;
}

.sop-lower-grid h4 {
  margin: 0 0 10px;
  color: #ffd28a;
  font-size: var(--fs-h2);
  line-height: 1.25;
}

.sop-box-standard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.sop-box-standard article {
  min-height: 130px;
  border: 1px solid rgba(232, 241, 236, 0.14);
  border-radius: 8px;
  background: rgba(7, 9, 9, 0.36);
  padding: 10px;
}

.sop-box-standard strong,
.sop-box-standard span,
.sop-quality-notes p {
  display: block;
}

.sop-box-standard strong {
  color: rgba(244, 247, 242, 0.9);
  font-size: var(--fs-body);
  font-weight: 950;
}

.sop-box-standard span,
.sop-quality-notes p {
  margin: 6px 0 0;
  color: rgba(244, 247, 242, 0.68);
  font-size: var(--fs-body);
  line-height: var(--lh-ui);
}

.export-doc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.export-doc-grid article {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 164px;
  border: 1px solid rgba(232, 241, 236, 0.12);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 178, 52, 0.1), rgba(244, 247, 242, 0.03)),
    rgba(7, 9, 9, 0.36);
  padding: 16px;
}

.export-doc-grid strong {
  color: rgba(244, 247, 242, 0.92);
  font-size: var(--fs-h2);
  line-height: 1.25;
  font-weight: 950;
}

.export-doc-grid p {
  min-height: 54px;
  margin: 0;
  color: rgba(244, 247, 242, 0.62);
  font-size: var(--fs-body);
  line-height: var(--lh-ui);
}

.export-doc-grid .ghost-button {
  justify-self: start;
  border-color: rgba(255, 178, 52, 0.32);
  color: rgba(255, 214, 154, 0.94);
  background: rgba(255, 178, 52, 0.08);
}

.mini-list,
.review-list,
.normalize-list,
.capability-list {
  display: grid;
  gap: 12px;
}

.mini-item strong,
.mini-item span,
.mini-item small {
  display: block;
}

.mini-item strong {
  color: rgba(244, 247, 242, 0.94);
  font-size: var(--fs-body);
  line-height: 1.35;
  font-weight: 950;
}

.mini-item span,
.mini-item small {
  margin-top: 6px;
  color: rgba(244, 247, 242, 0.62);
  font-size: var(--fs-body);
  line-height: var(--lh-ui);
  font-weight: 430;
}

.mini-item small {
  color: rgba(244, 247, 242, 0.46);
  font-size: var(--fs-meta);
}

.small-note {
  color: rgba(244, 247, 242, 0.7);
  font-size: var(--fs-body);
  line-height: var(--lh-ui);
  font-weight: 430;
}

.technique-chips,
.state-stack {
  margin: 12px 0;
}

.liquid-box-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.liquid-box.large {
  background: rgba(32, 57, 42, 0.7);
}

.liquid-box.empty {
  opacity: 0.66;
}

.box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.box-head strong {
  font-size: var(--fs-body);
  font-weight: 950;
}

.box-head span {
  color: rgba(244, 247, 242, 0.56);
  font-size: var(--fs-meta);
  font-weight: 900;
}

.box-select {
  min-height: 38px;
  border-radius: 8px;
  font-size: 13px;
}

.liquid-box p,
.liquid-box small {
  display: block;
  margin: 8px 0 0;
  color: rgba(244, 247, 242, 0.6);
  font-size: var(--fs-meta);
  line-height: 1.45;
  font-weight: 520;
}

.phase-chart {
  min-height: 160px;
  display: flex;
  align-items: end;
  gap: 10px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(244, 247, 242, 0.035), transparent),
    repeating-linear-gradient(90deg, rgba(232, 241, 236, 0.06) 0 1px, transparent 1px 68px),
    #050707;
  border: 1px solid rgba(232, 241, 236, 0.12);
  padding: 18px;
}

.bar {
  flex: 1;
  min-height: 42px;
  border-radius: 8px 8px 4px 4px;
  background: var(--accent);
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 8px 4px;
}

.bar:nth-child(2n) {
  background: var(--green);
}

.bar:nth-child(3n) {
  background: var(--accent-deep);
}

.bar span {
  color: #0b0d0c;
  font-size: var(--fs-meta);
  font-weight: 950;
}

.table-wrap {
  overflow: auto;
  margin-top: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th,
td {
  border-bottom: 1px solid rgba(232, 241, 236, 0.1);
  padding: 12px 10px;
  text-align: left;
  font-size: var(--fs-body);
  line-height: var(--lh-ui);
}

th {
  color: rgba(244, 247, 242, 0.58);
  font-size: var(--fs-meta);
  font-weight: 950;
}

td {
  color: rgba(244, 247, 242, 0.84);
  font-weight: 430;
}

.command-list {
  max-height: 420px;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.command-item {
  padding: 13px 16px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: var(--fs-body);
  line-height: var(--lh-ui);
  color: rgba(244, 247, 242, 0.88);
}

.review-item.pass {
  background: rgba(42, 78, 45, 0.36);
  border-color: rgba(146, 214, 122, 0.24);
}

.review-item.warn {
  background: rgba(128, 82, 18, 0.32);
  border-color: rgba(255, 189, 107, 0.24);
}

.review-item.error {
  background: rgba(124, 41, 32, 0.34);
  border-color: rgba(255, 107, 85, 0.28);
}

.review-item strong,
.review-item span {
  display: block;
}

.review-item strong {
  color: rgba(244, 247, 242, 0.94);
  font-size: var(--fs-body);
  line-height: 1.35;
  font-weight: 950;
}

.review-item span {
  margin-top: 5px;
  color: rgba(244, 247, 242, 0.64);
  font-size: var(--fs-body);
  line-height: var(--lh-ui);
  font-weight: 430;
}

.capability-list div {
  color: rgba(244, 247, 242, 0.72);
  line-height: var(--lh-ui);
  font-size: var(--fs-body);
  font-weight: 430;
}

.tag-line,
.capability-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.tag-line strong,
.capability-item strong {
  flex: 0 0 auto;
  max-width: 108px;
  border: 1px solid rgba(255, 178, 52, 0.22);
  border-radius: 5px;
  background: rgba(255, 178, 52, 0.075);
  padding: 2px 7px;
  color: #ffd28a;
  font-size: var(--fs-meta);
  line-height: 1.35;
  font-weight: 900;
}

.tag-line span,
.capability-item span {
  min-width: 0;
  color: rgba(244, 247, 242, 0.72);
  font-size: var(--fs-body);
  line-height: var(--lh-ui);
  font-weight: 430;
}

.capability-item strong {
  min-width: 72px;
  text-align: center;
}

body.mode-mobile .app-shell {
  max-width: 430px;
}

body.mode-mobile .topbar {
  position: static;
}

body.mode-mobile .top-actions {
  justify-content: flex-start;
}

body.mode-mobile .stage-shell,
body.mode-mobile .program-grid,
body.mode-mobile .fit-grid,
body.mode-mobile .metrics,
body.mode-mobile .light-options,
body.mode-mobile .liquid-box-grid,
body.mode-mobile .export-doc-grid,
body.mode-mobile .sop-info-grid,
body.mode-mobile .sop-lower-grid,
body.mode-mobile .sop-box-standard {
  grid-template-columns: 1fr;
}

body.mode-mobile .machine-figure {
  width: min(92vw, 560px);
  aspect-ratio: 1.58 / 1;
  margin: 24px auto 0;
  justify-self: center;
}

body.mode-mobile .result-hero {
  grid-template-columns: 1fr;
}

body.mode-mobile .dish-image-frame {
  width: 100%;
  height: 190px;
}

@media (max-width: 900px) {
  .app-shell {
    padding: 12px;
  }

  .topbar {
    position: static;
    display: grid;
  }

  .top-actions {
    justify-content: flex-start;
  }

  body[data-step="intro"] .intro-stage,
  .stage-shell,
  .program-grid,
  .fit-grid,
  .metrics,
  .light-options,
  .liquid-box-grid,
  .export-doc-grid,
  .sop-info-grid,
  .sop-lower-grid,
  .sop-box-standard {
    grid-template-columns: 1fr;
  }

  body[data-step="intro"] .intro-stage {
    min-height: calc(100vh - 132px);
    padding: 22px;
    align-content: start;
  }

  h1 {
    font-size: clamp(52px, 17vw, 88px);
  }

  h2 {
    font-size: var(--fs-h1);
    line-height: 1.18;
  }

  .machine-figure {
    width: min(92vw, 560px);
    aspect-ratio: 1.333 / 1;
    margin: 24px auto 0;
    justify-self: center;
  }

  .command-stage::before,
  .fit-stage::before,
  .choose-stage::before,
  .recipe-stage::before,
  .program-stage::before {
    inset: auto 0 8vh auto;
    width: 82vw;
    height: 36vh;
    opacity: 0.08;
    mask-image: linear-gradient(90deg, transparent 0%, #000 24%, #000 74%, transparent 100%);
  }

  .intro-badge {
    position: static;
    width: fit-content;
    margin-top: 20px;
  }

  .stage-shell {
    min-height: auto;
    padding: 18px 2px 28px;
  }

  .command-panel,
  .judgement-board,
  .match-panel,
  .result-panel,
  .program-card {
    border-radius: 14px;
    padding: 18px;
  }

  .result-hero {
    grid-template-columns: 1fr;
  }

  .dish-image-frame {
    width: 100%;
    height: 190px;
  }

  .score-ring {
    width: 106px;
    min-height: 78px;
  }

  .match-summary {
    display: grid;
  }

  .thinking-steps {
    grid-template-columns: 1fr;
  }
}

body.result-fresh .match-item,
body.result-fresh .program-card,
body.result-fresh .result-hero,
body.result-fresh .command-item {
  animation: revealUp 520ms ease both;
}

body.result-fresh .match-item:nth-child(2),
body.result-fresh .program-card:nth-child(2),
body.result-fresh .command-item:nth-child(2) {
  animation-delay: 50ms;
}

body.result-fresh .match-item:nth-child(3),
body.result-fresh .program-card:nth-child(3),
body.result-fresh .command-item:nth-child(3) {
  animation-delay: 90ms;
}

body.result-fresh .match-item:nth-child(4),
body.result-fresh .program-card:nth-child(4),
body.result-fresh .command-item:nth-child(4) {
  animation-delay: 130ms;
}

@keyframes revealUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
