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

html {
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    width: 100%;
}

/* 全局标题样式 */
h1, h2, h3, h4, h5, h6 {
    color: #1e293b;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.3px;
}

/* 主标题样式 */
h1 {
    font-size: 2.2rem;
    color: #1e293b;
    margin-bottom: 1.5rem;
    font-weight: 800;
}

/* 二级标题样式 */
h2 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

/* 三级标题样式 */
h3 {
    font-size: 1.4rem;
    margin: 1.5rem 0 0.75rem;
}

/* 简约设计原则 */
/* 1. 清晰的层次结构 - 标题大小有明显区分 */
/* 2. 适度的间距 - 确保内容呼吸感 */
/* 3. 简洁的色彩 - 以中性色为主，突出内容 */
/* 4. 无多余装饰 - 减少不必要的视觉元素 */
/* 5. 良好的可读性 - 合适的字体大小和行高 */

/* 为所有页面内容添加统一的顶部间距，避免被固定导航栏覆盖 */
body {
    padding-top: 80px; /* 为固定导航栏预留空间 */
}

/* 移动端main元素添加左右边距 */
@media (max-width: 768px) {
    main {
        padding-left: 10px;
        padding-right: 10px;
    }
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center; /* 内容不足时垂直居中 */
    align-items: stretch;
}

/* 确保main内部的容器和内容保持正常宽度和对齐 */
main .container,
main .post-header,
main .post-container,
main .product-detail-container {
    width: 100%;
    max-width: 2000px;
    margin: 0 auto;
    align-self: stretch;
}

/* 确保卡片网格在内容较少时垂直居中 */
.post-grid:not(.latest-posts .post-grid):not(.featured-products .product-grid),
.product-grid:not(.latest-posts .product-grid):not(.featured-products .product-grid) {
    align-self: stretch;
    margin: auto 0; /* 上下margin为auto，实现垂直居中 */
}

/* 首页水平滚动卡片保持正常margin，避免初始位置偏移 */
.latest-posts .post-grid,
.featured-products .product-grid {
    margin: 0 0 3rem 0;
    align-self: stretch;
}

/* 确保main内部的直接子元素不会被导航栏覆盖 */
main > *:first-child {
    margin-top: 0 !important;
}

/* 特殊页面样式调整 */
.post-header {
    margin-top: 0 !important;
}

/* 商品详情页的返回链接 */
.back-link {
    margin-top: 1rem !important;
}

/* 容器样式 */
.container {
    width: 98%;
    max-width: 2000px;
    margin: 0 auto;
    padding: 0 10px;
}

/* 导航栏容器样式 */
.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 导航栏样式 */
header {
    background-color: rgba(255, 255, 255, 0.95);
    color: #334155;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    width: 100%;
}

header.scrolled {
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    transition: all 0.3s ease;
}

header.scrolled .navbar {
    padding: 0.6rem 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo a {
    text-decoration: none;
    color: inherit;
}

/* 汉堡菜单样式 */
.hamburger-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.hamburger-btn span {
    width: 25px;
    height: 3px;
    background-color: #475569;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2.5rem;
    margin: 0;
    padding: 0;
}

.nav-links li {
    margin: 0;
    padding: 0;
    line-height: 1;
}

.nav-links a {
    color: #475569;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
    line-height: 1.3;
}

.nav-links a:hover {
    color: #6366f1;
    transform: translateY(-2px);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    transition: width 0.3s ease;
}

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

/* 导航链接激活状态 */
.nav-links a.active {
    color: #6366f1;
    font-weight: 600;
}

.nav-links a.active::after {
    width: 100%;
}

/* 英雄区域样式 */
.hero {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    margin-bottom: 2rem;
    border-radius: 0 0 30px 30px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></svg>');
    background-size: 50px 50px;
    animation: moveBackground 20s linear infinite;
}

@keyframes moveBackground {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    animation: fadeInDown 0.8s ease;
}

.hero p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    opacity: 0.95;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    animation: fadeInUp 0.8s ease 0.4s both;
    flex-wrap: wrap;
}

.hero-buttons .btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: #fff;
    color: #6366f1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background-color: #f8fafc;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background-color: transparent;
    color: #fff;
    border: 2px solid #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}



/* 网格布局 */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-bottom: 3rem;
}

/* 移动端卡片布局 */
@media (max-width: 768px) {
    /* 1. 首页：水平滚动卡片 */
    .latest-posts .post-grid,
    .featured-products .product-grid {
        display: flex;
        overflow-x: auto;
        scroll-behavior: smooth;
        gap: 1rem;
        padding-bottom: 1rem;
        margin-bottom: 2rem;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }
    
    /* 首页卡片链接容器 */
    .latest-posts .card-link,
    .featured-products .card-link {
        display: block;
        flex: 0 0 auto;
        width: 85%;
        max-width: 300px;
        min-width: 240px;
        text-decoration: none;
        color: inherit;
    }
    
    /* 首页卡片垂直布局 */
    .latest-posts .post-card,
    .latest-posts .product-card,
    .featured-products .post-card,
    .featured-products .product-card {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    /* 首页图片高度 */
    .latest-posts .post-image,
    .featured-products .product-image {
        height: 160px;
        width: 100%;
    }
    
    /* 首页内容区 */
    .latest-posts .post-content,
    .featured-products .product-content {
        width: 100%;
        padding: 1rem;
    }
    
    /* 2. 列表页：垂直排列，左图右文 */
    /* 不在首页容器内的网格布局改为垂直排列 */
    .post-grid:not(.latest-posts .post-grid):not(.featured-products .post-grid),
    .product-grid:not(.latest-posts .product-grid):not(.featured-products .product-grid) {
        display: flex;
        flex-direction: column;
        overflow-x: hidden;
        gap: 1rem;
        margin-bottom: 2rem;
        width: 100%;
    }
    
    /* 列表页卡片链接容器 */
    .post-grid:not(.latest-posts .post-grid):not(.featured-products .post-grid) .card-link,
    .product-grid:not(.latest-posts .product-grid):not(.featured-products .product-grid) .card-link {
        display: block;
        width: 100%;
        text-decoration: none;
        color: inherit;
    }
    
    /* 列表页卡片改为水平布局，左图右文 */
    .post-grid:not(.latest-posts .post-grid):not(.featured-products .post-grid) .post-card,
    .product-grid:not(.latest-posts .product-grid):not(.featured-products .product-grid) .product-card {
        width: 100%;
        height: 120px;
        display: flex;
        flex-direction: row;
        align-items: stretch;
        overflow: hidden;
    }
    
    /* 列表页图片大小和圆角 */
    .post-grid:not(.latest-posts .post-grid):not(.featured-products .post-grid) .post-image,
    .product-grid:not(.latest-posts .product-grid):not(.featured-products .product-grid) .product-image {
        width: 35%;
        height: 100%;
        flex-shrink: 0;
        border-radius: 12px 0 0 12px;
        overflow: hidden;
        margin: 0;
        padding: 0;
    }
    
    /* 确保图片填满容器 */
    .post-grid:not(.latest-posts .post-grid):not(.featured-products .post-grid) .post-image img,
    .product-grid:not(.latest-posts .product-grid):not(.featured-products .product-grid) .product-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        margin: 0;
        padding: 0;
    }
    
    /* 列表页内容区 */
    .post-grid:not(.latest-posts .post-grid):not(.featured-products .post-grid) .post-content,
    .product-grid:not(.latest-posts .product-grid):not(.featured-products .product-grid) .product-content {
        width: 65%;
        padding: 0.75rem 1rem;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }
    
    /* 列表页标题大小 */
    .post-grid:not(.latest-posts .post-grid):not(.featured-products .post-grid) .post-content h3,
    .product-grid:not(.latest-posts .product-grid):not(.featured-products .product-grid) .product-content h3 {
        font-size: 0.95rem;
        margin: 0 0 0.3rem 0;
        line-height: 1.3;
    }
    

    
    /* 列表页标签和元数据 */
    .post-grid:not(.latest-posts .post-grid):not(.featured-products .post-grid) .product-tags,
    .product-grid:not(.latest-posts .product-grid):not(.featured-products .product-grid) .product-tags {
        margin-bottom: 0.2rem;
    }
    
    .post-grid:not(.latest-posts .post-grid):not(.featured-products .post-grid) .post-meta,
    .product-grid:not(.latest-posts .product-grid):not(.featured-products .product-grid) .post-meta {
        gap: 0.4rem;
        margin-bottom: 0.3rem;
        font-size: 0.75rem;
    }
    
    /* 列表页摘要和描述 */
    .post-grid:not(.latest-posts .post-grid):not(.featured-products .post-grid) .post-excerpt,
    .product-grid:not(.latest-posts .product-grid):not(.featured-products .product-grid) .product-description {
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 0;
        font-size: 0.8rem;
        line-height: 1.4;
        flex: none;
    }
    
    /* 列表页商品价格 */
    .product-grid:not(.latest-posts .product-grid):not(.featured-products .product-grid) .product-price {
        font-size: 1rem;
        margin-bottom: 0;
    }
}

/* 卡片链接样式 */
.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* 卡片样式 */
.post-card,
.product-card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all 0.4s ease;
    border: 1px solid #e2e8f0;
    position: relative;
    animation: fadeInUp 0.6s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 确保卡片内容区填充剩余空间并保持统一高度 */
.post-content,
.product-content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card:hover,
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: transparent;
}

.post-image {
    height: 180px;
    overflow: hidden;
    position: relative;
}

.product-image {
    height: 160px;
    overflow: hidden;
    position: relative;
}

.post-image img,
.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-image img,
.product-card:hover .product-image img {
    transform: scale(1.08);
}

.post-content {
    padding: 1rem;
}

.product-content {
    padding: 1rem;
}

.post-content h3,
.product-content h3 {
    margin: 8px 0 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
    flex-shrink: 0;
}

.post-content h3 a,
.product-content h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-content h3 a:hover,
.product-content h3 a:hover {
    color: #6366f1;
}

/* 统一标签样式，适用于所有卡片 */
.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

.product-tag-small {
    background-color: #f1f5f9;
    color: #64748b;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
    transition: all 0.2s ease;
}

.product-tag-small:hover {
    background-color: #e2e8f0;
    transform: translateY(-1px);
}

/* 统一元数据样式 */
.post-meta {
    color: #94a3b8;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

/* 商品价格样式 */
.product-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: #e11d48;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

/* 统一摘要和描述样式 */
.post-excerpt,
.product-description {
    color: #64748b;
    margin-bottom: 1rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.read-more {
    color: #6366f1;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.read-more:hover {
    gap: 0.75rem;
    color: #4f46e5;
}



/* 页脚样式 */
footer {
    background-color: #0f172a;
    color: #e2e8f0;
    padding: 1rem 0;
    margin-top: 3rem;
}

.footer-bottom {
    text-align: center;
    color: #64748b;
    font-size: 0.875rem;
}

/* 滚动到顶部按钮 */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    z-index: 999;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.modal-visible {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    cursor: pointer;
}

.modal-content {
    position: relative;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 2001;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal.modal-visible .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background-color: #f1f5f9;
    color: #334155;
}

.modal-header {
    padding: 2rem 2rem 1rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.8rem;
    color: #1e293b;
}

.modal-body {
    padding: 1.5rem 2rem;
    line-height: 1.6;
    color: #475569;
}

.modal-body p {
    margin-bottom: 1rem;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-footer {
    padding: 1rem 2rem 2rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.modal-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.modal-checkbox input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.modal-checkbox label {
    font-size: 0.9rem;
    color: #64748b;
    cursor: pointer;
    user-select: none;
}

.modal-footer .btn {
    margin: 0;
    padding: 0.75rem 1.5rem;
}

/* 响应式模态框 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header {
        padding: 1.5rem 1.5rem 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    .modal-body {
        padding: 1.25rem 1.5rem;
    }
    
    .modal-footer {
        padding: 1rem 1.5rem 1.5rem;
        flex-direction: column-reverse;
        align-items: stretch;
    }
    
    .modal-footer .btn {
        text-align: center;
    }
    
    .modal-checkbox {
        justify-content: center;
    }
}

/* 搜索框样式 */
.search-container {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.search-input {
    width: 100%;
    max-width: 500px;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    outline: none;
    transition: all 0.3s ease;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.search-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 商品分类样式 */
.product-categories {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.product-categories .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    background-color: #fff;
    color: #475569;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.product-categories .btn:hover,
.product-categories .btn.active {
    background-color: #6366f1;
    color: #fff;
    border-color: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

/* 分页导航样式 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: auto;
    padding: 2rem 0;
}

.pagination .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    background-color: #fff;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.pagination .btn:hover,
.pagination .btn.btn-primary {
    background-color: #6366f1;
    color: #fff;
    border-color: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

/* 动画效果 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 0;
    }

    .hamburger-btn {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 60px;
        right: -100%;
        left: auto;
        width: 240px;
        background-color: #fff;
        flex-direction: column;
        align-items: flex-start;
        padding: 0.5rem;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.08);
        border-radius: 0 0 0 8px;
        transition: right 0.3s ease, transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
        z-index: 999;
        opacity: 0;
        transform: translateX(100%);
        visibility: hidden;
    }

    .nav-links.active {
        right: 0;
        opacity: 1;
        transform: translateX(0);
        visibility: visible;
    }
    
    /* 防止移动端横向滑动 */
    body {
        touch-action: pan-y;
    }

    .nav-links li {
        margin: 0.15rem 0;
        width: 100%;
        line-height: 1;
    }

    .nav-links a {
        font-size: 0.9rem;
        padding: 0.3rem 0;
        width: 100%;
        display: block;
        font-weight: 500;
        line-height: 1.3;
    }

    .navbar {
        flex-direction: row;
        gap: 1rem;
        padding: 0.6rem 0;
    }

    .hero {
        padding: 4rem 1.5rem;
        border-radius: 0;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    /* 移动端水平滚动卡片布局 - 已在上方统一设置 */

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .contact-item {
        justify-content: center;
    }

    .product-categories {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 1rem;
    }

    .product-categories .btn {
        flex-shrink: 0;
    }

    .search-input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .section-title h2 {
        font-size: 1.75rem;
    }

    .post-content h3,
    .product-content h3 {
        font-size: 1.25rem;
    }

    .product-price {
        font-size: 1.25rem;
    }
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #334155;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    background-color: #fff;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

/* 联系表单容器 */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 768px) {
    .contact-content {
        grid-template-columns: 1fr;
    }
}

/* 全局滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Firefox滚动条样式 */
* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

/* 移动端隐藏滚动条但保持滚动功能 */
@media (max-width: 768px) {
    /* 隐藏垂直滚动条 */
    ::-webkit-scrollbar {
        width: 0;
        height: 0;
    }
    
    /* 确保滚动功能正常 */
    * {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}