:root {
  color-scheme: light;
  --ink: #17201b;
  --muted: #5f6b65;
  --paper: #f7f5ee;
  --surface: #fffdf7;
  --line: #ddd8ca;
  --teal: #08736a;
  --teal-dark: #07564f;
  --tomato: #c84630;
  --mustard: #d49a1f;
  --green: #567f36;
  --graphite: #2b302d;
  --shadow: 0 18px 45px rgba(32, 37, 32, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(247, 245, 238, 0.92);
  border-bottom: 1px solid rgba(221, 216, 202, 0.8);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: 0 0 auto;
  background: var(--teal);
  color: white;
  border-radius: 8px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.2;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.top-nav a {
  padding: 6px 0;
}

.top-nav a:hover {
  color: var(--ink);
}

.hero-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding: clamp(32px, 6vw, 74px) clamp(18px, 4vw, 56px) 32px;
}

.hero-copy {
  max-width: 650px;
}

.eyebrow,
.section-kicker,
.tool-category {
  margin: 0 0 10px;
  color: var(--tomato);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.04;
  letter-spacing: 0;
}

.hero-copy h2 {
  margin: 0;
  max-width: 16ch;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.04;
  letter-spacing: 0;
}

.hero-lede {
  margin: 22px 0 0;
  max-width: 640px;
  color: #3d4741;
  font-size: clamp(17px, 2vw, 20px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary-link,
.secondary-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 800;
}

.primary-link {
  background: var(--teal);
  color: white;
}

.secondary-link {
  border: 1px solid var(--line);
  color: var(--graphite);
}

.hero-media {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: #e9e1d4;
}

.hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
}

.content-band {
  padding: 42px clamp(18px, 4vw, 56px);
}

.tool-band {
  padding: 34px clamp(18px, 4vw, 56px) 42px;
  background: #eef2ea;
  border-block: 1px solid var(--line);
}

.tool-intro {
  max-width: 1220px;
  margin: 0 auto 24px;
}

.tool-intro p:last-child {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 24px;
  max-width: 1220px;
  margin: 0 auto;
}

.tool-picker,
.calculator-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tool-picker {
  align-self: start;
  padding: 18px;
}

.tool-picker h2,
.calculator-heading h2,
.section-heading h2,
.split-band h2 {
  margin: 0;
  line-height: 1.1;
  letter-spacing: 0;
}

.tool-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.tool-tab {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  align-items: center;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--graphite);
  cursor: pointer;
  text-align: left;
}

.tool-tab:focus-visible,
.related-tools a:focus-visible,
.topic-card:focus-visible {
  outline: 3px solid rgba(8, 115, 106, 0.28);
  outline-offset: 2px;
}

.tool-tab:hover {
  border-color: var(--line);
  background: #faf7ef;
}

.tool-tab.is-active {
  border-color: rgba(8, 115, 106, 0.35);
  background: #e7f4ef;
  color: var(--teal-dark);
}

.tool-index {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: #ece6d8;
  color: #4d554f;
  font-size: 12px;
  font-weight: 800;
}

.tool-tab.is-active .tool-index {
  background: var(--teal);
  color: white;
}

.tool-name {
  font-weight: 800;
  line-height: 1.25;
}

.calculator-panel {
  padding: clamp(18px, 3vw, 28px);
}

.calculator-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.calculator-heading p:last-child {
  margin: 10px 0 0;
  max-width: 720px;
  color: var(--muted);
}

.tool-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #f4e7d4;
  color: #85521d;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
}

.calculator-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 22px 0;
}

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

.field label {
  color: var(--graphite);
  font-size: 14px;
  font-weight: 800;
}

.input-wrap {
  display: flex;
  min-height: 46px;
  overflow: hidden;
  border: 1px solid #d7d0c0;
  border-radius: 8px;
  background: white;
}

.input-wrap:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 115, 106, 0.14);
}

.input-wrap input,
.input-wrap select {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 10px 11px;
  color: var(--ink);
  outline: 0;
}

.input-wrap span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 0 10px;
  border-left: 1px solid #e7e0d1;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.field small {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
}

.result-shell {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.result-header h3,
.related-row h3 {
  margin: 0;
}

.result-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--graphite);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.icon-button:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

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

.result-card {
  min-height: 118px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.result-card[data-tone="teal"] {
  border-color: rgba(8, 115, 106, 0.35);
}

.result-card[data-tone="tomato"] {
  border-color: rgba(200, 70, 48, 0.35);
}

.result-card[data-tone="mustard"] {
  border-color: rgba(212, 154, 31, 0.42);
}

.result-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.result-value {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin-top: 10px;
  color: var(--ink);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 900;
  line-height: 1;
}

.result-value small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.result-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.assumption {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.related-row {
  display: grid;
  gap: 12px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.related-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.related-tools a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf7ef;
  color: var(--graphite);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 800;
}

.related-tools a:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.content-band {
  max-width: 1220px;
  margin: 0 auto;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 22px;
}

.section-heading p:last-child {
  color: var(--muted);
}

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

.topic-card {
  display: block;
  min-height: 168px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.topic-card:hover {
  border-color: rgba(8, 115, 106, 0.38);
  box-shadow: 0 12px 28px rgba(32, 37, 32, 0.08);
}

.topic-card strong {
  display: block;
  line-height: 1.25;
}

.topic-card span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.split-band {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
  gap: 28px;
  align-items: start;
  border-top: 1px solid var(--line);
}

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

.pipeline-list article {
  min-height: 108px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 15px;
}

.pipeline-list strong,
.pipeline-list span {
  display: block;
}

.pipeline-list span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.faq-band {
  border-top: 1px solid var(--line);
}

.guide-band {
  border-top: 1px solid var(--line);
}

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

.guide-card {
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.guide-card p {
  margin: 0;
  color: var(--muted);
}

.faq-list {
  display: grid;
  gap: 10px;
  max-width: 820px;
}

details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px 16px;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

details p {
  margin: 10px 0 0;
  color: var(--muted);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

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

  h1 {
    max-width: 13ch;
  }

  .tool-picker {
    position: static;
  }

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

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

@media (max-width: 640px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero-shell {
    padding-top: 26px;
  }

  h1 {
    max-width: 12ch;
    font-size: 42px;
  }

  .hero-media,
  .hero-media img {
    min-height: 230px;
  }

  .tool-list,
  .calculator-form,
  .result-grid,
  .topic-grid,
  .guide-grid,
  .pipeline-list {
    grid-template-columns: 1fr;
  }

  .tool-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
  }

  .tool-tab {
    flex: 0 0 150px;
    scroll-snap-align: start;
  }

  .calculator-heading,
  .result-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  .site-header,
  .hero-shell,
  .tool-picker,
  .hero-actions,
  .result-actions,
  .content-band,
  .site-footer {
    display: none;
  }

  body {
    background: white;
  }

  .tool-band {
    border: 0;
    padding: 0;
  }

  .tool-layout {
    display: block;
  }

  .calculator-panel {
    border: 0;
  }
}
