:root {
  font-size: 112.5%;
  --paper: #fffdf8;
  --moss: #3f6b4f;
  --gold: #c79a4a;
  --rose: #cf7f73;
  --ocean: #1b4751;
  --sea: #e6efee;
  --ink: #2e3a33;
  --white: #ffffff;
  --muted: #627066;
  --border: rgba(63, 107, 79, 0.12);
  --shadow: 0 1.2rem 2.6rem rgba(27, 71, 81, 0.08);
  --font-serif: "Noto Serif TC", serif;
  --font-sans: "Noto Sans TC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  line-height: 1.85;
}

body,
button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration-color: rgba(199, 154, 74, 0.65);
  text-underline-offset: 0.18em;
}

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

:focus-visible {
  outline: 0.18rem solid var(--gold);
  outline-offset: 0.2rem;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 10;
  transform: translateY(-160%);
  background: var(--ocean);
  color: var(--paper);
  padding: 0.5rem 0.75rem;
}

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

.shell,
.nav-shell,
.footer-grid,
.article-shell {
  width: min(68rem, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255, 253, 248, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(1rem);
}

.nav-shell {
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand,
.nav-menu {
  display: flex;
  align-items: center;
}

.brand {
  gap: 0.7rem;
  text-decoration: none;
}

.brand strong,
h1,
h2,
h3 {
  font-family: var(--font-serif);
  line-height: 1.25;
}

.brand small {
  display: block;
  color: var(--muted);
}

.nav-menu {
  gap: 1rem;
  font-size: 0.9rem;
}

.nav-cta,
.button {
  border: 0;
  border-radius: 999px;
  background: var(--moss);
  color: var(--paper);
  padding: 0.65rem 1rem;
  text-decoration: none;
  cursor: pointer;
}

.nav-toggle {
  display: none;
}

.hero-band,
.page-hero {
  background:
    radial-gradient(120% 80% at 50% 120%, rgba(27, 71, 81, 0.10), transparent 60%),
    linear-gradient(to bottom, transparent, rgba(230, 239, 238, 0.6));
  padding: clamp(3rem, 8vw, 6rem) 0;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(17rem, 0.6fr);
  gap: 2rem;
  align-items: center;
}

.eyebrow,
.bearing {
  margin: 0 0 0.4rem;
  color: var(--moss);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
}

.bearing {
  letter-spacing: 0.32em;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
}

.text-gold {
  color: var(--gold);
}

.muted {
  color: rgba(27, 71, 81, 0.55);
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 8vw, 4.4rem);
}

h2 {
  margin: 0;
  font-size: clamp(1.55rem, 4vw, 2.2rem);
}

.search-panel,
.form-panel,
.topic-card,
.article-card,
.compliance-note,
.channel-panel {
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--white);
  box-shadow: var(--shadow);
}

.search-panel,
.form-panel {
  display: grid;
  gap: 0.8rem;
  padding: 1.2rem;
}

input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  padding: 0.72rem 0.85rem;
  background: var(--paper);
  color: var(--ink);
}

.section {
  padding: clamp(2.5rem, 7vw, 5rem) 0;
}

.section-heading {
  margin-bottom: 1.2rem;
}

.card-grid,
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1rem;
}

.topic-card,
.article-card,
.channel-panel {
  padding: 1.2rem;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.article-card img {
  width: calc(100% + 2.4rem);
  max-width: none;
  height: 8rem;
  object-fit: cover;
  margin: -1.2rem -1.2rem 1rem;
  border-radius: 1rem 1rem 0 0;
}

.topic-card:hover,
.article-card:hover,
.card-lift:hover {
  transform: translateY(-0.18rem);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  padding: 0.45rem 0.75rem;
  cursor: pointer;
}

.chip.is-active {
  background: var(--moss);
  color: var(--paper);
}

.centered {
  text-align: center;
}

.centered .action-row,
.action-row.centered,
.chip-row.centered {
  justify-content: center;
}

.hero-subtitle {
  color: var(--moss);
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 3vw, 1.45rem);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

.button-ghost {
  border: 1px solid rgba(27, 71, 81, 0.35);
  background: transparent;
  color: var(--ocean);
}

.section-sea {
  background: rgba(230, 239, 238, 0.5);
}

.reference-figure img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow);
}

.reveal {
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 650ms ease, transform 650ms ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

.article-shell {
  padding: 2rem 0;
}

.breadcrumb {
  display: flex;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.article-header {
  padding: 2rem 0;
}

.article-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 1rem;
}

.author-mark {
  display: inline-grid;
  width: 2rem;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 999px;
  background: rgba(27, 71, 81, 0.1);
  color: var(--ocean);
  font-family: var(--font-serif);
  font-weight: 700;
}

.credential-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.credential-list span {
  border-radius: 999px;
  background: rgba(27, 71, 81, 0.08);
  color: var(--ocean);
  font-size: 0.74rem;
  padding: 0.12rem 0.45rem;
}

.article-cover {
  margin: 0 0 2rem;
}

.article-cover img,
.article-cover-placeholder,
.card-cover-placeholder {
  border-radius: 1rem;
  background: rgba(27, 71, 81, 0.08);
}

.article-cover img,
.article-cover-placeholder {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
}

.article-cover-placeholder,
.card-cover-placeholder {
  display: grid;
  place-items: center;
  color: rgba(27, 71, 81, 0.42);
  font-family: var(--font-serif);
}

.card-cover-placeholder {
  min-height: 7.5rem;
  margin: -1.2rem -1.2rem 1rem;
  border-radius: 1rem 1rem 0 0;
}

.article-layout {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 2rem;
}

.toc {
  position: sticky;
  top: 6rem;
  align-self: start;
  border-left: 0.2rem solid var(--gold);
  padding-left: 1rem;
}

.toc h2,
.toc-toggle {
  font-size: 1rem;
}

.toc-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  border: 0;
  background: transparent;
  color: var(--ocean);
  font-family: var(--font-serif);
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}

.toc a {
  display: block;
  border-left: 0.12rem solid transparent;
  color: rgba(46, 58, 51, 0.7);
  font-size: 0.9rem;
  padding: 0.25rem 0 0.25rem 0.65rem;
}

.article-content {
  font-size: 1.05rem;
}

.article-content p,
.article-content li {
  line-height: 1.95;
}

.article-content p {
  margin: 0 0 1.1rem;
}

.article-content h2 {
  color: var(--ocean);
  margin-top: 2rem;
}

.article-content h3 {
  color: var(--moss);
}

.compliance-note {
  margin-top: 2rem;
  padding: 1rem;
}

.cta-band {
  border-radius: 1rem;
  background: var(--ocean);
  color: var(--paper);
  padding: clamp(1.4rem, 4vw, 2.2rem);
}

.cta-band h2 {
  color: var(--paper);
}

.cta-band p {
  color: rgba(255, 253, 248, 0.84);
}

.cta-band .button {
  background: var(--paper);
  color: var(--ocean);
}

.cta-band .button-ghost {
  border-color: rgba(255, 253, 248, 0.45);
  background: transparent;
  color: var(--paper);
}

.fine-print,
.article-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.article-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding-top: 0;
}

.article-pager a {
  color: inherit;
  display: grid;
  gap: 0.4rem;
}

.align-right {
  text-align: right;
}

.success-box {
  display: grid;
  gap: 0.6rem;
  justify-items: center;
  border-radius: 1rem;
  background: rgba(63, 107, 79, 0.08);
  padding: 1.2rem;
  text-align: center;
}

.channel-hero {
  background: var(--ocean);
  color: var(--paper);
}

.channel-hero h1,
.channel-hero p {
  color: inherit;
}

.channel-detective {
  background:
    radial-gradient(circle at 80% 10%, rgba(199, 154, 74, 0.16), transparent 28rem),
    linear-gradient(135deg, var(--ink), var(--ocean));
}

.reading-progress {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 7;
  width: 0;
  height: 0.22rem;
  background: var(--gold);
}

.site-footer {
  background: var(--ocean);
  color: var(--paper);
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
}

.footer-note {
  width: min(68rem, calc(100% - 2rem));
  margin: 2rem auto 0;
  color: rgba(255, 253, 248, 0.76);
}

.empty-state,
.success-text {
  color: var(--muted);
}

@media (max-width: 52rem) {
  .nav-toggle {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--white);
    padding: 0.5rem 0.8rem;
  }

  .nav-menu {
    position: absolute;
    inset: 4.5rem 1rem auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--paper);
    padding: 1rem;
    box-shadow: var(--shadow);
  }

  .nav-menu.is-open {
    display: flex;
  }

  .hero-layout,
  .article-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
