/* ==============================
   凡是与美 · 全站字体与排版
   免费开源字体（SIL OFL），自托管
   - 拉丁文：Inter（无衬线）/ Cormorant Garamond（衬线）
   - 中文：优先系统高质量字体，逐级回退
   ============================== */

/* ---------- 拉丁：Inter 可变字重（正文 / 标题 / UI） ---------- */
@font-face {
  font-family: "FS Sans";
  src: url("/media/fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- 拉丁：Cormorant Garamond（品牌衬线 / 大标题 / 引言） ---------- */
@font-face {
  font-family: "FS Serif";
  src: url("/media/fonts/cormorant-300.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "FS Serif";
  src: url("/media/fonts/cormorant-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "FS Serif";
  src: url("/media/fonts/cormorant-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "FS Serif";
  src: url("/media/fonts/cormorant-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "FS Serif";
  src: url("/media/fonts/cormorant-500i.woff2") format("woff2");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

/* ---------- 标题衬线：Playfair Display 500（拉丁）/ 思源宋体 500（中文） ---------- */
@font-face {
  font-family: "FS Display";
  src: url("/media/fonts/playfair-display-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "FS Serif SC";
  src: url("/media/fonts/noto-serif-sc-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- 统一字体令牌 ---------- */
:root {
  --fs-sans: "FS Sans", "PingFang SC", "HarmonyOS Sans SC", "MiSans",
    "Source Han Sans SC", "Noto Sans SC", "Microsoft YaHei", system-ui,
    -apple-system, "Segoe UI", sans-serif;
  --fs-serif: "FS Serif", "Songti SC", "STSong", "Noto Serif SC",
    "Source Han Serif SC", "SimSun", Georgia, serif;
  --fs-heading: "FS Display", "FS Serif SC", "Songti SC", "STSong",
    "Noto Serif SC", "Source Han Serif SC", "SimSun", Georgia, serif;
  --font-sans: var(--fs-sans);
  --default-font-family: var(--fs-sans);
  --font-pretendard: var(--fs-sans);

  /* 文字色阶：中性柔和灰，替代纯黑，与品牌粉底色更协调
     2026-10 优化：整体加深半档，16px 正文对比度从 4.0:1 提升到 4.9:1 */
  --color-idh-gray-900: #1d1d22;
  --color-idh-gray-800: #3a3a42;
  --color-idh-gray-700: #525259;
  --color-idh-gray-600: #6d6d77;
  --color-idh-gray-500: #98989f;
}

html {
  font-family: var(--fs-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 覆盖页面根节点上的旧字体类（优先级高于 .pretendard_*） */
body,
body[class] {
  font-family: var(--fs-sans);
  letter-spacing: 0;
}

/* ---------- 标题：衬线（Playfair Display 500 / 思源宋体 500）/ 128% 行高 ---------- */
.title1,
.title2,
.title3 {
  font-family: var(--fs-heading);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: -0.01em;
}

@media (min-width: 48rem) {
  .md\:title1,
  .md\:title2,
  .md\:title3 {
    font-family: var(--fs-heading);
    font-weight: 500;
    line-height: 1.28;
    letter-spacing: -0.01em;
  }
}

@media (min-width: 64rem) {
  .lg\:title1,
  .lg\:title2,
  .lg\:title3 {
    font-family: var(--fs-heading);
    font-weight: 500;
    line-height: 1.28;
    letter-spacing: -0.01em;
  }
}

/* 次级标题同样对齐原站的 500 字重 */
.subtitle1,
.subtitle2,
.subtitle3 {
  font-family: var(--fs-heading);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0;
}

/* 语义标题统一 500 字重，去除过粗的 700/800 工具类影响 */
h1,
h2,
h3,
h4 {
  font-family: var(--fs-heading);
  font-weight: 500;
}

/* 项目页首屏大标题（原 Abril Fatface 粗展示体）：统一到标题衬线 */
:is(.visual-title, .visual-mobile-title, [class*="visual-title"], [class*="abril_fatface"]) {
  font-family: var(--fs-heading);
  font-weight: 500;
}

/* ---------- 字号阶梯（全站统一） ---------- */
/* 桌面端标题略收紧，避免中文大字号压排版 */
@media (min-width: 48rem) {
  .md\:title1 {
    font-size: 40px;
  }
  .md\:title2 {
    font-size: 34px;
  }
  .md\:title3 {
    font-size: 30px;
  }
  .md\:subtitle1 {
    font-size: 26px;
  }
}

@media (min-width: 64rem) {
  .lg\:title1 {
    font-size: 40px;
  }
  .lg\:title2 {
    font-size: 34px;
  }
  .lg\:title3 {
    font-size: 30px;
  }
  .lg\:subtitle1 {
    font-size: 26px;
  }
}

/* 小字号下限提高：12px 中文字在移动端过小，统一抬到 13px
   注意：必须限定断点，否则会盖掉桌面的 md:body1 / md:caption2 */
@media (max-width: 47.999rem) {
  .body3,
  .caption3 {
    font-size: 13px;
  }
}

@media (min-width: 48rem) {
  .md\:body3,
  .md\:caption3 {
    font-size: 13px;
  }
}

@media (min-width: 64rem) {
  .lg\:body3,
  .lg\:caption3 {
    font-size: 13px;
  }
}

/* 首屏品牌衬线大标题：80px 中文偏重，桌面端收至 72px（移动端保持 50px，断行正好落在标点后） */
@media (min-width: 64rem) {
  .lg\:text-\[80px\] {
    font-size: 72px;
  }
}

/* ---------- 行距与字距 ---------- */
/* 正文：130% 对中文长句过密，统一 170% */
:is(.body1, .body2, .body3, .md\:body1, .md\:body2, .md\:body3, .lg\:body1, .lg\:body2, .lg\:body3) {
  line-height: 1.7;
}

/* 说明文案：145%，避免小字挤在一起 */
:is(.caption1, .caption2, .caption3, .md\:caption1, .md\:caption2, .md\:caption3, .lg\:caption1, .lg\:caption2, .lg\:caption3) {
  line-height: 1.45;
}

/* 中文标题不做负字距，改用 0.01em 轻微透气 */
html[lang="zh-CN"] :is(.title1, .title2, .title3, .subtitle1, .subtitle2, .subtitle3) {
  letter-spacing: 0.01em;
}

/* 断行优化：标题均衡换行、正文避免孤字 */
:is(h1, h2, h3, h4, .fs-display) {
  text-wrap: balance;
}

main p {
  text-wrap: pretty;
}

/* 正文段落：参考原站行距节奏，中文长段落略作放宽，颜色比标题柔一档 */
main p:not([class]) {
  line-height: 1.7;
  color: var(--color-idh-gray-700);
}

/* 选中文字：品牌淡粉底 + 深墨字 */
::selection {
  background: #fbd9e7;
  color: var(--color-idh-gray-900);
}

main strong,
main b {
  font-weight: 600;
}

/* ---------- 品牌衬线大标题 ---------- */
.fs-display {
  font-family: var(--fs-heading);
  font-weight: 500;
  font-style: normal;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

/* ---------- 悬浮咨询按钮：拉丁短标签在 60/80px 圆内留出呼吸空间 ---------- */
[aria-label="Consultation"] {
  font-size: 12px;
  letter-spacing: 0.01em;
}
@media (min-width: 768px) {
  [aria-label="Consultation"] {
    font-size: 14px;
  }
}

/* ---------- 悬浮咨询菜单：WhatsApp 等短词不压到药丸描边 ---------- */
[aria-label="Consultation menu"] span,
#floating-inquiry-menu-mobile span {
  font-size: 12px;
  letter-spacing: -0.01em;
}
[aria-label="Consultation menu"] > div {
  padding-left: 4px;
  padding-right: 4px;
}
#floating-inquiry-menu-mobile {
  width: 68px;
}
