:root {
  color-scheme: light;
  --ink: #18221f;
  --muted: #62716a;
  --line: #dce5df;
  --surface: #ffffff;
  --page: #f5f8f5;
  --green: #176b4b;
  --green-dark: #10533a;
  --green-soft: #e8f4ed;
  --shadow: 0 12px 35px rgba(24, 50, 37, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC",
    "Microsoft JhengHei", sans-serif;
  line-height: 1.6;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px max(24px, calc((100% - 1040px) / 2));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.brand {
  color: var(--green);
  font-size: 1.15rem;
  font-weight: 750;
  text-decoration: none;
}

.container {
  width: min(100% - 32px, 820px);
  margin: 0 auto;
  padding: 56px 0 40px;
}

.intro {
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 700px;
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.intro > p:last-child {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.calculator,
.results {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.calculator {
  margin-bottom: 22px;
}

h2 {
  margin-bottom: 20px;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

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

.field {
  display: grid;
  gap: 7px;
  color: #33433b;
  font-size: 0.92rem;
  font-weight: 650;
}

.field input,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #cbd7cf;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.field input:focus-visible,
.field select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid #8bc5a5;
  outline-offset: 2px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

button {
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid var(--green);
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

button:hover {
  background: var(--green-dark);
}

button.secondary-button {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

button.secondary-button:hover {
  background: #f1f5f2;
}

.results h2 {
  margin-bottom: 8px;
}

#result-message {
  margin-bottom: 0;
  color: var(--muted);
}

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

.result-card {
  display: grid;
  gap: 8px;
  min-height: 100px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfb;
}

.result-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.result-card strong {
  font-size: 1.35rem;
  overflow-wrap: anywhere;
}

.result-card.highlight {
  border-color: #b6d9c3;
  background: var(--green-soft);
}

.disclaimer {
  margin: 16px 4px 0;
  color: var(--muted);
  font-size: 0.85rem;
}

[hidden] {
  display: none !important;
}

@media (max-width: 600px) {
  .site-header {
    padding: 15px 20px;
  }

  .container {
    width: min(100% - 24px, 480px);
    padding-top: 36px;
  }

  .calculator,
  .results {
    padding: 20px;
    border-radius: 14px;
  }

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

  .form-actions {
    display: grid;
  }

  .form-actions button {
    width: 100%;
  }
}
