/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 性能优化：减少重绘和重排 */
img {
    max-width: 100%;
    height: auto;
    display: block;
    will-change: auto;
}

/* 骨架屏加载效果 */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    font-size: 1rem;
}

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background-color: #ffffff;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
    overflow-x: hidden;
}

/* 导航栏样式（手机端优化） */
.navbar {
    background: #0f172a;
    color: #ffffff;
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo {
    height: 32px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.2rem;
}

.nav-menu a {
    color: #e2e8f0;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.3s;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #60a5fa;
    transition: width 0.3s;
}

.nav-menu a:hover {
    color: #ffffff;
}

.nav-menu a:hover::after {
    width: 100%;
}

/* 轮播图区域（手机端优化） */
.carousel-section {
    margin-top: 60px;
    width: 100%;
    overflow-x: hidden;
}

.carousel-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 300px;
    overflow: hidden;
    background: #000;
}

.carousel-slide {
    display: none;
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide.active {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
}

.carousel-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 10;
}

.carousel-content h2 {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.4);
}

.carousel-content p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    font-weight: 400;
    opacity: 0.95;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.4);
}

.btn-primary {
    display: inline-block;
    padding: 12px 24px;
    background: #2563eb;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.3s, transform 0.2s;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

/* 轮播图控制按钮（手机端优化） */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: #1a1a1a;
    font-size: 1.2rem;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.2s;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    touch-action: manipulation;
}

.carousel-btn:active {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(0.95);
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}

/* 轮播图指示器 */
.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 100;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s;
}

.indicator.active {
    background: white;
}

/* 产品展示区域（手机端优化） */
.products-section {
    padding: 40px 0;
    background: #fafafa;
    width: 100%;
    overflow-x: hidden;
}

.section-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: #1a1a1a;
    font-weight: 700;
    letter-spacing: -0.02em;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #2563eb;
    border-radius: 2px;
}

/* 产品列表 - 条状布局（手机端优先） */
.products-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 30px;
    width: 100%;
    max-width: 100%;
    padding: 0;
}

/* 产品条目 - 条状（手机端优化） */
.product-item {
    background: white;
    display: flex;
    align-items: center;
    padding: 15px;
    transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
    cursor: pointer;
    gap: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e5e5e5;
    text-decoration: none;
    color: inherit;
}

.product-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.product-item:active {
    transform: scale(0.98);
    background: #f9fafb;
}

/* Loading 样式已在全局定义，此处移除重复 */

/* 广告位样式 - 与产品条状布局一致 */
.ad-item {
    background: white;
    display: flex;
    align-items: center;
    padding: 15px;
    transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
    cursor: pointer;
    gap: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e5e5e5;
    text-decoration: none;
    color: inherit;
    margin-bottom: 12px;
}

.ad-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.ad-item:active {
    transform: scale(0.98);
    background: #f9fafb;
}

/* 广告图片 - 左边 */
.ad-item .ad-image {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    overflow: hidden;
    background: #f0f0f0;
    border-radius: 8px;
}

.ad-item .ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.ad-item:active .ad-image img {
    transform: scale(1.05);
}

/* 广告名字 - 中间 */
.ad-item .ad-name {
    font-size: 1rem;
    color: #1a1a1a;
    font-weight: 600;
    flex: 1;
    min-width: 0;
    margin: 0;
    line-height: 1.4;
    text-align: center;
    /* 文本截断优化 - 最多显示2行，超出部分显示省略号 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 2.8em;
    word-break: break-word;
}

/* 广告标签 - 右边 */
.ad-link-badge {
    flex-shrink: 0;
    padding: 6px 12px;
    background: #2563eb;
    color: white;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

/* 产品图片 - 左边 */
.product-item .product-image {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    overflow: hidden;
    background: #f0f0f0;
    border-radius: 8px;
    order: 1;
}

/* 产品名字 - 中间 */
.product-item .product-name {
    font-size: 1rem;
    color: #1a1a1a;
    font-weight: 600;
    flex: 1;
    min-width: 0;
    margin: 0;
    line-height: 1.4;
    order: 2;
    text-align: center;
    /* 文本截断优化 - 最多显示2行，超出部分显示省略号 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 2.8em; /* 2行的高度 */
    word-break: break-word;
}

.product-item .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-item:active .product-image img {
    transform: scale(1.05);
}

.discount-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: #dc2626;
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
    z-index: 2;
}

/* 价格包装器 */
.product-price-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
    min-width: 80px;
    order: 3;
}

/* Shopee Badge - 显示在价格上方 */
.shopee-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    background: #ee4d2d;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(238, 77, 45, 0.3);
}

.shopee-logo-img {
    width: 14px;
    height: 14px;
    object-fit: contain;
    display: block;
}

.shopee-text {
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* 产品价格 - 右边 */
.product-item .product-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.original-price {
    color: #9ca3af;
    text-decoration: line-through;
    font-size: 0.85rem;
}

.discount-price {
    color: #dc2626;
    font-size: 1.3rem;
    font-weight: 700;
    white-space: nowrap;
}

/* 页脚 */
.footer {
    background: #1a1a1a;
    color: #9ca3af;
    padding: 50px 0 30px;
    margin-top: 80px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-about {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-about h3 {
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 15px;
    letter-spacing: -0.02em;
}

.footer-about p {
    color: #9ca3af;
    font-size: 0.95rem;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

/* 页脚响应式 */
@media (max-width: 768px) {
    .footer {
        padding: 40px 0 20px;
    }
    
    .footer-about {
        margin-bottom: 25px;
        padding-bottom: 25px;
    }
    
    .footer-about h3 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .footer-about p {
        font-size: 0.9rem;
        line-height: 1.6;
        text-align: center;
    }
}

.footer-copyright {
    text-align: center;
    padding-top: 20px;
    font-size: 0.9rem;
    color: #6b7280;
}

/* 响应式设计 */
/* 手机端响应式优化（如果需要进一步调整） */
@media (max-width: 480px) {
    .carousel-content h2 {
        font-size: 1.5rem;
    }
    
    .carousel-content p {
        font-size: 0.9rem;
    }
    
    .carousel-container {
        height: 280px;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
}

/* 维护中模态框 */
.maintenance-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s;
}

.maintenance-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.maintenance-content {
    background: white;
    padding: 50px 40px;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s;
}

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

.maintenance-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.maintenance-content h2 {
    font-size: 2rem;
    color: #1a1a1a;
    margin-bottom: 15px;
    font-weight: 700;
}

.maintenance-content p {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 30px;
    line-height: 1.6;
}

.btn-close {
    padding: 12px 32px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.btn-close:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

