/* 首页样式 */

/* 通知横幅样式 */
.notification-container {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.notification-label {
    color: black;
    font-weight: bold;
    margin-right: 15px;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    text-shadow: none;
}

.notification-scroll-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
}

.notification-content {
    display: flex;
    align-items: center;
    white-space: nowrap;
    animation: scroll-left 40s linear infinite;
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: max-content;
}

.notification-text {
    color: black;
    font-size: 14px;
    opacity: 1;
    text-shadow: none;
    letter-spacing: 0.3px;
    line-height: 1.4;
}

/* 滚动动画 */
@keyframes scroll-left {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .notification-container {
        height: 35px;
        padding: 0 10px;
    }
    
    .notification-label {
        margin-right: 10px;
    }
    
    .notification-text {
        font-size: 12px;
        letter-spacing: 0.2px;
    }
    
    .notification-content {
        animation: scroll-left 35s linear infinite;
    }
}

@media (max-width: 480px) {
    .notification-container {
        height: 30px;
        padding: 0 8px;
    }
    
    .notification-label {
        font-size: 12px;
        margin-right: 8px;
    }
    
    .notification-text {
        font-size: 11px;
        letter-spacing: 0.1px;
    }
    
    .notification-content {
        animation: scroll-left 30s linear infinite;
    }
}

/* CSS变量定义 - 便于主题统一管理 */
:root {
    --primary-color: #ff4d4f;
    --primary-hover: #ff7875;
    --secondary-color: #1890ff;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --bg-primary: #ffffff;
    --bg-secondary: #f5f7fa;
    --border-color: #e8e8e8;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* 全局样式重置和基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f5f7fa;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

/* 基础动画类 */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-up {
    animation: slideUp 0.7s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 可访问性优化 */
button:focus,
input:focus,
a:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* 头部导航样式 */
.site-header {
    background-color: #fff;
    padding: 15px 0;
    border-bottom: 1px solid #eaeaea;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.logo img {
    max-width: 200px;
    max-height: 60px;
    object-fit: contain;
    transition: opacity 0.3s ease;
    vertical-align: middle;
}

.logo img:hover {
    opacity: 0.9;
}

.top-nav ul {
    display: flex;
    list-style: none;
}

.top-nav li {
    margin-left: 20px;
}

.top-nav a {
    text-decoration: none;
    color: #666;
    transition: color 0.3s;
}

.top-nav a:hover {
    color: #333;
}

/* 首页特定样式 */
.home-content {
    min-height: calc(100vh - 160px);
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 分类标签样式 */
.category-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tabs .tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    background-color: transparent;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    font-size: 14px;
    min-width: 80px;
    box-sizing: border-box;
}

.category-tabs .tab .tab-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    overflow: hidden;
}

.category-tabs .tab .tab-icon-img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.category-tabs .tab .tab-text {
    font-size: 12px;
    font-weight: 600;
    color: #4a5568;
    letter-spacing: 0.2px;
    line-height: 1.2;
}

.category-tabs .tab:hover {
    background-color: #f0f2f5;
}

.category-tabs .tab.active {
    background-color: transparent;
    border: 1px solid #1890ff;
}

.category-tabs .tab.active .tab-icon {
    color: #1890ff;
}

.category-tabs .tab.active .tab-text {
    color: #1890ff;
    font-weight: 700;
}

/* 商品分类区域 */
.product-category {
    margin-bottom: 40px;
}

/* 商品分类标题 */
.category-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 25px;
    padding-left: 15px;
    border-left: 4px solid #1890ff;
    color: #2c3e50;
    line-height: 1.4;
}

/* 商品网格布局 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* 商品卡片样式 */
.product-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    min-height: 160px;
}

/* 商品内容区域样式 */
.product-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-grow: 1;
}

/* 商品封面图样式 */
.product-image {
    width: 120px;
    height: 120px;
    overflow: hidden;
    border-radius: 8px;
    background-color: #f8f9fa;
    position: relative;
    flex-shrink: 0;
}

.product-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-cover {
    transform: scale(1.05);
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 商品平台信息 */
.product-platform {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.platform-icon {
    font-size: 24px;
    margin-right: 8px;
}

.platform-name {
    font-weight: 500;
    color: #333;
}

/* 商品信息 */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    padding-left: 15px;
}

.product-region {
    font-weight: bold;
    color: #2c3e50;
    font-size: 16px;
}

/* 移动端特定字体大小调整 */
@media (max-width: 480px) {
    .product-region {
        font-size: 14px;
    }
    
    .product-price {
        font-size: 16px;
    }
    
    .add-to-cart {
        margin-top: 12px;
        padding: 10px 0;
        font-size: 14px;
    }
}

.product-description {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 18px;
    font-weight: bold;
    color: #e74c3c;
    margin: 10px 0;
}

/* 商品标签 */
.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.tag {
    background-color: #f8f9fa;
    color: #666;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* 底部导航样式 */
.site-footer {
    background-color: #fff;
    padding: 15px 0;
    border-top: 1px solid #eaeaea;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
}

.bottom-nav ul {
    display: flex;
    justify-content: space-around;
    list-style: none;
    max-width: 600px;
    margin: 0 auto;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    transition: color 0.3s;
}

.nav-item:hover {
    color: #007bff;
}

.nav-item.active {
    color: #007bff;
}

.nav-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 5px;
    position: relative;
    display: block;
    object-fit: contain;
}

.nav-item span {
    font-size: 12px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .home-content {
        padding: 15px;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 15px;
    }
    
    .product-image {
        width: 100px;
        height: 100px;
    }
    
    .product-info {
        padding-left: 10px;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 15px;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .logo img {
        max-width: 150px;
        max-height: 45px;
    }
    
    .top-nav li {
        margin-left: 15px;
    }
    
    .home-content {
        padding: 10px;
        /*padding-bottom: 80px;*/
    }
    
    .product-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .product-content {
        flex-direction: row;
        align-items: center;
    }
    
    .product-image {
        width: 40%;
        height: 120px;
        margin-bottom: 0;
        margin-right: 10px;
    }
    
    .product-info {
        padding-left: 10px;
        width: 60%;
    }
}
.add-to-cart{
    margin-top: 16px;
    width: 100%;
    padding: 12px 0;
    background-color: #ff4081;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}