/**
 * SeoAIu 全站字体与排版优化
 * - 统一中文字体栈，跨平台呈现一致
 * - 修复 H1 行高过紧问题
 * - 提升卡片描述文字可读性
 * - 优化 banner 文字对比度
 * - 改善中英混排和数字对齐
 */

/* ========== 全局字体变量 ========== */
:root {
    /* 中文字体栈：按优先级排序，优先使用各系统原生高质量中文字体 */
    --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei",
        "Hiragino Sans GB", "Noto Sans CJK SC", "Source Han Sans SC",
        "WenQuanYi Micro Hei", "Inter", -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif,
        "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";

    /* 等宽字体：用于代码和数字 */
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco,
        Consolas, "Liberation Mono", "Courier New", monospace;
}

/* ========== 应用到 html 和 body ========== */
html {
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-variant-numeric: tabular-nums;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== 标题行高优化 ========== */
/* 修复首页 H1 line-height: 1.0 过紧问题 */
h1 {
    line-height: 1.25 !important;
    letter-spacing: -0.01em;
    font-weight: 700;
}

h2 {
    line-height: 1.3;
    letter-spacing: -0.005em;
    font-weight: 700;
}

h3 {
    line-height: 1.4;
    font-weight: 600;
}

/* ========== 工具卡片描述文字优化 ========== */
/* 提升可读性：字号从 12px 提升到 14px，颜色加深，行高增加 */
.tool-card-desc,
.tool-description,
.card-description,
[class*="tool-card"] p,
[class*="tool-card"] .text-slate-500,
.tool-grid .text-slate-500 {
    font-size: 14px !important;
    line-height: 1.65 !important;
    color: #475569 !important;
}

/* 卡片标题字体 */
.tool-card-title,
[class*="tool-card"] h3,
[class*="tool-card"] h4,
.tool-grid .font-semibold {
    line-height: 1.4;
    font-size: 15px;
}

/* ========== Banner 文字对比度优化 ========== */
/* 白色文字在图片背景上，添加渐变遮罩增强可读性 */
.banner-text,
[class*="banner"] h1,
[class*="banner"] h2,
[class*="banner"] .text-white {
    text-shadow: 0 2px 8px rgba(15, 23, 42, 0.35);
}

.banner-overlay {
    background: linear-gradient(to right,
        rgba(15, 23, 42, 0.45) 0%,
        rgba(15, 23, 42, 0.15) 50%,
        rgba(15, 23, 42, 0.0) 100%);
}

/* 工具详情页和文章详情页的 banner 遮罩 */
.detail-banner-bg {
    background: linear-gradient(135deg,
        rgba(30, 41, 59, 0.85) 0%,
        rgba(15, 23, 42, 0.75) 100%);
}

/* ========== 段落文本优化 ========== */
p {
    line-height: 1.65;
}

/* 副标题 / 导语文字 */
.subtitle,
.lead,
.intro-text {
    font-size: 17px;
    line-height: 1.7;
    color: #475569;
}

/* ========== 导航栏文字优化 ========== */
.nav-link,
header a,
nav a {
    font-size: 15px;
    line-height: 1.5;
}

/* ========== 列表文字优化 ========== */
li {
    line-height: 1.7;
}

/* ========== 数字和代码文本优化 ========== */
code,
pre {
    font-family: var(--font-mono);
}

/* ========== 小字（页脚、辅助信息）优化 ========== */
footer,
.footer-text,
.text-sm {
    font-size: 14px;
    line-height: 1.6;
}

/* ========== 中文标点符号优化 ========== */
/* 防止全角标点被当作半角处理 */
:lang(zh-CN) {
    font-feature-settings: "kern" 1;
}

/* ========== 响应式字号调整 ========== */
@media (max-width: 640px) {
    body {
        font-size: 15px;
    }

    .tool-card-desc,
    .tool-description,
    .card-description {
        font-size: 13px !important;
    }

    footer,
    .text-sm {
        font-size: 13px;
    }
}
