/**
 * BossV Team - 系统字体栈 (2026-02-27)
 *
 * 替代 Google Fonts，使用系统原生字体提升中国访问速度
 *
 * 字体栈设计原则：
 * 1. 系统字体优先 - 零网络请求
 * 2. 平台适配 - macOS/Windows/iOS/Android 各自最佳字体
 * 3. 中文支持 - 包含常用中文字体
 * 4. 优雅降级 - 从最理想字体到最通用字体
 */

/* ========================================
   CSS 变量定义
   ======================================== */
:root {
    /* 主字体栈 - 正文、UI 元素 */
    --font-sans-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                      "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC",
                      "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

    /* 展示字体栈 - 标题、大字号文本 (替代 Inter/Outfit/Poppins) */
    --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                    "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;

    /* 等宽字体栈 - 代码、数据展示 */
    --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
                 "Courier New", monospace;

    /* 特殊字体栈 - 科技风格标题 (替代 Orbitron/Rajdhani) */
    --font-tech: "SF Pro Display", -apple-system, BlinkMacSystemFont,
                 "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ========================================
   全局应用
   ======================================== */
body {
    font-family: var(--font-sans-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 标题使用展示字体 */
h1, h2, h3, h4, h5, h6,
.title, .heading, .headline {
    font-family: var(--font-display);
    font-weight: 600;
}

/* 科技风格模板特殊处理 */
.tech-theme, .cyber-theme, .neon-theme,
body[class*="techstream"] {
    font-family: var(--font-tech);
}

/* 代码和数字使用等宽字体 */
code, pre, kbd, samp,
.code, .mono, .data-value {
    font-family: var(--font-mono);
}

/* ========================================
   字重映射 (Google Fonts 替代)
   ======================================== */
/*
 * Inter/Outfit/Poppins 字重映射:
 * 300 → 300 (Light)
 * 400 → 400 (Regular)
 * 500 → 500 (Medium)
 * 600 → 600 (SemiBold)
 * 700 → 700 (Bold)
 * 800 → 800 (ExtraBold)
 * 900 → 900 (Black)
 */

.font-light { font-weight: 300; }
.font-regular { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-black { font-weight: 900; }

/* ========================================
   模板特定优化
   ======================================== */

/* Netflix 模板 - Inter 替代 */
.template-netflix body,
body.netflix-theme {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
}

/* Apple 模板 - SF Pro 风格 */
.template-apple body,
body.apple-theme {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
                 "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Techstream 模板 - 科幻风格 */
.template-techstream body,
body.techstream-theme {
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont,
                 "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    letter-spacing: -0.02em;
}

/* Pro1 模板 - Outfit 替代 */
.template-pro1 body,
body.pro1-theme {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
}

/* Stream1 模板 - Poppins 替代 */
.template-stream1 body,
body.stream1-theme {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
}

/* ========================================
   平台特定优化
   ======================================== */

/* macOS 优先 */
@media screen and (-webkit-min-device-pixel-ratio: 1) {
    :root {
        --font-sans-base: -apple-system, BlinkMacSystemFont, "SF Pro Text",
                          "Helvetica Neue", Arial, sans-serif;
        --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display",
                        "Helvetica Neue", Arial, sans-serif;
    }
}

/* Windows 优化 */
@media screen and (min-width: 0\0) {
    :root {
        --font-sans-base: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
        --font-display: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    }
}

/* Android 优化 */
@media screen and (-webkit-min-device-pixel-ratio: 0) and (min-width: 0px) {
    :root {
        --font-sans-base: "Roboto", "Noto Sans SC", "Droid Sans", sans-serif;
    }
}

/* ========================================
   优雅降级 - 字体加载失败时的处理
   ======================================== */
@supports not (font-family: -apple-system) {
    /* 不支持系统字体栈的老浏览器 */
    body {
        font-family: "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
    }
}
