/* 热门推荐小工具样式 */

/* 小工具容器 */
.tb-widget-hot-recommend {
    margin-bottom: 30px;
}

/* 工具网格 */
.hot-recommend-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

/* 工具卡片 */
.tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* 工具链接 */
.tool-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    width: 100%;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 12px;
    padding: 8px;
}

.tool-link:hover {
    background-color: rgba(0, 0, 0, 0.02);
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: inherit;
}

/* 深色模式下的交互效果 */
@media (prefers-color-scheme: dark) {
    .tool-link:hover {
        background-color: rgba(255, 255, 255, 0.05);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
}




/* 工具图标容器 */
.tool-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    border-radius: 8px;
    position: relative;
}

.tool-link:hover .tool-icon {
    animation-play-state: paused;
    transform: scale(1.08);
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 深色模式下图标交互效果 */
@media (prefers-color-scheme: dark) {
    .tool-link:hover .tool-icon {
        background-color: rgba(255, 255, 255, 0.15);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }
}

/* 图标摇摆动画 */
.tool-icon {
    animation: iconSway 3s ease-in-out infinite;
}

/* 为不同位置的图标添加不同的动画延迟 */
.tool-card:nth-child(1) .tool-icon { animation-delay: 0s; }
.tool-card:nth-child(2) .tool-icon { animation-delay: 0.2s; }
.tool-card:nth-child(3) .tool-icon { animation-delay: 0.4s; }
.tool-card:nth-child(4) .tool-icon { animation-delay: 0.6s; }
.tool-card:nth-child(5) .tool-icon { animation-delay: 0.8s; }
.tool-card:nth-child(6) .tool-icon { animation-delay: 1s; }
.tool-card:nth-child(7) .tool-icon { animation-delay: 1.2s; }
.tool-card:nth-child(8) .tool-icon { animation-delay: 1.4s; }
.tool-card:nth-child(9) .tool-icon { animation-delay: 1.6s; }
.tool-card:nth-child(10) .tool-icon { animation-delay: 1.8s; }
.tool-card:nth-child(11) .tool-icon { animation-delay: 2s; }
.tool-card:nth-child(12) .tool-icon { animation-delay: 2.2s; }

@keyframes iconSway {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

/* 图标大小变体 */
.tool-icon.icon-small {
    width: 45px;
    height: 45px;
    animation: iconSway 2.5s ease-in-out infinite;
}

.tool-icon.icon-medium {
    width: 50px;
    height: 50px;
    animation: iconSway 3s ease-in-out infinite;
}

.tool-icon.icon-large {
    width: 55px;
    height: 55px;
    animation: iconSway 3.5s ease-in-out infinite;
}

/* 图标图片 */
.tool-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* 首字母显示 */
.tool-letter {
    width: 50px;
    height: 50px;
    margin-bottom: 8px;
    font-size: 20px;
    font-weight: 700;
    color: #333;
    text-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.tool-link:hover .tool-letter {
    transform: scale(1.08);
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 深色模式下字母图标交互效果 */
@media (prefers-color-scheme: dark) {
    .tool-link:hover .tool-letter {
        background-color: rgba(255, 255, 255, 0.15);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }
}

/* 悬浮提示框样式 */
.tool-link[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    white-space: normal;
    width: 160px;
    text-align: center;
    word-wrap: break-word;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
    z-index: 9999;
    margin-bottom: 12px;
    opacity: 0;
    animation: tooltipFadeIn 0.3s ease forwards;
}

.tool-link[data-tooltip]:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #8b5cf6;
    margin-bottom: 4px;
    opacity: 0;
    animation: tooltipFadeIn 0.3s ease forwards;
    z-index: 9999;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 深色模式下的提示框 */
@media (prefers-color-scheme: dark) {
    .tool-link[data-tooltip]:hover::before {
        background: linear-gradient(135deg, #a855f7, #9333ea);
        box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4);
    }
    
    .tool-link[data-tooltip]:hover::after {
        border-top-color: #a855f7;
    }
}

.tool-letter.icon-small {
    width: 45px;
    height: 45px;
    font-size: 18px;
}

.tool-letter.icon-medium {
    width: 50px;
    height: 50px;
    font-size: 20px;
}

.tool-letter.icon-large {
    width: 55px;
    height: 55px;
    font-size: 22px;
}

/* 工具名称 */
.tool-name {
    font-size: 18px;
    font-weight: normal;
    color: transparent; /* 使用渐变文本需设置透明色 */
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
    overflow: visible;
    text-overflow: unset;
    max-width: none;
    /* 彩色循环渐变（与AI教程卡片标题一致） */
    background: linear-gradient(90deg,#1f80ff 0%,#6c5ce7 25%,#ff9f0a 50%,#ff6a00 75%,#1f80ff 100%);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: titleGradientFlow 6s linear infinite;
}

/* 无内容提示 */
.no-posts {
    text-align: center;
    color: #999;
    font-size: 14px;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #dee2e6;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .hot-recommend-grid {
        grid-template-columns: repeat(12, 1fr);
        gap: 12px;
    }
    
    .tool-icon, .tool-letter {
        width: 45px;
        height: 45px;
    }
    
    .tool-name {
        font-size: 16px;
        font-weight: normal;
        max-width: none;
    }
}

@media (max-width: 768px) {
    .hot-recommend-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 12px;
    }
    
    .tool-icon, .tool-letter {
        width: 50px;
        height: 50px;
    }
    
    .tool-icon.icon-small, .tool-letter.icon-small {
        width: 45px;
        height: 45px;
    }
    
    .tool-icon.icon-large, .tool-letter.icon-large {
        width: 55px;
        height: 55px;
    }
    
    .tool-name {
        font-size: 17px;
        font-weight: normal;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .hot-recommend-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    .tool-icon, .tool-letter {
        width: 45px;
        height: 45px;
    }
    
    .tool-icon.icon-small, .tool-letter.icon-small {
        width: 40px;
        height: 40px;
    }
    
    .tool-icon.icon-large, .tool-letter.icon-large {
        width: 50px;
        height: 50px;
    }
    
    .tool-name {
        font-size: 16px;
        font-weight: normal;
        max-width: none;
    }
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .tool-name {
        /* 暗色模式下为渐变文字增加轻微阴影提升可读性 */
        text-shadow: 0 1px 1px rgba(0,0,0,.4);
    }
    
    .no-posts {
        background: #2a2a2a;
        border-color: #404040;
        color: #999;
    }
}

/* 主题深色模式 */
body.darking .tool-name,
html[data-night="1"] .tool-name {
    text-shadow: 0 1px 1px rgba(0,0,0,.4) !important;
}

body.darking .no-posts,
html[data-night="1"] .no-posts {
    background: #2a2a2a !important;
    border-color: #404040 !important;
    color: #999 !important;
}

/* 动画效果 */
@keyframes toolCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-card {
    animation: toolCardFadeIn 0.5s ease-out;
}

.tool-card:nth-child(1) { animation-delay: 0.1s; }
.tool-card:nth-child(2) { animation-delay: 0.2s; }
.tool-card:nth-child(3) { animation-delay: 0.3s; }
.tool-card:nth-child(4) { animation-delay: 0.4s; }
.tool-card:nth-child(5) { animation-delay: 0.5s; }
.tool-card:nth-child(6) { animation-delay: 0.6s; }
.tool-card:nth-child(7) { animation-delay: 0.7s; }
.tool-card:nth-child(8) { animation-delay: 0.8s; }
.tool-card:nth-child(9) { animation-delay: 0.9s; }
.tool-card:nth-child(10) { animation-delay: 1.0s; }
.tool-card:nth-child(11) { animation-delay: 1.1s; }
.tool-card:nth-child(12) { animation-delay: 1.2s; }

/* 图标悬停效果 - 已移除背景效果 */
