/* ============================================
   index.html 专属增强样式
   说明: 基于 main.css 设计系统，覆盖主色调为蓝色系，
         保留首页专属动画和视觉效果
   ============================================ */

/* 覆盖 main.css 变量为蓝色系（与其他页面内联样式一致） */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #dbeafe;
    --secondary: #8b5cf6;
    --secondary-dark: #7c3aed;
    --accent: #06b6d4;
}

[data-theme="dark"] {
    --primary: #60a5fa;
    --primary-dark: #3b82f6;
    --primary-light: #1e3a5f;
    --secondary: #a78bfa;
    --secondary-dark: #8b5cf6;
    --accent: #22d3ee;
}

/* ============================================
   Hero 浮动粒子
   ============================================ */
.hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.hero-particles span {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(59, 130, 246, 0.25);
    border-radius: 50%;
    animation: heroFloat 8s ease-in-out infinite;
}

.hero-particles span:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; animation-duration: 7s; }
.hero-particles span:nth-child(2) { left: 20%; top: 60%; animation-delay: 1s; animation-duration: 9s; }
.hero-particles span:nth-child(3) { left: 35%; top: 30%; animation-delay: 2s; animation-duration: 8s; width: 4px; height: 4px; }
.hero-particles span:nth-child(4) { left: 50%; top: 70%; animation-delay: 0.5s; animation-duration: 10s; }
.hero-particles span:nth-child(5) { left: 65%; top: 25%; animation-delay: 1.5s; animation-duration: 7.5s; width: 5px; height: 5px; }
.hero-particles span:nth-child(6) { left: 75%; top: 55%; animation-delay: 3s; animation-duration: 9s; }
.hero-particles span:nth-child(7) { left: 85%; top: 35%; animation-delay: 2.5s; animation-duration: 8.5s; width: 3px; height: 3px; }
.hero-particles span:nth-child(8) { left: 90%; top: 75%; animation-delay: 1s; animation-duration: 7s; }

@keyframes heroFloat {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.3; }
    50% { transform: translateY(-30px) scale(1.3); opacity: 0.6; }
}

/* ============================================
   Hero 标题渐变文字
   ============================================ */
.hero-title .gradient-text {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: heroTextGradient 4s ease infinite;
}

@keyframes heroTextGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ============================================
   头像呼吸光环
   ============================================ */
.about-avatar {
    position: relative;
}

.about-avatar::after {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    z-index: -1;
    animation: avatarRing 3s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes avatarRing {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.05); opacity: 0.3; }
}

/* ============================================
   博客卡片缩略图
   ============================================ */
.blog-card .blog-thumbnail {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-size: 2.5rem;
    position: relative;
    overflow: hidden;
}

.blog-card .blog-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.blog-card:hover .blog-thumbnail::after {
    left: 100%;
}

/* ============================================
   分类图标彩色覆盖
   ============================================ */
.category-card:nth-child(1) .category-icon { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.category-card:nth-child(2) .category-icon { background: linear-gradient(135deg, #ec4899, #f59e0b); }
.category-card:nth-child(3) .category-icon { background: linear-gradient(135deg, #10b981, #3b82f6); }
.category-card:nth-child(4) .category-icon { background: linear-gradient(135deg, #f59e0b, #ec4899); }
.category-card:nth-child(5) .category-icon { background: linear-gradient(135deg, #8b5cf6, #3b82f6); }
.category-card:nth-child(6) .category-icon { background: linear-gradient(135deg, #06b6d4, #10b981); }

/* ============================================
   卡片滚动入场过渡（配合 main.js IntersectionObserver）
   ============================================ */
.blog-grid .blog-card,
.categories-grid .category-card {
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* ============================================
   标签呼吸效果
   ============================================ */
.tags-container .tag {
    animation: tagPulse 3s ease-in-out infinite;
}

.tags-container .tag:nth-child(2n) { animation-delay: 0.5s; }
.tags-container .tag:nth-child(3n) { animation-delay: 1s; }

@keyframes tagPulse {
    0%, 100% { box-shadow: 0 0 0 rgba(59, 130, 246, 0); }
    50% { box-shadow: 0 0 12px rgba(59, 130, 246, 0.15); }
}

/* ============================================
   加载进度条
   ============================================ */
.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--border-color);
    z-index: 9999;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.3s ease;
}

/* ============================================
   响应式减弱动画
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .hero-particles span,
    .hero-title .gradient-text,
    .about-avatar::after,
    .tags-container .tag {
        animation: none !important;
    }
}

/* ============================================
   Footer 底部美化
   ============================================ */
.footer-bottom {
    padding-top: var(--space-lg, 1.5rem);
}

.footer-tech {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm, 0.5rem);
    margin-bottom: var(--space-md, 1rem);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.tech-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
    border-radius: var(--radius-full, 9999px);
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(99, 102, 241, 0.15);
    transition: all 0.25s ease;
}

.tech-badge:hover {
    background: rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}

.tech-badge i {
    font-size: 0.9em;
}

.footer-sep {
    color: var(--border-color);
    margin: 0 0.25rem;
    user-select: none;
}

.footer-brand {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.25s ease;
}

.footer-brand:hover {
    color: var(--secondary);
}

.footer-copyright {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    font-size: 0.8rem;
    line-height: 2;
    color: var(--text-muted);
}

.footer-copyright i {
    margin-right: 0.15rem;
    font-size: 0.85em;
    opacity: 0.7;
}

.footer-icp {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.25s ease;
}

.footer-icp:hover {
    color: var(--primary);
}

/* Footer 底部响应式 */
@media (max-width: 768px) {
    .footer-tech {
        gap: 0.4rem;
    }

    .footer-copyright {
        flex-direction: column;
        line-height: 2;
    }

    .footer-copyright .footer-sep {
        display: none;
    }
}
