/* 全局样式 */
body {
    font-family: 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

/* 顶部导航 */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* 商品卡片 */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.product-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

.product-card .card-body {
    padding: 1rem;
}

.product-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    height: 2.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    color: #e74c3c;
    font-size: 1.2rem;
    font-weight: bold;
}

.product-original-price {
    color: #999;
    text-decoration: line-through;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

/* 侧边栏 */
.sidebar {
    background-color: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.sidebar .nav-link {
    color: #495057;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: #f8f9fa;
    color: #007bff;
}

/* 分页 */
.pagination {
    justify-content: center;
    margin-top: 2rem;
}

/* 购物车 */
.cart-item {
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 0;
}

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

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

/* 表单样式 */
.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 按钮样式 */
.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0069d9;
    border-color: #0062cc;
}

/* 管理端样式 */
.admin-header {
    background-color: #343a40;
    color: #fff;
    padding: 1rem 0;
}

.admin-sidebar {
    background-color: #f8f9fa;
    min-height: calc(100vh - 60px);
    border-right: 1px solid #e9ecef;
}

.admin-content {
    padding: 2rem;
}

.admin-card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.admin-card .card-header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
    font-weight: 500;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .product-card .card-img-top {
        height: 150px;
    }
    
    .admin-sidebar {
        min-height: auto;
    }
    
    .admin-content {
        padding: 1rem;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 提示框样式 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
}

/* 商品详情页 */
.product-detail-image {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.product-detail-gallery {
    margin-top: 1rem;
}

.product-detail-gallery img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}

.product-detail-gallery img:hover,
.product-detail-gallery img.active {
    border-color: #007bff;
}

/* 订单状态 */
.order-status {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.order-status.pending {
    background-color: #fff3cd;
    color: #856404;
}

.order-status.paid {
    background-color: #d1ecf1;
    color: #0c5460;
}

.order-status.shipped {
    background-color: #d4edda;
    color: #155724;
}

.order-status.completed {
    background-color: #d1ecf1;
    color: #0c5460;
}

.order-status.cancelled {
    background-color: #f8d7da;
    color: #721c24;
}