:root {
  --bg: #f3f6f6;
  --panel: #ffffff;
  --panel-soft: #f7faf9;
  --line: #d9e4e3;
  --line-strong: #c7d5d4;
  --ink: #20373a;
  --muted: #668083;
  --accent: #1d6f75;
  --accent-soft: #e7f1f1;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

.site-shell {
  width: min(1080px, calc(100vw - 2rem));
  min-height: 100vh;
  margin: 0 auto;
  padding: 1.5rem 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 1.25rem;
}

.page-header {
  padding: 0.25rem 0;
}

.page-header h1 {
  margin: 0;
  font-family: Georgia, "Noto Serif SC", "Source Han Serif SC", serif;
  font-size: clamp(2.3rem, 4.2vw, 3.4rem);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.calculator-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  min-height: 0;
  align-items: stretch;
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: var(--panel);
}

.panel-head {
  margin-bottom: 1rem;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.calculator-form {
  display: grid;
  gap: 1rem;
}

.form-actions,
.result-grid {
  display: grid;
  gap: 0.75rem;
}

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

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

.field {
  display: grid;
  gap: 0.4rem;
}

.field span,
.summary-label,
.detail-item span,
.result-placeholder p {
  color: var(--muted);
  font-size: 0.88rem;
}

input,
button {
  width: 100%;
  font: inherit;
}

input {
  padding: 0.82rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease;
}

input:focus {
  border-color: var(--accent);
}

button {
  border: 1px solid transparent;
  border-radius: 0.85rem;
  cursor: pointer;
  padding: 0.82rem 0.95rem;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover {
  background: #185e63;
}

.ghost-button {
  border-color: var(--line);
  background: var(--accent-soft);
  color: var(--accent);
}

.result-card {
  flex: 1;
  min-height: 0;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: var(--panel-soft);
}

.result-placeholder {
  display: grid;
  place-items: center;
  min-height: 12rem;
  text-align: center;
}

.result-placeholder p {
  margin: 0;
}

.result-heading {
  margin-bottom: 1rem;
}

.result-heading h3 {
  margin: 0;
  font-size: 1.24rem;
}

.result-grid {
  margin-bottom: 0;
  align-content: start;
}

.result-grid article {
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: #ffffff;
}

.result-grid article {
  padding: 1rem;
  min-height: 7.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.summary-label {
  display: block;
}

.summary-value {
  display: block;
  margin-top: 0.45rem;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 860px) {
  .site-shell {
    width: min(100vw - 1rem, 1080px);
    padding: 0.75rem 0;
  }

  .calculator-grid,
  .form-actions,
  .result-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
