/**
 * 首页样式
 */

/* 动画 */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(102, 126, 234, 0.3); }
    50% { box-shadow: 0 0 40px rgba(102, 126, 234, 0.5); }
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

/* 懒加载图片样式 */
.lazy-image {
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    background: linear-gradient(135deg, #f5f7ff 0%, #e8edff 50%, #e0e7ff 100%);
}

.lazy-image.loaded {
    opacity: 1;
}

/* Hero 区域 */
.hero-section {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    border-radius: 28px;
    padding: 48px 40px;
    margin-bottom: 24px;
    box-shadow: 
        0 20px 60px rgba(102, 126, 234, 0.18),
        0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.9);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -25%;
    width: 90%;
    height: 120%;
    background: radial-gradient(circle at center, rgba(102, 126, 234, 0.18) 0%, rgba(118, 75, 162, 0.1) 40%, transparent 70%);
    pointer-events: none;
    animation: float 6s ease-in-out infinite;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -20%;
    width: 60%;
    height: 80%;
    background: radial-gradient(circle at center, rgba(240, 147, 251, 0.12) 0%, transparent 60%);
    pointer-events: none;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 35%, #f093fb 70%, #667eea 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 14px;
    letter-spacing: -1px;
    animation: gradient-shift 8s ease infinite;
}

.hero-content p {
    font-size: 17px;
    color: var(--text-gray);
    margin-bottom: 28px;
    line-height: 1.7;
    font-weight: 400;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

.hero-actions .btn-primary {
    position: relative;
    overflow: hidden;
    animation: pulse-glow 3s ease-in-out infinite;
}

.hero-actions .btn-primary::before {
    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.5s ease;
}

.hero-actions .btn-primary:hover::before {
    left: 100%;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 80px;
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid rgba(102, 126, 234, 0.1);
    position: relative;
    z-index: 1;
}

.stat-item {
    text-align: center;
    position: relative;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-item::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.stat-item:hover::before {
    opacity: 1;
}

.stat-item:hover {
    transform: translateY(-4px);
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

.stat-text {
    font-size: 14px;
    color: var(--text-gray);
    font-weight: 500;
}

/* 商品卡片链接样式 */
.product-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.product-card-link:hover .product-card {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(102, 126, 234, 0.15);
}

/* Card 通用样式 */
.card {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.08),
        0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(208, 215, 255, 0.6);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.5;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.08);
}

.card-title {
    font-size: 21px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 2px;
}

.card-title-link {
    text-decoration: none;
    color: inherit;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-title-link:hover .card-title {
    color: var(--primary-color);
    transform: translateX(4px);
}

.card-title-link:hover .card-title::before {
    box-shadow: 0 0 15px var(--primary-color);
}

.card-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.card-link:hover {
    color: var(--primary-dark);
    transform: translateX(4px);
}

/* 智能体卡片 */
.product-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.06),
        0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(208, 215, 255, 0.5);
    position: relative;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    transform: scaleX(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover::before {
    transform: scaleX(1);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 20px 50px rgba(102, 126, 234, 0.22),
        0 0 0 1px rgba(102, 126, 234, 0.2);
}

.product-image {
    width: 100%;
    height: 170px;
    background: linear-gradient(135deg, #f5f7ff 0%, #e8edff 50%, #e0e7ff 100%);
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-info {
    padding: 20px;
}

.product-category {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%);
    color: var(--primary-color);
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.45;
}

.product-title a {
    color: inherit;
    text-decoration: none;
    position: relative;
}

.product-title a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

.product-title a:hover::after {
    width: 100%;
}

.product-title a:hover {
    color: var(--primary-color);
}

.product-summary {
    font-size: 13px;
    color: var(--text-gray);
    margin-bottom: 12px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 42px;
}

.product-price {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
}

.home-product-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-product-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.home-product-summary {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.5;
    margin: 0 0 12px 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 11px;
    color: var(--text-light);
    padding-top: 10px;
    margin-top: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.home-product-meta span:not(.price-badge) {
    display: flex;
    align-items: center;
    gap: 3px;
}

.home-product-image {
    width: 100%;
    height: auto !important;
    aspect-ratio: 3/4;
    background: #fff;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-product-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain !important;
    object-position: center;
}

.home-product-card:hover .home-product-image img {
    transform: none;
}

.home-product-meta .price-badge.free {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
}

.home-product-meta .price-badge:not(.free) {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
}

.home-product-info > div:last-child {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
    padding-top: 8px;
}

.home-price-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--danger-color);
    line-height: 1;
}

.price-badge.free {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(5, 150, 105, 0.18) 100%);
    color: var(--success-color);
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.15);
}

.price-value {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-light);
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.product-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 资讯列表 */
.news-item {
    display: flex;
    padding: 16px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 10px;
    border: 1px solid transparent;
}

.news-item:last-child {
    margin-bottom: 0;
}

.news-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.06) 0%, rgba(240, 147, 251, 0.04) 100%);
    transform: translateX(6px);
    border-color: rgba(102, 126, 234, 0.15);
}

.news-item img,
.news-item .no-image {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-item:hover img,
.news-item:hover .no-image {
    transform: scale(1.05);
}

/* 功能卡片 */
.feature-card {
    text-align: center;
    padding: 16px 12px;
    background: linear-gradient(135deg, rgba(248, 249, 255, 0.9) 0%, rgba(232, 237, 255, 0.8) 100%);
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(208, 215, 255, 0.4);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.08) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card:hover {
    transform: translateY(-6px);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(240, 147, 251, 0.06) 100%);
    border-color: rgba(102, 126, 234, 0.25);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.15);
}

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin: 0 auto 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.feature-icon::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.feature-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
    margin-top: 8px;
}

.feature-card p {
    font-size: 12px;
    color: var(--text-gray);
    line-height: 1.5;
}

/* 响应式优化 */
@media (max-width: 1200px) {
    .product-grid[style*="grid-template-columns: repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 992px) {
    [style*="grid-template-columns: repeat(4, 1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

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

    .hero-content h1 {
        font-size: 28px;
    }

    .hero-content p {
        font-size: 15px;
    }

    .hero-stats {
        gap: 40px;
        margin-top: 28px;
    }

    .stat-number {
        font-size: 28px;
    }

    .card {
        padding: 20px;
    }

    .card-header {
        margin-bottom: 18px;
        padding-bottom: 14px;
    }

    .card-title {
        font-size: 19px;
    }

    .product-image {
        height: 150px;
    }

    .product-info {
        padding: 16px;
    }

    .news-item {
        padding: 12px;
    }

}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 24px;
    }

    .hero-stats {
        gap: 25px;
    }

    .stat-number {
        font-size: 22px;
    }

    .stat-text {
        font-size: 12px;
    }
}
