/**
 * 图标清晰度修复 - 终极版本
 * 针对 Windows 高分屏和字体渲染问题进行优化
 */

/* 基础图标渲染优化 */
.fa, .fas, .far, .fab, .fal,
[class*="fa-"] {
    /* 强制使用 GPU 加速 */
    transform: translateZ(0) scale(1);
    -webkit-transform: translateZ(0) scale(1);
    
    /* 防止字体模糊 */
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    font-smooth: always;
    
    /* 文字渲染优化 */
    text-rendering: geometricPrecision !important;
    
    /* 防止被压缩 */
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    min-width: auto;
    
    /* 行高优化 */
    line-height: 1 !important;
    
    /* 显示模式 */
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    
    /* 防止变形 */
    font-variant: normal;
    font-style: normal;
    font-weight: 900;
}

/* 按钮内的图标 */
.btn .fa, .btn .fas, .btn .far, .btn .fab,
.btn [class*="fa-"] {
    vertical-align: middle !important;
    position: relative;
    top: -1px;
}

/* 导航栏图标 */
.navbar .fa, .navbar .fas, .navbar .far, .navbar .fab {
    font-size: 1em;
    width: 1.25em;
    text-align: center;
}

/* 小图标增强 */
.fa-sm, .btn-sm .fa, .btn-sm .fas,
.me-1, .me-2 {
    font-size: 0.9em !important;
}

/* 针对特定图标的优化 */
.fa-pen, .fa-book, .fa-user-ninja, .fa-fire {
    /* 这些常用图标需要额外的清晰度 */
    -webkit-text-stroke: 0.5px transparent;
}

/* 高分屏优化 */
@media (-webkit-min-device-pixel-ratio: 1.5), 
       (min-resolution: 144dpi),
       (min-resolution: 1.5dppx) {
    .fa, .fas, .far, .fab {
        /* 高分屏使用更精细的渲染 */
        -webkit-font-smoothing: subpixel-antialiased !important;
        text-rendering: optimizeLegibility !important;
    }
}

/* Windows 系统特殊优化 */
@media screen and (-ms-high-contrast: active), 
       screen and (-ms-high-contrast: none) {
    .fa, .fas, .far, .fab {
        /* IE/Edge 浏览器优化 */
        -ms-interpolation-mode: nearest-neighbor;
    }
}

/* 防止图标被截断 */
.card .fa, .card .fas, .card .far, .card .fab,
.alert .fa, .alert .fas, .alert .far, .alert .fab {
    overflow: visible;
}

/* 空状态图标特殊处理 */
.empty-state .fa, .empty-state .fas, 
.empty-state .far, .empty-state .fab {
    font-size: 4rem;
    opacity: 0.5;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

/* 修复 Font Awesome 在 Bootstrap 按钮中的对齐问题 */
.btn > .fa + span,
.btn > .fas + span,
.btn > .far + span {
    margin-left: 0.25rem;
}

/* 确保图标容器不会压缩图标 */
.d-inline-flex > .fa,
.d-inline-flex > .fas,
.d-inline-flex > .far,
.d-inline-flex > .fab {
    flex: 0 0 auto;
}

/* 微信图标 */
.fa-weixin:before {
    content: "\f1d7";
}

/* 微博图标 */
.fa-weibo:before {
    content: "\f18a";
}

/* QQ图标 */
.fa-qq:before {
    content: "\f1d6";
}

/* 哔哩哔哩图标样式 */
.bilibili-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25em;
    height: 1.25em;
    font-family: 'Microsoft YaHei', sans-serif;
    font-weight: 700;
    font-size: 1.1em;
    color: var(--naruto-primary);
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.social-links a:hover .bilibili-icon {
    color: white;
}

/* 社交链接样式 */
.social-links {
    display: flex;
    gap: 0.75rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 69, 0, 0.15);
    border: 1px solid rgba(255, 69, 0, 0.3);
    color: var(--naruto-primary);
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.social-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--naruto-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.social-links a:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(255, 69, 0, 0.3);
}

.social-links a:hover::before {
    opacity: 1;
}

.social-links a i,
.social-links a .fab {
    font-size: 1.25rem;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.social-links a:hover i,
.social-links a:hover .fab {
    color: white;
}
