:root {
  --navy: #0b1f3a;
  --navy-light: #163a5f;
  --gold: #c9a24b;
  --jade: #2f6b4f;
  --jade-pale: #e9f2ed;
  --cinnabar: #b33a3a;
  --ink: #17202a;
  --muted: #626b70;
  --line: #d8dedb;
  --paper: #faf7f2;
  --white: #ffffff;
  --cool: #f3f6f4;
  --radius: 8px;
  --shadow: 0 16px 42px rgba(11, 31, 58, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--white);
  color: var(--navy);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(216, 222, 219, 0.92);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.site-header .shell {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  text-decoration: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-family: Georgia, "Noto Serif TC", serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.brand strong {
  display: block;
  font-family: Georgia, "Noto Serif TC", serif;
  font-size: 1.08rem;
  line-height: 1.15;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.86rem;
}

.primary-nav a {
  color: var(--muted);
  text-decoration: none;
}

.primary-nav a:hover,
.primary-nav a:focus-visible,
.primary-nav a[aria-current="page"] {
  color: var(--navy);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 6px;
}

.locale-link {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 10px;
  background: var(--cool);
  color: var(--navy) !important;
  font-weight: 700;
  text-decoration: none !important;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--navy);
  font-family: Georgia, "Noto Serif TC", "Songti TC", serif;
  line-height: 1.18;
  letter-spacing: 0;
}

h1 {
  font-size: 3.55rem;
}

h2 {
  font-size: 2.35rem;
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.beta-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(47, 107, 79, 0.35);
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--jade-pale);
  color: var(--jade);
  font-size: 0.74rem;
  font-weight: 800;
}

.app-intro {
  padding: 44px 0 28px;
  background: var(--navy);
  color: var(--white);
}

.app-intro .shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.58fr);
  gap: 50px;
  align-items: end;
}

.app-intro h1 {
  max-width: 780px;
  color: var(--white);
}

.app-intro .lede {
  max-width: 650px;
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.02rem;
}

.intro-aside {
  border-left: 2px solid var(--gold);
  padding-left: 20px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.89rem;
}

.intro-aside strong {
  display: block;
  margin-bottom: 6px;
  color: var(--white);
}

.calculator-band {
  border-bottom: 1px solid var(--line);
  background: var(--cool);
  padding: 28px 0 34px;
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.36fr);
  gap: 30px;
  align-items: start;
}

.calculator-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.panel-heading h2 {
  font-size: 1.32rem;
}

.panel-heading p {
  max-width: 470px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.84rem;
}

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

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

.field-full,
.form-error,
.form-action,
.form-privacy {
  grid-column: 1 / -1;
}

label,
.field-label {
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 750;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cbd3cf;
  border-radius: var(--radius);
  outline: none;
  background: var(--white);
  color: var(--ink);
  padding: 9px 11px;
}

input:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 75, 0.18);
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 28px;
  color: var(--muted);
  font-size: 0.84rem;
}

.checkbox-field input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--jade);
}

.button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px 15px;
  font-weight: 800;
}

.button-primary {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--white);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--navy-light);
}

.button-quiet {
  border-color: var(--line);
  background: var(--white);
  color: var(--navy);
}

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

.form-privacy {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
  font-size: 0.78rem;
}

.form-error {
  border-left: 3px solid var(--cinnabar);
  background: #fff1ef;
  color: #8d2929;
  padding: 9px 11px;
  font-size: 0.84rem;
}

.scope-note {
  padding: 4px 0;
}

.scope-note h2 {
  font-size: 1.22rem;
}

.scope-list {
  display: grid;
  gap: 0;
  margin: 17px 0 0;
  padding: 0;
  list-style: none;
}

.scope-list li {
  border-top: 1px solid var(--line);
  padding: 13px 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.scope-list strong {
  display: block;
  margin-bottom: 2px;
  color: var(--navy);
}

.result-section {
  scroll-margin-top: 80px;
  padding: 56px 0 64px;
  background: var(--paper);
}

.result-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
}

.day-master {
  border-left: 3px solid var(--cinnabar);
  padding-left: 12px;
  color: var(--navy);
  font-weight: 800;
}

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

.pillar {
  min-height: 154px;
  display: grid;
  align-content: center;
  justify-items: center;
  border: 1px solid var(--line);
  border-top: 4px solid var(--navy);
  border-radius: var(--radius);
  background: var(--white);
  text-align: center;
}

.pillar-wood { border-top-color: var(--jade); }
.pillar-fire { border-top-color: var(--cinnabar); }
.pillar-earth { border-top-color: var(--gold); }
.pillar-metal { border-top-color: #70777b; }
.pillar-water { border-top-color: var(--navy-light); }

.pillar span,
.pillar small {
  color: var(--muted);
  font-size: 0.76rem;
}

.pillar strong {
  margin: 8px 0 5px;
  color: var(--navy);
  font-family: Georgia, "Noto Serif TC", serif;
  font-size: 2rem;
  font-weight: 600;
}

.result-details {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: 34px;
  margin-top: 30px;
}

.calculation-record {
  margin: 0;
  border-top: 2px solid var(--navy);
}

.record-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 11px 0;
}

.record-row dt {
  color: var(--muted);
  font-size: 0.8rem;
}

.record-row dd {
  margin: 0;
  color: var(--navy);
  font-size: 0.86rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.reflection {
  border-left: 2px solid var(--gold);
  padding-left: 24px;
}

.reflection h3 {
  font-size: 1.5rem;
}

.reflection p {
  margin-top: 13px;
  color: #454c50;
}

.focus-copy {
  border-top: 1px solid var(--line);
  padding-top: 13px;
}

.boundary-note {
  margin-top: 22px;
  border: 1px solid rgba(179, 58, 58, 0.3);
  border-radius: var(--radius);
  background: #fff1ef;
  color: #7f2a2a;
  padding: 13px 15px;
  font-size: 0.87rem;
}

.result-next {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  margin-top: 34px;
  border-top: 1px solid var(--line);
  padding-top: 26px;
}

.result-next h3 {
  max-width: 760px;
  margin-top: 4px;
  font-size: 1.2rem;
}

.result-next p:not(.eyebrow) {
  max-width: 720px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.86rem;
}

.result-next .text-link {
  margin-top: 0;
  white-space: nowrap;
}

.evidence-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.evidence-item {
  min-height: 144px;
  padding: 28px 26px;
  border-right: 1px solid var(--line);
}

.evidence-item:last-child {
  border-right: 0;
}

.evidence-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--navy);
}

.evidence-item p {
  color: var(--muted);
  font-size: 0.86rem;
}

.product-proof {
  padding: 64px 0;
  background: var(--cool);
}

.product-proof .shell {
  display: grid;
  grid-template-columns: minmax(0, 0.55fr) minmax(0, 1fr);
  gap: 44px;
  align-items: center;
}

.product-proof p {
  margin-top: 14px;
  color: var(--muted);
}

.product-proof picture {
  display: block;
  min-width: 0;
}

.product-proof img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 12px 28px rgba(11, 31, 58, 0.08);
}

.text-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--jade);
  font-weight: 800;
  text-underline-offset: 4px;
}

.content-hero {
  padding: 66px 0 50px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.content-hero h1 {
  max-width: 850px;
}

.content-hero .lede {
  max-width: 740px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.05rem;
}

.article-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 720px);
  gap: 64px;
  justify-content: center;
  padding: 56px 0 76px;
}

.article-nav {
  align-self: start;
  position: sticky;
  top: 96px;
  border-top: 2px solid var(--gold);
  padding-top: 12px;
}

.article-nav strong {
  color: var(--navy);
  font-size: 0.82rem;
}

.article-nav a {
  display: block;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: none;
}

.article-body section {
  scroll-margin-top: 92px;
  padding: 0 0 36px;
}

.article-body section + section {
  border-top: 1px solid var(--line);
  padding-top: 36px;
}

.article-body h2 {
  margin-bottom: 14px;
  font-size: 1.65rem;
}

.article-body h3 {
  margin: 24px 0 8px;
}

.article-body p + p,
.article-body ul + p,
.article-body p + ul {
  margin-top: 15px;
}

.article-body p,
.article-body li {
  color: #3f474b;
}

.article-body ul,
.article-body ol {
  padding-left: 21px;
}

.article-body li + li {
  margin-top: 8px;
}

.fact-table {
  width: 100%;
  margin-top: 18px;
  border-collapse: collapse;
}

.fact-table th,
.fact-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 8px;
  text-align: left;
  vertical-align: top;
}

.fact-table th {
  width: 34%;
  color: var(--navy);
  font-size: 0.82rem;
}

.fact-table td {
  color: #3f474b;
}

.callout {
  border-left: 3px solid var(--jade);
  background: var(--jade-pale);
  padding: 16px 18px;
}

.callout strong {
  display: block;
  margin-bottom: 5px;
  color: var(--jade);
}

.article-body h2 code {
  overflow-wrap: anywhere;
}

.license-text {
  max-width: 100%;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--cool);
  padding: 16px;
  color: #3f474b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.sample-pillars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.sample-pillar {
  min-height: 100px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--cool);
  color: var(--navy);
  font-family: Georgia, "Noto Serif TC", serif;
  font-size: 1.55rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--navy);
  color: rgba(255, 255, 255, 0.74);
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  padding: 34px 0 28px;
}

.footer-main strong {
  display: block;
  color: var(--white);
}

.footer-main p {
  max-width: 590px;
  margin-top: 6px;
  font-size: 0.82rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: flex-end;
  gap: 18px;
  font-size: 0.8rem;
}

.footer-links a {
  text-underline-offset: 4px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding: 15px 0 20px;
  font-size: 0.74rem;
}

.consent-banner {
  position: fixed;
  right: 20px;
  bottom: 20px;
  left: 20px;
  z-index: 80;
  width: min(760px, calc(100% - 40px));
  margin-left: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 18px 60px rgba(11, 31, 58, 0.2);
  padding: 18px;
}

.consent-banner strong {
  color: var(--navy);
}

.consent-banner p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

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

@media (max-width: 900px) {
  .site-header .shell {
    align-items: flex-start;
    padding: 13px 0;
  }

  .primary-nav {
    max-width: 55%;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 9px 16px;
  }

  .app-intro .shell,
  .calculator-layout,
  .product-proof .shell {
    grid-template-columns: 1fr;
  }

  .app-intro .shell {
    gap: 25px;
  }

  .intro-aside {
    max-width: 680px;
  }

  .calculator-layout {
    gap: 26px;
  }

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

  .evidence-item {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .evidence-item:last-child {
    border-bottom: 0;
  }

  .article-layout {
    grid-template-columns: minmax(0, 720px);
  }

  .article-nav {
    display: none;
  }
}

@media (max-width: 650px) {
  .shell {
    width: min(100% - 28px, 1120px);
  }

  .site-header {
    position: static;
  }

  .site-header .shell {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .brand small {
    display: none;
  }

  .primary-nav {
    grid-column: 1 / -1;
    max-width: none;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .locale-link {
    position: absolute;
    top: 14px;
    right: 14px;
  }

  .app-intro {
    padding: 34px 0 24px;
  }

  .app-intro h1 {
    font-size: 2.25rem;
  }

  h1 {
    font-size: 2.25rem;
  }

  h2 {
    font-size: 1.8rem;
  }

  .intro-aside {
    font-size: 0.83rem;
  }

  .calculator-band {
    padding-top: 20px;
  }

  .panel-heading,
  .result-heading {
    display: block;
  }

  .panel-heading .beta-label {
    margin-top: 12px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .field-full,
  .form-error,
  .form-action,
  .form-privacy {
    grid-column: 1;
  }

  .result-section {
    padding: 42px 0 48px;
  }

  .day-master {
    margin-top: 12px;
  }

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

  .pillar {
    min-height: 130px;
  }

  .result-details {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .result-next {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .result-next .text-link {
    margin-top: 12px;
    white-space: normal;
  }

  .record-row {
    grid-template-columns: 118px minmax(0, 1fr);
  }

  .reflection {
    padding-left: 18px;
  }

  .product-proof,
  .content-hero {
    padding: 44px 0;
  }

  .article-layout {
    padding: 40px 0 56px;
  }

  .fact-table th,
  .fact-table td {
    display: block;
    width: 100%;
  }

  .fact-table th {
    border-bottom: 0;
    padding-bottom: 2px;
  }

  .fact-table td {
    padding-top: 2px;
  }

  .footer-main {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .consent-banner {
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: calc(100% - 24px);
    grid-template-columns: 1fr;
  }

  .consent-actions .button {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
