/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)), 
                 url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?ixlib=rb-1.2.1&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 导航栏 */
header {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.9), rgba(39, 174, 96, 0.9));
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.logo i {
    margin-right: 10px;
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    opacity: 0.8;
}

.user-icon, .cart-icon {
    position: relative;
    cursor: pointer;
    font-size: 1.2rem;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* 搜索框 */
.search-container {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 1rem;
}

.search-box {
    display: flex;
    margin-bottom: 1rem;
}

.search-input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
    outline: none;
}

.search-btn {
    padding: 0 1.5rem;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: #27ae60;
}

/* 主要内容 */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    flex: 1;
}

/* 横幅区域 */
.banner {
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), 
                 url('https://images.unsplash.com/photo-1556911220-ef412aea178d?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
    height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    border-radius: 12px;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.banner h1 {
    font-size: 3.5rem;
    margin-bottom: 1.2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.banner p {
    font-size: 1.4rem;
    max-width: 700px;
    margin-bottom: 2.5rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.btn {
    display: inline-block;
    background: #f1c40f;
    color: #2c3e50;
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background: #f39c12;
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.hand-pointer {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    animation: pointDown 2s infinite;
}

@keyframes pointDown {
    0% { top: -40px; opacity: 0; }
    50% { top: -30px; opacity: 1; }
    100% { top: 10px; opacity: 0; }
}

/* 产品分类 */
.categories {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.category {
    background: white;
    border-radius: 12px;
    padding: 1.8rem;
    width: 23%;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeIn 1s forwards;
    animation-delay: calc(var(--delay) * 0.2s);
}

.category:nth-child(1) { --delay: 1; }
.category:nth-child(2) { --delay: 2; }
.category:nth-child(3) { --delay: 3; }
.category:nth-child(4) { --delay: 4; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.category:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.category i {
    font-size: 2.8rem;
    color: #2ecc71;
    margin-bottom: 1.2rem;
}

/* 产品列表 */
.section-title {
    font-size: 2.2rem;
    margin-bottom: 1.8rem;
    position: relative;
    padding-bottom: 0.8rem;
    color: #2c3e50;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background: #2ecc71;
    border-radius: 2px;
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.8rem;
    margin-bottom: 3rem;
}

.product {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.product-img {
    height: 220px;
    width: 100%;
    object-fit: cover;
    border-bottom: 3px solid #2ecc71;
}

.product-info {
    padding: 1.8rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.4rem;
    margin-bottom: 0.6rem;
    color: #2c3e50;
}

.product-farmer {
    color: #7f8c8d;
    font-size: 1rem;
    margin-bottom: 0.6rem;
}

.product-description {
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    flex: 1;
}

.product-origin {
    display: inline-block;
    background: #e8f8f5;
    color: #1abc9c;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
    font-weight: 500;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    font-size: 1.4rem;
    font-weight: bold;
    color: #e74c3c;
}

.add-to-cart {
    background: #2ecc71;
    color: white;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-to-cart:hover {
    background: #27ae60;
}

/* 用户评价 */
.reviews {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.review-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.8rem;
    margin-top: 1.8rem;
}

.review {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.8rem;
    transition: all 0.3s ease;
}

.review:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.review-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.2rem;
}

.review-avatar {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1.2rem;
    border: 2px solid #2ecc71;
}

.review-user {
    font-weight: bold;
    font-size: 1.1rem;
}

.review-rating {
    color: #f39c12;
    margin-left: auto;
    font-size: 1.1rem;
}

.review-date {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

.review-content {
    line-height: 1.7;
    color: #444;
}

/* 评论表单 */
.review-form {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2.5rem;
}

.form-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #2ecc71;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.2);
    outline: none;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.rating-stars {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.3rem;
}

.rating-stars i {
    font-size: 1.5rem;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rating-stars i:hover, 
.rating-stars i.active {
    color: #f39c12;
}

.submit-btn {
    background: #2ecc71;
    color: white;
    border: none;
    padding: 0.9rem 1.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background: #27ae60;
}

/* 购物车侧边栏 */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
    z-index: 1000;
    padding: 1.8rem;
    overflow-y: auto;
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.8rem;
    padding-bottom: 1.2rem;
    border-bottom: 2px solid #eee;
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #7f8c8d;
}

.cart-items {
    margin-bottom: 1.8rem;
}

.cart-item {
    display: flex;
    margin-bottom: 1.2rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid #eee;
}

.cart-item-img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 1.2rem;
    border: 1px solid #eee;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-weight: 500;
    margin-bottom: 0.4rem;
    font-size: 1.1rem;
}

.cart-item-price {
    color: #e74c3c;
    font-weight: bold;
    margin-bottom: 0.6rem;
    font-size: 1.1rem;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
}

.quantity-btn {
    background: #eee;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.quantity-input {
    width: 45px;
    text-align: center;
    margin: 0 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.3rem;
    font-size: 1rem;
}

.remove-item {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    margin-left: auto;
    font-size: 1.2rem;
}

.cart-summary {
    border-top: 2px solid #eee;
    padding-top: 1.5rem;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 1.8rem;
    color: #2c3e50;
}

.checkout-btn {
    width: 100%;
    padding: 1.2rem;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.checkout-btn:hover {
    background: #27ae60;
}

/* 遮罩层 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 音乐控制 */
.music-control {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 100;
}

.music-control i {
    font-size: 1.5rem;
    color: #2ecc71;
}

/* 关于我们 */
.about-us {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.1), rgba(39, 174, 96, 0.1));
    border-radius: 12px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.about-card {
    background: white;
    border-radius: 12px;
    padding: 1.8rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.about-card h3 {
    color: #27ae60;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.about-card h3 i {
    font-size: 1.5rem;
}

.about-card p {
    line-height: 1.7;
    color: #555;
}

.info-item {
    display: flex;
    margin-bottom: 1rem;
}

.info-icon {
    width: 40px;
    height: 40px;
    background: #e8f8f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    color: #2ecc71;
}

.info-content {
    flex: 1;
}

.info-title {
    font-weight: 600;
    color: #2c3e50;
}

.info-desc {
    color: #7f8c8d;
}

/* 页脚 */
footer {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    padding: 2rem;
    text-align: center;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-section {
    flex: 1;
    min-width: 250px;
    text-align: left;
}

.footer-section h3 {
    margin-bottom: 1.2rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background: white;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.copyright {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .categories {
        gap: 1rem;
    }
    
    .category {
        width: calc(50% - 0.5rem);
    }
}

@media (max-width: 768px) {
    .banner h1 {
        font-size: 2.5rem;
    }
    
    .banner p {
        font-size: 1.2rem;
    }
    
    .categories {
        flex-direction: column;
    }
    
    .category {
        width: 100%;
    }
    
    .cart-sidebar {
        width: 90%;
        right: -90%;
    }
    
    .cart-sidebar.active {
        right: 0;
    }
    
    .nav-links li {
        margin-left: 1rem;
    }
    
    .footer-section {
        text-align: center;
    }
    
    .footer-section h3::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animated {
    animation: fadeIn 0.6s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* 登录注册模态框 */
.auth-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1100;
    display: none;
    overflow: hidden;
}

.auth-modal.active {
    display: block;
}

.auth-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
}

.auth-tab {
    flex: 1;
    padding: 1.2rem;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.auth-tab.active {
    background: white;
    color: #2ecc71;
    border-bottom: 3px solid #2ecc71;
    margin-bottom: -2px;
}

.auth-form {
    padding: 2rem;
}

.auth-form.active {
    display: block;
}

.form-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.form-icon i {
    font-size: 3rem;
    color: #2ecc71;
}

.auth-form .form-group {
    margin-bottom: 1.2rem;
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
}

.forgot-password {
    color: #3498db;
    text-decoration: none;
    transition: all 0.3s ease;
}

.forgot-password:hover {
    color: #2980b9;
}

.auth-submit-btn {
    width: 100%;
    padding: 1rem;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.auth-submit-btn:hover {
    background: #27ae60;
}

.social-login {
    text-align: center;
    margin-bottom: 1.5rem;
}

.social-login p {
    color: #7f8c8d;
    margin-bottom: 1rem;
    position: relative;
}

.social-login p::before,
.social-login p::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: #ddd;
}

.social-login p::before {
    left: 0;
}

.social-login p::after {
    right: 0;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.social-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-icon.wechat {
    background: #2aae67;
    color: white;
}

.social-icon.qq {
    background: #3498db;
    color: white;
}

.social-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.auth-switch {
    text-align: center;
    color: #7f8c8d;
}

.auth-switch a {
    color: #2ecc71;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
}