/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 414px;
    margin: 0 auto;
    background-color: #fff;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* 头部导航样式 */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #ff6b6b;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.back-button {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-right {
    display: flex;
    gap: 15px;
}

.header-right i {
    font-size: 20px;
}

/* 主要内容区样式 */
.main-content {
    padding-bottom: 60px; /* 为底部导航留出空间 */
}

/* 轮播图样式 */
.carousel-section {
    position: relative;
    margin-bottom: 15px;
}

.carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: 0;
}

.carousel-wrapper {
    display: flex;
    transition: transform 0.5s ease;
}

.carousel-slide {
    flex: 0 0 100%;
    width: 100%;
}

.carousel-slide img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.indicator.active {
    background-color: white;
}

/* 用户积分信息样式 */
.user-points {
    padding: 10px 15px;
    margin-bottom: 15px;
}

.points-card {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    border-radius: 12px;
    padding: 15px;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.points-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.current-points {
    display: flex;
    flex-direction: column;
}

.points-number {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 4px;
}

.points-label {
    font-size: 14px;
    opacity: 0.8;
}

.points-history-btn {
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
}

/* 分类Tab样式 */
.category-tabs {
    display: flex;
    overflow-x: auto;
    background-color: white;
    margin-bottom: 15px;
    padding: 0 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    -webkit-overflow-scrolling: touch; /* 提升iOS滚动体验 */
    scrollbar-width: none; /* Firefox隐藏滚动条 */
}

.category-tabs::-webkit-scrollbar {
    display: none; /* Chrome隐藏滚动条 */
}

.tab {
    padding: 12px 15px;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    cursor: pointer;
}

.tab.active {
    color: #ff6b6b;
    border-bottom-color: #ff6b6b;
    font-weight: 500;
}

/* 产品列表样式 */
.product-list {
    padding: 0 15px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.product-item {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-item:active {
    transform: scale(0.98);
}

.product-image {
    position: relative;
    padding-top: 100%; /* 1:1 宽高比 */
    overflow: hidden;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.product-info {
    padding: 10px;
}

.product-name {
    font-size: 14px;
    margin-bottom: 6px;
    font-weight: normal;
    line-height: 1.3;
    height: 36px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    margin-bottom: 10px;
}

.exchange-price {
    color: #ff6b6b;
    font-weight: 500;
    font-size: 15px;
}

.original-price {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
    margin-top: 2px;
}

.exchange-button {
    text-align: center;
    background-color: #ff6b6b;
    color: white;
    padding: 6px 0;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

/* 加载更多按钮 */
.load-more {
    text-align: center;
    padding: 20px 15px;
}

.load-more-btn {
    background-color: transparent;
    border: 1px solid #ddd;
    color: #666;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
}

/* 底部导航样式 */
.footer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.1);
    z-index: 90;
    max-width: 414px;
    margin: 0 auto;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px 0;
    cursor: pointer;
}

.nav-item i {
    font-size: 20px;
    color: #999;
    margin-bottom: 3px;
}

.nav-item span {
    font-size: 12px;
    color: #999;
}

.nav-item.active i,
.nav-item.active span {
    color: #ff6b6b;
}

/* 响应式适配 */
@media (max-width: 320px) {
    .product-list {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 16px;
    }
    
    .tab {
        padding: 12px 10px;
        font-size: 13px;
    }
}

/* iOS特定样式 */
@supports (-webkit-touch-callout: none) {
    .app-container {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .footer-nav {
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }
} 