/* ==UserStyle==
@name:en Global Font: Apple-branded
@name 全局苹方
@namespace franciszhao
@version 2.5.2
@description:en An user stylesheet to replace all fonts on web pages with Apple-branded fonts, brings you a more unified and beautiful visual style.
@description 一款使用苹果品牌字体替换网页原有字体的用户样式表，为你呈现更统一美观的页面风格。
@author Francis Zhao <francis@n2o.io>
@homepageURL https://n2o.io/go?page=userstyles
@supportURL https://n2o.io/go?page=userstyles
@license MIT
@preprocessor default
==/UserStyle== */

@use 'base';
@use 'specific';

// 全局字体定义

// 无衬线字体
$font-sans-serif: 'San Francisco';
$font-sans-serif-fallback: 'Source Sans 3';

$font-sans-serif-sc: 'PingFang SC';
$font-sans-serif-sc-fallback: 'Source Han Sans SC', 'HanHei SC',
  base.$font-system-ui;

$font-sans-serif-tc: 'PingFang TC';
$font-sans-serif-tc-fallback: 'Source Han Sans TC', 'HanHei TC',
  base.$font-system-ui;

$font-sans-serif-hc: 'PingFang HK';
$font-sans-serif-hc-fallback: 'Source Han Sans HC', $font-sans-serif-tc,
  $font-sans-serif-tc-fallback;

// 等宽字体
$font-monospace: 'SF Mono';
$font-monospace-fallback: 'Source Code Pro';

$font-monospace-sc: 'SF Mono';
$font-monospace-sc-fallback: 'PingFang SC';

$font-monospace-tc: 'SF Mono';
$font-monospace-tc-fallback: 'PingFang TC';

$font-monospace-hc: 'SF Mono';
$font-monospace-hc-fallback: 'PingFang HK';

/* 字体设定 */

// ✔️ 拉丁字母、西里尔字母、希腊文
// ❌ 阿拉伯字母、希伯来文、泰文

$vendor: 'apple';
@-moz-document url-prefix() {
}

@include base.default-font-families(
  $font-sans-serif:
    base.get-default(
      $generic: 'sans-serif',
      $font-list: (
        $font-sans-serif,
        $font-sans-serif-fallback,
      )
    ),
  $font-monospace:
    base.get-default(
      $generic: 'monospace',
      $font-list: (
        $font-monospace,
        $font-monospace-fallback,
      )
    ),
  $font-sans-serif-sc:
    base.get-default(
      $generic: 'sans-serif',
      $font-list: (
        $font-sans-serif-sc,
        $font-sans-serif-sc-fallback,
      )
    ),
  $font-monospace-sc:
    base.get-default(
      $generic: 'monospace',
      $font-list: (
        $font-monospace-sc,
        $font-monospace-sc-fallback,
      )
    ),
  $font-sans-serif-tc:
    base.get-default(
      $generic: 'sans-serif',
      $font-list: (
        $font-sans-serif-tc,
        $font-sans-serif-tc-fallback,
      )
    ),
  $font-monospace-tc:
    base.get-default(
      $generic: 'monospace',
      $font-list: (
        $font-monospace-tc,
        $font-monospace-tc-fallback,
      )
    ),
  $font-sans-serif-hc:
    base.get-default(
      $generic: 'sans-serif',
      $font-list: (
        $font-sans-serif-hc,
        $font-sans-serif-hc-fallback,
      )
    ),
  $font-monospace-hc:
    base.get-default(
      $generic: 'monospace',
      $font-list: (
        $font-monospace-hc,
        $font-monospace-hc-fallback,
      )
    ),
  $vendor: $vendor
);

/* 字体替换 */

@include base.font-face-replace(
  $font-sans-serif: $font-sans-serif,
  $font-monospace: $font-monospace,
  $font-sans-serif-sc: $font-sans-serif-sc,
  $font-sans-serif-tc: $font-sans-serif-tc,
  $font-sans-serif-hc: $font-sans-serif-hc
);

/* 特定网站适配 */

@include specific.websites(
  $font-sans-serif:
    base.get-default(
      $generic: 'sans-serif',
      $font-list: (
        $font-sans-serif-sc,
        $font-sans-serif-sc-fallback,
      )
    ),
  $font-monospace:
    base.get-default(
      $generic: 'monospace',
      $font-list: (
        $font-monospace-sc,
        $font-monospace-sc-fallback,
      )
    )
);

// 真的到底了
