/**
 * 首页样式
 */

.hero-section {
    text-align: center;
    padding: 100px 20px 40px;
    position: relative;
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    line-height: 1.15;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-weight: 400;
    line-height: 1.6;
    max-width: 560px;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 0.1s forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 16px;
    padding: 0 20px 60px;
}

.tool-card {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    transition: all 0.28s ease;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    animation: cardFadeIn 0.5s ease-out both;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
    min-height: 240px;
}

.tool-card:nth-child(1) { animation-delay: 0.03s; }
.tool-card:nth-child(2) { animation-delay: 0.06s; }
.tool-card:nth-child(3) { animation-delay: 0.09s; }
.tool-card:nth-child(4) { animation-delay: 0.12s; }
.tool-card:nth-child(5) { animation-delay: 0.15s; }
.tool-card:nth-child(6) { animation-delay: 0.18s; }
.tool-card:nth-child(7) { animation-delay: 0.21s; }
.tool-card:nth-child(8) { animation-delay: 0.24s; }

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tool-card:active {
    transform: translateY(-2px) scale(0.99);
    transition: transform 0.15s ease;
}

.tool-card-content {
    padding: 22px;
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tool-card-bg {
    display: none;
}

.tool-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 18px;
    color: #ffffff;
    position: relative;
    transition: all 0.28s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tool-card:hover .tool-card-icon {
    transform: scale(1.05);
}

.tool-card-icon i {
    color: #ffffff;
    transition: all 0.28s ease;
}

.tool-card-icon.invest { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.tool-card-icon.weather { background: linear-gradient(135deg, #11998e 0%, #38f7d6 100%); }
.tool-card-icon.tools { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); }
.tool-card-icon.health { background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%); }
.tool-card-icon.life { background: linear-gradient(135deg, #10b981 0%, #34d399 100%); }
.tool-card-icon.finance { background: linear-gradient(135deg, #ec4899 0%, #f472b6 100%); }

.tool-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: -0.01em;
    line-height: 1.35;
    transition: color 0.25s ease;
}

.tool-card:hover .tool-card-title {
    color: var(--primary-color);
}

.tool-card-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 14px;
    flex: 0 0 auto;
    font-weight: 400;
    transition: color 0.25s ease;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 48px;
}

.tool-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 48px;
    overflow: hidden;
}

.tool-tag {
    font-size: 0.75rem;
    padding: 5px 12px;
    background: rgba(99, 102, 241, 0.06);
    color: var(--primary-color);
    border-radius: 6px;
    font-weight: 500;
    border: 1px solid rgba(99, 102, 241, 0.12);
    transition: all 0.25s ease;
    letter-spacing: 0.01em;
    cursor: pointer;
}

.tool-tag:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

.tool-card:hover .tool-tag {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
}

.favorite-btn {
    transition: all 0.25s ease;
}

.favorite-btn:hover {
    transform: scale(1.15);
}

.favorite-btn:active {
    transform: scale(1.25);
}

.category-btn {
    transition: all 0.25s ease;
}

.category-btn:hover {
    transform: translateY(-2px);
}

.category-btn:active {
    transform: scale(0.97);
}

.quick-nav {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out 0.3s forwards;
}

.quick-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.25s ease;
    position: relative;
}

.quick-nav-item:hover {
    background: rgba(99, 102, 241, 0.04);
    border-color: rgba(99, 102, 241, 0.2);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.quick-nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.quick-nav-item i {
    font-size: 1rem;
    transition: all 0.25s ease;
}

.quick-nav-item span {
    font-weight: 500;
}

::selection {
    background: rgba(99, 102, 241, 0.2);
    color: var(--text-primary);
}

::-moz-selection {
    background: rgba(99, 102, 241, 0.2);
    color: var(--text-primary);
}

*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hero-title,
    .hero-subtitle,
    .quick-nav,
    .tool-card {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 70px 16px 32px;
    }

    .hero-title {
        font-size: clamp(2rem, 9vw, 3rem);
        margin-bottom: 12px;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 24px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0 16px 32px;
    }

    .tool-card {
        min-height: 200px;
    }

    .tool-card-content {
        padding: 20px;
    }

    .tool-card-icon {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
        margin-bottom: 16px;
    }

    .tool-card-title {
        font-size: 1.1rem;
    }

    .tool-card-desc {
        font-size: 0.85rem;
        line-height: 1.6;
    }

    .quick-nav {
        gap: 6px;
        margin-top: 20px;
    }

    .quick-nav-item {
        padding: 8px 14px;
        font-size: 0.82rem;
    }

    .quick-nav-item i {
        font-size: 0.95rem;
    }
}

.tool-card::before,
.tool-card::after {
    display: none !important;
}

body::before {
    background:
        radial-gradient(circle at 10% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 90% 100%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, #05050a 0%, #080810 100%);
    animation: none !important;
}

body::after {
    display: none !important;
}

.hero-section::before {
    display: none !important;
}

[data-theme="light"] body::before {
    background:
        radial-gradient(circle at 10% 0%, rgba(0, 122, 255, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 90% 100%, rgba(88, 86, 214, 0.04) 0%, transparent 50%),
        linear-gradient(180deg, #f5f5f7 0%, #ffffff 100%);
}

/* ============================================
 * Glass Apple 主题首页样式
 * ============================================ */
[data-theme="glass-apple"] .tool-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.04),
        0 8px 24px rgba(0, 0, 0, 0.06),
        0 0 0 0.5px rgba(255, 255, 255, 0.6) inset;
}

[data-theme="glass-apple"] .tool-card:hover {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.08),
        0 16px 48px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.8) inset;
    transform: translateY(-4px) scale(1.01);
}

[data-theme="glass-apple"] .tool-card-icon {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="glass-apple"] .tool-tag {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: #1d1d1f;
}

[data-theme="glass-apple"] .hero-title {
    background: linear-gradient(135deg, #1d1d1f 0%, #424245 50%, #1d1d1f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

[data-theme="glass-apple"] .section-header h2 {
    background: linear-gradient(135deg, #1d1d1f 0%, #424245 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="glass-apple"] body::before {
    background:
        radial-gradient(circle at 10% 0%, rgba(0, 122, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 90% 100%, rgba(88, 86, 214, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, #f5f5f7 0%, #ffffff 100%);
}

/* ============================================
 * Glass Purple 主题首页样式
 * ============================================ */
[data-theme="glass-purple"] .tool-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.04),
        0 8px 24px rgba(0, 0, 0, 0.06),
        0 0 0 0.5px rgba(255, 255, 255, 0.6) inset;
}

[data-theme="glass-purple"] .tool-card:hover {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.08),
        0 16px 48px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.8) inset;
    transform: translateY(-4px) scale(1.01);
}

[data-theme="glass-purple"] .tool-card-icon {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="glass-purple"] .tool-tag {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: #1d1d1f;
}

[data-theme="glass-purple"] .hero-title {
    background: linear-gradient(135deg, #1d1d1f 0%, #424245 50%, #1d1d1f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

[data-theme="glass-purple"] .section-header h2 {
    background: linear-gradient(135deg, #1d1d1f 0%, #424245 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="glass-purple"] body::before {
    background:
        radial-gradient(circle at 10% 0%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 90% 100%, rgba(167, 139, 250, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, #f5f5f7 0%, #ffffff 100%);
}
