:root {
  --paper: #f5f0e6;
  --paper-soft: #fbf7ef;
  --ink: #151411;
  --muted: #6d675b;
  --line: rgba(21, 20, 17, 0.14);
  --line-strong: rgba(21, 20, 17, 0.24);
  --green: #0d7d68;
  --green-dark: #075947;
  --amber: #c87d2e;
  --night: #171917;
  --night-soft: #22251f;
  --white: #fffdf8;
  --font-body: "Noto Sans TC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Noto Serif TC", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(21, 20, 17, 0.035) 1px, transparent 1px) 0 0 / 100% 32px,
    radial-gradient(circle at 80% 0%, rgba(13, 125, 104, 0.08), transparent 36rem),
    var(--paper);
  font-family: var(--font-body);
  line-height: 1.72;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

body.nav-open {
  overflow: hidden;
}

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

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

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  width: 100%;
  height: 4px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left center;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 240, 230, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.header-shell,
.content-section,
.footer-grid,
.footer-bottom,
.home-hero,
.pillar-strip,
.archive-hero,
.article-shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

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

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

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--paper-soft);
  background: var(--ink);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-weight: 700;
}

.brand-copy {
  display: grid;
  line-height: 1.1;
}

.brand-copy strong {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 900;
}

.brand-copy span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.site-nav a,
.search-button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.site-nav a:hover,
.search-button:hover {
  color: var(--green);
}

.search-button {
  padding: 9px 14px;
  color: var(--paper-soft);
  background: var(--ink);
  border-radius: 3px;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--paper-soft);
  border-radius: 3px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: var(--ink);
}

.site-main {
  min-height: 65vh;
}

.home-hero {
  padding: 64px 0 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.78fr);
  align-items: stretch;
  gap: 34px;
}

.section-kicker,
.eyebrow,
.review-kicker {
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 6vw, 72px) 0;
}

.hero-copy h1 {
  max-width: 860px;
  margin: 16px 0 24px;
  font-family: var(--font-serif);
  font-size: clamp(3.1rem, 7vw, 6.7rem);
  font-weight: 900;
  line-height: 1.06;
  overflow-wrap: anywhere;
}

.hero-copy p {
  max-width: 690px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.03rem, 1.7vw, 1.28rem);
  font-weight: 500;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  font-weight: 900;
}

.button.primary {
  color: var(--paper-soft);
  background: var(--ink);
}

.button.secondary {
  background: transparent;
}

.hero-panel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  background: var(--paper-soft);
}

.hero-panel-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.lead-story {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.lead-story img {
  width: 100%;
  aspect-ratio: 1.42 / 1;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

.lead-story-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 26px;
}

.lead-story h2 {
  margin: 10px 0 14px;
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3vw, 2.45rem);
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.lead-story p {
  margin: 0;
  color: var(--muted);
}

.text-link {
  display: inline-flex;
  align-items: center;
  width: max-content;
  margin-top: auto;
  padding-top: 24px;
  color: var(--green-dark);
  font-weight: 900;
}

.pillar-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
  border: 1px solid var(--line-strong);
  background: var(--paper-soft);
}

.pillar-strip a {
  min-height: 150px;
  padding: 20px;
  border-right: 1px solid var(--line);
}

.pillar-strip a:last-child {
  border-right: 0;
}

.pillar-strip span {
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.pillar-strip strong {
  display: block;
  margin-top: 18px;
  font-family: var(--font-serif);
  font-size: 1.45rem;
  line-height: 1.2;
}

.pillar-strip em {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-style: normal;
  font-size: 0.92rem;
}

.content-section {
  padding: 72px 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 18px;
}

.section-heading h2 {
  max-width: 760px;
  margin: 8px 0 0;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.6vw, 3.75rem);
  line-height: 1.1;
}

.section-heading a {
  flex: 0 0 auto;
  color: var(--green-dark);
  font-weight: 900;
}

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

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

.post-card,
.review-card {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--paper-soft);
}

.post-card {
  display: flex;
  flex-direction: column;
}

.post-card-media {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.post-card-media img,
.image-fallback {
  width: 100%;
  aspect-ratio: 1.55 / 1;
  object-fit: cover;
}

.image-fallback {
  display: grid;
  place-items: center;
  padding: 22px;
  color: var(--paper-soft);
  background:
    linear-gradient(135deg, rgba(13, 125, 104, 0.9), rgba(21, 20, 17, 0.95)),
    var(--green-dark);
  font-family: var(--font-mono);
  font-weight: 700;
  text-align: center;
}

.post-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px;
}

.eyebrow-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.post-card h3,
.review-card h3,
.archive-list h3 {
  margin: 12px 0 10px;
  font-family: var(--font-serif);
  font-size: 1.44rem;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.post-card p,
.review-card p,
.archive-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.post-card footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 22px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.split-section {
  padding-top: 42px;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}

.review-card-link {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  padding: 22px;
}

.review-meta {
  margin-top: auto;
  padding-top: 26px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.metric-panel {
  padding: 26px;
  color: var(--paper-soft);
  background: var(--night);
}

.metric-panel h3 {
  margin: 14px 0 20px;
  font-family: var(--font-serif);
  font-size: 2rem;
  line-height: 1.18;
}

.metric-panel ul {
  display: grid;
  gap: 18px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.metric-panel li {
  display: grid;
  gap: 4px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 253, 248, 0.18);
}

.metric-panel strong {
  color: #f1c27d;
}

.metric-panel span:not(.section-kicker) {
  color: rgba(255, 253, 248, 0.72);
}

.dark-section {
  width: 100%;
  max-width: none;
  padding-inline: max(20px, calc((100vw - 1180px) / 2));
  color: var(--paper-soft);
  background: var(--night);
}

.dark-section .section-heading {
  border-bottom-color: rgba(255, 253, 248, 0.18);
}

.dark-section .post-card {
  color: var(--ink);
}

.dark-section .section-heading a {
  color: #f1c27d;
}

.archive-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.archive-list article {
  display: grid;
  grid-template-columns: 150px minmax(0, 0.72fr) minmax(260px, 1fr);
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.archive-list time {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.archive-list h3 {
  margin: 0;
}

.article-shell,
.archive-hero {
  padding: 58px 0 0;
}

.article-hero {
  width: min(900px, 100%);
}

.article-meta,
.article-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.article-hero h1,
.archive-hero h1 {
  margin: 18px 0 18px;
  font-family: var(--font-serif);
  font-size: clamp(2.75rem, 6vw, 5.7rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.article-hero p,
.archive-hero p {
  max-width: 840px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 1.18rem;
  font-weight: 500;
}

.article-feature {
  margin: 38px 0 0;
}

.article-feature img {
  width: 100%;
  max-height: 620px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.article-feature figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.article-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 760px);
  gap: 48px;
  align-items: start;
  margin-top: 48px;
}

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

.article-toc {
  position: sticky;
  top: 104px;
  padding: 18px 0;
  border-top: 1px solid var(--line-strong);
  color: var(--muted);
}

.article-toc.is-empty {
  display: none;
}

.article-toc span {
  display: block;
  margin-bottom: 12px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.toc-link {
  display: block;
  padding: 7px 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.toc-link.child {
  padding-left: 14px;
}

.toc-link:hover {
  color: var(--green);
}

.article-content {
  min-width: 0;
  font-size: 1.08rem;
}

.article-content > *:first-child {
  margin-top: 0;
}

.article-content h2,
.article-content h3,
.article-content h4 {
  margin: 2.2em 0 0.7em;
  font-family: var(--font-serif);
  line-height: 1.25;
}

.article-content h2 {
  font-size: 2.25rem;
}

.article-content h3 {
  font-size: 1.55rem;
}

.article-content p,
.article-content ul,
.article-content ol {
  margin: 0 0 1.28em;
}

.article-content a {
  color: var(--green-dark);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.article-content blockquote {
  margin: 2em 0;
  padding: 0 0 0 22px;
  border-left: 4px solid var(--green);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.35rem;
  line-height: 1.6;
}

.article-content pre,
.article-content code {
  font-family: var(--font-mono);
}

.article-content pre {
  overflow: auto;
  padding: 18px;
  background: var(--night);
  color: var(--paper-soft);
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.article-content th,
.article-content td {
  padding: 12px;
  border: 1px solid var(--line);
  text-align: left;
}

.article-content .kg-image-card img,
.article-content .kg-gallery-image img {
  border: 1px solid var(--line);
}

.article-content .kg-width-wide {
  width: min(1060px, calc(100vw - 40px));
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.article-content .kg-width-full {
  width: 100vw;
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.article-content .kg-width-full img {
  width: 100%;
}

.related-section {
  padding-top: 52px;
}

.archive-section {
  padding-top: 42px;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 34px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.site-footer {
  margin-top: 78px;
  padding: 48px 0 28px;
  color: rgba(255, 253, 248, 0.78);
  background: var(--night);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(180px, 0.55fr));
  gap: 42px;
}

.footer-brand {
  color: var(--paper-soft);
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 900;
}

.footer-grid p {
  max-width: 520px;
  margin: 14px 0 0;
}

.footer-grid h2 {
  margin: 0 0 12px;
  color: var(--paper-soft);
  font-size: 0.9rem;
}

.footer-grid section:not(:first-child) {
  display: grid;
  align-content: start;
  gap: 8px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 42px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 253, 248, 0.18);
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

@media (max-width: 1040px) {
  .hero-grid,
  .split-grid,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    min-height: auto;
  }

  .article-toc {
    display: none;
  }

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

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

  .pillar-strip a:nth-child(2) {
    border-right: 0;
  }

  .pillar-strip a:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .archive-list article {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .archive-list p {
    grid-column: 2;
  }
}

@media (max-width: 760px) {
  .header-shell,
  .content-section,
  .footer-grid,
  .footer-bottom,
  .home-hero,
  .pillar-strip,
  .archive-hero,
  .article-shell {
    width: min(calc(100% - 28px), 1180px);
  }

  .header-shell {
    min-height: 66px;
  }

  .brand-copy span {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: fixed;
    inset: 66px 14px auto 14px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 18px;
    border: 1px solid var(--line);
    background: var(--paper-soft);
    box-shadow: 0 24px 60px rgba(21, 20, 17, 0.18);
  }

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

  .site-nav a,
  .search-button {
    width: 100%;
    padding: 12px 0;
    text-align: left;
  }

  .search-button {
    padding-inline: 12px;
    text-align: center;
  }

  .home-hero {
    padding-top: 38px;
  }

  .hero-copy h1 {
    width: 100%;
    max-width: 340px;
    font-size: clamp(2rem, 9.3vw, 2.3rem);
    line-height: 1.12;
    line-break: anywhere;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .hero-copy p {
    max-width: 342px;
  }

  .hero-panel-top {
    flex-wrap: wrap;
    font-size: 0.7rem;
  }

  .hero-panel {
    margin-top: 4px;
  }

  .lead-story-body {
    padding: 20px;
  }

  .lead-story h2,
  .post-card h3,
  .review-card h3,
  .archive-list h3 {
    font-size: 1.22rem;
    line-height: 1.28;
    line-break: anywhere;
  }

  .pillar-strip,
  .post-grid,
  .post-grid.compact,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .pillar-strip a,
  .pillar-strip a:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .pillar-strip a:last-child {
    border-bottom: 0;
  }

  .content-section {
    padding: 48px 0;
  }

  .section-heading {
    display: block;
  }

  .section-heading a {
    display: inline-block;
    margin-top: 14px;
  }

  .archive-list article {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .archive-list p {
    grid-column: auto;
  }

  .article-hero h1,
  .archive-hero h1 {
    font-size: clamp(2.1rem, 12vw, 3.35rem);
    line-break: anywhere;
  }

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

  .article-content h2 {
    font-size: 1.8rem;
  }

  .footer-bottom {
    flex-direction: column;
  }
}
