/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    color: #333;
    background-color: #f8f9fa;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

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

button {
    cursor: pointer;
    border: none;
    font-family: inherit;
}

input, select, textarea {
    font-family: inherit;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
    border: 1px solid #4CAF50;
}

.btn-primary:hover {
    background-color: #3d8b40;
    border-color: #3d8b40;
}

.btn-outline {
    background-color: transparent;
    color: #4CAF50;
    border: 1px solid #4CAF50;
}

.btn-outline:hover {
    background-color: #f0f9f0;
}

.btn-block {
    display: block;
    width: 100%;
}

/* 标题样式 */
.section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #333;
    text-align: center;
}

/* 头部导航栏 */
.header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #4CAF50;
}

.logo i {
    font-size: 1.8rem;
    margin-right: 10px;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-weight: 500;
    color: #555;
    padding: 8px 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: #4CAF50;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #4CAF50;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.location-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
}

.location-selector select {
    border: none;
    background: transparent;
    font-size: 0.9rem;
    color: #666;
    cursor: pointer;
}

.cart-icon {
    position: relative;
    font-size: 1.3rem;
    color: #666;
    cursor: pointer;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #ff4757;
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle {
    display: none;
    background: transparent;
    font-size: 1.5rem;
    color: #555;
}

/* 主横幅区域 */
.hero {
    background: linear-gradient(135deg, #f0f9f0 0%, #e6f7e6 100%);
    padding: 60px 0;
    overflow: hidden;
}

.hero .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-content {
    flex: 1;
}

.hero-title {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.highlight {
    color: #4CAF50;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
    max-width: 600px;
}

.delivery-options {
    display: flex;
    gap: 20px;
    margin-bottom: 2rem;
}

.option-card {
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    width: 180px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.option-card.active {
    border-color: #4CAF50;
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.15);
}

.option-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.option-card i {
    font-size: 2rem;
    color: #4CAF50;
    margin-bottom: 15px;
}

.option-card h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.option-card p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.price-tag {
    display: inline-block;
    background-color: #f0f9f0;
    color: #4CAF50;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.address-input {
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    max-width: 600px;
}

.input-group {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}

.input-group i {
    padding: 0 15px;
    color: #888;
}

.input-group input {
    flex: 1;
    padding: 15px 10px;
    border: none;
    outline: none;
    font-size: 1rem;
}

.address-hint {
    color: #666;
    font-size: 0.9rem;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.hero-image img {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* 商品分类 */
.categories {
    padding: 40px 0;
    background-color: white;
}

.category-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.category-tab {
    padding: 10px 20px;
    background-color: #f8f9fa;
    border-radius: 30px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #eee;
}

.category-tab:hover, .category-tab.active {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.category-tab i {
    margin-right: 8px;
}

/* 商品展示 */
.products {
    padding: 60px 0;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-options select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: white;
    color: #333;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.product-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.product-image {
    height: 180px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-desc {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ff6b6b;
}

.product-price .unit {
    font-size: 0.9rem;
    color: #888;
    font-weight: normal;
}

.add-to-cart {
    background-color: #4CAF50;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.add-to-cart:hover {
    background-color: #3d8b40;
    transform: scale(1.1);
}

.load-more {
    text-align: center;
}

/* 系统特色 */
.features {
    padding: 60px 0;
    background-color: #f8f9fa;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background-color: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background-color: #f0f9f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.feature-icon i {
    font-size: 1.8rem;
    color: #4CAF50;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.feature-card p {
    color: #666;
}

/* 使用指南 */
.how-it-works {
    padding: 60px 0;
    background-color: white;
}

.steps {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.step {
    flex: 1;
    min-width: 200px;
    text-align: center;
    padding: 20px;
}

.step-number {
    width: 50px;
    height: 50px;
    background-color: #4CAF50;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 20px;
}

.step-content h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.step-content p {
    color: #666;
}

/* 购物车侧边栏 */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background-color: white;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1100;
    transition: right 0.4s ease;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.cart-header h3 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-cart {
    font-size: 1.8rem;
    background: transparent;
    color: #888;
    transition: color 0.3s ease;
}

.close-cart:hover {
    color: #333;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.empty-cart {
    text-align: center;
    padding: 60px 20px;
    color: #aaa;
}

.empty-cart i {
    font-size: 3rem;
    margin-bottom: 15px;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item-image {
    width: 70px;
    height: 70px;
    background-color: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.cart-item-image img {
    max-width: 90%;
    max-height: 90%;
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.cart-item-price {
    color: #ff6b6b;
    font-weight: 600;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    background-color: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.remove-item {
    color: #ff4757;
    background: transparent;
    font-size: 1.2rem;
    margin-left: 10px;
}

.cart-summary {
    padding: 20px;
    border-top: 1px solid #eee;
    background-color: #f8f9fa;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.summary-row.total {
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ddd;
}

.delivery-time {
    margin: 20px 0;
}

.delivery-time select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-top: 8px;
}

.cart-notice {
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    margin-top: 15px;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    display: none;
}

.cart-overlay.active {
    display: block;
}

/* 页脚 */
.footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3, .footer-col h4 {
    margin-bottom: 20px;
    color: white;
}

.footer-col h3 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-col p {
    color: #bdc3c7;
    margin-bottom: 20px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background-color: #34495e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background-color: #4CAF50;
    transform: translateY(-3px);
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 12px;
    color: #bdc3c7;
}

.footer-col ul li i {
    margin-right: 10px;
    width: 20px;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 30px;
    border-top: 1px solid #34495e;
    flex-wrap: wrap;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: #bdc3c7;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #4CAF50;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 100%;
    max-width: 450px;
    background-color: white;
    border-radius: 12px;
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal-content {
    padding: 30px;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.5rem;
    background: transparent;
    color: #888;
}

.modal h2 {
    text-align: center;
    margin-bottom: 25px;
}

.login-tabs {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.login-tab {
    flex: 1;
    padding: 12px;
    background: transparent;
    font-weight: 600;
    color: #888;
    border-bottom: 3px solid transparent;
}

.login-tab.active {
    color: #4CAF50;
    border-bottom-color: #4CAF50;
}

.login-form, .register-form {
    display: none;
}

.login-form.active, .register-form.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group input {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.btn-sms {
    position: absolute;
    right: 5px;
    top: 5px;
    background-color: #f0f9f0;
    color: #4CAF50;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    font-size: 0.9rem;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    display: none;
}

.modal-overlay.active {
    display: block;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .hero .container {
        flex-direction: column;
    }
    
    .hero-image {
        justify-content: center;
        margin-top: 40px;
    }
    
    .delivery-options {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .steps {
        flex-direction: column;
        align-items: center;
    }
    
    .step {
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .nav-menu, .nav-actions .btn-outline {
        display: none;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .nav-actions {
        gap: 1rem;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .section-title {
        font-size: 1.7rem;
    }
    
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .option-card {
        width: 100%;
        max-width: 250px;
    }
    
    .address-input .input-group {
        flex-direction: column;
    }
    
    .input-group input, .input-group button {
        width: 100%;
        border-radius: 8px;
        margin: 5px 0;
    }
}