/* zh.css: Simplified Chinese pages (/zh/*). Loaded after landing-communities.css by
   partials/head-i18n.njk. System CJK fonts only: never load a web CJK font (megabytes,
   and Google Fonts is unreachable from mainland China). Space Grotesk stays first so
   Latin text keeps the brand face; CJK glyphs fall through to the system font. */

html[lang="zh-Hans"] {
  --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", "Source Han Sans SC", "WenQuanYi Micro Hei",
    "Segoe UI", system-ui, sans-serif;
  --font-display: var(--font-sans);
}

html[lang="zh-Hans"] body {
  line-height: 1.75;
  line-break: strict;
  overflow-wrap: break-word;
}

html[lang="zh-Hans"] h1,
html[lang="zh-Hans"] h2,
html[lang="zh-Hans"] h3 { letter-spacing: 0; }

html[lang="zh-Hans"] .section-label { letter-spacing: 1px; }

html[lang="zh-Hans"] .hero h1 {
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.25;
}

html[lang="zh-Hans"] .hero__subtitle {
  font-size: clamp(16px, 1.8vw, 18px);
  line-height: 1.85;
  max-width: 760px;
  margin-bottom: 28px;
}

html[lang="zh-Hans"] .hero__subtitle a { text-decoration: underline; text-underline-offset: 3px; }

html[lang="zh-Hans"] .hero__updated {
  font-size: 13px;
  color: var(--text-muted);
  margin: -12px 0 28px;
}

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

html[lang="zh-Hans"] .hero__stats { flex-wrap: wrap; justify-content: center; row-gap: 24px; }

/* FAQ: long Chinese answers read better left-aligned and need more room than the
   300px max-height the English accordion allows. */
html[lang="zh-Hans"] .faq__question { text-align: left; justify-content: space-between; line-height: 1.6; }
html[lang="zh-Hans"] .faq__item.open .faq__answer { max-height: 1200px; }
html[lang="zh-Hans"] .faq__answer-inner { text-align: left; padding: 0 32px 20px; font-size: 15px; line-height: 1.85; }

/* ── Founder welcome block ─────────────────────────────────────────────── */
.zh-welcome {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  max-width: 640px;
  width: 100%;
  margin: 0 auto 32px;
  padding: 18px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  text-align: left;
}
.zh-welcome__avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-glow);
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
}
.zh-welcome__body { min-width: 0; }
.zh-welcome__text { margin: 0 0 10px; color: var(--text-primary); font-size: 16px; line-height: 1.8; }
.zh-welcome__text strong { color: var(--accent-bright); }
.zh-welcome__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 13px; }
.zh-welcome__sig { margin: 8px 0 0; font-size: 12px; color: var(--text-muted); }

/* ── Telegram CTA with mainland fallback (t.me / tg:// / copy handle) ─── */
.zh-tg { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 0 auto; }
.zh-tg__buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.zh-tg__fallback {
  margin: 0;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 6px 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.zh-tg--left { align-items: flex-start; }
.zh-tg--left .zh-tg__buttons, .zh-tg--left .zh-tg__fallback { justify-content: flex-start; }

html[lang="zh-Hans"] main code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--accent-bright);
  overflow-wrap: anywhere;
}
html[lang="zh-Hans"] main pre code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  overflow-wrap: normal;
}

.zh-copy {
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent-dim);
  background: transparent;
  color: var(--accent-bright);
  cursor: pointer;
}
.zh-copy:hover { background: var(--accent-glow); }
.zh-copy.is-done { color: var(--success); border-color: var(--success); }

/* ── Tables ────────────────────────────────────────────────────────────── */
.zh-table-wrap {
  max-width: 1000px;
  margin: 0 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.zh-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.zh-table th, .zh-table td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  line-height: 1.65;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.zh-table thead th { background: var(--bg-secondary); color: var(--text-primary); font-weight: 600; white-space: nowrap; }
.zh-table tbody tr:last-child td { border-bottom: 0; }
.zh-table td strong { color: var(--text-primary); }
.zh-table .num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.zh-table tr.is-us td { background: rgba(212, 175, 55, 0.05); }
.zh-table tr.is-us td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.zh-note { max-width: 1000px; margin: 16px auto 0; font-size: 13px; line-height: 1.8; color: var(--text-muted); }
.zh-note a { color: var(--accent-bright); }

/* ── Long-form guide text ──────────────────────────────────────────────── */
.zh-prose { max-width: 760px; margin: 0 auto; font-size: 16px; line-height: 1.9; color: var(--text-secondary); }
.zh-prose h2 { margin: 56px 0 16px; color: var(--text-primary); font-size: clamp(22px, 3vw, 30px); line-height: 1.4; }
.zh-prose h2:first-child { margin-top: 0; }
.zh-prose h3 { margin: 32px 0 12px; color: var(--text-primary); font-size: 19px; line-height: 1.5; }
.zh-prose p { margin: 0 0 16px; }
.zh-prose ol, .zh-prose ul { margin: 0 0 20px; padding-left: 1.5em; }
.zh-prose li { margin: 0 0 10px; }
.zh-prose li::marker { color: var(--accent); }
.zh-prose strong { color: var(--text-primary); }
.zh-prose .zh-table-wrap { margin: 8px 0 20px; }
.zh-prose .zh-tg { margin: 24px 0; }

.zh-callout {
  margin: 24px 0;
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-card);
  font-size: 15px;
  line-height: 1.85;
  color: var(--text-secondary);
}
.zh-callout strong { color: var(--text-primary); }

/* ── Code samples (reuses .webhook-code from landing-communities.css) ─── */
.zh-code-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; max-width: 1100px; margin: 0 auto; }
.zh-code-grid .webhook-code { max-width: none; margin: 0; }
.webhook-code + .webhook-code { margin-top: 24px; }
.zh-code-grid .webhook-code + .webhook-code { margin-top: 0; }
.webhook-code__header code { font-family: var(--font-mono); text-transform: none; letter-spacing: 0; color: var(--accent-bright); }
.webhook-code__body pre { font-size: 12.5px; }

/* ── Small helpers ─────────────────────────────────────────────────────── */
.zh-center { text-align: center; }
.zh-links { margin-top: 24px; font-size: 14px; color: var(--text-secondary); text-align: center; line-height: 2; }
.zh-links a { color: var(--accent); }
.zh-disclaimer { max-width: 760px; margin: 24px auto 0; font-size: 12px; line-height: 1.8; color: var(--text-muted); text-align: center; }

@media (max-width: 768px) {
  .zh-code-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .zh-welcome { padding: 16px; gap: 12px; }
  .zh-welcome__avatar { width: 36px; height: 36px; }
  .zh-welcome__text { font-size: 15px; }
  .zh-tg__buttons .btn { width: 100%; justify-content: center; }
  html[lang="zh-Hans"] .faq__question { padding: 16px 18px; }
  html[lang="zh-Hans"] .faq__answer-inner { padding: 0 18px 16px; }
  .zh-prose { font-size: 15px; }
}

/* Code reads literally: no "!=" -> "≠" style ligatures from the mono font. */
html[lang="zh-Hans"] pre { font-variant-ligatures: none; }
