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

body {
    font-family: 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

/* 顶部导航栏 */
.header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    color: white;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.logo h1 {
    font-size: 28px;
    font-weight: bold;
    white-space: nowrap;
}

.search-bar {
    flex: 1;
    display: flex;
    max-width: 500px;
}

.search-bar input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 25px 0 0 25px;
    font-size: 14px;
    outline: none;
}

.search-btn {
    background: #333;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 0 25px 25px 0;
    cursor: pointer;
    font-size: 16px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-icon {
    position: relative;
    cursor: pointer;
    font-size: 24px;
    padding: 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-icon span {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

.btn-login {
    background: transparent;
    border: 2px solid white;
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-login:hover {
    background: white;
    color: #ff6b6b;
}

.btn-register {
    background: white;
    border: none;
    color: #ff6b6b;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* 导航菜单 */
.nav-menu {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.menu-list {
    display: flex;
    list-style: none;
    overflow-x: auto;
}

.menu-list li {
    flex-shrink: 0;
}

.menu-list a {
    display: block;
    padding: 15px 25px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
}

.menu-list a:hover,
.menu-list a.active {
    color: #ff6b6b;
    font-weight: bold;
}

/* 轮播图 */
.banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 80px 0;
    text-align: center;
    color: white;
}

.banner-content h2 {
    font-size: 48px;
    margin-bottom: 20px;
}

.banner-content p {
    font-size: 24px;
    margin-bottom: 30px;
    opacity: 0.9;
}

.btn-banner {
    background: white;
    color: #667eea;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-banner:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* 分类图标 */
.categories {
    padding: 40px 0;
    background: white;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
}

.category-item {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.category-item:hover {
    background: #f5f5f5;
    transform: translateY(-5px);
}

.category-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.category-item span {
    font-size: 14px;
    color: #666;
    display: block;
}

/* 商品列表 */
.products-section {
    padding: 40px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 28px;
    color: #333;
}

.filter-options select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

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

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

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

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

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff4757;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: bold;
}

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-desc {
    font-size: 13px;
    color: #999;
    margin-bottom: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.product-price {
    font-size: 24px;
    font-weight: bold;
    color: #ff4757;
}

.product-price::before {
    content: '¥';
    font-size: 16px;
}

.product-original-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
    margin-left: 5px;
}

.product-sales {
    font-size: 12px;
    color: #999;
}

.btn-add-cart {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-add-cart:hover {
    transform: scale(1.05);
}

.load-more {
    text-align: center;
    margin-top: 30px;
}

.btn-outline {
    background: transparent;
    color: #ff6b6b;
    border: 2px solid #ff6b6b;
    padding: 12px 40px;
    font-size: 16px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
}

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

/* 购物车侧边栏 */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 2000;
    transition: right 0.3s;
    display: flex;
    flex-direction: column;
}

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

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

.cart-header h3 {
    font-size: 20px;
}

.close-cart {
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

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

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

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 10px;
    margin-bottom: 15px;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

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

.cart-item-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.cart-item-price {
    font-size: 18px;
    font-weight: bold;
    color: #ff4757;
}

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

.quantity-btn {
    width: 25px;
    height: 25px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: #f5f5f5;
}

.quantity-value {
    font-size: 14px;
    min-width: 30px;
    text-align: center;
}

.cart-remove {
    color: #ff4757;
    cursor: pointer;
    font-size: 14px;
    margin-left: auto;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #eee;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 18px;
}

.total-price {
    font-size: 28px;
    font-weight: bold;
    color: #ff4757;
}

.btn-checkout {
    width: 100%;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    color: white;
    border: none;
    padding: 15px;
    font-size: 18px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

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

.overlay.active {
    display: block;
}

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

.empty-cart-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 40px;
    border-radius: 15px;
    max-width: 600px;
    position: relative;
    animation: slideDown 0.3s;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-small {
    max-width: 400px;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #333;
}

/* 商品详情弹窗 */
.product-detail-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.product-detail-image {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.product-detail-info h2 {
    font-size: 28px;
    margin-bottom: 15px;
    color: #333;
}

.product-detail-price {
    font-size: 36px;
    font-weight: bold;
    color: #ff4757;
    margin-bottom: 20px;
}

.product-detail-price::before {
    content: '¥';
    font-size: 24px;
}

.product-detail-desc {
    color: #666;
    line-height: 1.8;
    margin-bottom: 20px;
}

.product-detail-meta {
    margin-bottom: 20px;
}

.product-detail-meta p {
    margin-bottom: 10px;
    color: #666;
}

.btn-add-cart-large {
    width: 100%;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    color: white;
    border: none;
    padding: 15px;
    font-size: 18px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-add-cart-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

/* 认证表单 */
.auth-form {
    margin-top: 20px;
}

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

.auth-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.auth-form input,
.auth-form select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.auth-form input:focus,
.auth-form select:focus {
    outline: none;
    border-color: #ff6b6b;
}

.verify-code {
    display: flex;
    gap: 10px;
}

.verify-code input {
    flex: 1;
}

.btn-code {
    padding: 12px 20px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.3s;
}

.btn-code:hover {
    background: #e8e8e8;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    color: white;
    border: none;
    padding: 15px;
    font-size: 18px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.auth-footer a {
    color: #ff6b6b;
    text-decoration: none;
    font-weight: bold;
}

/* 页脚 */
.footer {
    background: #2c3e50;
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
}

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

.footer-section h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.footer-section p {
    margin-bottom: 10px;
    opacity: 0.8;
    font-size: 14px;
}

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

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-section ul li a:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    opacity: 0.7;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 通知提示 */
.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: #67c23a;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 4000;
    animation: slideInRight 0.3s;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 响应式 */
@media (max-width: 768px) {
    .header-top {
        flex-wrap: wrap;
    }

    .search-bar {
        order: 3;
        width: 100%;
        max-width: none;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .cart-sidebar {
        width: 100%;
        right: -100%;
    }

    .product-detail-container {
        grid-template-columns: 1fr;
    }

    .menu-list {
        padding: 0 10px;
    }

    .menu-list a {
        padding: 15px;
    }
}
