:root {
  color-scheme: light;
  --bg: #f6efe5;
  --panel: #fffaf2;
  --card: #fffdf8;
  --line: rgba(114, 84, 42, 0.18);
  --text: #2d2418;
  --muted: #7d6d58;
  --strong: #1f6b52;
  --warn: #b26a1c;
  --danger: #b84c4c;
  --shadow: 0 16px 36px rgba(72, 47, 12, 0.08);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: linear-gradient(180deg, #fcf6ed 0%, #f4ecdf 100%);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

.quote-shell {
  width: min(1180px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.quote-topbar,
.tool-panel,
.results-panel {
  background: rgba(255, 250, 242, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.quote-topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.15;
}

.subcopy {
  margin-top: 12px;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.6;
}

.top-actions,
.calculator-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.calculator-actions {
  margin-top: 18px;
  align-items: center;
}

.calculator-actions .primary-btn {
  min-width: 156px;
}

.calculator-actions .ghost-btn {
  min-width: 92px;
}

.primary-btn,
.ghost-btn {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 12px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}

.primary-btn {
  background: var(--strong);
  color: #fff;
  border-color: transparent;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
}

.summary-grid,
.filter-grid,
.calculator-grid,
.workspace-grid,
.quote-list,
.quote-metrics,
.price-grid,
.quote-tags {
  display: grid;
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.summary-card {
  background: rgba(255, 250, 242, 0.96);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.summary-card strong {
  display: block;
  font-size: 28px;
  margin-top: 8px;
}

.summary-card span {
  color: var(--muted);
  font-size: 13px;
}

.workspace-grid {
  grid-template-columns: 1.4fr 0.9fr;
  gap: 18px;
}

.tool-panel,
.results-panel {
  padding: 20px;
}

.results-panel {
  margin-top: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-head p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.filter-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

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

.calculator-grid .field-control:first-child {
  grid-column: 1 / -1;
}

.field-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-control span {
  font-size: 13px;
  color: var(--muted);
}

.field-control input,
.field-control select {
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 14px;
  color: var(--text);
}

.inline-toggle {
  justify-content: flex-end;
}

.inline-toggle input {
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
}

.quote-hint {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(31, 107, 82, 0.08);
  border: 1px solid rgba(31, 107, 82, 0.12);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quote-hint strong {
  font-size: 14px;
}

.quote-hint span {
  color: var(--muted);
  line-height: 1.5;
}

.calc-result {
  margin-top: 20px;
}

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

.calc-total {
  margin-top: 12px;
  color: var(--muted);
}

.quote-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

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

.quote-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.quote-card h3 {
  font-size: 24px;
  line-height: 1.1;
}

.quote-card .meta {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.stock-chip {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: rgba(31, 107, 82, 0.08);
}

.stock-chip.high-pressure {
  background: rgba(184, 76, 76, 0.08);
  color: var(--danger);
}

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

.quote-metrics {
  margin-top: 16px;
}

.metric-box,
.price-box {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  border-radius: 14px;
  padding: 12px;
}

.metric-box span,
.price-box span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.metric-box strong,
.price-box strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.price-grid {
  margin-top: 16px;
}

.price-box.quick strong {
  color: var(--warn);
}

.price-box.normal strong {
  color: var(--strong);
}

.price-box.premium strong {
  color: #6c4db4;
}

.price-box.break-even strong {
  color: var(--text);
}

.quote-tags {
  grid-template-columns: repeat(auto-fit, minmax(120px, max-content));
  gap: 8px;
  margin-top: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
}

.tag.hot {
  background: rgba(31, 107, 82, 0.08);
  color: var(--strong);
}

.tag.pressure {
  background: rgba(184, 76, 76, 0.08);
  color: var(--danger);
}

.tag.no-history {
  background: rgba(178, 106, 28, 0.1);
  color: var(--warn);
}

.formula-note {
  margin-top: 16px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.48);
}

@media (max-width: 980px) {
  .summary-grid,
  .filter-grid,
  .workspace-grid,
  .quote-list {
    grid-template-columns: 1fr;
  }

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

  .calculator-grid .field-control:first-child {
    grid-column: auto;
  }

  .quote-topbar,
  .panel-head,
  .quote-card header {
    flex-direction: column;
  }

  .calculator-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .calculator-actions .primary-btn,
  .calculator-actions .ghost-btn {
    width: 100%;
    min-width: 0;
  }

  .quote-card header {
    align-items: flex-start;
  }

  h1 {
    font-size: 24px;
  }
}
