:root {
  color-scheme: light;
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --ink: #13202b;
  --muted: #61707d;
  --line: #d9e2ea;
  --primary: #0f766e;
  --primary-dark: #0b5f5a;
  --accent: #b45309;
  --ok: #15803d;
  --shadow: 0 18px 42px rgba(22, 32, 42, 0.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
i, svg { width: 18px; height: 18px; flex: 0 0 auto; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(18px, 4vw, 54px);
  min-height: 68px;
  background: rgba(238, 242, 246, 0.88);
  border-bottom: 1px solid rgba(217, 226, 234, 0.9);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: 12px; margin-top: 2px; }
.nav { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 14px; }

.nav-cta, .primary-action, .secondary-action, .primary-button, .ghost-button, .price-card {
  border-radius: 8px;
}
.nav-cta, .primary-action, .primary-button, .price-card button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 0;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.nav-cta, .primary-action, .primary-button { padding: 0 16px; }
.nav-cta:hover, .primary-action:hover, .primary-button:hover, .price-card button:hover { background: var(--primary-dark); }
.secondary-action, .ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.product-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 24px;
  align-items: center;
  padding: 34px 0 18px;
}
.hero-slim .hero-copy { max-width: 720px; }
.hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.04;
  letter-spacing: 0;
}
.hero-sub {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.preview-card,
.report-preview {
  min-height: 300px;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: 8px;
}
.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.preview-head strong {
  font-size: 18px;
  font-weight: 800;
}
.preview-head span {
  color: var(--muted);
  font-size: 13px;
}
.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.preview-grid div {
  min-height: 66px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}
.preview-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.preview-grid strong {
  font-size: 14px;
}
.preview-lines {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}
.line {
  height: 10px;
  border-radius: 999px;
  background: #e8eef4;
}
.line-a { width: 100%; }
.line-b { width: 74%; }
.line-c { width: 86%; }

.workspace, .pricing { padding: 28px 0 56px; }
.section-heading { margin-bottom: 16px; }
.section-heading h2 { margin: 0; font-size: 26px; line-height: 1.12; letter-spacing: 0; }

.workspace-grid {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
}
.stepper {
  position: sticky;
  top: 84px;
  align-self: start;
  display: grid;
  gap: 8px;
}
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  color: var(--muted);
  text-align: left;
}
.step.is-active {
  border-color: rgba(15, 118, 110, 0.35);
  background: #ebfbf8;
  color: var(--primary);
  font-weight: 800;
}

.work-surface {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.activation-bar, .review-grid, .panel-grid, .pricing-grid, .ops-grid { display: grid; gap: 14px; }
.activation-bar { grid-template-columns: 1fr 1fr 1fr; margin-bottom: 14px; }
.minimal-bar label { min-width: 0; }
label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
input, select { min-height: 42px; padding: 0 12px; }
textarea { min-height: 110px; padding: 12px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(15, 118, 110, 0.55);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.panel-grid { grid-template-columns: 1fr 1fr; }
.input-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfdff;
}
.input-panel h3 { margin: 0 0 12px; font-size: 16px; }

.dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 160px;
  padding: 18px;
  border: 1px dashed #aab8c4;
  border-radius: 8px;
  background: #fff;
  text-align: center;
  cursor: pointer;
  color: var(--muted);
}
.dropzone.compact { min-height: 78px; margin-bottom: 10px; }
.dropzone input { display: none; }
.dropzone strong { color: var(--ink); }

.button-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.review-panel, .report-panel, .chat-panel { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.hidden { display: none; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-title h3 { margin: 0; font-size: 18px; }
.quality-badge, .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff7ed;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}
.review-grid { grid-template-columns: repeat(3, 1fr); }
.checks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 14px 0; }
.check-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  border-radius: 8px;
  background: var(--surface-soft);
}
.check-item.ok { color: var(--ok); }
.check-item.warn { color: var(--accent); }
.mapping-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.mapping-table > div {
  display: grid;
  grid-template-columns: 1fr 1fr 84px;
  align-items: center;
  min-height: 44px;
  border-top: 1px solid var(--line);
}
.mapping-table > div:first-child { border-top: 0; }
.mapping-table span { padding: 0 12px; }
.table-head { background: var(--surface-soft); color: var(--muted); font-size: 13px; font-weight: 800; }
.mapping-table button {
  min-height: 30px;
  width: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.report-editor {
  min-height: 440px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  line-height: 1.7;
  outline: none;
}
.report-editor table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.report-editor th, .report-editor td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.report-editor th { background: var(--surface-soft); }
.assistant-adjustment { padding: 12px 14px; border-left: 4px solid var(--primary); background: #ecfdf5; }

.chat-log {
  display: grid;
  gap: 10px;
  max-height: 230px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.chat-message {
  max-width: 82%;
  padding: 11px 13px;
  border-radius: 8px;
  line-height: 1.55;
}
.chat-message strong { display: block; margin-bottom: 4px; font-size: 13px; }
.chat-message p { margin: 0; }
.chat-message.system { justify-self: start; background: var(--surface-soft); }
.chat-message.user { justify-self: end; background: #e9fbf7; color: var(--primary-dark); }
.chat-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 102px;
  gap: 10px;
  margin-top: 12px;
  align-items: stretch;
}
.chat-input-row textarea { min-height: 76px; }

.pricing-grid { grid-template-columns: repeat(4, 1fr); }
.price-card {
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.price-card.featured { border-color: rgba(15, 118, 110, 0.35); }
.price-card h3 { margin: 0; font-size: 16px; }
.price { margin: 12px 0 8px; font-size: 30px; font-weight: 900; }
.price-card p:not(.price) { margin: 0; color: var(--muted); line-height: 1.6; }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0 32px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .hero, .workspace-grid, .activation-bar, .panel-grid, .pricing-grid, .review-grid, .checks {
    grid-template-columns: 1fr;
  }
  .stepper {
    position: static;
    grid-template-columns: repeat(4, 1fr);
  }
  .step { justify-content: center; }
}

@media (max-width: 680px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .nav { width: 100%; justify-content: space-between; }
  .nav-cta { width: 100%; }
  .product-shell { width: min(100% - 20px, 1200px); }
  .hero { padding-top: 22px; }
  .hero h1 { font-size: 32px; }
  .panel-title, .chat-input-row, .footer { flex-direction: column; align-items: flex-start; }
  .chat-input-row { grid-template-columns: 1fr; }
  .mapping-table > div { grid-template-columns: 1fr; gap: 6px; padding: 10px 0; }
  .mapping-table button { margin-left: 12px; }
  .preview-grid { grid-template-columns: 1fr; }
}
