/* GAG Recipes - 蓝色字体清晰度专项增强 */

/* === 核心原则 === */
/* 1. 所有蓝色文字必须达到WCAG AA对比度标准（4.5:1） */
/* 2. 使用更深、更饱和的蓝色替代偏淡的颜色 */
/* 3. 添加文字渲染优化和阴影效果 */
/* 4. 确保在任何背景下都清晰可见 */

/* === 链接文字增强 === */
a,
.link,
.text-link {
    /* 使用更深的蓝色，对比度更高 */
    color: #1e40af !important;
    
    /* 字体渲染优化 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    
    /* 增强字体权重 */
    font-weight: 600;
    
    /* 轻微文字阴影增强清晰度 */
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
    
    /* 过渡效果 */
    transition: all 0.2s ease;
}

a:hover,
.link:hover,
.text-link:hover {
    /* 悬停时使用更深的蓝色 */
    color: #1e3a8a !important;
    
    /* 增强字体权重 */
    font-weight: 700;
    
    /* 更强的文字阴影 */
    text-shadow: 0 1px 2px rgba(30, 64, 175, 0.2);
}

/* === 导航菜单增强 === */
.nav-menu a,
.navigation a,
.menu-link {
    /* 更深的灰蓝色，提高对比度 */
    color: #374151 !important;
    
    /* 字体渲染优化 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    /* 增强字体权重 */
    font-weight: 600;
    
    /* 文字阴影 */
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
    
    /* 字符间距优化 */
    letter-spacing: 0.01em;
}

.nav-menu a:hover,
.nav-menu a.active,
.navigation a:hover,
.navigation a.active,
.menu-link:hover,
.menu-link.active {
    /* 激活状态使用深蓝色 */
    color: #1e40af !important;
    
    /* 最大字体权重 */
    font-weight: 700;
    
    /* 增强阴影效果 */
    text-shadow: 0 1px 2px rgba(30, 64, 175, 0.15);
}

/* === 段落文字增强 === */
p,
.paragraph,
.text-content {
    /* 使用更深的灰色替代偏淡的#64748b */
    color: #374151 !important;
    
    /* 字体渲染优化 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    /* 增强字体权重 */
    font-weight: 500;
    
    /* 轻微阴影增强可读性 */
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.03);
}

/* === 按钮中的蓝色文字 === */
.btn-primary,
.button-primary,
.primary-button {
    /* 确保按钮文字为白色，背景为深蓝 */
    color: #ffffff !important;
    background-color: #1e40af !important;
    
    /* 字体渲染优化 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    /* 字体权重 */
    font-weight: 600;
    
    /* 白色文字阴影 */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover,
.button-primary:hover,
.primary-button:hover {
    background-color: #1e3a8a !important;
    
    /* 增强阴影 */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* === 次要按钮的蓝色文字 === */
.btn-secondary,
.button-secondary,
.secondary-button {
    /* 深蓝色文字 */
    color: #1e40af !important;
    background-color: #ffffff !important;
    border: 2px solid #1e40af !important;
    
    /* 字体渲染优化 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    /* 字体权重 */
    font-weight: 600;
    
    /* 文字阴影 */
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover,
.button-secondary:hover,
.secondary-button:hover {
    color: #ffffff !important;
    background-color: #1e40af !important;
    
    /* 白色文字阴影 */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* === 卡片标题的蓝色文字 === */
.card h1,
.card h2,
.card h3,
.card h4,
.card h5,
.card h6,
.feature-card h1,
.feature-card h2,
.feature-card h3,
.feature-card h4,
.feature-card h5,
.feature-card h6 {
    /* 深色标题 */
    color: #111827 !important;
    
    /* 字体渲染优化 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    
    /* 增强字体权重 */
    font-weight: 700;
    
    /* 文字阴影 */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    
    /* 字符间距 */
    letter-spacing: -0.01em;
}

/* === 品牌色彩类覆盖 === */
.text-primary,
.text-blue,
.text-primary-600,
.text-blue-600 {
    color: #1e40af !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.08) !important;
}

.text-primary-500,
.text-blue-500 {
    color: #1e40af !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.08) !important;
}

/* === 表单标签增强 === */
.form-label,
label {
    /* 深色标签 */
    color: #374151 !important;
    
    /* 字体权重 */
    font-weight: 600;
    
    /* 文字阴影 */
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

/* === 面包屑导航增强 === */
.breadcrumb a,
.breadcrumb-link {
    color: #1e40af !important;
    font-weight: 500;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.breadcrumb a:hover,
.breadcrumb-link:hover {
    color: #1e3a8a !important;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(30, 64, 175, 0.15);
}

/* === 特殊情况：浅色背景上的深蓝文字 === */
.bg-white .text-blue,
.bg-gray-50 .text-blue,
.bg-gray-100 .text-blue {
    color: #1e40af !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.08) !important;
}

/* === 深色背景上的蓝色文字 === */
.bg-dark .text-blue,
.bg-gray-800 .text-blue,
.bg-gray-900 .text-blue {
    color: #60a5fa !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* === 高分辨率屏幕优化 === */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    a,
    .nav-menu a,
    p,
    .text-primary {
        /* 高分辨率屏幕使用subpixel渲染 */
        -webkit-font-smoothing: subpixel-antialiased;
        
        /* 减少阴影强度 */
        text-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.05);
    }
}

/* === 低分辨率屏幕增强 === */
@media (-webkit-max-device-pixel-ratio: 1.5), (max-resolution: 144dpi) {
    a,
    .nav-menu a,
    p,
    .text-primary {
        /* 强制抗锯齿 */
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        
        /* 增强阴影 */
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        
        /* 增加字体权重 */
        font-weight: 600;
    }
}

/* === 移动设备优化 === */
@media (max-width: 768px) {
    a,
    .nav-menu a,
    .text-primary {
        /* 移动设备增强字体大小 */
        font-size: calc(1em + 0.1vw);
        
        /* 增强触摸目标 */
        padding: 0.25rem 0;
        
        /* 更强的文字阴影 */
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }
}

/* === 无障碍访问增强 === */
@media (prefers-contrast: high) {
    a,
    .nav-menu a,
    p,
    .text-primary {
        /* 高对比度模式使用纯黑色 */
        color: #000000 !important;
        text-shadow: none !important;
        font-weight: 700 !important;
    }
}

/* === 打印样式优化 === */
@media print {
    a,
    .nav-menu a,
    .text-primary {
        color: #000000 !important;
        text-shadow: none !important;
        text-decoration: underline !important;
    }
}

/* === 调试模式 - 显示颜色对比度信息 === */
.debug-contrast::after {
    content: "Color: " attr(data-color) " | Contrast: " attr(data-contrast-ratio);
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
    font-family: monospace;
}
