/* Front-end type roles, based on the homepage and product catalog/dossier.
 * Preserve those reference templates, navigation, icons and calculator diagrams.
 * Do not use zoom, root-font scaling, or blanket h2 rules: a rail label is not
 * a section heading. Use these tokens for new content components as well.
 */
body.wp-theme-qianmiao {
  --site-type-page: clamp(1.875rem, 4vw, 3.2rem);
  --site-type-section: clamp(1.5rem, 2.4vw, 2rem);
  --site-type-article: clamp(1.75rem, 3vw, 2.5rem);
  --site-type-subsection: clamp(1.25rem, 1.8vw, 1.5rem);
  --site-type-card: 1.15rem;
  --site-type-compact-title: 1rem;
  --site-type-body: var(--fs-body, .96rem);
  --site-type-lead: 1rem;
  --site-type-small: .86rem;
  --site-type-caption: .75rem;
  --site-type-label: .72rem;
}

/* Page introductions (catalog and product hero sizes remain untouched). */
body.wp-theme-qianmiao :is(.rkc-hero h1, .qdh-hero h1,
  .pfm-case-archive-heading h1, .title_527a24) {
  font-size: var(--site-type-page); line-height: 1.12; letter-spacing: -.025em;
}
body.wp-theme-qianmiao :is(.pa-heading h1, .pfm-case-hero h1) {
  font-size: var(--site-type-article); line-height: 1.2; letter-spacing: -.025em;
}
body.wp-theme-qianmiao :is(.rkc-lead, .qdh-lead, .lead_527a24,
  .pfm-case-deck, .pfm-case-archive-heading > p:not(.pfm-case-kicker), .intro_fd2b9e) {
  font-size: var(--site-type-lead); line-height: 1.65;
}

/* Full-width section headings: same scale as the homepage's catalog/topics. */
body.wp-theme-qianmiao :is(.rkc-heading-row h2, .rkc-answer-grid h2,
  .rkc-limit-grid h2, .rkc-faq-grid h2, .rkc-final h2, .rkc-methodology h2,
  .qdh-intro h2, .qdh-heading-row h2, .qdh-checklist-grid h2,
  .qdh-policy h2, .qdh-final h2, .pfm-case-facts h2,
  .pfm-case-sources h2, .pfm-case-archive-method h2,
  .scms-compare-builder-head h2, .scms-related h2,
  .phoenix-topic-knowledge__head h2, .name_54cea2, .title_64b349,
  .title_a94823, .title_f90da2, .title_2c555d) {
  font-size: var(--site-type-section); line-height: 1.25; letter-spacing: -.02em;
}

/* Reading columns use smaller chapter headings than full-width landing pages. */
body.wp-theme-qianmiao :is(.pa-page .pa-prose, .pfm-case-content,
  .qdh-intro-grid > div:last-child) {
  font-size: var(--site-type-body); line-height: 1.75;
}
body.wp-theme-qianmiao :is(.pa-page .pa-prose h2, .pfm-case-content h2,
  .rkc-guide-sections h2, .scms-search .scms-search-summary h2,
  .scms-search .scms-search-intro h2, .scms-search .scms-search-empty h2) {
  font-size: var(--site-type-subsection); line-height: 1.35;
}
body.wp-theme-qianmiao :is(.pa-page .pa-prose h3, .pfm-case-content h3) {
  font-size: var(--site-type-card); line-height: 1.4;
}

/* Cards: consistent density across knowledge, comparison, case and tool hubs. */
body.wp-theme-qianmiao :is(.rkc-boundary-card h2, .rkc-compare-card h3,
  .rkc-three-grid h2, .rkc-tool-grid h2, .rkc-tool-grid h3,
  .rkc-knowledge-card h2, .rkc-knowledge-card h3, .rkc-glossary-term h2,
  .qdh-guide-body h3, .pfm-case-card h2, .pfm-case-fact-grid h3,
  .pfm-case-side-card h2, .rkc-product-copy h3,
  .scms-search .scms-product-hit h3, .hTitle_64b349, .title_990c69) {
  font-size: var(--site-type-card); line-height: 1.35; letter-spacing: -.01em;
}
body.wp-theme-qianmiao :is(.rkc-record-main h3, .rkc-reference-list h3,
  .rkc-related-grid strong, .scms-search .scms-list-hit h3,
  .phoenix-topic-knowledge__grid h3) {
  font-size: var(--site-type-compact-title); line-height: 1.4;
}
body.wp-theme-qianmiao :is(.rkc-boundary-card p, .rkc-boundary-card li,
  .rkc-compare-card > p, .rkc-three-grid p, .rkc-knowledge-card p,
  .rkc-glossary-term p, .rkc-evidence-grid p, .rkc-timeline p,
  .rkc-heading-row > p, .scms-compare-builder-head > p,
  .pfm-case-card-body > p:not(.pfm-case-card-model), .pfm-case-fact-grid p) {
  font-size: var(--site-type-body); line-height: 1.65;
}
body.wp-theme-qianmiao :is(.rkc-tool-grid p, .rkc-reference-list p,
  .rkc-related-grid span, .rkc-product-copy p, .qdh-framework p,
  .pfm-case-side-card > p:not(.pfm-case-kicker), .pfm-case-sources p,
  .scms-search .scms-list-hit p, .phoenix-topic-knowledge__grid p) {
  font-size: var(--site-type-small); line-height: 1.6;
}
body.wp-theme-qianmiao .rkc-verdict p {
  font-size: var(--site-type-body); line-height: 1.75;
}

/* Metadata stays subordinate; leave SVG, icon fonts and formula text alone. */
body.wp-theme-qianmiao :is(.rkc-eyebrow, .rkc-kicker, .qdh-eyebrow,
  .qdh-kicker, .pfm-case-kicker, .scms-related-kicker) {
  font-size: var(--site-type-label); line-height: 1.5;
}
body.wp-theme-qianmiao :is(.rkc-breadcrumb, .qdh-breadcrumb,
  .pfm-case-breadcrumb, .pa-breadcrumb, .pa-meta) {
  font-size: var(--site-type-caption); line-height: 1.5;
}
body.wp-theme-qianmiao :is(.rkc-button, .rkc-text-link,
  .scms-compare-form button, .scms-compare-result-head a) {
  font-size: var(--site-type-small); line-height: 1.45;
}
body.wp-theme-qianmiao .scms-compare-result-head h3 {
  font-size: var(--site-type-subsection); line-height: 1.35;
}
body.wp-theme-qianmiao .scms-compare-row { font-size: var(--site-type-small); }

/* Tools already have a tested compact workspace. Share its text roles without
 * changing the model/result scale, animation or touch-target dimensions. */
body.wp-theme-qianmiao .rkc-page.rkc-tool-detail :is(.rkc-heading-row h2, .rkc-method-card h2, .rkc-simple-guide h2) {
  font-size: var(--site-type-subsection); line-height: 1.3;
}
body.wp-theme-qianmiao .rkc-page.rkc-tool-detail .rkc-product-copy h3 {
  font-size: var(--site-type-card); line-height: 1.35;
}

/* Inputs must remain 16px on touch layouts to avoid iOS focus zoom. Font-only:
 * checkbox/radio geometry, native icons and existing hit areas are untouched. */
@media (max-width: 700px) {
  body.wp-theme-qianmiao {
    --site-type-page: clamp(1.875rem, 7vw, 2.375rem);
    --site-type-article: clamp(1.75rem, 6vw, 2.125rem);
    --site-type-card: 1.0625rem;
  }
  body.wp-theme-qianmiao main :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=range]):not([type=submit]):not([type=button]), select, textarea) {
    font-size: 1rem;
  }
}
