:root {
  --ink: #1a1a2e;
  --ink-2: #27273d;
  --gold: #b08a3e;
  --gold-2: #d6b36a;
  --cream: #f5efe4;
  --paper: #fffdf8;
  --muted: #5d5a5f;
  --line: rgba(26, 26, 46, 0.12);
  --shadow: 0 24px 70px rgba(26, 26, 46, 0.14);
  --toc-w: 200px;
  --toc-gap: 56px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.narrow {
  max-width: 700px;
}

/* Editorial section layout: heading in the left gutter, copy at a readable measure */
.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 640px);
  gap: 40px 64px;
  justify-content: space-between;
  align-items: start;
}

.section-head h2 {
  margin-bottom: 0;
}

.section-head .eyebrow {
  margin-bottom: 14px;
}

/* Section illustrations: fill the left gutter under the heading */
.section-figure {
  margin: 28px 0 0;
  max-width: 340px;
}

.section-figure img {
  width: 100%;
  height: auto;
}

@media (min-width: 961px) {
  .section-head--sticky {
    position: sticky;
    top: 104px;
  }
}

.section-body {
  min-width: 0;
}

/* Guide page layout: table of contents + article column */
.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding-top: 28px;
}

.page-main {
  min-width: 0;
}

/* Narrow screens: compact contents block above the article */
.toc {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--cream);
}

.toc-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 24px;
}

.toc li {
  margin: 0;
}

.toc a {
  display: block;
  padding: 4px 0 4px 10px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

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

/* Wide screens: sticky sidebar in the left gutter */
@media (min-width: 1240px) {
  .page-layout {
    grid-template-columns: var(--toc-w) minmax(0, 1fr);
    gap: var(--toc-gap);
  }

  /* Pages without a TOC (blog, cases, Chinese guides) use the full width */
  .page-layout--single {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-layout--single .page-main .section--alt {
    margin-left: 0;
    padding-left: 0;
  }

  .toc {
    position: sticky;
    top: 104px;
    align-self: start;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    padding: 4px 0 24px;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
  }

  .toc-title {
    margin: 14px 0 10px;
  }

  .toc ol {
    columns: 1;
  }

  .page-main .section-grid {
    grid-template-columns: minmax(0, 280px) minmax(0, 640px);
    gap: 40px 56px;
  }

  /* Let the alternating bands bleed left, under the table of contents */
  .page-main .section--alt {
    margin-left: calc(-1 * (var(--toc-w) + var(--toc-gap)));
    padding-left: calc(var(--toc-w) + var(--toc-gap));
  }
}

@media (max-width: 640px) {
  .toc {
    padding: 14px 16px;
  }

  .toc a {
    padding: 3px 0 3px 8px;
  }
}

@media (max-width: 480px) {
  .toc ol {
    columns: 1;
  }
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  z-index: 999;
}

.skip:focus {
  left: 12px;
  top: 12px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 253, 248, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  transition: box-shadow 0.2s ease;
}

.site-header.is-scrolled {
  box-shadow: 0 10px 30px rgba(26, 26, 46, 0.08);
}

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

.brand {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}

.brand span {
  color: var(--gold);
}

.site-header .brand {
  display: inline-flex;
  align-items: center;
}

.brand-mark {
  width: 32px;
  height: 32px;
  flex: none;
  margin-right: 10px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav a {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  transition: color 0.2s ease;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: #7d5c22;
}

.nav a.btn,
.nav a.btn:hover {
  color: var(--paper);
}

/* Language switch: always visible, including when the nav collapses */
.header-inner .nav {
  margin-left: auto;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 14px;
  padding: 7px 12px;
  border: 1px solid rgba(26, 26, 46, 0.22);
  border-radius: 999px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.lang-switch:hover,
.lang-switch:focus-visible {
  border-color: var(--gold);
  color: var(--gold);
}

@media (max-width: 900px) {
  .lang-switch {
    margin-left: auto;
    margin-right: 8px;
  }
}

/* Chinese edition: system CJK fonts, looser line height */
html[lang="zh-Hans"] body {
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  line-height: 1.78;
}

html[lang="zh-Hans"] h1,
html[lang="zh-Hans"] h2,
html[lang="zh-Hans"] h3 {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Inter", sans-serif;
  letter-spacing: 0;
}

html[lang="zh-Hans"] .lead {
  line-height: 1.85;
}

html[lang="zh-Hans"] h2 {
  font-size: clamp(24px, 2.4vw, 30px);
}

html[lang="zh-Hans"] .nav a,
html[lang="zh-Hans"] .eyebrow,
html[lang="zh-Hans"] .toc-title {
  letter-spacing: 0.04em;
}

/* Chinese home: generated sections need the same gutters as .container */
.home-sections .section-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav-toggle {
  display: none;
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 15px;
  font: 600 11px/1 var(--font-sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: var(--ink-2);
}

.btn--small {
  padding: 11px 17px;
  font-size: 10px;
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: rgba(26, 26, 46, 0.3);
}

.btn--ghost:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn--gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

.btn--gold:hover {
  background: var(--gold-2);
}

.btn--ghost-light {
  background: transparent;
  color: var(--paper);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn--ghost-light:hover {
  background: var(--paper);
  color: var(--ink);
}

/* Hero */
.hero {
  padding: 72px 0 58px;
  background:
    radial-gradient(circle at 92% 8%, rgba(214, 179, 106, 0.18), transparent 34%),
    radial-gradient(circle at 4% 100%, rgba(176, 138, 62, 0.1), transparent 30%),
    var(--paper);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 56px;
  align-items: center;
}

.hero-copy,
.hero-media {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 18px;
  color: #7d5c22;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow--light {
  color: var(--gold-2);
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  color: var(--ink);
}

h1 {
  margin: 0 0 24px;
  font-size: clamp(44px, 5.4vw, 72px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.03;
}

h2 {
  margin: 0 0 20px;
  font-size: clamp(30px, 3.4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

h3 {
  margin: 0 0 14px;
  font-size: 21px;
  font-weight: 700;
}

.lead {
  max-width: 620px;
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 18.5px;
  line-height: 1.68;
}

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

.hero-note {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.hero-media {
  margin: 0;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.hero-media img {
  width: 100%;
  aspect-ratio: 820 / 460;
  object-fit: cover;
}

/* Trust strip */
.trust {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding-top: 24px;
  padding-bottom: 24px;
}

.trust-grid div {
  padding: 0 32px;
  border-left: 1px solid var(--line);
}

.trust-grid div:first-child {
  padding-left: 0;
  border-left: 0;
}

.trust-grid strong {
  display: block;
  margin-bottom: 3px;
  font-family: var(--font-serif);
  font-size: 23px;
  line-height: 1.1;
}

.trust-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Sections */
.section {
  padding: 74px 0;
}

.section--alt {
  background: var(--cream);
}

.section--dark {
  background: var(--ink);
  color: var(--paper);
}

.section--dark h2,
.section--dark h3 {
  color: var(--paper);
}

.section.section--dark p,
.section.section--dark li {
  color: rgba(255, 253, 248, 0.82);
}

.section p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.72;
}

.section ul {
  margin: 10px 0 22px;
  padding-left: 22px;
}

.section li {
  margin: 9px 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

/* Tables */
.table-wrap {
  margin: 24px 0 28px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.55;
}

th {
  padding: 12px 14px;
  border-bottom: 2px solid var(--ink);
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: rgba(176, 138, 62, 0.06);
}

/* Quote */
.quote-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 56px;
  align-items: center;
}

.quote-card {
  display: grid;
  gap: 12px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.quote-small {
  margin: 6px 0 0;
  color: rgba(255, 253, 248, 0.62) !important;
  font-size: 12px !important;
}

.quote-small a {
  color: var(--gold-2);
}

/* FAQ */
.faq-list {
  margin-top: 26px;
  border-top: 1px solid var(--line);
}

.faq-item {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}

.faq-item summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  cursor: pointer;
  color: var(--ink);
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.45;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--gold);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item p {
  max-width: 660px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.7;
}

/* Guide pages */
.breadcrumb {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--gold);
}

.breadcrumb span {
  color: var(--ink);
}

.page-hero {
  padding: 54px 0 44px;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  max-width: 1000px;
  margin-bottom: 20px;
  font-size: clamp(36px, 4.6vw, 58px);
}

.page-hero .lead {
  max-width: 760px;
}

.article-meta {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.callout {
  margin: 0 0 24px;
  padding: 18px 22px;
  border-left: 3px solid var(--gold);
  border-radius: 0 10px 10px 0;
  background: var(--cream);
}

.callout p {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.7;
}

.callout-title {
  margin-bottom: 6px !important;
  color: var(--ink) !important;
  font-size: 11px !important;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 24px;
}

@media (max-width: 1100px) {
  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.related-card {
  display: block;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.related-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.related-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.2;
}

.related-card span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

/* Footer */
.site-footer {
  padding: 56px 0 24px;
  background: #12121f;
  color: rgba(255, 253, 248, 0.68);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
}

.footer-grid h3 {
  margin: 0 0 14px;
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.footer-grid p {
  max-width: 300px;
  margin: 14px 0 0;
  color: rgba(255, 253, 248, 0.58);
  font-size: 13px;
  line-height: 1.7;
}

.footer-grid a {
  display: block;
  margin: 8px 0;
  color: rgba(255, 253, 248, 0.72);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-grid a:hover {
  color: var(--gold-2);
}

.footer-grid > div > span {
  display: block;
  margin: 8px 0;
  color: rgba(255, 253, 248, 0.58);
  font-size: 13px;
}

.footer-grid a.brand--footer {
  color: var(--paper);
  font-size: 25px;
  letter-spacing: -0.03em;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 253, 248, 0.46);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.footer-bottom p {
  margin: 0;
}

/* Responsive */
@media (max-width: 1160px) {
  .section-grid {
    grid-template-columns: minmax(0, 300px) minmax(0, 560px);
    gap: 32px 40px;
  }
}

@media (max-width: 960px) {
  .section-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .section-head h2 {
    margin-bottom: 2px;
  }

  .section-body {
    max-width: 660px;
  }
}

@media (max-width: 1100px) {
  .nav {
    gap: 16px;
  }

  .nav a {
    font-size: 10px;
    letter-spacing: 0.1em;
  }
}

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

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

  .nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 24px 22px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px rgba(26, 26, 46, 0.08);
  }

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

  .nav a {
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
  }

  .nav .btn {
    margin-top: 14px;
    justify-content: center;
  }

  .hero {
    padding: 48px 0 40px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-media {
    order: 2;
  }

  .trust-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 0;
  }

  .trust-grid div:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .quote-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 20px;
  }

  h1 {
    font-size: 42px;
  }

  h2 {
    font-size: 30px;
  }

  .lead {
    font-size: 16px;
  }

  .section {
    padding: 54px 0;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .trust-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .trust-grid div {
    padding: 14px 0;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .trust-grid div:last-child {
    border-bottom: 0;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  table {
    font-size: 13px;
  }

  th,
  td {
    padding: 10px 11px;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
