:root {
  --color-ink: #2e2923;
  --color-muted: #6f665b;
  --color-bg: #f8f5ef;
  --color-surface: #fffdf8;
  --color-stone: #e9e1d3;
  --color-stone-light: #f1ebe2;
  --color-earth: #7b6046;
  --color-earth-dark: #4f3f31;
  --color-gold: #a77a36;
  --shadow-soft: 0 20px 50px rgba(70, 55, 38, 0.12);
  --radius: 8px;
  --container: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--color-ink);
  background: var(--color-bg);
  font-family: "Noto Serif TC", "Source Han Serif TC", "PingFang TC", "Microsoft JhengHei", serif;
  line-height: 1.85;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
}

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

.narrow {
  max-width: 820px;
}

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 30;
  padding: 8px 14px;
  color: var(--color-surface);
  background: var(--color-earth-dark);
  border-radius: 4px;
  transform: translateY(-140%);
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(248, 245, 239, 0.94);
  border-bottom: 1px solid rgba(123, 96, 70, 0.16);
  backdrop-filter: blur(12px);
}

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

.site-title {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
  color: var(--color-earth-dark);
  white-space: nowrap;
}

.site-logo {
  width: 92px;
  height: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.95rem;
}

.site-nav a,
.back-nav a,
.bottom-nav a,
.text-link {
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.site-nav a {
  padding: 8px 13px;
  border-bottom: 2px solid transparent;
  color: var(--color-muted);
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  color: var(--color-earth-dark);
  border-color: var(--color-gold);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(123, 96, 70, 0.24);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-earth-dark);
  cursor: pointer;
}

.nav-toggle-line {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: currentColor;
}

.hero {
  position: relative;
  min-height: 74vh;
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #fffdf8;
}

.hero-image,
.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(40, 33, 26, 0.72), rgba(40, 33, 26, 0.36) 58%, rgba(40, 33, 26, 0.18)),
    linear-gradient(0deg, rgba(40, 33, 26, 0.44), rgba(40, 33, 26, 0.06));
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 0 0 88px;
}

.eyebrow,
.section-kicker,
.topic-number {
  margin: 0 0 10px;
  color: var(--color-gold);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0;
}

.hero .eyebrow {
  color: #e8c982;
}

.hero h1,
.page-hero h1 {
  margin: 0;
  line-height: 1.18;
  font-size: clamp(2.55rem, 7vw, 5.4rem);
  font-weight: 700;
  letter-spacing: 0;
}

.hero p:last-child,
.page-hero > .container > p:last-child {
  max-width: 720px;
  margin: 22px 0 0;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: rgba(255, 253, 248, 0.9);
}

.home-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: 26px;
  padding: 9px 18px;
  color: var(--color-earth-dark);
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid rgba(232, 201, 130, 0.68);
  border-radius: 4px;
  font-weight: 700;
  text-decoration: none;
}

.home-link-button:hover,
.home-link-button:focus-visible {
  color: var(--color-surface);
  background: var(--color-earth-dark);
}

.section {
  padding: 88px 0;
}

.intro-section {
  background: var(--color-surface);
}

.section h2 {
  margin: 0 0 20px;
  color: var(--color-earth-dark);
  line-height: 1.35;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  letter-spacing: 0;
}

.section p {
  margin: 0;
}

.section p + p,
.article-content p + p {
  margin-top: 1.25em;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 36px;
}

.topic-section {
  background:
    linear-gradient(180deg, var(--color-bg), #f0e9dd);
}

.topic-grid {
  display: grid;
  gap: 22px;
}

.topic-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  background: rgba(255, 253, 248, 0.8);
  border: 1px solid rgba(123, 96, 70, 0.14);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.topic-card.with-image {
  grid-template-columns: minmax(260px, 0.48fr) minmax(0, 1fr);
}

.topic-card figure {
  margin: 0;
  min-height: 100%;
  background: var(--color-stone-light);
}

.topic-card img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
}

.topic-card figcaption,
.article-main-figure figcaption,
.inline-figure figcaption {
  color: var(--color-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.topic-card figcaption {
  padding: 10px 16px 14px;
}

.topic-text {
  padding: 30px;
}

.topic-text h3 {
  margin: 0 0 14px;
  color: var(--color-earth-dark);
  font-size: clamp(1.45rem, 2.5vw, 1.9rem);
  line-height: 1.35;
}

.text-link {
  display: inline-flex;
  align-items: center;
  margin-top: 22px;
  padding-bottom: 3px;
  color: var(--color-earth-dark);
  border-bottom: 1px solid var(--color-gold);
  font-weight: 700;
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--color-gold);
}

.significance-section {
  background: var(--color-earth-dark);
  color: rgba(255, 253, 248, 0.86);
}

.significance-section h2 {
  color: var(--color-surface);
}

.page-hero {
  padding: 48px 0 72px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.86), rgba(248, 245, 239, 1)),
    linear-gradient(90deg, rgba(167, 122, 54, 0.16), rgba(123, 96, 70, 0.06));
  border-bottom: 1px solid rgba(123, 96, 70, 0.12);
}

.page-hero h1 {
  max-width: 760px;
  color: var(--color-earth-dark);
}

.page-hero > .container > p:last-child {
  color: var(--color-muted);
}

.back-nav,
.bottom-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.back-nav {
  margin-bottom: 52px;
}

.bottom-nav {
  padding-bottom: 78px;
}

.back-nav a,
.bottom-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid rgba(123, 96, 70, 0.24);
  border-radius: 4px;
  color: var(--color-earth-dark);
  background: rgba(255, 253, 248, 0.72);
  font-weight: 700;
}

.back-nav a:hover,
.back-nav a:focus-visible,
.bottom-nav a:hover,
.bottom-nav a:focus-visible {
  border-color: var(--color-gold);
  background: var(--color-surface);
}

.reserved-link {
  color: var(--color-muted) !important;
  border-style: dashed !important;
}

.article-section {
  padding-top: 64px;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.42fr) minmax(0, 0.58fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.article-layout-portrait {
  grid-template-columns: minmax(220px, 0.34fr) minmax(0, 0.66fr);
}

.article-main-figure {
  position: sticky;
  top: 100px;
  margin: 0;
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid rgba(123, 96, 70, 0.14);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.article-main-figure img {
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  background: var(--color-stone-light);
}

.portrait-figure img {
  max-height: 620px;
}

.article-main-figure figcaption {
  margin-top: 12px;
}

.article-content {
  max-width: 760px;
  font-size: 1.05rem;
}

.article-content p {
  color: #393229;
}

.inline-figure {
  margin: 36px 0;
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid rgba(123, 96, 70, 0.14);
  border-radius: var(--radius);
}

.inline-figure img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  background: var(--color-stone-light);
}

.inline-figure figcaption {
  margin-top: 12px;
}

.closing-note {
  margin-top: 42px;
  padding: 28px;
  background: #f0e9dd;
  border-left: 4px solid var(--color-gold);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.closing-note h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
}

.site-footer {
  padding: 46px 0;
  color: rgba(255, 253, 248, 0.82);
  background: #30271f;
}

.footer-inner {
  display: grid;
  gap: 18px;
}

.footer-inner p {
  margin: 0;
  max-width: 880px;
}

.footer-link {
  width: fit-content;
  color: #fffdf8;
  font-weight: 700;
  text-decoration-color: rgba(255, 253, 248, 0.32);
  text-underline-offset: 5px;
}

.footer-meta {
  color: rgba(255, 253, 248, 0.62);
  font-size: 0.92rem;
}

@media (max-width: 860px) {
  .header-inner {
    min-height: 64px;
  }

  .nav-toggle {
    display: inline-block;
  }

  .site-nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 10px 20px 18px;
    background: rgba(248, 245, 239, 0.98);
    border-bottom: 1px solid rgba(123, 96, 70, 0.16);
  }

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

  .site-nav a {
    padding: 11px 0;
  }

  .hero {
    min-height: 68vh;
  }

  .hero-content {
    padding-bottom: 64px;
  }

  .section {
    padding: 64px 0;
  }

  .topic-card.with-image,
  .article-layout,
  .article-layout-portrait {
    grid-template-columns: 1fr;
  }

  .topic-card img {
    max-height: 340px;
  }

  .article-main-figure {
    position: static;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 28px, var(--container));
  }

  .site-title {
    gap: 8px;
    font-size: 0.98rem;
  }

  .site-logo {
    width: 78px;
  }

  .hero {
    min-height: 620px;
  }

  .hero-overlay {
    background:
      linear-gradient(0deg, rgba(40, 33, 26, 0.72), rgba(40, 33, 26, 0.22)),
      linear-gradient(90deg, rgba(40, 33, 26, 0.64), rgba(40, 33, 26, 0.28));
  }

  .hero-content {
    padding-bottom: 48px;
  }

  .hero h1,
  .page-hero h1 {
    font-size: 2.5rem;
  }

  .topic-text,
  .closing-note {
    padding: 22px;
  }

  .page-hero {
    padding: 32px 0 56px;
  }

  .back-nav {
    margin-bottom: 40px;
  }

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