

/* css/index.css - 修复版本 */

/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1E40AF;
    --secondary-color: #3B82F6;
    --accent-color: #06B6D4;
    --background-color: #FFFFFF;
    --text-color: #1F2937;
    --carousel-height: 500px;
    --carousel-width: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

/* 容器间距调整 - 左右边距更小 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 主内容区域 */
.main-content {
    min-height: calc(100vh - 140px);
}

/* 消息通知样式 - 修复版本 */
.cart-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 10000;
    padding: 16px 20px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    min-width: 300px;
    backdrop-filter: blur(10px);
    border-left: 4px solid;
    animation: slideInRight 0.4s ease-out;
}

.cart-notification-success {
    background: rgba(16, 185, 129, 0.95);
    border-left-color: #10B981;
}

.cart-notification-error {
    background: rgba(239, 68, 68, 0.95);
    border-left-color: #EF4444;
}

.cart-notification-warning {
    background: rgba(245, 158, 11, 0.95);
    border-left-color: #F59E0B;
}

.notification-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notification-message {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.notification-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.login-btn {
    margin-left: 12px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.3);
    border: 1px solid rgba(255,255,255,0.5);
    color: white;
    cursor: pointer;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.login-btn:hover {
    background: rgba(255,255,255,0.4);
}

.close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 18px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-btn:hover {
    background: rgba(255,255,255,0.3);
}

.notification-hiding {
    animation: slideOutRight 0.3s ease-out forwards !important;
}

/* 轮播图样式 */
.hero-carousel {
    position: relative;
    width: 100%;
    height: var(--carousel-height);
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: var(--carousel-width);
    margin: 0 auto;
}

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    flex: 0 0 100%;
    position: relative;
    height: 100%;
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-content {
    position: absolute;
    top: 50%;
    left: 8%;
    transform: translateY(-50%);
    color: white;
    max-width: 500px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.carousel-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease-out;
}

.carousel-description {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.carousel-btn {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.carousel-control:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-50%) scale(1.1);
}

.carousel-control.prev {
    left: 15px;
}

.carousel-control.next {
    right: 15px;
}

.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: white;
    transform: scale(1.2);
}

/* 广告区域样式 */
.advertisement-section {
    background: white;
    padding: 2rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.ad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.ad-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.ad-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.ad-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
}

.ad-content {
    flex: 1;
}

.ad-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.ad-description {
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.ad-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.ad-link:hover {
    color: var(--secondary-color);
}

/* 统计区域样式 */
.stats-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    font-size: 3rem;
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 通用版块样式 */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 2rem;
}

.view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.view-all-btn:hover {
    gap: 1rem;
    color: var(--secondary-color);
}

/* 特色服务区域 */
.features-section {
    padding: 5rem 0;
    background: var(--background-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2.5rem 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.feature-description {
    color: var(--text-color);
    opacity: 0.8;
    line-height: 1.6;
}

/* 产品展示区域 */
.products-section {
    padding: 5rem 0;
    background: #f8fafc;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.product-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.quick-view-btn,
.add-to-cart-btn {
    background: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.quick-view-btn:hover,
.add-to-cart-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.discount-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.product-info {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-title a {
    color: inherit;
    text-decoration: none;
}

.product-title a:hover {
    color: var(--primary-color);
}

.product-description {
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.original-price {
    text-decoration: line-through;
    color: #9ca3af;
    font-size: 0.9rem;
}

.current-price {
    color: var(--accent-color);
    font-size: 1.25rem;
    font-weight: 700;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-color);
    opacity: 0.7;
}

/* 产品分类区域 */
.categories-section {
    padding: 5rem 0;
    background: white;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.category-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.category-image {
    height: 200px;
    overflow: hidden;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-card:hover .category-image img {
    transform: scale(1.05);
}

.category-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: #f3f4f6;
}

.category-info {
    padding: 1.5rem;
}

.category-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.category-description {
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.category-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    transition: gap 0.3s ease;
}

.category-card:hover .category-link {
    gap: 1rem;
}

/* 新闻资讯区域 */
.news-section {
    padding: 5rem 0;
    background: #f8fafc;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.news-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.news-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.05);
}

.news-date {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
}

.news-content {
    padding: 1.5rem;
}

.news-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.news-title a {
    color: inherit;
    text-decoration: none;
}

.news-title a:hover {
    color: var(--primary-color);
}

.news-meta {
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-color);
    opacity: 0.7;
}

.news-excerpt {
    color: var(--text-color);
    opacity: 0.8;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: gap 0.3s ease;
}

.read-more-btn:hover {
    gap: 1rem;
}

/* 呼叫行动区域 */
.cta-section {
    padding: 6rem 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-align: center;
}

.cta-content {
    max-width: 600px;
    margin: 0 auto;
}

.cta-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.cta-description {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cta-btn.primary {
    background: white;
    color: var(--primary-color);
}

.cta-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255,255,255,0.3);
}

.cta-btn.secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.cta-btn.secondary:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* 按钮样式 */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-icon {
    transition: transform 0.3s ease;
}

.btn-primary:hover .btn-icon {
    transform: translateX(3px);
}

/* 动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    .stats-grid,
    .features-grid,
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .categories-grid,
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
        max-width: 720px;
    }
    
    .carousel-title {
        font-size: 2rem;
    }
    
    .carousel-description {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .stats-grid,
    .features-grid,
    .products-grid,
    .categories-grid,
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-icon {
        font-size: 2.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .cta-title {
        font-size: 2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .ad-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .carousel-content {
        left: 5%;
        right: 5%;
    }
    
    .carousel-title {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* 触摸设备优化 */
@media (hover: none) {
    .product-overlay {
        opacity: 1;
        background: rgba(0,0,0,0.5);
    }
    
    .feature-card:hover,
    .product-card:hover,
    .category-card:hover,
    .news-card:hover {
        transform: none;
    }
    
    .carousel-control:hover {
        transform: translateY(-50%);
    }
}











/* ===== 消息通知样式 ===== */
.cart-notification {
    position: fixed !important;
    top: 120px !important;
    right: 20px !important;
    z-index: 99999 !important;
    padding: 20px 24px !important;
    border-radius: 12px !important;
    color: white !important;
    font-weight: 600 !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15) !important;
    min-width: 380px !important;
    border-left: 6px solid !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    font-size: 16px !important;
    font-family: inherit !important;
    line-height: 1.5 !important;
    pointer-events: auto !important;
    
    /* 初始状态 - 隐藏在右侧 */
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* 显示状态 */
.cart-notification.active {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

/* 使用主题颜色 */
.cart-notification-success {
    background: linear-gradient(135deg, #059669, #047857) !important;
    border-left-color: rgba(255, 255, 255, 0.5) !important;
}

.cart-notification-error {
    background: linear-gradient(135deg, #EF4444, #DC2626) !important;
    border-left-color: rgba(255, 255, 255, 0.5) !important;
}

.cart-notification-warning {
    background: linear-gradient(135deg, #ffa200, #e68900) !important;
    border-left-color: rgba(255, 255, 255, 0.5) !important;
}

.notification-message {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex: 1 !important;
}

.notification-actions {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-shrink: 0 !important;
}

.login-btn {
    margin-left: 12px !important;
    padding: 8px 16px !important;
    background: rgba(255, 255, 255, 0.3) !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    color: white !important;
    cursor: pointer !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
}

.login-btn:hover {
    background: rgba(255, 255, 255, 0.5) !important;
    transform: translateY(-1px) !important;
}

.close-btn {
    background: rgba(255, 255, 255, 0.3) !important;
    border: none !important;
    color: white !important;
    cursor: pointer !important;
    font-size: 20px !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    font-weight: bold !important;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.5) !important;
    transform: scale(1.1) !important;
}