/* 花月设计系统 —— 唯一真源（tokens）
   所有组件只允许使用这里的变量；禁止在组件里写魔数。
   修改这里 = 修改全站；新增取值必须先加进这里。 */
:root {
  /* 间距：4px 网格 */
  --sp-0: 0;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* 字号 */
  --text-2xs: 11px;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 28px;
  --text-4xl: 32px;
  --text-5xl: 40px;
  --text-6xl: 48px;
  --text-7xl: 56px;
  --text-8xl: 64px;

  /* 行高 */
  --leading-tight: 1.1;
  --leading-snug: 1.2;
  --leading-normal: 1.4;
  --leading-relaxed: 1.6;
  --leading-loose: 1.75;

  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 10px;
  --radius-2xl: 12px;
  --radius-3xl: 16px;
  --radius-pill: 999px;

  /* 层级阴影（克制：只有三级） */
  --elev-1: 0 1px 2px rgb(0 0 0 / .06), 0 4px 12px rgb(0 0 0 / .06);
  --elev-2: 0 4px 16px rgb(0 0 0 / .10), 0 12px 32px rgb(0 0 0 / .08);
  --elev-3: 0 12px 48px rgb(0 0 0 / .16);

  /* 动效：三档时长，一条缓动 */
  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 320ms;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);

  /* 版心 */
  --measure: 65ch;
  --w-narrow: 44rem;
  --w-read: 52rem;
  --w-content: 72rem;
  --w-wide: 86rem;
}

/* 排版：中西文自动空距 + 防孤行（不支持的浏览器无副作用） */
:lang(zh-CN) p, :lang(zh-CN) li, :lang(zh-CN) dd, :lang(zh-CN) blockquote,
:lang(zh-CN) h1, :lang(zh-CN) h2, :lang(zh-CN) h3, :lang(zh-CN) h4,
:lang(zh-CN) h5, :lang(zh-CN) h6, :lang(zh-CN) figcaption {
  text-autospace: normal;
}
/* 正文不要 text-wrap: pretty —— 真机实测（iPhone/Safari）它会把整段重新均分，
   手机上每行比可用宽度短 60–70px，表现为"右边留白偏多、句子提前换行"。
   只有靠 balance 的地方（标题）保留。 */
p, li, dd, blockquote {
  text-wrap: auto;
}

/* 颜色别名：站点颜色实际由 appearance 系列的 --fm-* 定义，
   这里给出语义别名，新组件只引用这些名字，避免再写死。 */
:root {
  --color-canvas: var(--fm-canvas, var(--paper, #fbfaf7));
  --color-surface: var(--fm-surface, var(--card, #fffdf8));
  --color-surface-strong: var(--fm-surface-strong, var(--line, #d2d2d7));
  --color-ink: var(--fm-ink, var(--ink, #1d1d1f));
  --color-muted: var(--fm-muted, var(--muted, #6e6e73));
  --color-line: var(--fm-line, var(--line, #d2d2d7));
  --color-action: var(--fm-action, #0071e3);
}
/* ============ 手机端固定层参数（底部标签栏 / 页脚 / 选中块） ============
   所有数值集中在这里；改动后全站生效，不要再散落在页面 CSS 里。 */
:root {
  --fmc-tabbar-height: 70px;        /* 贴合 Safari 地址栏的紧凑高度 */        /* 实测：Apple TV 标签栏 ≈70pt */        /* 标签栏总高（含内边距） */
  --fmc-tabbar-bottom: 8px;         /* 紧贴浏览器地址栏上方 */         /* 更贴近浏览器地址栏 */        /* 实测：距屏幕底部 ≈20pt */        /* 距可视区底部 */
  --fmc-tabbar-radius: calc(var(--fmc-tabbar-height) / 2); /* 胶囊：半径 = 高度一半 */
  --fmc-tabbar-item-height: 43px;   /* 实测：选中块高约 43–46pt */   /* 单个标签命中高度（≥44） */
  --fmc-tabbar-icon-size: 24px;     /* 图标尺寸 */
  --fmc-tabbar-label-size: 10px;  /* 标签文字 */
  --fmc-tabbar-gap: 4px;            /* 图标与文字间距 */
  --fmc-tabbar-side: 20px;          /* 实测：栏左右留白 ≈20pt */
  --fmc-content-bottom-gap: 16px;
  --fmc-tabbar-pad-v: calc((var(--fmc-tabbar-height) - var(--fmc-tabbar-item-height)) / 2);

  --fmc-chip-radius: 20px;          /* 实测：选中块圆角 ≈20pt */          /* 选中块圆角 */
  --fmc-chip-blur: 22px;            /* 选中块背景模糊 */
  --fmc-chip-surface-day: color-mix(in srgb, #ffffff 58%, transparent);
  --fmc-chip-surface-night: color-mix(in srgb, #ffffff 16%, transparent);
  --fmc-chip-shadow-day: 0 2px 8px color-mix(in srgb, #000 14%, transparent),
                         inset 0 0.5px 0 color-mix(in srgb, #fff 85%, transparent),
                         inset 0 -0.5px 0 color-mix(in srgb, #000 7%, transparent);
  --fmc-chip-shadow-night: 0 3px 12px color-mix(in srgb, #000 45%, transparent),
                           inset 0 0.5px 0 color-mix(in srgb, #fff 22%, transparent),
                           inset 0 -0.5px 0 color-mix(in srgb, #000 30%, transparent);

  --fmc-footer-offset: 76px;        /* 标签栏高度 + 底部间距 */        /* 页脚距可视区底部（让出标签栏） */
  --fmc-footer-pad: 8px;            /* 页脚上下内边距 */
  --fmc-footer-height: var(--fmc-footer-h, 88px); /* 运行时由 JS 写入 */
}
/* 手机端标签栏其余参数（全部可调，禁止在页面 CSS 写字面量） */
:root {
  --fmc-tabbar-pad-h: 8px;          /* 栏内左右内边距 */
  --fmc-tabbar-blur: 26px;          /* 栏体背景模糊 */
  --fmc-tabbar-saturate: 185%;      /* 栏体饱和 */
  --fmc-tabbar-item-pad-h: 4px;     /* 单标签左右内边距 */
  --fmc-tabbar-label-weight: 500;
  --fmc-chip-inset: 3px;            /* 选中块相对标签格内缩 */
  --fmc-tabbar-surface-day: color-mix(in srgb, #fbfbfd 80%, transparent);
  --fmc-tabbar-surface-night: color-mix(in srgb, #1c1c1e 78%, transparent);
  --fmc-tabbar-shadow: 0 8px 28px color-mix(in srgb, #000 18%, transparent),
                       inset 0 1px 0 color-mix(in srgb, #fff 60%, transparent);
}
