/* 基础：子集字体、重置、排版、工具类。颜色一律来自 tokens.css。
   字体规则：.fd = 模板里写死的标题与营销文字（子集字体）；其余一切（尤其是站点名、价格、用户填写的内容）用系统字体。 */
@font-face { font-family: "Site Sans"; font-weight: 400; font-display: swap; src: url(/static/fonts/sans-400.woff2) format("woff2"); }
@font-face { font-family: "Site Sans"; font-weight: 600; font-display: swap; src: url(/static/fonts/sans-600.woff2) format("woff2"); }
@font-face { font-family: "Site Serif"; font-weight: 400; font-display: swap; src: url(/static/fonts/serif-400.woff2) format("woff2"); }
@font-face { font-family: "Site Serif"; font-weight: 700; font-display: swap; src: url(/static/fonts/serif-700.woff2) format("woff2"); }
/* 子集字体还没下载完时的替身：本机的苹方 / 雅黑 / 思源黑体，按子集字体（思源黑体）的上下度量对齐，换字体时文字不上下跳。
   汉字两者都是 1 个字宽，所以 size-adjust 保持 100%（数字和字母宽度只差 2–4%） */
@font-face { font-family: "Site Sans Fallback"; font-weight: 400;
  src: local("PingFangSC-Regular"), local("PingFang SC"), local("MicrosoftYaHei"), local("Microsoft YaHei"), local("NotoSansCJKsc-Regular"), local("Noto Sans CJK SC"), local("SourceHanSansSC-Regular");
  ascent-override: 116%; descent-override: 28.8%; line-gap-override: 0%; size-adjust: 100%; }
@font-face { font-family: "Site Sans Fallback"; font-weight: 600;
  src: local("PingFangSC-Semibold"), local("MicrosoftYaHei-Bold"), local("Microsoft YaHei Bold"), local("NotoSansCJKsc-Bold"), local("SourceHanSansSC-Bold");
  ascent-override: 116%; descent-override: 28.8%; line-gap-override: 0%; size-adjust: 100%; }

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { background: var(--page); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }   /* 去掉手机点按时的蓝色闪块（按下反馈由各组件的 :active 负责） */
body { min-height: 100svh; background: var(--page); color: var(--text); font-family: var(--font-ui); font-size: var(--fs-3); line-height: var(--lh-body);
  font-variant-numeric: tabular-nums;   /* 价格、小时、页数、日期：数字等宽，上下行对得齐 */
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; line-break: strict; overflow-x: hidden;
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }   /* iPhone 横屏时避开刘海 */
::selection { background: var(--selection); color: var(--ink); }
a { color: inherit; text-decoration: none; }
ol, ul { list-style: none; }
img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4 { color: var(--ink); font-weight: 600; line-height: var(--lh-head); letter-spacing: -0.01em; }
/* 不让最后一行只剩一两个字：段落、列表、表格、表单说明都用 pretty */
h1, h2, h3, p, li, dd, dt, td, label, legend, summary, .lede, .form-hint, .alert, .note, .faq-a { text-wrap: pretty; }
strong, b { font-weight: 600; color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { scroll-margin-block: var(--s-8); }   /* 手机弹出键盘、页面滚到输入框时，上下留出空间，不被挡住 */
button { cursor: pointer; background: none; border: 0; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-3) 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }   /* 键盘焦点：清晰的墨色焦点环（跟随元素自己的圆角）。只用 :focus-visible——鼠标、手指点按不出焦点框 */
:where(a, summary):not([class]):focus-visible { border-radius: var(--r-sm); }

.fd, .fd-body { font-family: var(--font-display); }   /* 标题与营销正文：子集字体 */
/* 标点一律全角：句中的“，”占一个字宽（不再用 halt 把标点压成半宽，那样看起来像英文逗号）。
   支持 text-spacing-trim 的浏览器，只把第二行起行首的开引号 / 括号、以及挨在一起的两个标点挤紧；不支持的浏览器保持全角 */
@supports (text-spacing-trim: space-first) {
  body { text-spacing-trim: space-first; }
}
.ph { display: inline-block; white-space: nowrap; }   /* 一个不拆开的词组：换行只发生在词组之间（配合 text-wrap: balance） */

/* 正文里的链接（按钮不算）：墨色 + 下划线，悬停变橙 */
:is(.prose, .alert, .hint, .form-hint, .muted, .empty, .faq-a, .lede, .check-field, .board-note, .auth-alt) a:not(.btn), a.link {
  color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent);
  text-underline-offset: .22em; transition: color var(--dur-ui) var(--ease), text-decoration-color var(--dur-ui) var(--ease); }
:is(.prose, .alert, .hint, .form-hint, .muted, .empty, .faq-a, .lede, .check-field, .board-note, .auth-alt) a:not(.btn):hover, a.link:hover { color: var(--accent-text); text-decoration-color: currentColor; }
:is(.prose, .alert, .hint, .form-hint, .muted, .empty, .faq-a, .lede, .check-field, .board-note, .auth-alt) a:not(.btn):active, a.link:active { color: var(--accent-btn-hover); }
.alert a:not(.btn) { color: inherit; }

/* 长文：每行最多约 36 个汉字 */
.measure, .prose p, .faq-a, .board-body > p.small, .empty-text { max-width: 36em; }

/* 布局 */
.wrap { width: min(var(--wrap), calc(100% - 2 * var(--wrap-pad))); margin-inline: auto; }
.wrap-narrow { width: min(760px, calc(100% - 2 * var(--wrap-pad))); margin-inline: auto; }
.wrap-form { width: min(560px, calc(100% - 2 * var(--wrap-pad))); margin-inline: auto; }
.section { padding-top: var(--s-12); }
.section-sm { padding-top: var(--s-6); }
.stack > * + * { margin-top: var(--s-3); }
.stack-sm > * + * { margin-top: var(--s-2); }
.row { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); }

/* 工具类 */
.muted { color: var(--muted); }
.small { font-size: var(--fs-2); }
.xsmall { font-size: var(--fs-1); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); letter-spacing: .02em; }
.mt-1 { margin-top: var(--s-1); } .mt-2 { margin-top: var(--s-2); } .mt-3 { margin-top: var(--s-3); } .mt-4 { margin-top: var(--s-4); } .mt-6 { margin-top: var(--s-6); }
.mb-0 { margin-bottom: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--s-2); top: -100px; z-index: 100; padding: var(--s-1) var(--s-2); border-radius: var(--r-sm); background: var(--ink); color: var(--on-ink); }
.skip-link:focus-visible { top: var(--s-2); }
.js-only { display: none; }
.js .js-only { display: revert; }

@media (max-width: 860px) {
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: var(--fs-2b); }
  .section { padding-top: var(--s-8); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
@media print {
  html, body, .frame { background: var(--color-print-bg); }
  .nav, .foot, .dev-banner, .announcement, .menu { display: none; }
}
