:root {
  color-scheme: light;
  --brand-navy: #172b48;
  --logo-ivory: #ece9df;
  --parchment: #f5f0e8;
  --linen-light: #faf7f2;
  --linen-dark: #ede7db;
  --charcoal: #3c3c3c;
  --charcoal-light: #6b6b6b;
  --amber: #d4a057;
  --amber-light: #e8c88a;
  --navy-12: rgba(23, 43, 72, 0.12);
  --navy-20: rgba(23, 43, 72, 0.2);
  --shadow: 0 18px 54px rgba(23, 43, 72, 0.1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  background: var(--parchment);
  color: var(--charcoal);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
  font-size: 1rem;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--brand-navy);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  border-radius: 0.2rem;
  outline: 3px solid var(--amber-light);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  transform: translateY(-180%);
  border-radius: 0.35rem;
  background: var(--linen-light);
  color: var(--brand-navy);
  font-weight: 700;
}

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

.site-header {
  background: var(--brand-navy);
  color: var(--logo-ivory);
}

.site-nav,
.hero,
.page-shell,
.footer-inner {
  width: min(70rem, calc(100% - 2.5rem));
  margin-inline: auto;
}

.site-nav {
  display: flex;
  min-height: 5.25rem;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border-bottom: 1px solid rgba(236, 233, 223, 0.16);
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.8rem;
  color: var(--logo-ivory);
  text-decoration: none;
}

.brand img {
  display: block;
  width: 2.25rem;
  height: 2.75rem;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-name,
.brand-en {
  display: block;
  line-height: 1.25;
}

.brand-name {
  font-size: 1.02rem;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.brand-en {
  margin-top: 0.12rem;
  color: rgba(236, 233, 223, 0.74);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.language-switch {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem;
  border: 1px solid rgba(236, 233, 223, 0.32);
  border-radius: 999px;
}

.language-switch a {
  min-width: 4.75rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  color: var(--logo-ivory);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.language-switch a[aria-current="page"] {
  background: var(--logo-ivory);
  color: var(--brand-navy);
}

.hero {
  padding-block: clamp(3rem, 8vw, 5.5rem) clamp(4.75rem, 10vw, 7rem);
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--amber-light);
  font-size: 0.76rem;
  font-weight: 760;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 50rem;
  margin: 0;
  color: var(--logo-ivory);
  font-size: clamp(2.25rem, 6vw, 4.15rem);
  font-weight: 720;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.policy-date {
  margin: 1rem 0 0;
  color: var(--logo-ivory);
  font-size: 0.9rem;
}

.page-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 3.25rem);
  margin-top: -2.5rem;
  margin-bottom: 4.5rem;
  padding: clamp(2rem, 5vw, 3.25rem);
  border: 1px solid var(--navy-12);
  border-radius: 1.2rem;
  background: var(--linen-light);
  box-shadow: var(--shadow);
}

.toc {
  position: sticky;
  top: 1.5rem;
  align-self: start;
}

.toc-title {
  margin: 0 0 0.85rem;
  color: var(--charcoal-light);
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--linen-dark);
  list-style: none;
}

.toc a {
  display: block;
  margin-left: -1px;
  padding: 0.38rem 0 0.38rem 1rem;
  border-left: 2px solid transparent;
  color: var(--charcoal-light);
  font-size: 0.84rem;
  line-height: 1.45;
  text-decoration: none;
}

.toc a:hover,
.toc a:focus-visible {
  border-left-color: var(--brand-navy);
  color: var(--brand-navy);
}

.policy-intro {
  margin: 0;
  padding: 0 0 2rem;
  border-bottom: 1px solid var(--linen-dark);
  font-size: 1.04rem;
}

article section {
  padding-block: 2rem;
  border-bottom: 1px solid var(--linen-dark);
  scroll-margin-top: 1.5rem;
}

article section:last-of-type {
  border-bottom: 0;
}

article h2,
article h3 {
  color: var(--brand-navy);
  font-weight: 720;
  line-height: 1.35;
}

article h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  letter-spacing: -0.015em;
}

article h3 {
  margin: 1.65rem 0 0.75rem;
  font-size: 1.06rem;
}

article p,
article ul {
  margin-top: 0;
  margin-bottom: 0.9rem;
}

article p:last-child,
article ul:last-child,
article li:last-child {
  margin-bottom: 0;
}

article ul {
  padding-left: 1.35rem;
}

article li {
  margin-bottom: 0.45rem;
  padding-left: 0.2rem;
}

article code {
  padding: 0.08rem 0.3rem;
  border: 1px solid var(--navy-12);
  border-radius: 0.25rem;
  background: var(--parchment);
  color: var(--brand-navy);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.contact-lines {
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--navy-20);
  border-radius: 0.75rem;
  background: var(--parchment);
}

.contact-lines p {
  margin-bottom: 0.35rem;
}

.legal-note {
  color: var(--charcoal-light);
  font-size: 0.9rem;
}

.site-footer {
  background: var(--brand-navy);
  color: rgba(236, 233, 223, 0.78);
}

.footer-inner {
  display: flex;
  min-height: 6rem;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  font-size: 0.8rem;
}

.footer-inner p {
  margin: 0;
}

.footer-inner strong,
.footer-inner a {
  color: var(--logo-ivory);
}

.error-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 2rem;
  background: var(--brand-navy);
  color: var(--logo-ivory);
  text-align: center;
}

.error-card {
  width: min(32rem, 100%);
  padding: clamp(2rem, 8vw, 4rem);
  border: 1px solid rgba(236, 233, 223, 0.2);
  border-radius: 1rem;
}

.error-card img {
  width: 3.25rem;
  height: auto;
}

.error-card h1 {
  margin: 1rem 0 0.5rem;
  font-size: clamp(2rem, 10vw, 4rem);
}

.error-card p {
  margin: 0 0 1.4rem;
  color: rgba(236, 233, 223, 0.82);
}

.error-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.error-links a {
  padding: 0.6rem 0.9rem;
  border: 1px solid rgba(236, 233, 223, 0.42);
  border-radius: 999px;
  color: var(--logo-ivory);
  text-decoration: none;
}

@media (max-width: 52rem) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .toc {
    display: none;
  }
}

@media (max-width: 35rem) {
  .site-nav,
  .hero,
  .page-shell,
  .footer-inner {
    width: min(100% - 1.5rem, 70rem);
  }

  .site-nav {
    min-height: 4.75rem;
    gap: 0.75rem;
  }

  .brand img {
    width: 1.9rem;
    height: 2.35rem;
  }

  .brand-name {
    font-size: 0.9rem;
  }

  .brand-en {
    display: none;
  }

  .language-switch a {
    min-width: auto;
    padding-inline: 0.58rem;
    font-size: 0.72rem;
  }

  .page-shell {
    margin-top: -2rem;
    margin-bottom: 2.75rem;
    padding: 1.65rem 1.25rem 2rem;
    border-radius: 0.9rem;
  }

  article section {
    padding-block: 1.65rem;
  }

  .footer-inner {
    min-height: 7rem;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
  }
}

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

@media print {
  @page {
    margin: 18mm;
  }

  :root {
    --brand-navy: #172b48;
    --charcoal: #202020;
  }

  body {
    background: #ffffff;
    color: var(--charcoal);
    font-family: ui-serif, Georgia, "Times New Roman", serif;
    font-size: 10.5pt;
    line-height: 1.55;
  }

  .skip-link,
  .site-nav,
  .toc,
  .site-footer {
    display: none;
  }

  .site-header {
    background: #ffffff;
    color: var(--charcoal);
  }

  .hero {
    width: auto;
    padding: 0 0 8mm;
  }

  .eyebrow,
  .policy-date,
  .hero h1 {
    color: var(--brand-navy);
  }

  .hero h1 {
    font-size: 24pt;
  }

  .page-shell {
    display: block;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
  }

  .policy-intro {
    padding-bottom: 7mm;
  }

  article section {
    padding-block: 6mm;
    break-inside: avoid-page;
  }

  article h2,
  article h3 {
    break-after: avoid-page;
  }

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

  a[href^="http"]::after,
  a[href^="mailto:"]::after {
    content: " (" attr(href) ")";
    overflow-wrap: anywhere;
    font-size: 0.85em;
  }
}
