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

:root {
    --primary: #1F2937;
    --primary-light: #374151;
    --accent: #F97316;
    --accent-light: #FB923C;
    --background: #FFFFFF;
    --card-bg: #F9FAFB;
    --border: #E5E7EB;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-light: #9CA3AF;
    --success: #10B981;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }
}

/* ===== 按钮样式 ===== */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: white;
}

.btn-secondary {
    background-color: var(--accent);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--accent-light);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ===== 导航栏 ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--background);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.5rem;
}

.logo-icon {
    width: 2rem;
    height: 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: bold;
}

.logo-text {
    display: none;
}

@media (min-width: 768px) {
    .logo-text {
        display: inline;
    }
}

.nav-desktop {
    display: none;
    gap: 2rem;
}

@media (min-width: 768px) {
    .nav-desktop {
        display: flex;
    }
}

.nav-desktop a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-desktop a:hover {
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-btn,
.cart-btn,
.menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.search-btn:hover,
.cart-btn:hover,
.menu-toggle:hover {
    transform: scale(1.1);
}

.cart-btn {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--accent);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

.menu-toggle {
    display: block;
}

@media (min-width: 768px) {
    .menu-toggle {
        display: none;
    }
}

.nav-mobile {
    display: none;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
}

.nav-mobile.active {
    display: flex;
}

.nav-mobile a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
}

/* ===== 英雄区 ===== */
.hero {
    padding: 3rem 0;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}

@media (min-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
}

.hero-text {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hero-badge {
    display: inline-block;
    width: fit-content;
    background-color: rgba(249, 115, 22, 0.1);
    color: var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .hero h1 {
        font-size: 3rem;
    }
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-image {
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.hero-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ===== 特色服务 ===== */
.features {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 3rem 0;
    margin: 2rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.feature-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.feature-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ===== 产品区 ===== */
.products {
    padding: 4rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-secondary);
}

/* 分类筛选 */
.category-filter {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border);
    background-color: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 产品网格 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 2rem;
    }
}

/* 产品卡片 */
.product-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.product-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: #f0f0f0;
}

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

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.discount-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background-color: var(--accent);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: bold;
}

.product-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.category-tag {
    display: inline-block;
    width: fit-content;
    background-color: var(--card-bg);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.stars {
    font-size: 0.875rem;
}

.reviews {
    color: var(--text-secondary);
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.current-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--accent);
}

.original-price {
    font-size: 0.875rem;
    color: var(--text-light);
    text-decoration: line-through;
}

.btn-small {
    margin-top: auto;
}

.view-all {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

/* ===== 促销横幅 ===== */
.promo {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 3rem 0;
    margin: 2rem 0;
}

.promo-content {
    text-align: center;
}

.promo-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.promo-content p {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

/* ===== 购物车侧边栏 ===== */
.cart-sidebar {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: 100vh;
    background-color: var(--background);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

@media (max-width: 480px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
}

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

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.cart-header h2 {
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

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

.empty-cart {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem 1rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.item-details {
    flex: 1;
}

.item-details h4 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.item-details p {
    color: var(--accent);
    font-weight: 600;
}

.item-quantity {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.qty-btn {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border);
    background-color: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
}

.qty-btn:hover {
    background-color: var(--card-bg);
}

.remove-btn {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 1.25rem;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ===== 产品详情模态框 ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    position: relative;
    background-color: var(--background);
    border-radius: var(--radius);
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
}

.modal-body {
    padding: 2rem;
}

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

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

.detail-image {
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: var(--radius);
    background-color: var(--card-bg);
}

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

.detail-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-category {
    display: inline-block;
    width: fit-content;
    background-color: var(--card-bg);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.detail-info h2 {
    font-size: 2rem;
}

.detail-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-text {
    color: var(--text-secondary);
}

.detail-price {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.savings {
    color: var(--success);
    font-size: 0.875rem;
}

.detail-stock {
    color: var(--success);
    font-weight: 600;
}

.detail-description {
    color: var(--text-secondary);
}

.quantity-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quantity-control {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    width: fit-content;
}

.quantity-control input {
    width: 60px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    text-align: center;
}

.detail-buttons {
    display: flex;
    gap: 1rem;
}

.detail-buttons .btn {
    flex: 1;
}

.detail-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.feature {
    display: flex;
    gap: 1rem;
}

.feature span {
    font-size: 1.5rem;
}

.feature h4 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.feature p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ===== 页脚 ===== */
.footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

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

.footer-section h4 {
    margin-bottom: 1rem;
}

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

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--primary);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-section p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--primary);
}

/* ===== 通知 ===== */
.notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--success);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

@media (max-width: 640px) {
    .notification {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
}

/* ===== 响应式设计 ===== */
@media (max-width: 640px) {
    .hero h1 {
        font-size: 1.875rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .product-image {
        height: 150px;
    }

    .modal-body {
        padding: 1rem;
    }

    .product-detail {
        gap: 1rem;
    }

    .detail-image {
        height: 250px;
    }

    .detail-info h2 {
        font-size: 1.5rem;
    }
}
