:root {
  --bg: #f6efe4;
  --bg-deep: #eadfcf;
  --panel: rgba(255, 250, 242, 0.88);
  --panel-strong: #fffaf2;
  --text: #1f2a2a;
  --muted: #5d6c69;
  --line: rgba(31, 42, 42, 0.12);
  --accent: #0f766e;
  --accent-strong: #0c5f58;
  --accent-soft: rgba(15, 118, 110, 0.1);
  --accent-warm: #c76c2f;
  --shadow: 0 20px 50px rgba(57, 43, 23, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.15), transparent 26%),
    radial-gradient(circle at right 20%, rgba(199, 108, 47, 0.15), transparent 22%),
    linear-gradient(160deg, var(--bg), var(--bg-deep));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), transparent 75%);
  pointer-events: none;
}

.page-shell {
  position: relative;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
  gap: 24px;
  align-items: stretch;
}

.hero-copy,
.hero-panel,
.panel {
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 42px;
  border-radius: 34px;
}

.hero-panel {
  padding: 30px;
  border-radius: 30px;
  display: grid;
  gap: 16px;
  align-content: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: "Source Han Serif SC", "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(2.1rem, 4vw, 4rem);
  line-height: 1.08;
}

.hero-text {
  margin: 20px 0 0;
  max-width: 52rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.8;
}

.formula-card {
  margin-top: 28px;
  padding: 18px 22px;
  border-radius: 20px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(255, 255, 255, 0.65));
}

.formula-card span,
.metric span,
.summary-main span,
.summary-total span,
.summary-note,
.custom-header p {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.formula-card strong,
.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.02rem;
  line-height: 1.5;
}

.workspace {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.panel {
  border-radius: var(--radius-xl);
  padding: 28px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.section-heading.compact {
  margin-bottom: 18px;
}

.section-heading h2,
.custom-header h3 {
  margin: 0;
  font-family: "Source Han Serif SC", "Noto Serif SC", "Songti SC", serif;
  font-size: 1.55rem;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-pill {
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.filter-pill:hover,
.filter-pill.active {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.3);
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-strong);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.catalog-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.catalog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 34px rgba(18, 35, 35, 0.08);
  border-color: rgba(15, 118, 110, 0.18);
}

.catalog-card.selected {
  border-color: rgba(15, 118, 110, 0.36);
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.12), rgba(255, 255, 255, 0.75));
}

.catalog-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.catalog-top h3 {
  margin: 0;
  font-size: 1.02rem;
}

.catalog-tag {
  align-self: start;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(199, 108, 47, 0.12);
  color: var(--accent-warm);
  font-size: 0.78rem;
  font-weight: 700;
}

.catalog-desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  min-height: 3.3em;
}

.catalog-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.catalog-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.catalog-action small,
.mini-note {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.catalog-action button,
.secondary-button,
.ghost-button,
.remove-button {
  font: inherit;
  cursor: pointer;
}

.catalog-action button,
.secondary-button {
  padding: 11px 16px;
  border: none;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  transition: transform 160ms ease, background-color 160ms ease;
}

.catalog-action button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
}

.catalog-action button.selected-button {
  background: rgba(15, 118, 110, 0.18);
  color: var(--accent-strong);
}

.quote-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 22px;
}

.quote-config,
.quote-result {
  min-width: 0;
}

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

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.94rem;
  font-weight: 700;
}

.field input {
  width: 100%;
  padding: 14px 15px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  font: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input:focus {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.08);
}

.custom-item {
  margin-top: 24px;
  padding: 20px;
  border-radius: 22px;
  border: 1px dashed rgba(15, 118, 110, 0.28);
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.06), rgba(255, 255, 255, 0.72));
}

.custom-header {
  margin-bottom: 16px;
}

.custom-header p {
  margin: 6px 0 0;
}

.line-items-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.line-items {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.line-items th,
.line-items td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(31, 42, 42, 0.08);
  text-align: left;
}

.line-items th {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.line-items tbody tr:last-child td {
  border-bottom: none;
}

.line-items input {
  width: 100%;
  min-width: 90px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  font: inherit;
}

.line-items .subtotal {
  font-weight: 700;
}

.empty-row td {
  color: var(--muted);
  text-align: center;
  padding: 26px 16px;
}

.remove-button,
.ghost-button {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
}

.remove-button:hover,
.ghost-button:hover {
  border-color: rgba(199, 108, 47, 0.3);
  color: var(--accent-warm);
}

.summary-card {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 20px 22px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(199, 108, 47, 0.08), rgba(255, 255, 255, 0.78));
  border: 1px solid rgba(15, 118, 110, 0.18);
}

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

.summary-main strong,
.summary-total strong {
  display: block;
  margin-top: 8px;
  font-size: 1.3rem;
}

.summary-total {
  min-width: 180px;
  text-align: right;
}

.summary-total strong {
  font-size: 2.1rem;
  color: var(--accent-strong);
}

.summary-total p {
  margin: 10px 0 0;
  color: var(--muted);
}

.summary-note {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(31, 42, 42, 0.08);
  background: rgba(255, 255, 255, 0.56);
  line-height: 1.7;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: rise-in 600ms ease forwards;
}

.delay-1 {
  animation-delay: 90ms;
}

.delay-2 {
  animation-delay: 180ms;
}

.delay-3 {
  animation-delay: 270ms;
}

@keyframes rise-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .summary-card,
  .summary-main {
    grid-template-columns: 1fr;
  }

  .summary-total {
    text-align: left;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1240px);
    padding-top: 18px;
  }

  .hero-copy,
  .hero-panel,
  .panel {
    padding: 20px;
  }

  .field-grid,
  .custom-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    flex-direction: column;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
  }
}
