/**
 * 新云商城 - 全新专业主题
 * 响应式设计 - 居中自适应
 */

/* ==================== 基础重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* ==================== 主容器 - 居中自适应 ==================== */
.store-wrapper {
    max-width: 750px;
    margin: 0 auto;
    background: #f5f7fa;
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 30px rgba(0,0,0,0.1);
}

/* ==================== 头部样式 ==================== */
.store-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(102,126,234,0.3);
}

.store-header .header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 750px;
    margin: 0 auto;
}

.store-header .logo {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.store-header .logo i {
    font-size: 24px;
}

.store-header .header-actions {
    display: flex;
    gap: 15px;
}

.store-header .header-actions a {
    color: #fff;
    font-size: 20px;
    text-decoration: none;
    position: relative;
}

.store-header .header-actions .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: #fff;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

/* ==================== 轮播图样式 ==================== */
.banner-section {
    padding: 15px;
}

.banner-slider {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    position: relative;
    max-width: 100%;
}

.banner-slider {
    position: relative;
    width: 100%;
    padding-bottom: 40%; /* 宽高比 5:2 */
    height: 0;
    overflow: hidden;
    border-radius: 16px;
}

.banner-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.banner-slider img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.banner-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.banner-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.banner-dots .dot.active {
    width: 24px;
    border-radius: 4px;
    background: #fff;
}

/* ==================== 公告栏样式 ==================== */
.notice-section {
    padding: 0 15px 15px;
}

.notice-bar {
    background: #fff;
    border-radius: 12px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.notice-bar .notice-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
}

.notice-bar .notice-content {
    flex: 1;
    overflow: hidden;
}

.notice-bar .notice-text {
    font-size: 14px;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== 搜索栏样式 ==================== */
.search-section {
    padding: 0 15px 15px;
}

.search-box {
    background: #fff;
    border-radius: 25px;
    padding: 5px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.search-box input {
    flex: 1;
    border: none;
    padding: 12px 15px;
    font-size: 14px;
    background: transparent;
    outline: none;
}

.search-box input::placeholder {
    color: #999;
}

.search-box button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 10px 25px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-box button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102,126,234,0.4);
}

/* ==================== 分类导航 ==================== */
.category-section {
    padding: 0 15px 15px;
}

.category-grid {
    background: #fff;
    border-radius: 16px;
    padding: 20px 15px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.category-grid .grid-row {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
}

.category-grid .grid-row:last-child {
    margin-bottom: 0;
}

.category-item {
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.category-item:hover {
    transform: translateY(-3px);
}

.category-item .icon-box {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-size: 24px;
    color: #fff;
    box-shadow: 0 4px 15px rgba(102,126,234,0.3);
    overflow: hidden;
}

.category-item .icon-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.category-item .cat-name {
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

/* ==================== 排序栏 ==================== */
.sort-section {
    padding: 0 15px 15px;
}

.sort-bar {
    background: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

.sort-item {
    flex: 1;
    padding: 15px;
    text-align: center;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    border-right: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.sort-item:last-child {
    border-right: none;
}

.sort-item.active {
    color: #667eea;
    font-weight: 600;
    background: rgba(102,126,234,0.05);
}

.sort-item .sort-icon {
    display: flex;
    flex-direction: column;
    font-size: 10px;
    line-height: 1;
}

/* ==================== 商品列表 ==================== */
.goods-section {
    padding: 0 15px;
}

.goods-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.goods-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.goods-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.goods-card {
    position: relative;
}

.goods-card .img-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 宽高比 */
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
}

.goods-card .goods-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.goods-card .goods-info {
    padding: 15px;
}

.goods-card .goods-title {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    margin-bottom: 10px;
    line-height: 1.4;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.goods-card .goods-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.goods-card .goods-price {
    font-size: 18px;
    color: #ff4757;
    font-weight: 700;
}

.goods-card .goods-price span {
    font-size: 12px;
}

.goods-card .buy-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.goods-card .buy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102,126,234,0.4);
}

/* ==================== 底部导航 ==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 750px;
    background: #fff;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #999;
    transition: all 0.3s ease;
    padding: 5px 20px;
}

.nav-item i {
    font-size: 22px;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 12px;
}

.nav-item.active {
    color: #667eea;
}

.nav-item.active i {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 60px;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state p {
    font-size: 14px;
    color: #999;
}

/* ==================== 页脚 ==================== */
.store-footer {
    text-align: center;
    padding: 30px 20px 100px;
    color: #999;
    font-size: 12px;
}

/* ==================== 响应式适配 ==================== */

/* 小屏手机 */
@media (max-width: 375px) {
    .goods-list {
        gap: 10px;
    }
    
    .goods-card .goods-img {
        height: 130px;
    }
    
    .category-item .icon-box {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .store-header .logo {
        font-size: 18px;
    }
}

/* 大屏手机 */
@media (min-width: 376px) and (max-width: 414px) {
    .goods-card .goods-img {
        height: 160px;
    }
}

/* 平板 */
@media (min-width: 768px) and (max-width: 1024px) {
    .store-wrapper {
        max-width: 750px;
    }
    
    .goods-card .goods-img {
        height: 180px;
    }
    
    .category-item .icon-box {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
}

/* 电脑 */
@media (min-width: 1025px) {
    body {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        padding: 20px;
    }
    
    .store-wrapper {
        max-width: 750px;
        border-radius: 20px;
        overflow: hidden;
        min-height: calc(100vh - 40px);
    }
    
    .store-header {
        border-radius: 20px 20px 0 0;
    }
    
    .bottom-nav {
        border-radius: 0 0 20px 20px;
    }
}

/* ==================== 动画 ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.goods-card {
    animation: fadeInUp 0.5s ease forwards;
}
