﻿:root {
  color-scheme: light;
  --bg: #f7f5ef;
  --surface: #ffffff;
  --surface-soft: #f9faf8;
  --text: #171717;
  --muted: #6b7280;
  --subtle: #9ca3af;
  --line: #e5e2d8;
  --line-strong: #d6d0c2;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --brand-soft: #e8f0ff;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow: 0 24px 70px rgba(31, 41, 55, 0.10);
  --shadow-soft: 0 14px 35px rgba(31, 41, 55, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }

body.wizard-page [hidden] { display: none !important; }

html,
body {
  margin: 0;
  min-height: 100%;
}

body.wizard-page {
  min-height: 100vh;
  color: var(--text);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 4%, rgba(37, 99, 235, 0.14), transparent 30rem),
    radial-gradient(circle at 90% 8%, rgba(245, 158, 11, 0.12), transparent 26rem),
    linear-gradient(135deg, #fbfaf5 0%, #f6f3ec 52%, #eef4ff 100%);
  background-attachment: fixed;
}

body.wizard-page::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background-image:
    linear-gradient(rgba(23, 23, 23, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 23, 23, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 72%);
}

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

button {
  border: 0;
}

.wizard-shell {
  width: min(1220px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 48px;
}

.wizard-account-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.wizard-account-bar > strong {
  font-size: 22px;
}

.wizard-account-bar [data-auth-host] {
  min-width: 0;
  max-width: 100%;
}

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

.wizard-step {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.wizard-step b {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: var(--muted);
  background: #eceff3;
}

.wizard-step small,
.wizard-step strong {
  display: block;
  line-height: 1.25;
}

.wizard-step small {
  color: var(--subtle);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.wizard-step strong { margin-top: 2px; font-size: 14px; }

.wizard-step.is-active {
  border-color: rgba(37, 99, 235, 0.38);
  background: rgba(255, 255, 255, 0.94);
}

.wizard-step.is-active b {
  color: #fff;
  background: var(--brand);
}

.wizard-step.is-active small { color: var(--brand); }

.wizard-banner {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  color: #92400e;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.6;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.wizard-banner.is-error {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

.wizard-banner.is-success {
  color: #065f46;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.wizard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}

.wizard-main,
.wizard-result,
.wizard-result-grid,
.wizard-prompt-plan {
  display: grid;
  gap: 18px;
}

.wizard-card,
.wizard-cost-card {
  border: 1px solid rgba(229, 226, 216, 0.9);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.wizard-card { padding: clamp(16px, 2.4vw, 24px); }

.wizard-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.wizard-card-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  color: var(--brand);
  font-weight: 950;
  background: var(--brand-soft);
}

.wizard-card h2,
.wizard-card-head h2,
.wizard-cost-card h3,
.wizard-result-head h1 {
  margin: 0;
}

.wizard-card-head h2 { font-size: 18px; }
.wizard-card-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

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

.wizard-field,
.wizard-label {
  display: grid;
  gap: 7px;
  color: #374151;
  font-size: 12px;
  font-weight: 900;
}

.wizard-field input,
.wizard-field select,
.wizard-field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
}

.wizard-field input,
.wizard-field select {
  min-height: 44px;
  padding: 0 12px;
  font-weight: 850;
}

.wizard-field textarea {
  min-height: 168px;
  padding: 12px;
  resize: vertical;
  line-height: 1.65;
}

.wizard-field input:focus,
.wizard-field select:focus,
.wizard-field textarea:focus {
  border-color: rgba(37, 99, 235, 0.72);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

.wizard-dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 168px;
  margin-top: 8px;
  border: 2px dashed #d1d5db;
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.7);
  cursor: pointer;
  transition: 0.18s ease;
}

.wizard-dropzone:hover,
.wizard-dropzone.is-dragging {
  border-color: rgba(37, 99, 235, 0.55);
  background: rgba(232, 240, 255, 0.78);
}

.wizard-dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.wizard-drop-copy {
  display: grid;
  place-items: center;
  gap: 7px;
  text-align: center;
  pointer-events: none;
}

.wizard-drop-copy::before {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: #fff;
  content: "+";
  font-size: 28px;
  font-weight: 500;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
}

.wizard-drop-copy b { font-size: 15px; }
.wizard-drop-copy span { color: var(--muted); font-size: 12px; }

.wizard-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.wizard-preview-item {
  position: relative;
  overflow: hidden;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
}

.wizard-preview-item img {
  width: 100%;
  height: 118px;
  object-fit: cover;
  display: block;
}

.wizard-preview-item button {
  position: absolute;
  top: 7px;
  right: 7px;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 23, 42, 0.78);
  cursor: pointer;
}

.wizard-preview-item span {
  position: absolute;
  left: 7px;
  bottom: 7px;
  max-width: calc(100% - 14px);
  overflow: hidden;
  padding: 4px 7px;
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 23, 42, 0.64);
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wizard-description-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 174px;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}

.wizard-description-field { position: relative; }
.wizard-description-field small {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 800;
}

.wizard-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 950;
  text-decoration: none;
  transition: 0.16s ease;
}

.wizard-button span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  opacity: 0.74;
}

.wizard-button.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #0f172a);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.24);
}

.wizard-button.secondary {
  color: var(--text);
  background: #eef2f7;
}

.wizard-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow: none;
}

.wizard-cost-card {
  position: sticky;
  top: 76px;
  overflow: hidden;
}

.wizard-cost-card header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.wizard-cost-card h3 { font-size: 15px; }

.wizard-cost-card > div {
  margin: 18px;
}

.wizard-cost-card .wizard-button {
  width: calc(100% - 36px);
  margin: 0 18px;
}

.wizard-cost-card .wizard-button + .wizard-button {
  margin-top: 10px;
}

.wizard-cost-card p {
  margin: 12px 18px 18px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
  line-height: 1.6;
}

.wizard-estimate-empty,
.wizard-estimate-box {
  min-height: 88px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.9);
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.wizard-estimate-box {
  place-items: stretch;
  padding: 14px;
  text-align: left;
}

.wizard-estimate-box strong {
  display: block;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.wizard-estimate-box span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.wizard-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(229, 226, 216, 0.9);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
}

.wizard-kicker {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.12em;
}

.wizard-result-head h1 { font-size: clamp(24px, 4vw, 38px); }
.wizard-result-head p:not(.wizard-kicker) { max-width: 760px; margin: 8px 0 0; color: var(--muted); line-height: 1.7; }

.wizard-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.wizard-result-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wizard-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wizard-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: #1e40af;
  background: var(--brand-soft);
  font-size: 12px;
  font-weight: 900;
}

.wizard-list,
.wizard-warning-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.wizard-list p,
.wizard-warning-list p {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  color: #374151;
  background: #f8fafc;
  font-size: 13px;
  line-height: 1.55;
}

.wizard-warning-list p {
  color: #92400e;
  background: #fffbeb;
}

.wizard-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.wizard-card-title-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.wizard-prompt-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.wizard-prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wizard-prompt-head h3 {
  margin: 0;
  font-size: 16px;
}

.wizard-prompt-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.wizard-prompt-meta span,
.wizard-mini-estimate span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--muted);
  background: #f3f4f6;
  font-size: 12px;
  font-weight: 850;
}

.wizard-prompt-card pre {
  overflow: auto;
  max-height: 260px;
  margin: 0;
  padding: 13px;
  border-radius: 14px;
  color: #111827;
  background: #f8fafc;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 13px;
}

.wizard-copy-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: #fff;
  background: #111827;
  cursor: pointer;
  font-size: 12px;
  font-weight: 950;
}

.wizard-mini-estimate {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.wizard-generate-panel {
  scroll-margin-top: 18px;
}

.wizard-generate-intro,
.wizard-generate-summary {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.6;
}

.wizard-generate-summary {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  color: #1e40af;
  background: var(--brand-soft);
}

.wizard-progress-track {
  overflow: hidden;
  height: 10px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: #e5e7eb;
}

.wizard-progress-track i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #06b6d4);
  transition: width 0.25s ease;
}

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

.wizard-generate-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.wizard-generate-item[data-state="running"] {
  border-color: rgba(37, 99, 235, 0.35);
  background: #f8fbff;
}

.wizard-generate-item[data-state="success"] {
  border-color: rgba(5, 150, 105, 0.32);
  background: #f7fffb;
}

.wizard-generate-item[data-state="failed"] {
  border-color: rgba(220, 38, 38, 0.28);
  background: #fff8f8;
}

.wizard-generate-item-main {
  min-width: 0;
}

.wizard-generate-item-main b,
.wizard-generate-item-main span {
  display: block;
}

.wizard-generate-item-main b {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wizard-generate-item-main span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.wizard-generate-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  max-width: 270px;
}

.wizard-preview-thumb-button,
.wizard-progress-result-open {
  display: block;
  padding: 0;
  border: 0;
  background: #f3f4f6;
  cursor: zoom-in;
}

.wizard-generate-preview img {
  display: block;
  width: 76px;
  height: 76px;
  border: 1px solid var(--line);
  border-radius: 12px;
  object-fit: cover;
  background: #f3f4f6;
}

.wizard-generate-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.wizard-progress-page .wizard-shell {
  max-width: 1180px;
}

.wizard-progress-hero {
  margin-bottom: 18px;
}

.wizard-progress-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.wizard-progress-result-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.wizard-progress-result-open {
  width: 100%;
}

.wizard-progress-result-card a,
.wizard-progress-result-open {
  display: block;
  background: #f3f4f6;
}

.wizard-progress-result-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.wizard-progress-result-card div {
  display: grid;
  gap: 4px;
  padding: 10px;
}

.wizard-progress-result-card b {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wizard-progress-result-card span {
  color: var(--muted);
  font-size: 12px;
}

.wizard-progress-preview-modal[hidden] {
  display: none;
}

.wizard-progress-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.82);
}

.wizard-progress-preview-dialog {
  position: relative;
  display: grid;
  place-items: center;
  width: min(96vw, 1280px);
  height: min(92vh, 920px);
}

.wizard-progress-preview-dialog img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 18px;
  object-fit: contain;
  background: #0f172a;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

.wizard-progress-preview-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 23, 42, 0.82);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

@media (max-width: 900px) {
  .wizard-layout,
  .wizard-result-grid {
    grid-template-columns: 1fr;
  }

  .wizard-cost-card { position: static; }
  .wizard-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wizard-result-head { display: grid; }
  .wizard-result-actions { justify-content: flex-start; }
}

@media (max-width: 620px) {
  .wizard-steps { gap: 8px; }
  .wizard-step { min-height: 56px; padding: 10px; }
  .wizard-field-grid,
  .wizard-description-row { grid-template-columns: 1fr; }
  .wizard-description-row .wizard-button { width: 100%; }
  .wizard-card-title-row,
  .wizard-prompt-head { align-items: flex-start; flex-direction: column; }

  .wizard-generate-item {
    grid-template-columns: 1fr;
  }

  .wizard-generate-preview {
    justify-content: flex-start;
    max-width: none;
  }
}
