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

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

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

/* 头部样式 */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

header h1 {
    color: #333;
    font-size: 24px;
}

/* Logo样式 */
.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.site-logo {
    max-height: 60px;
    max-width: 200px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo-link:hover .site-logo {
    transform: scale(1.05);
}

/* 右上角菜单样式 */
.top-nav {
    display: flex;
    gap: 10px;
    background-color: white;
    padding: 8px;
    border-radius: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.top-nav a {
    text-decoration: none;
    color: #555;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-size: 14px;
    position: relative;
}

.top-nav a:hover {
    background-color: #f0f0f0;
    color: #333;
    transform: translateY(-2px);
}

.top-nav a.active {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8e9e 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

/* 分类导航样式 */
.category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.category-nav a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-size: 14px;
    background-color: #f8f9fa;
    border: 2px solid transparent;
}

.category-nav a:hover {
    background-color: #e9ecef;
    color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-nav a.active {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8e9e 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

/* 搜索框样式 */
.search-bar {
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    gap: 10px;
    max-width: 400px;
}

.search-form input[type="text"] {
    flex: 1;
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s ease;
    outline: none;
}

.search-form input[type="text"]:focus {
    border-color: #ff6b9d;
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1);
}

.search-form button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8e9e 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}

.search-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}

/* 购物车图标样式 */
.cart-icon {
    position: relative;
    cursor: pointer;
}

.cart-icon img {
    width: 24px;
    height: 24px;
}

#cart-count {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
}

/* 会员中心导航样式 */
.member-nav {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 30px;
}

.member-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 15px;
    flex-wrap: wrap;
}

.member-nav li {
    margin-bottom: 10px;
}

.member-nav a {
    text-decoration: none;
    color: #333;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-size: 14px;
    background-color: #f8f9fa;
    display: inline-block;
}

.member-nav a:hover {
    background-color: #e9ecef;
    color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.member-nav a.active {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8e9e 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

/* 产品展示样式 */
.products {
    margin-bottom: 40px;
}

.products h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

/* 响应式产品网格 */
@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* 移除480px断点，保持一行2个产品 */

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #666;
    background-color: #f9f9f9;
    border-radius: 12px;
}

.product-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 15px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.product-card.out-of-stock {
    opacity: 0.7;
}

.product-card.out-of-stock .add-to-cart {
    background: linear-gradient(135deg, #ccc 0%, #aaa 100%);
    cursor: not-allowed;
    color: #666;
}

.product-card .image-container {
    width: 100%;
    padding-bottom: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 15px;
    background-color: #f8f9fa;
    flex-shrink: 0;
}

.product-card .image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.product-card h3 {
    margin-bottom: 10px;
    color: #333;
    font-size: 16px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    flex-shrink: 0;
}

.product-card .price {
    font-size: 18px;
    font-weight: bold;
    color: #ff4d4f;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.product-card .stock {
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
    font-weight: normal;
    flex-shrink: 0;
}

.product-card .description {
    margin-bottom: 15px;
    color: #999;
    font-size: 13px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    flex-shrink: 0;
}

.quantity-control {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.quantity-control button {
    width: 30px;
    height: 30px;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.quantity-control button:hover {
    background-color: #e8e8e8;
}

.quantity-control input {
    width: 50px;
    height: 30px;
    text-align: center;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin: 0 10px;
    font-size: 14px;
}

.add-to-cart {
    width: 100%;
    padding: 10px 15px;
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8e9e 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 157, 0.3);
    flex-shrink: 0;
    margin-top: auto;
}

.add-to-cart:hover {
    background: linear-gradient(135deg, #ff8e9e 0%, #ff6b9d 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.4);
}

/* 购物车样式 */
.cart {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 25px;
    margin-bottom: 40px;
}

.cart h2 {
    margin-bottom: 25px;
    color: #333;
    font-size: 20px;
}

.cart-items {
    margin-bottom: 25px;
}

.empty-cart {
    text-align: center;
    color: #999;
    padding: 40px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

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

.cart-item:last-child {
    border-bottom: none;
}

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

.cart-item-info h4 {
    margin-bottom: 8px;
    color: #333;
    font-size: 16px;
}

.cart-item-info p {
    color: #666;
    font-size: 14px;
}

.stock-info {
    color: #999;
    font-size: 13px;
    margin-top: 8px;
}

.cart-item-quantity {
    margin: 0 30px;
    font-size: 16px;
    font-weight: 500;
}

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

.remove-item {
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
}

.remove-item:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
}

.cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 25px;
    border-top: 1px solid #ddd;
}

.total {
    font-size: 20px;
    font-weight: bold;
}

#total-price {
    color: #e74c3c;
    margin-left: 15px;
    font-size: 22px;
}

.checkout {
    padding: 12px 25px;
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8e9e 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}

.checkout:hover {
    background: linear-gradient(135deg, #ff8e9e 0%, #ff6b9d 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #ff6b9d;
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-order,
.btn-primary {
    padding: 12px 25px;
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8e9e 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}

.submit-order:hover,
.btn-primary:hover {
    background: linear-gradient(135deg, #ff8e9e 0%, #ff6b9d 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 订单详情行默认隐藏 */
.order-details {
    display: none;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

tr:hover {
    background-color: #f9f9f9;
}

tr:last-child td {
    border-bottom: none;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    gap: 10px;
}

.pagination a {
    display: inline-block;
    padding: 10px 18px;
    background: #f8f9fa;
    text-decoration: none;
    color: #333;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 14px;
}

.pagination a:hover {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8e9e 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.4);
}

.pagination a.active {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8e9e 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.4);
}

/* 状态样式 */
.status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status.pending {
    background: linear-gradient(135deg, #ffb800 0%, #ffd93d 100%);
    color: white;
}

.status.shipped {
    background: linear-gradient(135deg, #17a2b8 0%, #63e6be 100%);
    color: white;
}

.status.completed {
    background: linear-gradient(135deg, #28a745 0%, #4caf50 100%);
    color: white;
}

.status.unpaid {
    background: linear-gradient(135deg, #dc3545 0%, #f56c6c 100%);
    color: white;
}

.status.paid {
    background: linear-gradient(135deg, #6610f2 0%, #8a2be2 100%);
    color: white;
}

.status.offline {
    background: linear-gradient(135deg, #6c757d 0%, #adb5bd 100%);
    color: white;
}

/* 信息卡片样式 */
.user-info,
.order-list,
.points-list,
.subordinates-list {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 25px;
    margin-bottom: 30px;
}

.user-info h2,
.order-list h2,
.points-list h2,
.subordinates-list h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
}

.points-display {
    font-size: 28px;
    font-weight: bold;
    color: #ff6b9d;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        max-width: 992px;
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 768px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    /* 头部响应式 */
    header {
        flex-direction: column;
        gap: 20px;
        padding-bottom: 20px;
        text-align: center;
    }

    header h1 {
        font-size: 22px;
    }

    /* 右上角菜单响应式 */
    .top-nav {
        gap: 8px;
        padding: 6px;
        border-radius: 20px;
    }

    .top-nav a {
        padding: 8px 16px;
        font-size: 13px;
        border-radius: 16px;
    }

    /* 会员中心导航响应式 */
    .member-nav ul {
        gap: 10px;
    }

    .member-nav a {
        padding: 8px 16px;
        font-size: 13px;
    }

    /* 分类导航响应式 */
    .category-nav {
        gap: 10px;
        padding: 12px;
        border-radius: 10px;
    }

    .category-nav a {
        padding: 8px 16px;
        font-size: 13px;
        border-radius: 16px;
    }

    /* 搜索框响应式 */
    .search-form {
        max-width: 100%;
    }

    .search-form input[type="text"] {
        padding: 10px 16px;
        font-size: 14px;
    }

    .search-form button {
        padding: 10px 20px;
        font-size: 14px;
    }

    /* 产品网格响应式 */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .product-card {
        padding: 15px;
    }

    /* 购物车响应式 */
    .cart {
        padding: 20px;
    }

    .cart-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .checkout {
        width: 100%;
        text-align: center;
    }

    /* 表格响应式 */
        table {
            font-size: 14px;
            width: 100%;
            overflow-x: auto;
            display: block;
        }

        th, td {
            padding: 12px;
        }

        /* 订单页面响应式 */
        .order-list table {
            font-size: 13px;
        }

        .order-list th,
        .order-list td {
            padding: 8px;
        }

        @media (max-width: 768px) {
            .order-list table {
                font-size: 12px;
            }

            .order-list th,
            .order-list td {
                padding: 6px;
            }

            .order-list .view-details,
            .order-list .delete-order {
                font-size: 11px;
                padding: 4px 8px;
                margin: 2px;
            }

            /* 订单详情表格响应式 */
            .order-items table {
                font-size: 11px;
            }

            .order-items th,
            .order-items td {
                padding: 4px;
            }
        }

    /* 分页响应式 */
    .pagination {
        flex-wrap: wrap;
    }

    .pagination a {
        padding: 8px 14px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    /* 超小屏幕优化 */
    .container {
        padding: 10px;
    }

    .top-nav {
        gap: 5px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .top-nav a {
        padding: 6px 12px;
        font-size: 12px;
    }

    .member-nav ul {
        flex-direction: column;
        align-items: center;
    }

    .member-nav li {
        width: 100%;
        text-align: center;
    }

    .member-nav a {
        display: block;
        width: 100%;
    }

    .category-nav {
        gap: 8px;
        padding: 10px;
    }

    .category-nav a {
        padding: 6px 12px;
        font-size: 12px;
    }

    .search-form {
        flex-direction: column;
    }

    .search-form button {
        width: 100%;
    }

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

    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 15px 0;
    }

    .cart-item-quantity {
        margin: 0;
    }

    .remove-item {
        align-self: flex-end;
    }

    table {
        font-size: 13px;
    }

    th, td {
        padding: 10px;
    }
}

/* 页脚样式 */
footer {
    background-color: #f8f8f8;
    padding: 30px 0;
    text-align: center;
    margin-top: 60px;
    border-top: 1px solid #ddd;
}

footer p {
    color: #666;
    font-size: 14px;
}

/* 通用按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8e9e 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ff8e9e 0%, #ff6b9d 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}

.btn-secondary {
    background-color: #f8f9fa;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 消息提示样式 */
.message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background-color: #f9f9f9;
    border-radius: 12px;
    margin: 40px 0;
}

.empty-state h3 {
    color: #666;
    margin-bottom: 15px;
    font-size: 18px;
}

.empty-state p {
    color: #999;
    margin-bottom: 30px;
    font-size: 14px;
}
