:root {
  --bg: #f5efe7;
  --surface: #fffdf9;
  --surface-2: #f9f4ed;
  --ink: #1f1710;
  --muted: #6a5a4f;
  --line: #dfd3c4;
  --gold: #a98247;
  --gold-deep: #896a3b;
  --green: #40624c;
  --warn: #9a6230;
  --shadow: 0 18px 44px rgba(36, 23, 12, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(169, 130, 71, 0.14), transparent 34%),
    linear-gradient(180deg, #f9f4ee 0%, #f3ece2 100%);
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: min(1480px, calc(100vw - 40px));
  margin: 28px auto 40px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 360px;
  gap: 20px;
  padding: 20px 24px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background:
    linear-gradient(135deg, rgba(31, 23, 16, 0.95), rgba(50, 37, 24, 0.9)),
    linear-gradient(120deg, rgba(169, 130, 71, 0.18), transparent 40%);
  color: white;
  box-shadow: var(--shadow);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -120px auto;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(169, 130, 71, 0.25) 0%, transparent 68%);
  pointer-events: none;
}

.hero-badge {
  grid-column: 1 / -1;
  justify-self: start;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #d4ba91;
}

.hero-copy h1 {
  margin: 0;
  font-family: "Source Han Serif SC", "Songti SC", "Noto Serif SC", serif;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.hero-text {
  margin: 10px 0 0;
  max-width: 760px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  line-height: 1.7;
}

.hero-panel {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 22px;
  padding: 22px 20px;
  align-self: end;
}

.hero-panel-title {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #d4ba91;
  margin-bottom: 14px;
}

.source-list {
  margin: 0;
  padding-left: 18px;
  color: rgba(255, 255, 255, 0.82);
  display: grid;
  gap: 10px;
  font-size: 13px;
  line-height: 1.6;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) 390px;
  gap: 18px;
  margin-top: 18px;
}

.workspace-main,
.workspace-side {
  display: grid;
  gap: 16px;
  align-content: start;
}

.card,
.summary-card {
  border: 1px solid rgba(169, 130, 71, 0.16);
  border-radius: 24px;
  background: rgba(255, 253, 249, 0.92);
  box-shadow: var(--shadow);
}

.section-card,
.side-card {
  padding: 20px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.section-step {
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.section-heading h2,
.side-card-head h3 {
  margin: 0;
  font-family: "Source Han Serif SC", "Songti SC", "Noto Serif SC", serif;
  font-size: 26px;
  line-height: 1.1;
}

.section-heading p,
.side-card-head p {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 760px;
}

.ghost-button,
.secondary-button,
.primary-button,
.segmented-button,
.pill {
  border: 1px solid transparent;
  cursor: pointer;
  transition: 180ms ease;
}

.ghost-button {
  background: transparent;
  color: var(--muted);
  padding: 10px 14px;
  border-color: var(--line);
  border-radius: 999px;
}

.ghost-button:hover,
.secondary-button:hover {
  border-color: var(--gold);
  color: var(--ink);
}

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

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.field-help {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: #86786d;
}

.input-control,
.select-control,
.fx-input,
.qty-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf9;
  color: var(--ink);
  padding: 11px 14px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input-control:focus,
.select-control:focus,
.fx-input:focus,
.qty-row input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(169, 130, 71, 0.12);
}

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

.segmented-button {
  background: #fffaf4;
  border-color: var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  text-align: left;
}

.segmented-button.is-active {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: white;
  border-color: rgba(255, 255, 255, 0.18);
}

.segmented-code {
  display: block;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.72;
}

.segmented-label {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  font-weight: 600;
}

.lane-wrap,
.destination-meta-wrap {
  margin-top: 18px;
}

.meta-label {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.meta-value {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 700;
}

.status-stack {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.status-card {
  border-radius: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.status-card.is-ok {
  border-color: rgba(64, 98, 76, 0.28);
  background: rgba(77, 109, 87, 0.08);
}

.status-card.is-warn {
  border-color: rgba(154, 98, 48, 0.24);
  background: rgba(154, 98, 48, 0.08);
}

.status-card.is-neutral {
  border-color: rgba(169, 130, 71, 0.22);
  background: rgba(169, 130, 71, 0.08);
}

.status-title {
  font-size: 14px;
  font-weight: 700;
}

.status-body {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  margin-top: 18px;
  align-items: end;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  background: #fffaf4;
  border-color: var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 11px 14px;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.pill.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

.products-root {
  margin-top: 16px;
}

.product-group + .product-group {
  margin-top: 24px;
}

.product-group-header {
  margin-bottom: 10px;
}

.product-group-header h3 {
  margin: 0;
  font-size: 18px;
  font-family: "Source Han Serif SC", "Songti SC", "Noto Serif SC", serif;
}

.product-group-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

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

.product-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffdf9;
  padding: 12px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.product-layout {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.product-content {
  min-width: 0;
}

.product-visual {
  border: 1px solid rgba(169, 130, 71, 0.16);
  border-radius: 14px;
  background:
    radial-gradient(circle at top, rgba(169, 130, 71, 0.12), transparent 48%),
    linear-gradient(180deg, #fffefb, #f8f1e8);
  min-height: 100px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-visual img {
  width: 100%;
  height: 100%;
  max-height: 84px;
  object-fit: contain;
  display: block;
}

.product-card:hover {
  transform: translateY(-1px);
  border-color: rgba(169, 130, 71, 0.35);
}

.product-card.is-selected {
  border-color: rgba(169, 130, 71, 0.58);
  box-shadow: 0 10px 30px rgba(169, 130, 71, 0.12);
  background: #fffaf2;
}

.product-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.check-wrap {
  position: relative;
  display: inline-flex;
  width: 24px;
  height: 24px;
}

.check-wrap input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.check-wrap span {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  display: block;
}

.check-wrap input:checked + span {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  border-color: transparent;
}

.check-wrap input:checked + span::after {
  content: "";
  display: block;
  width: 6px;
  height: 11px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin: 4px 0 0 8px;
}

.product-code {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.product-title-wrap h4 {
  margin: 4px 0 0;
  font-size: 16px;
  line-height: 1.3;
  font-family: "Source Han Serif SC", "Songti SC", "Noto Serif SC", serif;
}

.group-badge,
.count-chip {
  align-self: start;
  border: 1px solid rgba(169, 130, 71, 0.2);
  background: rgba(169, 130, 71, 0.1);
  color: var(--gold-deep);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.price-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.price-row > div,
.fx-card {
  border: 1px solid rgba(169, 130, 71, 0.16);
  background: rgba(169, 130, 71, 0.06);
  border-radius: 12px;
  padding: 10px 12px;
}

.price-row label,
.qty-row label {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.lock-row label {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.price-row strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
}

.qty-row {
  display: grid;
  grid-template-columns: 120px auto;
  gap: 8px;
  margin-top: 10px;
  align-items: end;
}

.lock-row {
  margin-top: 10px;
}

.secondary-button {
  border-color: var(--line);
  border-radius: 16px;
  background: white;
  color: var(--ink);
  padding: 14px 16px;
}

.product-footnote {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.product-footnote span {
  display: inline;
}

.summary-card {
  position: sticky;
  top: 16px;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(31, 23, 16, 0.98), rgba(41, 29, 18, 0.96)),
    radial-gradient(circle at top right, rgba(169, 130, 71, 0.2), transparent 42%);
  color: white;
}

.summary-eyebrow {
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #d4ba91;
}

.summary-top h3 {
  margin: 10px 0 0;
  font-size: 26px;
  font-family: "Source Han Serif SC", "Songti SC", "Noto Serif SC", serif;
  line-height: 1.1;
}

.summary-top p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
  font-size: 14px;
}

.fx-card {
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.fx-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.fx-row span {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.68);
}

.fx-input {
  max-width: 110px;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.summary-stats {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.summary-stats div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.summary-stats span {
  color: rgba(255, 255, 255, 0.68);
}

.summary-stats strong {
  font-weight: 700;
}

.total-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.total-block span {
  color: #d4ba91;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
}

.total-block strong {
  font-size: 30px;
  line-height: 1;
}

.primary-button {
  width: 100%;
  margin-top: 18px;
  border-radius: 18px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #d4ba91, var(--gold));
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.summary-actions {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.summary-actions .primary-button {
  margin-top: 0;
}

.summary-action-button {
  display: grid;
  gap: 4px;
  text-align: left;
}

.summary-action-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.summary-action-meta {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  opacity: 0.78;
}

.summary-secondary-button {
  width: 100%;
  border-radius: 18px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.06);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 14px;
  font-weight: 600;
}

.summary-secondary-button:hover {
  border-color: rgba(212, 186, 145, 0.56);
  background: rgba(255, 255, 255, 0.1);
}

.summary-secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.side-card-head h3 {
  font-size: 24px;
}

.quote-lines {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.quote-line-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
  padding: 16px;
}

.quote-line-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.quote-line-head h4 {
  margin: 0;
  font-size: 17px;
  font-family: "Source Han Serif SC", "Songti SC", "Noto Serif SC", serif;
}

.quote-line-head p {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.quote-line-head strong {
  font-size: 18px;
}

.quote-line-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  font-size: 13px;
}

.quote-line-grid span:nth-child(odd) {
  color: var(--muted);
}

.note-list {
  margin: 16px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 26px 18px;
  text-align: center;
  display: grid;
  gap: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
}

.empty-state.compact {
  padding: 18px;
}

@media (max-width: 1180px) {
  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .summary-card {
    position: static;
  }
}

@media (max-width: 860px) {
  .page-shell {
    width: min(100vw - 20px, 1480px);
    margin: 12px auto 24px;
  }

  .hero,
  .section-card,
  .side-card,
  .summary-card {
    padding: 20px;
    border-radius: 20px;
  }

  .grid-two,
  .toolbar,
  .qty-row,
  .price-row,
  .product-layout {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .quote-line-head,
  .product-top {
    grid-template-columns: 1fr;
    display: grid;
  }

  .group-badge,
  .count-chip {
    justify-self: start;
  }

  .product-visual {
    min-height: 220px;
  }

  .fx-row {
    flex-direction: column;
    align-items: stretch;
  }

  .fx-input {
    max-width: none;
  }
}
