/* 重置默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
}

/* 导航栏样式 */
header {
    background-color: #333;
    padding: 1rem 0;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: #555;
}

/* 响应式导航栏 */
nav {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

nav ul {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0;
    margin: 0;
}

nav li {
    flex: 1;
    text-align: center;
}

nav a {
    display: block;
    padding: 1rem;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* 响应式布局调整 */
@media (max-width: 768px) {
    /* 导航栏调整 */
    nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    nav li {
        width: 100%;
    }
    
    nav a {
        padding: 0.75rem;
    }

    /* Hero区域调整 */
    .hero-content {
        padding: 1rem;
    }

    .hero-content h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .hero-content p {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .btn-shop-now {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* 平板尺寸调整 */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }
}

/* 较小手机屏幕 */
@media (max-width: 375px) {
    nav a {
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .hero-content h1 {
        font-size: 1.25rem;
    }

    .hero-content p {
        font-size: 0.9rem;
    }

    .btn-shop-now {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

/* 确保内容区域在各种屏幕尺寸下都有合适的间距 */
@media (max-width: 1200px) {
    .main-content {
        padding: 0 1rem;
    }
}

/* 增加内容区域最大宽度限制,防止在超宽屏幕上过于拉伸 */
.main-content {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

/* 响应式网格布局 */
.categories-grid,
.products-grid,
.promo-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

@media (max-width: 640px) {
    .categories-grid,
    .products-grid,
    .promo-grid {
        grid-template-columns: 1fr;
    }
}

/* 图片响应式处理 */
img {
    max-width: 100%;
    height: auto;
}

/* 文字大小响应式 */
@media (max-width: 768px) {
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    p {
        font-size: 0.9rem;
    }
}

/* 按钮响应式样式 */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        width: 100%;
    }
}

/* 主容器样式 */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* 错误消息样式 */
.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

/* 成功消息样式 */
.success-message {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

/* 底部样式 */
footer {
    background-color: #333;
    color: white;
    padding: 2rem 0;
    margin-top: 2rem;
    width: 100%;
    text-align: center;
}

/* 保证页面最小高度,使footer保持在底部 */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* footer内容容器 */
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

/* footer各个区块 */
.footer-section {
    margin-bottom: 1.5rem;
}

.footer-section h3 {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* 底部链接样式 */
.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #fff;
}

/* 版权信息 */
.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    margin: 0;
    font-size: 0.9rem;
    color: #ccc;
}

/* 响应式调整 */
@media (max-width: 768px) {
    footer {
        padding: 1.5rem 0;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        padding: 0 1rem;
        text-align: center;
    }
    
    .footer-section {
        margin-bottom: 1rem;
    }
    
    .footer-section h3 {
        font-size: 1.1rem;
    }
    
    .footer-bottom {
        padding-top: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .footer-bottom p {
        font-size: 0.8rem;
    }
}

/* 小屏幕设备 */
@media (max-width: 375px) {
    footer {
        padding: 1rem 0;
    }
    
    .footer-content {
        gap: 1rem;
    }
    
    .footer-section h3 {
        font-size: 1rem;
    }
    
    .footer-links a {
        font-size: 0.9rem;
    }
}


/* 首页英雄区域 */
.hero-section {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), 
                url('../assets/images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    margin-bottom: 3rem;
}

.hero-content {
    max-width: 800px;
    padding: 2rem;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: fadeInDown 1s ease;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease;
}

.btn-shop-now {
    display: inline-block;
    padding: 1rem 2rem;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 30px;
    transition: all 0.3s ease;
    animation: fadeInUp 1.5s ease;
}

.btn-shop-now:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* 主要内容区域 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* 分类部分 */
.categories-section {
    margin-bottom: 4rem;
}

.categories-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.category-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: #2c3e50;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.category-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #3498db;
}

/* 商品部分 */
.featured-products {
    margin-bottom: 4rem;
}

.featured-products h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-info {
    padding: 1.5rem;
}

.product-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.category {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.price {
    font-size: 1.25rem;
    color: #e74c3c;
    font-weight: bold;
    margin: 1rem 0;
}

.btn-view-details {
    display: block;
    text-align: center;
    padding: 0.75rem;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-view-details:hover {
    background: #2980b9;
}

/* 商品列表样式 */
.products-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
}

.category-filter {
    margin-bottom: 2rem;
}

.category-filter select {
    padding: 0.5rem 1rem;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #2c3e50;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-info {
    padding: 1.5rem;
}

.product-info h2 {
    font-size: 1.25rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.price {
    font-size: 1.25rem;
    color: #e74c3c;
    font-weight: bold;
    margin: 1rem 0;
}

/* 商品操作区域样式 */
.product-actions {
    margin-top: 1rem;
}

.quantity-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    text-align: center;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.btn-add-cart,
.btn-buy-now {
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
}

.btn-add-cart {
    background: #3498db;
    color: white;
}

.btn-add-cart:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-buy-now {
    background: #e74c3c;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-buy-now:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* 缺货状态 */
.out-of-stock {
    text-align: center;
    color: #e74c3c;
    font-weight: bold;
    margin-top: 1rem;
    padding: 0.5rem;
    background: #fdf2f2;
    border-radius: 4px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .products-container {
        padding: 1rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .button-group {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .btn-add-cart,
    .btn-buy-now {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    
    .quantity-input {
        padding: 0.4rem;
        font-size: 0.85rem;
    }
}

/* 小屏幕设备 */
@media (max-width: 375px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-card img {
        height: 150px;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .product-info h2 {
        font-size: 1.1rem;
    }
    
    .price {
        font-size: 1.1rem;
    }
    
    .product-actions {
        margin-top: 0.75rem;
    }
    
    .button-group {
        gap: 0.3rem;
    }
}


/* 促销专区 */
.promo-section {
    margin-bottom: 4rem;
}

.promo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.promo-card {
    background: linear-gradient(135deg, #3498db, #2980b9);
    padding: 2rem;
    border-radius: 8px;
    color: white;
    text-align: center;
}

.promo-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.promo-card p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.btn-promo {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: white;
    color: #3498db;
    text-decoration: none;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.btn-promo:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* 动画效果 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .hero-section {
        height: 400px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .categories-grid,
    .products-grid,
    .promo-grid {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        padding: 0 1rem;
    }
}



/* 登录和注册表单样式 */
.login-container,
.register-container {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-container h1,
.register-container h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.login-form,
.register-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-form .form-group,
.register-form .form-group {
    margin-bottom: 1rem;
}

.login-form label,
.register-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #34495e;
    font-weight: 500;
}

.login-form input,
.register-form input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.login-form input:focus,
.register-form input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.login-form button,
.register-form button {
    padding: 0.75rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-form button:hover,
.register-form button:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.register-link,
.login-link {
    text-align: center;
    margin-top: 1rem;
}

/* 购物车样式 */
.cart-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 2rem;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.cart-table th,
.cart-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.cart-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.cart-product-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.btn-continue-shopping,
.btn-checkout {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-continue-shopping {
    background: #95a5a6;
    color: white;
}

.btn-checkout {
    background: #2ecc71;
    color: white;
}

.btn-continue-shopping:hover,
.btn-checkout:hover {
    transform: translateY(-2px);
}

.empty-cart-message {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
    background: #f8f9fa;
    border-radius: 8px;
}
.cart-table .btn-remove {
    padding: 0.5rem 1rem;
    background: #e74c3c;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: inline-block;
}

.cart-table .btn-remove:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* 动画效果 */
.cart-table tr {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.cart-table tr.removing {
    opacity: 0;
    transform: translateX(100%);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .profile-content {
        grid-template-columns: 1fr;
    }
    
    .cart-table {
        display: block;
        overflow-x: auto;
    }
    
    .cart-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn-continue-shopping,
    .btn-checkout {
        text-align: center;
    }
}



/* 结算页面样式 */
.checkout-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 2rem;
}

/* 收货地址部分 */
.address-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.address-item {
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.address-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

.address-item label {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.address-info {
    flex: 1;
    line-height: 1.6;
}

.btn-add-address {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #f8f9fa;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-add-address:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

/* 商品清单表格 */
.order-items {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.order-table {
    width: 100%;
    border-collapse: collapse;
}

.order-table th,
.order-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.order-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.order-table tfoot td {
    font-weight: bold;
    color: #e74c3c;
}

.product-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

/* 订单备注 */
.remark-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.remark-section textarea {
    width: 100%;
    height: 100px;
    padding: 0.75rem;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    resize: vertical;
    transition: all 0.3s ease;
}

.remark-section textarea:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 支付方式 */
.payment-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.payment-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.payment-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.payment-options label:hover {
    border-color: #3498db;
}

.payment-options input[type="radio"] {
    margin: 0;
}

/* 提交按钮 */
.submit-section {
    text-align: center;
}

.btn-submit-order {
    padding: 1rem 2rem;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 400px;
}

.btn-submit-order:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* 错误提示 */
.error-message {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    padding: 1rem;
    border-radius: 6px;
    color: #ff4d4f;
    margin-bottom: 1.5rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .checkout-container {
        padding: 1rem;
    }

    .payment-options {
        grid-template-columns: 1fr;
    }

    .order-table {
        display: block;
        overflow-x: auto;
    }
}

/* 小屏幕设备 */
@media (max-width: 375px) {
    .address-item label {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-submit-order {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}


