/**
 * 首页独有样式文件
 * 只包含首页特有的 Banner、搜索框、商品分类展示等
 * 公共样式（导航栏、底部、主题切换等）已移至 common.css
 * @author FastAdmin
 * @version 1.0.0
 */

/* ========================================
   Banner区域 - 超级华丽动画
   ======================================== */
.banner {
    text-align: center;
    padding: 100px 20px 60px;
    background: var(--gradient-banner);
    background-size: 400% 400%;
    color: white;
    position: relative;
    overflow: hidden;
    animation: gradientShift 15s ease infinite;
    transition: background var(--transition-normal) ease;
}

/* 渐变背景动画 */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 动态粒子背景 - 增强版 */
.banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.18) 0%, transparent 50%),
        radial-gradient(circle at 60% 70%, rgba(147, 51, 234, 0.3) 0%, transparent 40%),
        radial-gradient(circle at 30% 80%, rgba(59, 130, 246, 0.25) 0%, transparent 45%);
    animation: pulse 6s ease-in-out infinite;
}

/* 超级光束扫描特效 */
.banner::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -100%;
    width: 50%;
    height: 200%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0) 20%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 80%,
        transparent 100%
    );
    transform: skewX(-20deg);
    animation: lightSweep 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
    50% { opacity: 0.7; transform: scale(1.1) rotate(5deg); }
}

@keyframes lightSweep {
    0% { left: -100%; }
    50%, 100% { left: 150%; }
}

/* 标题 - 打字机效果 + 发光 */
.banner h1 {
    font-size: 52px;
    font-weight: 800;
    margin-bottom: 20px;
    color: white;
    position: relative;
    z-index: 1;
    text-shadow: 
        0 0 20px rgba(255, 255, 255, 0.8),
        0 0 40px rgba(147, 51, 234, 0.6),
        0 4px 20px rgba(0, 0, 0, 0.3);
    animation: 
        fadeInUp 0.8s ease-out,
        textGlow 3s ease-in-out infinite,
        float 3s ease-in-out infinite;
    letter-spacing: 2px;
}

/* 副标题 - 彩色渐变文字 */
.banner p {
    font-size: 22px;
    margin-bottom: 50px;
    background: linear-gradient(90deg, #fff 0%, #fde68a 50%, #fff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
    animation: 
        fadeInUp 1.2s ease-out,
        shimmer 3s linear infinite,
        float 3s ease-in-out infinite 0.5s;
    font-weight: 500;
    letter-spacing: 1px;
}

/* 文字发光动画 */
@keyframes textGlow {
    0%, 100% { 
        text-shadow: 
            0 0 20px rgba(255, 255, 255, 0.8),
            0 0 40px rgba(147, 51, 234, 0.6),
            0 4px 20px rgba(0, 0, 0, 0.3);
    }
    50% { 
        text-shadow: 
            0 0 30px rgba(255, 255, 255, 1),
            0 0 60px rgba(147, 51, 234, 0.8),
            0 4px 30px rgba(0, 0, 0, 0.4),
            0 0 80px rgba(249, 115, 22, 0.4);
    }
}

/* 文字渐变流动 */
@keyframes shimmer {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

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

/* 淡入上升动画 - 增强版 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 动态粒子容器 */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    pointer-events: none;
    animation: particleFloat linear infinite;
}

/* 粒子上升动画 */
@keyframes particleFloat {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-100vh) translateX(50px) rotate(360deg);
        opacity: 0;
    }
}

/* ========================================
   搜索框 - 增强动画
   ======================================== */
.search-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    animation: fadeInUp 1.4s ease-out, float 4s ease-in-out infinite 1s;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

/* 3D视差效果 */
.banner:hover .search-container {
    transform: translateY(-5px) scale(1.02);
}

.search-box {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 50px;
    box-shadow: 
        0 15px 50px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.8);
    padding: 8px;
    display: flex;
    align-items: center;
    border: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.search-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(147, 51, 234, 0.1) 50%,
        transparent 70%
    );
    animation: searchBoxShine 3s linear infinite;
}

@keyframes searchBoxShine {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.search-box:hover {
    box-shadow: 
        0 20px 70px rgba(147, 51, 234, 0.4),
        0 0 0 2px rgba(147, 51, 234, 0.3),
        0 0 50px rgba(147, 51, 234, 0.2);
    transform: translateY(-5px) scale(1.02);
}

.search-box:focus-within {
    box-shadow: 
        0 25px 80px rgba(147, 51, 234, 0.5),
        0 0 0 3px rgba(147, 51, 234, 0.4),
        0 0 60px rgba(147, 51, 234, 0.3);
    transform: translateY(-5px) scale(1.03);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 15px 25px;
    font-size: 17px;
    border-radius: 50px;
    color: var(--text-primary);
    background: transparent;
    position: relative;
    z-index: 2;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.search-input:focus {
    color: #667eea;
    font-size: 18px;
}

.search-input::placeholder {
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.search-input:focus::placeholder {
    color: transparent;
}

/* 夜间模式搜索框特殊处理 */
body.dark-mode .search-box {
    background: rgba(30, 41, 59, 0.95);
}

body.dark-mode .search-input {
    color: #e2e8f0;
}

.search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 200% 200%;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
    animation: gradientMove 3s ease infinite;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.search-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 40px rgba(147, 51, 234, 0.6);
}

.search-btn:active {
    transform: scale(0.98);
}

.search-btn i {
    font-size: 18px;
    animation: searchPulse 2s ease-in-out infinite;
}

@keyframes searchPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ========================================
   主内容区域
   ======================================== */
.main-content {
    padding: 60px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ========================================
   分类区块
   ======================================== */
.category-section {
    margin-bottom: 60px;
    animation: fadeInUp 0.6s ease-out;
}

.category-section:last-child {
    margin-bottom: 0;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.category-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.category-title i {
    font-size: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.more-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 5px;
}

.more-link:hover {
    color: #667eea;
    gap: 8px;
}

.more-link i {
    transition: transform var(--transition-fast);
}

.more-link:hover i {
    transform: translateX(3px);
}

/* ========================================
   商品网格
   ======================================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* ========================================
   商品卡片
   ======================================== */
.product-card {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    padding: 25px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-card-hover);
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: 0;
}

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

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(102, 126, 234, 0.3);
}

.product-card > * {
    position: relative;
    z-index: 1;
}

.product-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.product-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all var(--transition-fast);
}

.product-card:hover .product-icon {
    transform: rotate(10deg) scale(1.1);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

.product-icon i {
    font-size: 24px;
    color: white;
}

.product-name {
    flex: 1;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    margin: 5px 0 0 0;
}

.product-desc {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .category-title {
        font-size: 24px;
    }
    
    .category-title i {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .banner {
        padding: 90px 20px 50px;
    }

    .banner h1 {
        font-size: 32px;
    }

    .banner p {
        font-size: 16px;
    }

    .search-container {
        padding: 0 10px;
    }

    .search-box {
        flex-direction: column;
        padding: 15px;
        border-radius: 20px;
    }

    .search-input {
        width: 100%;
        padding: 12px 15px;
        text-align: center;
    }

    .search-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
        margin-top: 10px;
    }

    .main-content {
        padding: 40px 15px;
    }

    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .category-title {
        font-size: 22px;
    }

    .category-title i {
        font-size: 26px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }

    .product-card {
        padding: 20px;
    }

    .product-icon {
        width: 45px;
        height: 45px;
    }

    .product-icon i {
        font-size: 22px;
    }

    .product-name {
        font-size: 16px;
    }
}

@media (max-width: 576px) {
    .banner h1 {
        font-size: 26px;
        letter-spacing: 1px;
    }

    .banner p {
        font-size: 14px;
        margin-bottom: 30px;
    }

    .search-input {
        font-size: 15px;
    }

    .search-btn {
        font-size: 14px;
    }

    .category-section {
        margin-bottom: 40px;
    }

    .category-title {
        font-size: 20px;
    }

    .category-title i {
        font-size: 24px;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-header {
        gap: 12px;
    }

    .product-icon {
        width: 40px;
        height: 40px;
    }

    .product-icon i {
        font-size: 20px;
    }

    .product-name {
        font-size: 15px;
    }

    .product-desc {
        font-size: 13px;
    }
}

/* ========================================
   打印样式
   ======================================== */
@media print {
    .banner,
    .search-container {
        display: none;
    }

    .main-content {
        padding: 20px;
    }

    .product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .product-card:hover {
        transform: none;
    }
}
