:root {
  --app-background: #F5F3EF;
  --canvas-background: #EAE6DF;
  --surface: #FFFFFF;
  --elevated: #FBFAF7;
  --subtle: #F1ECE4;
  --dark-surface: #2A2521;
  --text-primary: #2A2521;
  --text-secondary: #6E665B;
  --text-tertiary: #9C9487;
  --text-on-brand: #FFFFFF;
  --border: #E9E3DA;
  --border-subtle: #F1ECE4;
  --brand-primary: #B0533C;
  --brand-primary-surface: #F3E3DC;
  --brand-secondary: #6E8E72;
  --brand-secondary-surface: #DEEBDF;
  --sage-ink: #3C6E48;
  --shadow-card: 0 4px 14px rgba(42, 37, 33, 0.06);
  --shadow-lift: 0 20px 50px rgba(42, 37, 33, 0.12);
  --shadow-button: 0 2px 6px rgba(176, 83, 60, 0.32);
  --container: 1120px;
  --content: 720px;
  --gh-font-heading: ui-rounded, "SF Pro Rounded", "PingFang SC", "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK SC", "Noto Sans CJK TC", "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --gh-font-body: ui-rounded, "SF Pro Rounded", "PingFang SC", "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK SC", "Noto Sans CJK TC", "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--app-background);
  color: var(--text-primary);
  font-family: var(--gh-font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; }
.site-shell { min-height: 100vh; }
.container { width: min(var(--container), calc(100% - 32px)); margin-inline: auto; }
.container-wide { width: min(1040px, calc(100% - 32px)); margin-inline: auto; }
.container-narrow { width: min(var(--content), calc(100% - 32px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

h1, h2, h3, p { margin-top: 0; overflow-wrap: anywhere; }
h1, h2, h3 { font-family: var(--gh-font-heading); line-height: 1.12; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.45rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.25rem; }

.eyebrow {
  margin-bottom: 10px;
  color: var(--brand-primary);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(245, 243, 239, 0.92);
  backdrop-filter: blur(16px);
}

.site-nav {
  min-height: 76px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
}

.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-size: 1.16rem; font-weight: 850; white-space: nowrap; }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--surface); object-fit: cover; box-shadow: var(--shadow-button); }
.nav-menu { display: flex; align-items: center; justify-content: center; gap: 26px; }
.nav-menu a, .product-link { color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; font-weight: 750; }
.nav-menu a:hover, .product-link:hover { color: var(--brand-primary); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.product-link { display: inline-flex; align-items: center; gap: 5px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.nav-toggle { display: none; width: 42px; height: 42px; border: 0; background: transparent; padding: 10px; }
.nav-toggle > span:not(.sr-only) { display: block; height: 2px; margin: 4px 0; border-radius: 2px; background: currentColor; }

.language-picker { position: relative; z-index: 40; color: var(--elevated); font-family: inherit; }
.language-picker summary {
  min-height: 44px;
  min-width: 142px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid rgba(245, 243, 239, 0.14);
  border-radius: 999px;
  background: rgba(42, 37, 33, 0.96);
  box-shadow: var(--shadow-card);
  color: var(--elevated);
  cursor: pointer;
  list-style: none;
  font-size: 0.86rem;
  font-weight: 750;
}
.language-picker summary::-webkit-details-marker { display: none; }
.language-picker summary::after { content: ""; width: 6px; height: 6px; margin-left: auto; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform 160ms ease; }
.language-picker[open] summary::after { transform: rotate(-135deg) translate(-2px, -1px); }
.language-picker summary:focus-visible, .language-menu a:focus-visible, .nav-toggle:focus-visible, a:focus-visible { outline: 3px solid rgba(176, 83, 60, 0.35); outline-offset: 3px; }
.language-globe { width: 20px; height: 20px; display: grid; place-items: center; color: rgba(245, 243, 239, 0.76); }
.language-globe svg { width: 20px; height: 20px; }
.language-flag { width: 22px; text-align: center; font-family: "Apple Color Emoji", "Segoe UI Emoji", sans-serif; font-size: 1.15rem; line-height: 1; }
.language-menu {
  display: grid;
  gap: 2px;
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: 220px;
  padding: 9px;
  border: 1px solid rgba(245, 243, 239, 0.14);
  border-radius: 22px;
  background: #211c18;
  box-shadow: var(--shadow-lift);
}
.language-menu a { min-height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border-radius: 15px; color: rgba(245, 243, 239, 0.84); text-decoration: none; font-size: 0.96rem; font-weight: 700; }
.language-menu a:hover, .language-menu a[aria-current="true"] { background: rgba(255, 255, 255, 0.08); color: var(--elevated); }
.language-menu a[aria-current="true"] { font-weight: 850; }

.journal-hero { display: grid; grid-template-columns: 0.88fr 1.12fr; gap: 54px; align-items: center; padding-block: 84px 72px; }
.journal-intro h1 { max-width: 590px; margin-bottom: 20px; font-size: clamp(2.4rem, 5vw, 3.9rem); }
.hero-copy { max-width: 540px; margin-bottom: 0; color: var(--text-secondary); font-size: 1.08rem; }

.featured-card, .article-card { overflow: hidden; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-card); }
.featured-card { border-radius: 20px; box-shadow: var(--shadow-lift); }
.featured-card a, .article-card-link { display: block; text-decoration: none; }
.featured-media { margin: 0; aspect-ratio: 16 / 9; overflow: hidden; background: var(--brand-secondary-surface); }
.featured-media img, .article-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 220ms ease; }
.featured-card:hover img, .article-card:hover img { transform: scale(1.025); }
.featured-fallback, .article-card-fallback { position: relative; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-secondary-surface), #F1DFD1 55%, var(--brand-primary-surface)); }
.featured-fallback::before, .article-card-fallback::before { content: ""; width: 55%; height: 54%; border-radius: 18px; background: rgba(255, 255, 255, 0.78); box-shadow: -70px 32px 0 -24px rgba(110, 142, 114, 0.42); }
.featured-fallback span, .article-card-fallback span { position: absolute; font-weight: 850; }
.featured-body { padding: 24px; }
.featured-body h2 { margin-bottom: 12px; font-size: clamp(1.45rem, 3vw, 2rem); }
.featured-body p:not(.eyebrow) { color: var(--text-secondary); }
.article-meta { color: var(--text-tertiary); font-size: 0.78rem; }

.latest-section, .related-section { padding-block: 72px 88px; border-top: 1px solid var(--border-subtle); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.section-heading h2 { margin: 0; }
.article-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.article-card { border-radius: 15px; }
.article-card-media { margin: 0; aspect-ratio: 4 / 2.6; overflow: hidden; background: var(--subtle); }
.article-card-body { padding: 18px; }
.article-card-body h3 { margin-bottom: 10px; }
.article-card-body p { display: -webkit-box; margin-bottom: 14px; overflow: hidden; color: var(--text-secondary); font-size: 0.92rem; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.empty-state { grid-column: 1 / -1; padding: 44px; border: 1px dashed var(--border); border-radius: 16px; text-align: center; color: var(--text-secondary); }

.collection-page { padding-block: 70px 96px; }
.collection-header { max-width: 720px; margin-bottom: 36px; }
.collection-header h1 { margin-bottom: 14px; }
.collection-header p:not(.eyebrow) { color: var(--text-secondary); font-size: 1.05rem; }
.pagination-wrap { display: flex; justify-content: center; margin-top: 38px; }
.pagination { display: flex; gap: 18px; color: var(--text-secondary); font-size: 0.9rem; }
.pagination a { color: var(--brand-primary); text-decoration: none; font-weight: 750; }

.post { padding-top: 74px; }
.post-header { text-align: center; }
.post-header h1 { margin-bottom: 18px; }
.post-excerpt { margin: 0 auto 18px; color: var(--text-secondary); font-size: 1.18rem; line-height: 1.65; }
.post-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; color: var(--text-tertiary); font-size: 0.84rem; }
.post-feature { margin-top: 38px; overflow: hidden; border-radius: 22px; box-shadow: var(--shadow-lift); }
.post-feature img { width: 100%; max-height: 680px; object-fit: cover; }
.post-feature figcaption { padding: 10px 16px; background: var(--surface); color: var(--text-tertiary); text-align: center; font-size: 0.8rem; }
.post-feature-fallback { position: relative; min-height: 410px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-secondary-surface), #F1DFD1 55%, var(--brand-primary-surface)); }
.post-feature-fallback::before { content: ""; width: min(420px, 58%); height: 210px; border-radius: 30px; background: rgba(255, 255, 255, 0.8); box-shadow: -110px 45px 0 -34px rgba(110, 142, 114, 0.42); }
.post-feature-fallback span { position: absolute; font-size: 1.5rem; font-weight: 850; }

.post-content {
  --gap: 4vw;
  --main: min(var(--content), 100% - var(--gap) * 2);
  --wide: minmax(0, calc((1040px - var(--content)) / 2));
  --full: minmax(var(--gap), 1fr);
  display: grid;
  grid-template-columns: [full-start] var(--full) [wide-start] var(--wide) [main-start] var(--main) [main-end] var(--wide) [wide-end] var(--full) [full-end];
  margin-top: 54px;
}
.post-content > * { grid-column: main-start / main-end; }
.post-content > .kg-width-wide { grid-column: wide-start / wide-end; }
.post-content > .kg-width-full { grid-column: full-start / full-end; }
.post-content > * + * { margin-top: 1.75rem; }
.post-content p, .post-content li { font-family: Georgia, "Times New Roman", "Songti SC", "Songti TC", serif; font-size: 1.08rem; line-height: 1.82; }
.post-content h2 { margin-top: 3.2rem; }
.post-content h3 { margin-top: 2.4rem; }
.post-content a { color: var(--brand-primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.post-content blockquote { margin-inline: 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--brand-primary); color: var(--text-secondary); font-style: italic; }
.post-content pre { overflow-x: auto; padding: 18px; border-radius: 12px; background: var(--dark-surface); color: var(--elevated); }
.post-content :not(pre) > code { padding: 0.15em 0.36em; border: 1px solid var(--border); border-radius: 5px; background: var(--subtle); font-size: 0.9em; }
.post-content img { height: auto; margin-inline: auto; border-radius: 12px; }
.post-content figcaption { margin-top: 8px; color: var(--text-tertiary); text-align: center; font-size: 0.82rem; }
.post-content table { width: 100%; border-collapse: collapse; }
.post-content th, .post-content td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.post-content .kg-callout-card { padding: 20px; border-radius: 14px; background: var(--brand-secondary-surface); color: var(--sage-ink); }
.post-content .kg-button-card a.kg-btn { display: inline-flex; min-height: 48px; align-items: center; padding: 0 20px; border-radius: 9px; background: var(--brand-primary); color: var(--text-on-brand); text-decoration: none; font-family: inherit; font-weight: 800; box-shadow: var(--shadow-button); }
.post-content .kg-gallery-container { display: flex; flex-direction: column; gap: 8px; }
.post-content .kg-gallery-row { display: flex; gap: 8px; }
.post-content .kg-gallery-image { flex: 1; }
.post-content .kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; }
.post-content .kg-bookmark-card a { display: grid; grid-template-columns: 1fr minmax(130px, 32%); overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: inherit; text-decoration: none; }
.post-content .kg-bookmark-content { padding: 18px; }
.post-content .kg-bookmark-thumbnail img { width: 100%; height: 100%; border-radius: 0; object-fit: cover; }
.post-content iframe { width: 100%; max-width: 100%; aspect-ratio: 16 / 9; border: 0; }

.post-footer { padding-block: 54px 86px; }
.product-cta { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px; border-radius: 18px; background: var(--dark-surface); color: var(--elevated); }
.product-cta h2 { max-width: 440px; margin: 0; font-size: 1.55rem; }
.product-cta a, .button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 19px; border-radius: 9px; background: var(--brand-primary); color: var(--text-on-brand); box-shadow: var(--shadow-button); text-decoration: none; font-weight: 850; white-space: nowrap; }
.product-cta svg { width: 18px; height: 18px; }
.related-section { padding-top: 58px; }

.page, .error-page { padding-block: 74px 100px; }
.page-header { margin-bottom: 42px; }
.page-header p:not(.eyebrow), .error-page p { color: var(--text-secondary); }
.error-page { min-height: 62vh; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }

.site-footer { padding-block: 54px 28px; background: var(--dark-surface); color: var(--elevated); }
.footer-inner { display: flex; justify-content: space-between; gap: 40px; }
.footer-brand { font-size: 1.15rem; font-weight: 850; text-decoration: none; }
.footer-inner p { max-width: 470px; margin-top: 8px; color: rgba(245, 243, 239, 0.68); }
.footer-links { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; }
.footer-links a { color: rgba(245, 243, 239, 0.82); text-decoration: none; }
.footer-links a:hover { color: #F0B3A1; }
.footer-legal { margin-top: 30px; padding-top: 18px; border-top: 1px solid rgba(245, 243, 239, 0.14); color: rgba(245, 243, 239, 0.5); font-size: 0.76rem; }
.footer-legal a { color: inherit; }
.footer-legal a:hover { color: #F0B3A1; }

@media (max-width: 960px) {
  .site-nav { grid-template-columns: auto auto 1fr; gap: 12px; }
  .nav-toggle { display: block; grid-column: 2; }
  .nav-menu { display: none; position: absolute; top: 68px; left: 16px; right: 16px; flex-direction: column; align-items: stretch; gap: 0; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lift); }
  .nav-menu.is-open { display: flex; }
  .nav-menu a { padding: 11px 12px; border-radius: 8px; }
  .nav-actions { justify-content: flex-end; }
  .journal-hero { grid-template-columns: 1fr; gap: 36px; padding-block: 54px; }
  .journal-intro { max-width: 720px; }
  .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .site-nav { min-height: 64px; }
  .brand span { display: none; }
  .brand-mark { width: 36px; height: 36px; }
  .product-link { display: none; }
  .language-picker summary { min-width: 0; padding-inline: 11px; }
  .language-picker summary > span:last-of-type { display: none; }
  .language-menu { width: min(220px, calc(100vw - 32px)); }
  .article-grid { grid-template-columns: 1fr; }
  .latest-section, .related-section { padding-block: 52px 64px; }
  .post { padding-top: 52px; }
  .post-feature { margin-top: 28px; border-radius: 14px; }
  .post-feature-fallback { min-height: 230px; }
  .post-content { margin-top: 38px; }
  .post-content p, .post-content li { font-size: 1rem; }
  .product-cta { align-items: flex-start; flex-direction: column; padding: 22px; }
  .footer-inner { flex-direction: column; }
}

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