/* ============================================
   NBBB Web端样式表
   ============================================ */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    
    --border-radius: 8px;
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--dark-color);
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    padding: 1rem 0;
    transition: var(--transition);
}

.navbar-brand {
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.nav-link {
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link.active {
    color: var(--primary-color) !important;
}

/* Banner 轮播样式 */
.banner-section {
    margin-bottom: 3rem;
}

.carousel-item img {
    width: 100%;
    height: 500px;
    object-fit: cover;
}

@media (max-width: 768px) {
    .carousel-item img {
        height: 300px;
    }
}

/* 分类卡片样式 */
.category-section {
    margin: 3rem 0;
}

.category-card {
    text-decoration: none;
    color: inherit;
    display: block;
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
    height: 100%;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    color: inherit;
    text-decoration: none;
}

.category-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.category-card h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.category-card p {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin: 0;
}

/* 商品卡片样式 */
.product-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.product-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    background: var(--light-color);
}

.product-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3rem;
}

.product-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--danger-color);
    margin-bottom: 1rem;
}

.product-price::before {
    content: "¥";
    font-size: 1rem;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.product-actions .btn {
    flex: 1;
}

.btn-add-cart {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
}

.btn-add-cart:hover {
    background: #0b5ed7;
    color: white;
}

.btn-view-detail {
    background: white;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
}

.btn-view-detail:hover {
    background: var(--primary-color);
    color: white;
}

/* 加载状态 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay.show {
    display: flex;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--secondary-color);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .product-image {
        height: 200px;
    }
    
    .product-body {
        padding: 1rem;
    }
    
    .product-title {
        font-size: 1rem;
    }
    
    .product-price {
        font-size: 1.25rem;
    }
    
    .category-card {
        padding: 1.5rem;
    }
    
    .category-card i {
        font-size: 2.5rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* 工具类 */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shadow-sm-hover {
    transition: var(--transition);
}

.shadow-sm-hover:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
}





