/* AIS-TIP typography baseline · 2026-11-11 · v3
   Loaded in <head> for every route (login, home, detail, report, developer,
   skill, vulnerability, batch) after assets/fonts/ais-tip-fonts.css and before
   route stylesheets, so global text, native controls and body-mounted portaled
   layers share one family, one weight model and one neutral text scale.

   UI family is platform-native: PingFang SC on macOS and Microsoft YaHei on
   Windows, following TDesign's component token order. The declaration exists so
   Safari no longer falls back to its default serif; it is not a cross-platform
   glyph unification. Self-hosted Noto Sans SC (AIS TIP Sans) is kept as the
   last CJK fallback for systems without a platform UI face.

   Self-hosted faces (SIL OFL 1.1, locked 2026-11-11):
   - AIS TIP Sans  -> Noto Sans SC 2.004-H2, 169 unicode-range shards (fallback)
   - AIS TIP Mono  -> Noto Sans Mono, code / JSON / character-by-character
   - TCloudNumber  -> TCloud Number v1.010, selected display numbers only
   Provenance, hashes and licences: assets/fonts/README.md + font-manifest.json.

   Keep component font-size / line-height / weight tokens untouched: this file
   only unifies family, synthesis policy and neutral text roles. Do not add
   global .t-* size or weight overrides. */

:root {
  /* Platform-native UI stack: PingFang SC on macOS, Microsoft YaHei on
     Windows. AIS TIP Sans is the last CJK fallback only. */
  --font-ui: "PingFang SC", "Microsoft YaHei",
    "Hiragino Sans GB", "Source Han Sans CN", "Noto Sans CJK SC",
    "Noto Sans SC", "AIS TIP Sans", Arial, sans-serif;
  --font-number: "TCloudNumber", var(--font-ui);
  --font-code: "AIS TIP Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Legacy aliases kept for route stylesheets that still call them. */
  --font: var(--font-ui);
  --secondary-font: var(--font-ui);

  /* TDesign Vue Next font tokens, so components and root text stay identical.
     A family token is not a weight: --td-font-family-medium is not 500. */
  --td-font-family: var(--font-ui);
  --td-font-family-medium: var(--font-ui);
  --font-weight-regular: 400;
  --font-weight-medium: 600; /* legacy name; 500 is not used: Windows renders <600 as Regular */
  --font-weight-semibold: 600;

  /* Project neutral text scale (not generic TDesign defaults). */
  --ais-text-primary: rgba(0, 0, 0, .90);
  --ais-text-secondary: rgba(0, 0, 0, .70);
  --ais-text-placeholder: rgba(0, 0, 0, .50);
  --ais-text-disabled: rgba(0, 0, 0, .30);
  --ais-text-inverse: #fff;

  /* Existing route tokens resolve to the same four roles. */
  --text: var(--ais-text-primary);
  --text-secondary: var(--ais-text-secondary);
  --text-placeholder: var(--ais-text-placeholder);
  --text-disabled: var(--ais-text-disabled);

  --td-text-color-primary: var(--ais-text-primary);
  --td-text-color-secondary: var(--ais-text-secondary);
  --td-text-color-placeholder: var(--ais-text-placeholder);
  --td-text-color-disabled: var(--ais-text-disabled);
  --td-text-color-anti: var(--ais-text-inverse);
}

html {
  font-family: var(--font-ui);
  /* Real 400/500/600 come from the variable fonts. Disable synthesized bold
     only; italic synthesis keeps its normal semantics. */
  font-synthesis-weight: none;
}

body {
  color: var(--ais-text-primary);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 22px;
  font-weight: var(--font-weight-regular);
  font-style: normal;
  font-variation-settings: normal;
  letter-spacing: normal;
}

/* Native controls inherit the page family; component size/weight roles are
   left to each component instead of being reset by `font: inherit`. */
button,
input,
select,
textarea {
  font-family: inherit;
}

/* Non-TDesign content reuses the existing tokens instead of adding a scale. */
.type-caption { font-size: 12px; line-height: 20px; }
.type-section-title { font-size: 16px; line-height: 24px; font-weight: var(--font-weight-semibold); }
.type-page-title { font-size: 24px; line-height: 32px; font-weight: var(--font-weight-semibold); }

/* TCloud Number is reserved for the CVSS base score and EPSS values.
   Those two components declare it locally in assessment.css. Every other
   number -- body copy, tables, issue numbers, statistics, ranks -- follows
   the UI face of the text around it. */

/* Digit-by-digit comparison columns; does not switch to the code face. */
.type-tabular { font-variant-numeric: tabular-nums; }

/* Code, JSON and character-by-character content. IP / CVE / hash / version
   strings in prose keep the UI face and their original characters. */
pre,
code,
kbd,
samp,
.type-code {
  font-family: var(--font-code);
}

.type-text-primary { color: var(--ais-text-primary); }
.type-text-secondary { color: var(--ais-text-secondary); }
.type-text-placeholder { color: var(--ais-text-placeholder); }
.type-text-disabled { color: var(--ais-text-disabled); }

/* Body copy is 400; TDesign titles / emphasis stay 600; an explicit 500 in an
   existing design is left alone. Do not lock wght with font-variation-settings,
   do not globally override strong/b, selected states or .t-* size/weight.
   Font smoothing is a platform opt-in and is not part of this baseline. */
