/* ========== 全局重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

/* ========== 全局变量 ========== */
:root {
    --primary: #165DFF;
    --secondary: #E8F3FF;
    --neutral: #F8FAFC;
    --dark: #1E293B;
    --gray: #64748B;
    --white: #ffffff;
    --shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* ========== 通用样式 ========== */
body {
    color: var(--dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    line-height: 1.3;
    margin-bottom: 15px;
}

p {
    color: var(--gray);
    margin-bottom: 10px;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: var(--dark);
    transition: var(--transition);
}

button {
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

/* 图片占位符（无外部图片） */
.placeholder-img, .card-img, .about-img, .product-img {
    /* background-color: var(--secondary); */
    border-radius: 8px;
    width: 100%;
    height: 100%;
}

/* ========== 顶部横幅 ========== */
.top-banner {
    background: #1A2A5A;
    padding: 10px 0;
}

.top-banner .container {
    display: flex;
    align-items: center;
}

.top-banner span {
    color: var(--white);
    font-size: 12px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    /* 与导航栏Logo对齐：container padding(20px) + margin-left(30px) + logo-icon width(40px) + gap(10px) = 100px */
    padding-left: 8px;
}

/* ========== 导航栏 ========== */
.navbar {
    background: var(--white);
    border-bottom: 1px solid #e5e7eb;
    padding: 15px 0;
    z-index: 99;
    position: relative;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 30px;
    text-decoration: none;
}

.logo h1 {
    color: #1a1a1a;
    font-size: 26px;
    margin: 0;
    font-weight: 600;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: orange;
    border-radius: 50%;
    position: relative;
}

.logo-icon::before,
.logo-icon::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
}

.logo-icon::before {
    top: 12px;
    left: 16px;
}

.logo-icon::after {
    top: 20px;
    right: 12px;
}

.logo h1 {
    color: #1a1a1a;
    font-size: 26px;
    margin: 0;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    gap: 35px;
    margin-right: 30px;
}

.nav-menu a {
    color: #888888;
    font-size: 15px;
    font-weight: 400;
}

.nav-menu a:hover {
    color: var(--primary);
}

.nav-menu a.active {
    color: #000000;
    font-weight: 500;
}

/* 登录注册按钮样式 */
.nav-auth {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.auth-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s ease;
    border: none;
    background: transparent;
    color: #666666;
}

.auth-btn:hover {
    color: #165DFF;
}

.login-btn:hover,
.signup-btn:hover {
    color: #165DFF;
}

/* 弹窗遮罩层 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

/* 弹窗内容 */
.modal-content {
    background: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

/* 移动端竖屏适配 */
@media (max-width: 480px) {
    .modal-content {
        max-width: 95%;
        margin: 0 10px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    /* 购物车移动端适配 */
    .cart-item {
        flex-wrap: nowrap;
        padding: 12px 0;
        position: relative;
    }

    .cart-item-image {
        width: 70px;
        height: 70px;
        margin-right: 12px;
    }

    .cart-item-info {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .cart-item-name {
        font-size: 14px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        margin-bottom: 8px;
        line-height: 1.4;
    }

    .cart-item-price {
        font-size: 14px;
        margin-bottom: 0;
    }

    .cart-item-quantity {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-top: 8px;
    }

    .quantity-btn {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }

    .quantity-input {
        width: 40px;
        height: 26px;
        font-size: 13px;
    }

    .cart-item-total {
        display: none;  /* 移动端隐藏重复的小计 */
    }

    .cart-item-remove {
        position: absolute;
        top: 12px;
        right: 0;
        margin: 0;
        padding: 4px 8px;
        font-size: 12px;
        background: #fee2e2;
        border-radius: 4px;
        color: #dc2626;
    }

    /* 购物车头部移动端适配 */
    .modal-header-actions {
        gap: 8px;
    }

    .btn-text {
        font-size: 12px;
        padding: 4px 6px;
        white-space: nowrap;
    }

    .modal-header h3 {
        font-size: 16px;
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
    }

    #cartItemCount {
        font-size: 12px !important;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #888888;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #333333;
}

.modal-body {
    padding: 24px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

/* 大弹窗样式 */
.modal-content.modal-large {
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-content.modal-large .modal-body {
    flex: 1;
    overflow-y: auto;
}

/* 订单弹窗样式 */
.order-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 16px;
}

.tab-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    border-color: #165DFF;
    color: #165DFF;
}

.tab-btn.active {
    background: #165DFF;
    color: white;
    border-color: #165DFF;
}

.order-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.order-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    background: #f9fafb;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 8px;
}

.order-id {
    font-weight: 600;
    color: #1a1a1a;
    word-break: break-all;
    flex: 1;
    min-width: 0;
}

.order-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.order-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.order-status.paid {
    background: #dbeafe;
    color: #1e40af;
}

.order-status.shipped {
    background: #d1fae5;
    color: #065f46;
}

.order-status.completed {
    background: #e0e7ff;
    color: #3730a3;
}

.order-status.cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.order-products {
    margin-bottom: 12px;
}

.order-product {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.order-product img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 4px;
    background: white;
}

.order-product-info {
    flex: 1;
}

.order-product-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.order-product-quantity {
    font-size: 14px;
    color: #666;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.order-total {
    font-weight: 600;
    color: #165DFF;
}

.order-date {
    font-size: 14px;
    color: #666;
}

.order-cancel-wrapper {
    margin-top: 12px;
    text-align: right;
}

.btn-cancel-order {
    white-space: nowrap;
}

@media (max-width: 480px) {
    .order-cancel-wrapper {
        text-align: center;
    }

    .btn-cancel-order {
        width: 100%;
    }
}

.empty-orders {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-orders-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* 按钮样式 */
.btn-primary {
    padding: 12px 24px;
    background: linear-gradient(135deg, #165DFF, #0047D1);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(22, 93, 255, 0.3);
}

.btn-secondary {
    padding: 8px 16px;
    background: white;
    color: #ef4444;
    border: 1px solid #ef4444;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #ef4444;
    color: white;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333333;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #165DFF;
    box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1);
}

.form-submit {
    width: 100%;
    padding: 12px;
    background: #165DFF;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 8px;
}

.form-submit:hover {
    background: #0047D1;
}

.form-links {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    color: #666666;
}

.form-links a {
    color: #165DFF;
    text-decoration: none;
    font-weight: 500;
}

.form-links a:hover {
    text-decoration: underline;
}

.form-links span {
    display: block;
    margin-top: 12px;
}

/* 全局消息提示 */
.global-message {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1002;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.global-message.success {
    background: #10B981;
    color: #ffffff;
}

.global-message.error {
    background: #EF4444;
    color: #ffffff;
}

.global-message.info {
    background: #165DFF;
    color: #ffffff;
}

/* 用户中心菜单 */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0f0f0;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.user-avatar:hover {
    background: #e0e0e0;
}

.user-avatar svg {
    width: 24px;
    height: 24px;
    color: #666666;
}

.user-avatar:hover svg {
    color: #165DFF;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    display: none;
    z-index: 1000;
    border: 1px solid #e5e7eb;
}

/* 确保nav-auth为相对定位，使下拉菜单相对于它定位 */
.nav-auth {
    position: relative;
}

.user-menu-dropdown.show {
    display: block;
}

/* 移动端下拉菜单调整 */
@media (max-width: 768px) {
    .user-menu-dropdown {
        right: 10px;
        left: auto;
        top: 60px;
        z-index: 1000;
    }
    
    /* 确保移动端下拉菜单相对于nav-right定位 */
    .nav-right {
        position: relative;
    }
    
    .nav-auth {
        position: static;
    }
}

/* 确保nav-right为相对定位，使下拉菜单相对于它定位 */
.nav-right {
    position: relative;
}

.user-menu-dropdown a {
    display: block;
    padding: 10px 16px;
    color: #333333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease;
}

.user-menu-dropdown a:hover {
    background: #f5f5f5;
    color: #165DFF;
}

/* 购物车图标 */
.cart-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0f0f0;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    transition: background 0.3s ease;
    position: relative;
}

.cart-icon:hover {
    background: #e0e0e0;
}

.cart-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    padding: 0 6px;
}

.cart-icon svg {
    width: 24px;
    height: 24px;
    color: #666666;
}

.cart-icon:hover svg {
    color: #165DFF;
}

.cart-icon .cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #165DFF;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* 订单模态框样式 */
.orders-container {
    width: 100%;
}

.order-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    background: #f8f9fa;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.order-id {
    font-weight: 600;
    color: #165DFF;
}

.order-date {
    font-size: 14px;
    color: #666666;
}

.order-status {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.order-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.order-status.shipped {
    background: #dbeafe;
    color: #1e40af;
}

.order-status.delivered {
    background: #d1fae5;
    color: #065f46;
}

.order-items {
    margin-bottom: 12px;
}

.order-item-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f1f1;
}

.order-item-detail:last-child {
    border-bottom: none;
}

.order-item-name {
    font-weight: 500;
}

.order-item-quantity {
    color: #666666;
    font-size: 14px;
}

.order-item-price {
    font-weight: 600;
    color: #165DFF;
}

.order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    font-weight: 600;
}

/* 地址模态框样式 */
.address-container {
    width: 100%;
}

.address-list {
    margin-bottom: 24px;
}

.address-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
}

.address-item.selected {
    border-color: #165DFF;
    background: #f0f7ff;
}

.address-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.address-name {
    font-weight: 600;
}

.address-actions {
    display: flex;
    gap: 8px;
}

.address-action-btn {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.address-action-btn:hover {
    background: #f8f9fa;
    border-color: #165DFF;
    color: #165DFF;
}

.address-details {
    font-size: 14px;
    color: #666666;
    line-height: 1.5;
}

.add-address-btn {
    width: 100%;
    padding: 12px;
    border: 2px dashed #e5e7eb;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
    color: #165DFF;
}

.add-address-btn:hover {
    border-color: #165DFF;
    background: #f0f7ff;
}

/* 产品购买模态框样式 */
.product-details {
    width: 100%;
}

.product-details p {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 16px;
}

.cart-price {
    color: #165DFF;
    font-weight: 600;
    font-size: 18px;
}

.cart-form {
    margin-bottom: 24px;
}

.cart-form label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333333;
    margin-bottom: 8px;
}

.cart-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.cart-form input:focus {
    outline: none;
    border-color: #165DFF;
    box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1);
}

.add-to-cart-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #165DFF, #0047D1);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(22, 93, 255, 0.3);
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(22, 93, 255, 0.4);
    background: linear-gradient(135deg, #0047D1, #165DFF);
}

/* 购物车模态框样式 */
.cart-items {
    width: 100%;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    flex-shrink: 0;
}

.cart-item-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.cart-item-price {
    color: #165DFF;
    font-weight: 600;
    margin-bottom: 8px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    border-color: #165DFF;
    color: #165DFF;
}

.quantity-input {
    width: 50px;
    height: 28px;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.3s ease;
    margin-left: 16px;
}

.cart-item-remove:hover {
    color: #dc2626;
}

.cart-summary {
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    margin-top: 20px;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    color: #666;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-text {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.3s ease;
}

.btn-text:hover {
    color: #dc2626;
    text-decoration: underline;
}

.cart-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
}

.cart-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    font-size: 16px;
    font-weight: 600;
}

.checkout-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #165DFF, #0047D1);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(22, 93, 255, 0.3);
    margin-top: 20px;
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(22, 93, 255, 0.4);
    background: linear-gradient(135deg, #0047D1, #165DFF);
}

.checkout-btn:disabled {
    background: #93c5fd;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: #666666;
}

.empty-cart-icon {
    font-size: 48px;
    margin-bottom: 16px;
    color: #d1d5db;
}

.continue-shopping-btn {
    margin-top: 20px;
    padding: 10px 20px;
    border: 1px solid #165DFF;
    border-radius: 8px;
    background: white;
    color: #165DFF;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.continue-shopping-btn:hover {
    background: #f0f7ff;
}

/* 页面消息框 */
.page-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1003;
    display: none;
}

.page-message .message-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

.page-message h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #333333;
    font-weight: 600;
}

.page-message .cart-form {
    margin-bottom: 20px;
}

.page-message .cart-form label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666666;
    font-weight: 500;
}

.page-message .cart-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.page-message .cart-form p {
    margin: 10px 0;
    font-size: 14px;
    color: #666666;
}

.page-message .cart-form .cart-price {
    color: #165DFF;
    font-weight: 600;
}

.page-message .add-to-cart-btn {
    width: 100%;
    padding: 12px;
    background: #165DFF;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.page-message .add-to-cart-btn:hover {
    background: #1453d6;
}

.page-message .close-btn {
    width: 100%;
    padding: 10px;
    background: #f5f5f5;
    color: #666666;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 10px;
}

.page-message .close-btn:hover {
    background: #e5e5e5;
}

/* 消息框样式 */
.auth-message {
    position: fixed;
    top: 80px;
    right: 20px;
    min-width: 250px;
    max-width: 350px;
    padding: 16px 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 1001;
    border: 1px solid #e5e7eb;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.auth-message.show {
    display: flex;
}

.message-text {
    font-size: 14px;
    color: #333333;
    flex: 1;
    line-height: 1.4;
}

.message-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #888888;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.message-close:hover {
    color: #333333;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .nav-auth .login-signup-buttons {
        display: none;
    }
    
    .nav-auth #userMenu {
        display: none !important;
    }
}

/* 移动端登录注册按钮 */
.mobile-auth-buttons, .mobile-user-menu {
    display: none;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}

.mobile-auth-buttons .auth-btn, .mobile-user-menu button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0f0f0;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    padding: 0;
}

.mobile-auth-buttons .auth-btn:hover, .mobile-user-menu button:hover {
    background: #e0e0e0;
}

.mobile-auth-buttons .auth-btn svg, .mobile-user-menu button svg {
    color: #666666;
}

.mobile-auth-buttons .auth-btn:hover svg, .mobile-user-menu button:hover svg {
    color: #165DFF;
}

/* 移动端显示 */
@media (max-width: 768px) {
    .mobile-auth-buttons, .mobile-user-menu {
        display: flex;
    }

    .login-signup-buttons {
        display: none !important;
    }

    .mobile-menu {
        display: flex;
        font-size: 24px;
        background: none;
        cursor: pointer;
        padding: 5px;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        border-bottom: 1px solid #e5e7eb;
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        z-index: 999;
        display: none;
    }
    
    .nav-menu a {
        display: block;
        padding: 10px 0;
    }
}

/* 桌面端隐藏移动端菜单和用户菜单 */
@media (min-width: 769px) {
    .mobile-menu {
        display: none !important;
    }

    .mobile-auth-buttons {
        display: none !important;
    }

    .mobile-user-menu {
        display: none !important;
    }

    .nav-menu {
        display: flex !important;
    }
}



/* ========== 头部横幅 ========== */
.hero {
    background: #f8f9fa;
    padding: 80px 0 100px;
    position: relative;
    overflow: hidden;
}

.hero .container {
    display: flex;
    align-items: center;
    gap: 60px;
}

.hero-content {
    flex: 0 0 40%;
}

.hero-welcome {
    display: block;
    color: #1A2A5A;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 25px;
    color: var(--dark);
    line-height: 1.2;
}

.hero p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--gray);
    max-width: 480px;
}

.hero-visual {
    flex: 0 0 60%;
    display: flex;
    gap: 20px;
    height: 500px;
}

/* 左侧: 主图(自带对比图) + 产品包装 */
.hero-left {
    flex: 1;
    position: relative;
}

.hero-main-image {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
}

.hero-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-packaging {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border: 4px solid var(--white);
}

.product-packaging img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 右侧: 猫用产品 */
.hero-cat-products {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: flex-end;
}

.cat-product-item {
    width: 110px;
    height: 130px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
}

.cat-product-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dewormer-item {
    width: 110px;
    height: 150px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
}

.dewormer-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, rgba(22, 93, 255, 0.05), transparent);
    border-radius: 50% 50% 0 0;
}

/* ========== 产品分类 ========== */
.category {
    padding: 80px 0;
    background: var(--white);
}

.category h2 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 50px;
    color: #1A2B5C;
    font-weight: 700;
    letter-spacing: 1px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.category-card {
    background: #F8F6F2;
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.card-img {
    height: 280px;
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.category-card:hover .card-img img {
    transform: scale(1.05);
}

.card-text {
    padding: 25px;
}

.card-text h3 {
    font-size: 20px;
    color: var(--dark);
    margin-bottom: 12px;
    font-weight: 600;
}

.card-text p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray);
    margin: 0;
}

/* ========== 产品介绍 ========== */
.about {
    padding: 80px 0;
    background: var(--white);
}

.about-grid {
    display: flex;
    align-items: center;
    gap: 60px;
}

.about-img {
    flex: 0 0 40%;
    height: 500px;
    border-radius: 12px;
    overflow: hidden;
}

.about-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-text {
    flex: 0 0 60%;
}

.about-text h2 {
    font-size: 32px;
    color: #1A2B5C;
    margin-bottom: 40px;
    font-weight: 700;
    letter-spacing: 1px;
}

.text-item {
    display: flex;
    gap: 20px;
    padding-bottom: 25px;
    margin-bottom: 25px;
    border-bottom: 1px solid #e5e7eb;
}

.text-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.item-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.item-content h3 {
    font-size: 20px;
    color: var(--dark);
    margin-bottom: 10px;
    font-weight: 600;
}

.item-content p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--gray);
    margin: 0;
}

/* ========== 产品列表 ========== */
.products {
    padding: 80px 0;
    background: var(--white);
}

.products h2 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 50px;
    color: #1A2B5C;
    font-weight: 700;
    letter-spacing: 1px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.product-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.product-img {
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-info {
    padding: 25px;
    border-radius: 0 0 12px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 150px;
}

.product-info h3 {
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 10px;
    font-weight: 600;
}

.product-info p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray);
    margin-bottom: 15px;
}

.price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    height: 40px;
}

.price span {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
}

.buy-btn {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, #8A2BE2, #9370DB);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);
    position: relative;
    overflow: hidden;
    margin-top: auto;
}

.buy-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.buy-btn:hover::before {
    left: 100%;
}

.buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(138, 43, 226, 0.4);
}

.buy-btn:active {
    transform: translateY(0);
}

/* ========== 产品优势 ========== */
.advantages {
    padding: 80px 0;
    background: #F8F9FA;
}

.advantages h2 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 50px;
    color: #1A2B5C;
    font-weight: 700;
    letter-spacing: 1px;
}

.advantage-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}

.advantage-card {
    padding: 40px 30px;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.advantage-card:nth-child(3n) {
    border-right: none;
}

.advantage-card:nth-child(n+4) {
    border-bottom: none;
}

.advantage-card h3 {
    font-size: 20px;
    color: var(--dark);
    margin-bottom: 15px;
    font-weight: 600;
}

.advantage-card p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--gray);
    margin: 0;
}

/* ========== 用户评价 ========== */
.reviews {
    padding: 80px 0;
    background: #F8F9FA;
}

.reviews h2 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 50px;
    color: #1A2B5C;
    font-weight: 700;
    letter-spacing: 1px;
}

.review-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.review-card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.review-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.review-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
}

.review-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.review-rating {
    font-size: 28px;
    font-weight: 700;
    color: #475569;
}

.review-card h3 {
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 12px;
    font-weight: 600;
}

.review-card p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--gray);
    margin-bottom: 20px;
    font-style: italic;
}

.review-user h4 {
    font-size: 16px;
    color: var(--dark);
    margin: 0 0 5px 0;
    font-weight: 600;
}

.review-user span {
    font-size: 13px;
    color: var(--gray);
}

/* ========== 常见问题 ========== */
.faq {
    padding: 80px 0;
    background: var(--white);
}

.faq-wrapper {
    display: flex;
    gap: 60px;
    align-items: center;
}

.faq-image {
    flex: 0 0 40%;
    height: 500px;
    border-radius: 12px;
    overflow: hidden;
}

.faq-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.faq-content {
    flex: 0 0 60%;
}

.faq-label {
    display: inline-block;
    color: #2C3E50;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.faq h2 {
    font-size: 36px;
    color: var(--dark);
    margin-bottom: 30px;
    font-weight: 700;
}

.faq-list {
    width: 100%;
}

.faq-item {
    border-bottom: 1px solid #E0E0E0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    cursor: pointer;
    transition: var(--transition);
}

.faq-question:hover {
    background: #F8F8F8;
    padding-left: 10px;
    padding-right: 10px;
    margin-left: -10px;
    margin-right: -10px;
}

.faq-question h3 {
    font-size: 16px;
    color: var(--dark);
    font-weight: 500;
    margin: 0;
    flex: 1;
}

.faq-icon {
    font-size: 24px;
    color: #888888;
    font-weight: 300;
    transition: var(--transition);
    margin-left: 20px;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
    color: var(--dark);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out;
}

.faq-item.active .faq-answer {
    max-height: 200px;
    padding-bottom: 20px;
}

.faq-answer p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--gray);
    margin: 0;
}

/* ========== 博客与最新文章 ========== */
.blog {
    padding: 80px 0;
    background: #F8F9FA;
}

.blog h2 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 50px;
    color: #1A2B5C;
    font-weight: 700;
    letter-spacing: 1px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.blog-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: var(--transition);
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.blog-img {
    height: 240px;
    overflow: hidden;
}

.blog-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.blog-card:hover .blog-img img {
    transform: scale(1.05);
}

.blog-content {
    padding: 25px;
}

.blog-content h3 {
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.blog-subtitle {
    font-size: 14px;
    color: var(--gray);
    line-height: 1.6;
    margin-bottom: 15px;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #94a3b8;
}

.blog-author {
    font-weight: 500;
}

.blog-date {
    color: #94a3b8;
}

.blog-meta::before {
    content: '•';
    margin-right: 4px;
}

/* ========== 页脚 ========== */
.footer {
    background: linear-gradient(135deg, #1A2A5A 0%, #2C3E50 100%);
    color: var(--white);
    padding: 60px 0 30px;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.03)" d="M0,96L48,112C96,128,192,160,288,186.7C384,213,480,235,576,213.3C672,192,768,128,864,128C960,128,1056,192,1152,208C1248,224,1344,192,1392,176L1440,160L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
    background-position: bottom;
    pointer-events: none;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.footer-brand .logo-icon {
    width: 40px;
    height: 40px;
    background: #FFA500;
    border-radius: 50%;
    position: relative;
}

.footer-brand .logo-icon::before,
.footer-brand .logo-icon::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
}

.footer-brand .logo-icon::before {
    top: 12px;
    left: 16px;
}

.footer-brand .logo-icon::after {
    top: 20px;
    right: 12px;
}

.footer-brand h3 {
    font-size: 24px;
    margin: 0;
    color: var(--white);
    font-weight: 600;
}

.footer-col h4 {
    font-size: 18px;
    color: var(--white);
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-col p {
    color: #B8C5D6;
    line-height: 1.7;
    font-size: 14px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 12px;
}
.footer-col ul li a {
    color: #B8C5D6;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-col ul li a:hover {
    color: var(--white);
}

.footer-col ul li a.active {
    color: var(--white);
    font-weight: 500;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #B8C5D6;
    font-size: 14px;
    line-height: 1.6;
}

.contact-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.copyright {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 25px;
    text-align: center;
    color: #B8C5D6;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

.copyright p {
    margin: 0;
}

/* ========== 响应式适配 ========== */
@media (max-width: 1199px) {
    .product-grid {
        gap: 20px;
    }
}

@media (max-width: 992px) {
    .hero .container, .about-grid, .faq-wrapper {
        flex-direction: column;
    }
    .category-grid, .advantage-grid, .review-grid, .footer-grid, .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    .faq-image {
        width: 100%;
        height: 400px;
    }
}

@media (max-width: 768px) {
    .nav-menu, .cart-btn {
        display: none;
    }
    .mobile-menu {
        display: block;
    }
    .category-grid, .advantage-grid, .review-grid, .footer-grid, .blog-grid {
        grid-template-columns: 1fr;
    }
    .product-grid {
        grid-template-columns: 1fr;
    }
    .hero h1 {
        font-size: 32px;
    }
    .faq h2, .blog h2 {
        font-size: 28px;
    }
}
