/* 基础变量 */
:root {
    --primary-color: #3A5A40;  /* 矿物绿 */
    --accent-color: #6B8F71;   /* 辅助色 */
    --text-light: #F4F4F9;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* 全局布局容器 */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}
 
.main-header {
    /* 保持原有页眉样式 */
    flex-shrink: 0; /* 禁止收缩 */
}
 
.content-container {
    flex: 1 0 auto; /* 关键属性：撑满剩余空间 */
    width: 100%;
    padding-bottom: 80px; /* 预留页尾高度 */
}
 
.main-footer {
    flex-shrink: 0;
    background: #2c3e50;
    color: white;
    height: 80px; /* 固定高度 */
    margin-top: auto; /* 自动置底 */
    
    /* 增强视觉稳定性 */
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 500;
}

/* 针对IE11的hack */
@media all and (-ms-high-contrast: none) {
    body {
        display: block;
        position: relative;
        padding-bottom: 80px;
    }
    .main-footer {
        position: absolute;
        bottom: 0;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .content-container {
        padding-bottom: 60px; /* 减少移动端预留空间 */
    }
    .main-footer {
        height: auto; /* 高度自适应 */
        padding: 1rem 0;
    }
}

/* 页眉设计 */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: var(--primary-color);
    color: var(--text-light);
    position: sticky;
    top: 0;
    z-index: 1000;
}
 
.logo {
    font-family: 'Georgia', serif;
    font-size: 2.2rem;
    letter-spacing: 2px;
}
 
.header-nav {
    display: flex;
    gap: 2rem;
}
 
.nav-link {
    color: inherit;
    transition: opacity 0.3s;
}
.nav-link:hover {
    opacity: 0.8;
}
 
/* 页中布局 */
/* 分类按钮样式改造 */
.category-btn {
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    background: #f0f0f0;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
 
.category-btn.active  {
    background: var(--primary-color);
    color: white;
    border-color: var(--accent-color);
    transform: scale(1.05);
}
 
/* 滚动提示标识 */
.scroll-indicator {
    position: absolute;
    top: 50%;
    width: 30px;
    height: 30px;
    background: rgba(0,0,0,0.1);
    border-radius: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.3s;
}
.scroll-indicator.right  {
    right: 0;
    background-image: url("data:image/svg+xml,%3Csvg..."); /* 右箭头图标 */
}
.scroll-wrapper:hover ~ .scroll-indicator {
    opacity: 1;
}

/* 分类栏：横向无缝滚动 */
.category-scrollbar {
    overflow-x: auto;
    -ms-overflow-style: none;  /* IE隐藏滚动条 */
    scrollbar-width: none;     /* Firefox隐藏滚动条 */
    background: #f5f5f5;
    padding: 12px 0;
    position: sticky;
    top: 60px;
    z-index: 500;
}
.category-scrollbar::-webkit-scrollbar { display: none; }
 
.category-container {
    display: flex;
    white-space: nowrap;
    padding: 0 5px;
}
.category-tab {
    flex: 0 0 auto;
    padding: 8px 20px;
    margin: 0;
    border-radius: 20px;
    border: 1px solid #ddd;
    background: white;
    transition: all 0.3s;
}
.category-tab.active  {
    background: #2c3e50;
    color: white;
    border-color: transparent;
}
 
/* 商品网格：无缝响应式 */
.seamless-product-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* 电脑端6列 */
    gap: 0;
    margin: 0 -1px; /* 消除边缘间隙 */
}
 
@media (max-width: 1024px) {
    .seamless-product-grid {
        grid-template-columns: repeat(3, 1fr); /* 平板端3列 */
    }
}
 
@media (max-width: 768px) {
    .seamless-product-grid {
        grid-template-columns: repeat(2, 1fr); /* 手机端2列 */
    }
}
 
.product-card {
    position: relative;
    border: 1px solid #eee;
    aspect-ratio: 3/4; /* 固定宽高比 */
    overflow: hidden;
}

/* 页尾设计 */
.main-footer {
    background: var(--primary-color);
    color: var(--text-light);
    padding: 3rem 5%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}
 
.footer-section {
    line-height: 1.8;
}
.footer-section a {
    color: inherit;
    display: block;
}
 
/* 移动端适配 */
@media (max-width: 768px) {
    .content-container {
        grid-template-columns: 1fr;
    }
    .category-sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}
