:root {
  --bg: #f4f1ea;
  --surface: #fffdf8;
  --surface-2: #eef6ec;
  --border: #d8e0d4;
  --text: #1f2a1c;
  --muted: #5f6f5a;
  --green: #2d6a3e;
  --green-light: #4f9d69;
  --accent: #c47b2b;
  --accent-soft: #f3e2cf;
  --sky-top: #8ecae6;
  --sky-bottom: #e8f4fa;
  --soil: #8b5e3c;
  --soil-dark: #5c3d28;
  --danger: #b33a3a;
  --shadow: 0 12px 40px rgba(31, 42, 28, 0.08);
  --radius: 16px;
  --font: "Noto Sans SC", system-ui, sans-serif;
  --mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, #d4ecd8 0%, transparent 55%),
    var(--bg);
  min-height: 100vh;
}

.app { max-width: 1440px; margin: 0 auto; padding: 20px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand-icon { font-size: 2rem; }
.brand h1 { font-size: 1.25rem; font-weight: 700; letter-spacing: 0.02em; }
.brand p { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.status-pill {
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--green);
  font-weight: 600;
}

/* —— 页面切换过渡 —— */
body.is-page-exit::after,
body.is-page-enter::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg);
  pointer-events: none;
}
body.is-page-exit::after {
  animation: pageVeilIn 0.38s ease forwards;
}
body.is-page-enter::after {
  opacity: 1;
  animation: pageVeilOut 0.62s ease 0.08s forwards;
}
@keyframes pageVeilIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes pageVeilOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
.page-transition-root--exit {
  animation: pageExit 0.52s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.page-transition-root--enter {
  animation: breatheIn 0.9s cubic-bezier(0.34, 1.08, 0.64, 1) forwards;
}
.page-exit--forward .page-transition-root--exit {
  transform-origin: center top;
}
.page-exit--back .page-transition-root--exit {
  animation-name: pageExitBack;
}
.page-enter--back .page-transition-root--enter {
  animation-name: pageEnterBack;
}
@keyframes pageExit {
  to {
    opacity: 0;
    transform: translateY(-20px) scale(0.97);
    filter: blur(2px);
  }
}
@keyframes pageExitBack {
  to {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
    filter: blur(2px);
  }
}
@keyframes pageEnterBack {
  0% {
    opacity: 0;
    transform: translateY(-18px) scale(0.97);
  }
  68% {
    opacity: 1;
    transform: translateY(2px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* —— 呼吸感入场（单次起伏） —— */
@keyframes breatheIn {
  0% {
    opacity: 0;
    transform: translateY(22px) scale(0.96);
  }
  68% {
    opacity: 1;
    transform: translateY(-3px) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.entrance {
  opacity: 0;
  transform: translateY(22px) scale(0.96);
}
.entrance--play {
  animation: breatheIn 1.25s cubic-bezier(0.34, 1.08, 0.64, 1) forwards;
  animation-delay: calc(var(--entrance-delay, 0) * 0.14s);
}
.entrance-stagger .feature-card {
  opacity: 0;
  transform: translateY(22px) scale(0.96);
}
.entrance-stagger.entrance-stagger--play .feature-card {
  animation: breatheIn 1.25s cubic-bezier(0.34, 1.08, 0.64, 1) forwards;
}
.entrance-stagger.entrance-stagger--play .feature-card:nth-child(1) {
  animation-delay: calc(var(--entrance-delay, 0) * 0.14s);
}
.entrance-stagger.entrance-stagger--play .feature-card:nth-child(2) {
  animation-delay: calc(var(--entrance-delay, 0) * 0.14s + 0.12s);
}
.entrance-stagger.entrance-stagger--play .feature-card:nth-child(3) {
  animation-delay: calc(var(--entrance-delay, 0) * 0.14s + 0.24s);
}
.entrance[data-entrance="0"] { --entrance-delay: 0; }
.entrance[data-entrance="1"] { --entrance-delay: 1; }
.entrance[data-entrance="2"] { --entrance-delay: 2; }
.entrance[data-entrance="3"] { --entrance-delay: 3; }
.entrance[data-entrance="4"] { --entrance-delay: 4; }
.entrance[data-entrance="5"] { --entrance-delay: 5; }
.entrance[data-entrance="6"] { --entrance-delay: 6; }
.entrance[data-entrance="7"] { --entrance-delay: 7; }

.metric-grid.entrance .metric {
  opacity: 0;
  transform: translateY(10px) scale(0.97);
}
.metric-grid.entrance--play .metric {
  animation: metricIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.metric-grid.entrance--play .metric:nth-child(1) { animation-delay: 0.28s; }
.metric-grid.entrance--play .metric:nth-child(2) { animation-delay: 0.34s; }
.metric-grid.entrance--play .metric:nth-child(3) { animation-delay: 0.40s; }
.metric-grid.entrance--play .metric:nth-child(4) { animation-delay: 0.46s; }
.metric-grid.entrance--play .metric:nth-child(5) { animation-delay: 0.52s; }
.metric-grid.entrance--play .metric:nth-child(6) { animation-delay: 0.58s; }
@keyframes metricIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .entrance--play, .entrance-stagger.entrance-stagger--play .feature-card,
  .metric-grid.entrance--play .metric,
  .setup-form.panel-enter.entrance--play,
  .setup-step-card.step-card--in {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .welcome-orb, .setup-dot.is-active, .boot-ring, .sandbox-boot--out,
  body.is-page-exit::after, body.is-page-enter::after,
  .page-transition-root--exit, .page-transition-root--enter {
    animation: none !important;
  }
}

/* —— 参数配置页 —— */
.page-setup {
  min-height: 100vh;
  overflow-x: hidden;
}
.setup-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 55% at 20% 10%, rgba(110, 207, 122, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 50% at 85% 20%, rgba(196, 123, 43, 0.12), transparent 50%),
    var(--bg);
}
.setup-app {
  position: relative;
  z-index: 1;
}
.setup-page {
  max-width: 560px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
}
.setup-wizard {
  padding-bottom: 48px;
}
.setup-wizard-head {
  text-align: center;
  padding: 12px 8px 4px;
}
.setup-wizard-nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 4vw, 28px);
  min-height: 40px;
}
.setup-wizard-nav-row .setup-step-label {
  margin: 0;
  min-width: 6.5em;
}
.setup-swipe-hint {
  margin: 8px 0 0;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  transition: color 0.25s, transform 0.25s;
}
.setup-swipe-hint--flash {
  color: var(--green);
  transform: scale(1.02);
}
.setup-swipe-hint--warn {
  color: #9a5b00;
}
.setup-step-label {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0;
  font-family: var(--mono);
}
.setup-step-label strong {
  color: var(--green);
  font-size: 1.1rem;
}
.setup-step-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  padding-bottom: 8px;
}
.setup-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d8e0d4;
  transition: transform 0.35s, background 0.35s, box-shadow 0.35s;
}
.setup-dot.is-active {
  background: var(--green);
  transform: scale(1.25);
  box-shadow: 0 0 0 4px rgba(45, 106, 62, 0.15);
  animation: dotBreathe 2.4s ease-in-out infinite;
}
.setup-dot.is-done {
  background: var(--green-light);
}
@keyframes dotBreathe {
  0%, 100% { box-shadow: 0 0 0 4px rgba(45, 106, 62, 0.12); }
  50% { box-shadow: 0 0 0 8px rgba(45, 106, 62, 0.22); }
}
.setup-wizard-form {
  display: grid;
  gap: 20px;
}
.setup-step-panel {
  display: none;
}
.setup-step-panel.is-active {
  display: block;
}
.setup-step-card {
  position: relative;
  padding: 32px 32px 28px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(250, 248, 244, 0.92) 100%);
  border: 1px solid rgba(45, 106, 62, 0.12);
  box-shadow: 0 12px 40px rgba(31, 42, 28, 0.08);
  opacity: 0;
  transform: translateY(22px) scale(0.96);
}
.setup-step-card.step-card--in {
  animation: breatheIn 1.25s cubic-bezier(0.34, 1.08, 0.64, 1) forwards;
}
.breathe-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 19px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(110, 207, 122, 0.45), rgba(61, 126, 166, 0.3), rgba(196, 123, 43, 0.35));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.75;
}
.breathe-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(110, 207, 122, 0.07), transparent 65%);
  pointer-events: none;
}
.setup-step-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green-light);
  font-weight: 600;
  margin-bottom: 10px;
  font-family: var(--mono);
}
.setup-step-card h2 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
}
.setup-step-desc {
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 24px;
  max-width: 46ch;
}
.setup-step-fields {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.setup-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}
.setup-field > span {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.setup-step-card .setup-field input,
.setup-step-card .setup-field select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 11px 14px;
  font-size: 0.95rem;
  border-radius: 10px;
  border: 1px solid #e0e8dc;
  background-color: #fff;
}
.setup-step-card .setup-field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237a8a72' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 20px center;
  cursor: pointer;
}
.setup-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}
.setup-field-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(45, 106, 62, 0.06);
  border: 1px solid rgba(45, 106, 62, 0.08);
  font-size: 0.8rem;
  line-height: 1.55;
}
@media (max-width: 520px) {
  .setup-step-card { padding: 24px 20px 22px; }
  .setup-field-row { grid-template-columns: 1fr; }
}
.nav-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1;
  font-family: var(--mono);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s, transform 0.2s, opacity 0.2s;
}
.nav-arrow--prev { color: var(--muted); }
.nav-arrow--next { color: var(--green); }
.nav-arrow--prev:hover:not(:disabled) {
  color: var(--muted);
  opacity: 0.75;
  transform: translateX(-3px);
}
.nav-arrow--next:hover:not(:disabled) {
  color: var(--green);
  opacity: 0.85;
  transform: translateX(3px);
}
.nav-arrow:disabled {
  cursor: default;
  opacity: 0.35;
}
.nav-arrow.is-pulse-prev { animation: navPulsePrev 0.35s ease; }
.nav-arrow.is-pulse-next { animation: navPulseNext 0.35s ease; }
@keyframes navPulsePrev {
  50% { transform: translateX(-4px); opacity: 1; }
}
@keyframes navPulseNext {
  50% { transform: translateX(4px); opacity: 1; }
}
.nav-arrow[hidden] { visibility: hidden; }

.setup-final-cta {
  display: flex;
  justify-content: center;
  padding: 16px 0 4px;
  margin-top: 4px;
}
.setup-enter-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: min(100%, 320px);
  padding: 14px 24px;
  border-radius: 14px;
  font-weight: 600;
}
.setup-enter-btn__label { font-size: 1rem; }
.setup-enter-btn__sub {
  font-size: 0.78rem;
  font-weight: 500;
  opacity: 0.88;
}
.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
}
.setup-hero {
  text-align: center;
  padding: 8px 12px 4px;
}
.setup-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-light);
  font-weight: 600;
  margin-bottom: 10px;
}
.setup-hero h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.setup-lead {
  font-size: 0.95rem;
  line-height: 1.65;
  max-width: 560px;
  margin: 0 auto;
}
.setup-lead strong { color: var(--green); font-weight: 600; }

.setup-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
  margin-bottom: 22px;
}

.setup-form.panel-enter.entrance--play {
  animation: panelEnter 0.88s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--entrance-delay, 2) * 0.09s);
}
@keyframes panelEnter {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.97);
    box-shadow: 0 4px 20px rgba(31, 42, 28, 0.04);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    box-shadow: var(--shadow);
  }
}

.setup-form-grid .param-card {
  margin: 0;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #e8e2d6;
  background: linear-gradient(180deg, #fff 0%, #faf8f4 100%);
  border-bottom: 1px solid #e8e2d6;
}

.ai-supervision-card {
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  overflow: visible;
}
.ai-card-frame {
  position: relative;
  padding: 18px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(45, 106, 62, 0.06), rgba(196, 123, 43, 0.08)),
    #fff;
  border: 1px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 8px 28px rgba(45, 106, 62, 0.1);
}
.ai-card-frame::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 17px;
  padding: 1px;
  background: linear-gradient(135deg, #6ecf7a, #c47b2b, #3d7ea6);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.ai-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.ai-card-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2d6a3e, #4f9d69);
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 6px 16px rgba(45, 106, 62, 0.28);
}
.ai-card-head h3 {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 2px;
}
.ai-card-sub {
  font-size: 0.78rem;
  color: var(--muted);
}
.toggle--fancy {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #e0e8dc;
  cursor: pointer;
  margin-bottom: 12px;
}
.toggle--fancy input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track {
  flex-shrink: 0;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #d0d8cc;
  position: relative;
  transition: background 0.25s;
}
.toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.25s;
}
.toggle--fancy input:checked + .toggle-track {
  background: linear-gradient(135deg, var(--green), var(--green-light));
}
.toggle--fancy input:checked + .toggle-track::after {
  transform: translateX(18px);
}
.toggle-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}
.ai-card-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ai-tag {
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--mono);
}

.setup-cta-row {
  display: flex;
  justify-content: center;
  padding-top: 4px;
}
.setup-cta {
  font-size: 1.02rem;
  padding: 14px 32px;
  min-width: min(100%, 320px);
}
.setup-side h3 {
  font-size: 0.95rem;
  color: var(--green);
  margin-bottom: 12px;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.82rem;
  border-radius: 10px;
}
.btn-xl {
  padding: 16px 36px;
  font-size: 1.08rem;
  border-radius: 14px;
}

/* —— 实验室准备页 —— */
.page-prepare {
  min-height: 100vh;
  overflow-x: hidden;
}
.prepare-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 55% at 20% 10%, rgba(110, 207, 122, 0.2), transparent 55%),
    radial-gradient(ellipse 60% 50% at 85% 20%, rgba(196, 123, 43, 0.12), transparent 50%),
    var(--bg);
}
.prepare-app {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
}
.prepare-main {
  min-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px 64px;
}
.prepare-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green-light);
  font-family: var(--mono);
  font-weight: 600;
  margin-bottom: 20px;
}
.prepare-title {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 16px;
}
.prepare-title span {
  display: block;
  margin-top: 6px;
  background: linear-gradient(135deg, var(--green), #3d8a55 50%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.prepare-desc {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--muted);
  max-width: 32em;
  margin-bottom: 36px;
}
.prepare-progress {
  width: min(320px, 80vw);
  height: 3px;
  border-radius: 999px;
  background: rgba(45, 106, 62, 0.12);
  overflow: hidden;
  margin-bottom: 16px;
}
.prepare-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-light), var(--green));
  transition: width 0.08s linear;
}
.prepare-status {
  font-size: 0.82rem;
  font-family: var(--mono);
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* —— 欢迎页 —— */
.page-welcome {
  min-height: 100vh;
  overflow-x: hidden;
}
.welcome-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 55% at 20% 10%, rgba(110, 207, 122, 0.22), transparent 55%),
    radial-gradient(ellipse 60% 50% at 85% 20%, rgba(196, 123, 43, 0.14), transparent 50%),
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(61, 126, 166, 0.1), transparent 55%),
    var(--bg);
}
.welcome-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: orbFloat 12s ease-in-out infinite;
}
.welcome-orb-a {
  width: 320px;
  height: 320px;
  top: -80px;
  left: -60px;
  background: rgba(79, 157, 105, 0.35);
}
.welcome-orb-b {
  width: 280px;
  height: 280px;
  bottom: 10%;
  right: -40px;
  background: rgba(196, 123, 43, 0.25);
  animation-delay: -4s;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(12px, -18px); }
}
.welcome-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(45, 106, 62, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 106, 62, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
}
.welcome-app {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  width: 100%;
}
.welcome-main {
  text-align: center;
  padding: 48px 20px 64px;
  min-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.welcome-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.04em;
  margin-bottom: 28px;
}
.welcome-brand-icon { font-size: 1.6rem; }
.welcome-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green-light);
  font-weight: 600;
  margin-bottom: 20px;
}
.welcome-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  color: var(--text);
}
.welcome-title span {
  background: linear-gradient(135deg, var(--green), #3d8a55 45%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.welcome-desc {
  max-width: 560px;
  margin: 0 auto 36px;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--muted);
}
.welcome-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 920px;
  margin: 0 auto 40px;
}
.feature-card {
  padding: 22px 20px;
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid rgba(216, 224, 212, 0.9);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(31, 42, 28, 0.05);
  transition: transform 0.25s, box-shadow 0.25s;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(31, 42, 28, 0.09);
}
.feature-icon {
  display: block;
  font-size: 1.4rem;
  color: var(--green);
  margin-bottom: 10px;
}
.feature-card h3 {
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: var(--text);
}
.feature-card p {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}
.welcome-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.welcome-foot {
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .welcome-features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 100%;
  }
}

@media (max-width: 700px) {
  .app { padding: 16px; }
  .topbar {
    flex-wrap: wrap;
    padding: 14px 16px;
    gap: 12px;
  }
  .topbar-actions { width: 100%; justify-content: flex-end; }
  .welcome-main { padding: 36px 16px 48px; }
  .welcome-features {
    grid-template-columns: 1fr;
    gap: 12px;
    max-width: 100%;
  }
  .feature-card { padding: 20px 18px; }
  .welcome-desc { font-size: 0.95rem; }
  .prepare-main { padding: 36px 18px 48px; }
  .setup-page { max-width: 100%; }
  .panel { padding: 16px; }
  .scene-panel { min-height: auto; }
  .setup-form-grid { grid-template-columns: 1fr; }
  .session-chips { flex-direction: column; }
}

/* —— 生长沙盒页 —— */
.sandbox-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sandbox-meta {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.session-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.82rem;
}
.chip em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.75rem;
}
.chip strong {
  font-weight: 600;
  color: var(--green);
}

.layout {
  display: grid;
  grid-template-columns: 300px 1fr 280px;
  gap: 18px;
  align-items: start;
}
.layout-sandbox {
  grid-template-columns: 1fr 300px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel h2 {
  font-size: 1rem;
  margin-bottom: 14px;
  color: var(--green);
}

.param-block {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ebe6dc;
}

.param-block h3 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.param-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.param-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.param-col .full {
  margin-top: 0;
  width: 100%;
}

.param-col input,
.param-row input,
.param-block input,
.param-block select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.param-block label,
.param-block .full {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--muted);
}

.param-block .full { margin-top: 8px; }

.param-advanced { border-bottom: none; padding-bottom: 0; }

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}

.hint-inline {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.45;
}

.info-dl { display: grid; gap: 6px; font-size: 0.84rem; }
.info-dl div { display: flex; justify-content: space-between; }
.info-dl dt { color: var(--muted); }
.info-dl dd { font-weight: 600; }
.info-block.compact { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }

input, select {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}

input:focus, select:focus {
  outline: 2px solid rgba(45, 106, 62, 0.25);
  border-color: var(--green-light);
}

.btn {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
a.btn { color: inherit; }
a.btn-primary { color: #fff; }
a.btn-accent { color: #fff; }

.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:not(:disabled):hover { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--green), #3d8a55);
  color: #fff;
  box-shadow: 0 8px 20px rgba(45, 106, 62, 0.25);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #d99545);
  color: #fff;
  font-size: 1.05rem;
  padding: 14px 28px;
  box-shadow: 0 10px 24px rgba(196, 123, 43, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn--busy {
  pointer-events: none;
  box-shadow: none;
  filter: saturate(0.85);
}

.btn--busy .btn-icon {
  display: inline-block;
  animation: btn-spin 0.9s linear infinite;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.info-block { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border); }
.info-block h3 { font-size: 0.9rem; margin-bottom: 10px; }
.info-block dl { display: grid; gap: 8px; font-size: 0.85rem; }
.info-block dl div { display: flex; justify-content: space-between; gap: 8px; }
.info-block dt { color: var(--muted); }
.info-block dd { font-weight: 600; text-align: right; }

.bullet-list { list-style: none; display: grid; gap: 8px; font-size: 0.82rem; line-height: 1.5; }
.bullet-list li::before { content: "•"; color: var(--green-light); margin-right: 8px; }

.muted { color: var(--muted); }
.small { font-size: 0.8rem; }

.scene-panel { display: flex; flex-direction: column; gap: 16px; min-height: 640px; }

.progress-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: 6px 10px;
  align-items: center;
}
.progress-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}
.progress-meta span:first-child { font-size: 1.15rem; font-weight: 700; }
.progress-meta .muted { font-size: 0.78rem; }
.progress-track {
  grid-column: 1 / -1;
  height: 10px;
  background: #e6ede3;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green-light), var(--green));
  border-radius: inherit;
  transition: width 0.5s ease;
}
.progress-percent { font-family: var(--mono); font-size: 0.85rem; color: var(--green); }

.milestone-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
}
.milestone-modal[hidden] { display: none; }
body.milestone-open { overflow: hidden; }
.milestone-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 42, 28, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: milestoneFadeIn 0.35s ease;
}
.milestone-modal__card {
  position: relative;
  z-index: 1;
  width: min(400px, 92vw);
  padding: 28px 26px 24px;
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.96);
  border: 1px solid rgba(232, 201, 146, 0.85);
  box-shadow: 0 24px 60px rgba(31, 42, 28, 0.18);
  text-align: center;
  animation: milestonePop 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.milestone-modal__icon {
  display: block;
  font-size: 2.4rem;
  margin-bottom: 8px;
}
.milestone-modal__kicker {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}
.milestone-modal__card h3 {
  font-size: 1.35rem;
  color: var(--green);
  margin-bottom: 10px;
}
.milestone-modal__card p {
  font-size: 0.92rem;
  line-height: 1.65;
  color: #5a4a32;
  margin-bottom: 20px;
}
.milestone-modal__card .btn { min-width: 120px; }

@keyframes milestoneFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes milestonePop {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.scene {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #e8f2e6;
  flex: 1;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  transform-origin: center bottom;
}
.scene.entrance--play {
  animation-name: sceneIn;
  animation-duration: 0.72s;
}
@keyframes sceneIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.sky {
  position: relative;
  flex: 0 0 clamp(96px, 26%, 148px);
  min-height: 96px;
  max-height: 148px;
  background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom));
  transition: background 0.6s ease, filter 0.5s ease;
  overflow: hidden;
}
.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  background: linear-gradient(180deg, rgba(72, 82, 96, 0.28), rgba(120, 130, 142, 0.12) 70%, transparent);
}
.scene.is-rainy .sky::after { opacity: 1; }

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 50px;
  filter: blur(0.2px);
  opacity: 0.9;
}
.cloud-a {
  width: 78px; height: 24px; top: 22px; left: 10%;
  box-shadow: 26px 0 0 -4px rgba(255,255,255,0.92), 52px 4px 0 -8px rgba(255,255,255,0.75);
  animation: cloudDriftA 32s ease-in-out infinite alternate;
}
.cloud-b {
  width: 62px; height: 20px; top: 44px; right: 14%;
  box-shadow: 20px 0 0 -3px rgba(255,255,255,0.88);
  animation: cloudDriftB 26s ease-in-out infinite alternate-reverse;
  z-index: 2;
}
.cloud-cover {
  top: 16px;
  right: 6%;
  width: 132px;
  height: 44px;
  opacity: 0;
  z-index: 4;
  transition: opacity 0.5s ease;
  background: rgba(186, 194, 204, 0.96);
  box-shadow:
    -36px 6px 0 -6px rgba(176, 184, 194, 0.95),
    32px 10px 0 -8px rgba(168, 176, 186, 0.9),
    0 18px 0 -4px rgba(160, 168, 178, 0.85);
}
.scene.is-rainy .cloud-cover { opacity: 1; }
.scene.is-rainy .cloud-a,
.scene.is-rainy .cloud-b {
  background: rgba(190, 198, 208, 0.94);
  opacity: 1;
  filter: none;
}
.scene.is-rainy .cloud-a {
  width: 96px;
  height: 30px;
  top: 18px;
  box-shadow: 30px 0 0 -4px rgba(180,188,198,0.95), 58px 6px 0 -8px rgba(170,178,188,0.85);
}
.scene.is-rainy .cloud-b {
  width: 88px;
  height: 28px;
  top: 38px;
  right: 10%;
  box-shadow: 28px 0 0 -4px rgba(178,186,196,0.92);
}
@keyframes cloudDriftA { from { transform: translateX(0); } to { transform: translateX(28px); } }
@keyframes cloudDriftB { from { transform: translateX(0); } to { transform: translateX(-22px); } }

.scene.is-rainy .sky { filter: saturate(0.45) brightness(0.9); }
.rain-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: repeating-linear-gradient(
    105deg,
    transparent 0 8px,
    rgba(120, 170, 220, 0.35) 8px 9px
  );
  animation: rain 0.7s linear infinite;
}
.scene.is-rainy .rain-layer { opacity: 0.62; z-index: 5; }
@keyframes rain { to { background-position: 0 24px; } }

.sun {
  position: absolute;
  top: 28px;
  right: 36px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff7c2, #f4b942);
  box-shadow: 0 0 40px rgba(244, 185, 66, 0.5);
  transition: transform 0.5s ease, opacity 0.5s ease, box-shadow 0.5s ease;
  z-index: 1;
}
.scene.is-rainy .sun {
  opacity: 0;
  box-shadow: none;
  pointer-events: none;
}

.weather-chip {
  position: absolute;
  left: 16px;
  top: 16px;
  max-width: 70%;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  font-size: 0.8rem;
  line-height: 1.4;
  backdrop-filter: blur(4px);
}

.field {
  position: relative;
  flex: 1;
  min-height: 260px;
  overflow: hidden;
  background: linear-gradient(180deg, #8ecf88 0%, #5da856 100%);
}

.field-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

.field-furrows {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      92deg,
      transparent 0 34px,
      rgba(38, 88, 36, 0.14) 34px 36px,
      transparent 36px 72px
    ),
    repeating-linear-gradient(
      88deg,
      rgba(255, 255, 255, 0.06) 0 18px,
      transparent 18px 36px
    );
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.85) 40%, #000 100%);
}

.scene.is-dry .field-bg,
.scene.is-dry .field-furrows { filter: saturate(0.65) brightness(1.05); }

.plant-svg {
  position: absolute;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  width: min(300px, 78%);
  height: auto;
  z-index: 3;
  filter: drop-shadow(0 2px 6px rgba(30, 60, 28, 0.12));
}

.seed { opacity: 0; transition: opacity 0.35s; }
.stem {
  fill: #3d7a45;
  transform-origin: bottom center;
  transform: scaleY(0);
  transition: transform 0.6s ease, fill 0.4s;
}
.leaf {
  fill: #5cb86a;
  stroke: #2f6d3a;
  stroke-width: 0.5;
  opacity: 0;
  transition: opacity 0.4s, transform 0.5s;
}
.highlight-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 6 4;
  opacity: 0;
  animation: spin 8s linear infinite;
}
.highlight-ring.show { opacity: 0.85; }

@keyframes spin { to { transform: rotate(360deg); } }

.soil-layer {
  position: absolute;
  inset: auto 0 0;
  height: 84px;
  z-index: 4;
  background: linear-gradient(180deg, #8b6344 0%, var(--soil) 18%, var(--soil-dark) 100%);
  box-shadow: inset 0 6px 14px rgba(0, 0, 0, 0.12);
}

.soil-grass-fringe {
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 14px;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      95deg,
      transparent 0 5px,
      rgba(90, 168, 82, 0.85) 5px 6px,
      transparent 6px 11px
    ),
    linear-gradient(180deg, rgba(111, 191, 104, 0.95), rgba(90, 168, 82, 0.35) 60%, transparent);
}

.moisture-fill {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 0%;
  background: linear-gradient(180deg, rgba(100, 180, 255, 0.35), rgba(60, 130, 220, 0.55));
  transition: height 0.5s ease;
}

.stage-badge {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(22, 48, 20, 0.55);
  color: #f4fff2;
  font-size: 0.78rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 2;
}

.field.is-seed .plant-svg { width: min(260px, 70%); }

.metric-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
  min-width: 0;
}

.metric {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.metric span { font-size: 0.68rem; color: var(--muted); margin: 0; }
.metric strong { font-family: var(--mono); font-size: 0.78rem; color: var(--green); font-weight: 600; }

.action-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.hint { font-size: 0.85rem; color: var(--muted); }

.narration-card {
  padding: 16px;
  border-radius: 14px;
  background: #faf8f3;
  border: 1px solid #e8e0d2;
}
.narration-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.narration-card h3 { font-size: 0.95rem; color: var(--green); }
.llm-badge {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}
.llm-badge--on {
  background: #e8f4ec;
  color: var(--green);
  border: 1px solid #b9d8bf;
}
.llm-badge--off {
  background: #fff4e6;
  color: #9a5b00;
  border: 1px solid #e8c99a;
}
.soil-texture {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 6px 3px at 12% 30%, rgba(0,0,0,0.08), transparent),
    radial-gradient(ellipse 5px 2px at 38% 55%, rgba(0,0,0,0.06), transparent),
    radial-gradient(ellipse 7px 3px at 72% 40%, rgba(0,0,0,0.07), transparent),
    repeating-linear-gradient(90deg, transparent, transparent 10px, rgba(0,0,0,0.05) 10px, rgba(0,0,0,0.05) 11px);
  pointer-events: none;
}
.narration-card p { font-size: 0.9rem; line-height: 1.65; color: #3a4536; }

.charts-panel {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  background: #faf8f3;
  border: 1px solid #e8e0d2;
}
.charts-panel h3 {
  font-size: 0.92rem;
  color: var(--green);
  margin-bottom: 4px;
}
.charts-hint { font-size: 0.75rem; margin-bottom: 10px; }
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.chart-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 4px 2px;
  margin: 0;
}
.chart-box svg {
  width: 100%;
  height: auto;
  display: block;
}
.chart-title { font-size: 9px; fill: var(--text); font-family: var(--font); font-weight: 600; }
.chart-unit-inline { font-size: 8px; fill: var(--muted); font-family: var(--mono); }
.chart-val-bg { fill: #fff; stroke: var(--border); stroke-width: 0.5; }
.chart-axis { stroke: #d8e0d4; stroke-width: 1; }
.chart-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.95; }
.chart-dot { stroke: #fff; stroke-width: 1; }
.chart-val { font-size: 8px; fill: var(--green); font-family: var(--mono); font-weight: 500; }
.chart-tick { font-size: 7px; fill: var(--muted); font-family: var(--mono); }

@media (max-width: 900px) {
  .charts-grid { grid-template-columns: 1fr; }
}

.teaching-panel {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.teaching-panel h2 { font-size: 0.95rem; color: var(--green); margin-bottom: 6px; }
.teaching-hint { font-size: 0.78rem; margin-bottom: 8px; }
.teaching-block { margin-bottom: 6px; }
.teaching-block summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  padding: 4px 0;
}
.teaching-list {
  margin: 6px 0 0 1.1rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
}
.teaching-list li + li { margin-top: 4px; }
.teaching-legend li { list-style: none; margin-left: -1.1rem; }

.setup-field--check {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.setup-field--check input[type="checkbox"] { width: auto; align-self: flex-start; }
.timeline {
  list-style: none;
  display: grid;
  gap: 10px;
  margin-top: 12px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.timeline-item {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  animation: slideIn 0.35s ease;
}
.timeline-item.active {
  border-color: var(--green-light);
  background: var(--surface-2);
}
.timeline-item.milestone { border-color: #e0b56d; background: #fffaf2; }

.timeline-item header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.8rem;
}
.timeline-item header strong { color: var(--green); }
.timeline-item h4 { font-size: 0.9rem; margin-bottom: 4px; }
.timeline-item p { font-size: 0.8rem; color: var(--muted); line-height: 1.45; }

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

.result-card {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eaf5ec, #f7fbf8);
  border: 1px solid #b9d8bf;
}
.result-card h3 { font-size: 0.95rem; color: var(--green); margin-bottom: 8px; }
.yield-primary {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--green);
  font-family: var(--mono);
  margin: 0 0 0.35rem;
}
.yield-secondary {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  font-family: var(--mono);
  margin: 0 0 0.5rem;
}
.yield-formula { margin: 0 0 0.75rem; line-height: 1.45; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1f2a1c;
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 0.9rem;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 100;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

.loading {
  position: fixed;
  inset: 0;
  background: rgba(244, 241, 234, 0.72);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 200;
  backdrop-filter: blur(3px);
}

.loading.is-active {
  display: flex;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: rotate 0.8s linear infinite;
}
@keyframes rotate { to { transform: rotate(360deg); } }

/* —— 沙盒启动载入 —— */
.sandbox-boot {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.sandbox-boot[hidden] { display: none !important; }
.sandbox-boot-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.sandbox-boot-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 32px 24px;
  max-width: 420px;
  width: 100%;
}
.boot-ring {
  width: 88px;
  height: 88px;
  margin: 0 auto 20px;
  border-radius: 50%;
  border: 2px solid rgba(45, 106, 62, 0.2);
  display: grid;
  place-items: center;
  animation: bootRingPulse 2s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(110, 207, 122, 0.25);
}
.boot-ring-core {
  font-size: 2rem;
  animation: bootCoreFloat 2.4s ease-in-out infinite;
}
@keyframes bootRingPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(110, 207, 122, 0.2);
    border-color: rgba(45, 106, 62, 0.25);
  }
  50% {
    box-shadow: 0 0 0 14px rgba(110, 207, 122, 0.06);
    border-color: rgba(45, 106, 62, 0.55);
  }
}
@keyframes bootCoreFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.boot-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green-light);
  font-family: var(--mono);
  margin-bottom: 8px;
}
.boot-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.boot-status {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 8px;
  min-height: 1.4em;
}
.boot-overall {
  font-family: var(--mono);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--green);
  margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
}
.boot-progress {
  height: 4px;
  border-radius: 999px;
  background: rgba(45, 106, 62, 0.12);
  overflow: hidden;
  margin-bottom: 16px;
}
.boot-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--green-light));
}
.boot-log {
  list-style: none;
  text-align: left;
  font-size: 0.78rem;
  font-family: var(--mono);
  color: var(--muted);
  max-height: 148px;
  overflow-y: auto;
  display: grid;
  gap: 6px;
  width: min(360px, 92vw);
  margin: 0 auto;
}
.boot-log-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  opacity: 0.72;
  animation: bootLogIn 0.35s ease-out;
}
.boot-log-item.is-active {
  opacity: 1;
  color: var(--text);
}
.boot-log-item.is-active .boot-log-pct {
  color: var(--green-light);
}
.boot-log-item.is-done {
  opacity: 0.88;
}
.boot-log-item.is-done .boot-log-pct {
  color: var(--green);
}
.boot-log-pct {
  font-variant-numeric: tabular-nums;
  min-width: 3.4em;
  text-align: right;
  flex-shrink: 0;
}
@keyframes bootLogIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 0.85; transform: translateX(0); }
}
.sandbox-boot--out {
  animation: bootFadeOut 0.42s ease-in forwards;
}
@keyframes bootFadeOut {
  to { opacity: 0; visibility: hidden; }
}
.sandbox-app--hidden {
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 1100px) {
  .layout, .layout-sandbox { grid-template-columns: 1fr; }
  .timeline-panel { order: 3; }
  .timeline { max-height: 280px; }
}

@media (max-width: 900px) {
  .progress-header {
    grid-template-columns: 1fr auto;
  }
  .metric-grid {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}
