/* 主样式文件 */

/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* 导航栏样式 */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.nav-link {
    margin-right: 1rem;
}

/* 轮播图样式 */
.carousel {
    margin-bottom: 2rem;
}

.carousel-inner {
    max-height: 500px;
}

.carousel-item img {
    object-fit: cover;
    height: 500px;
}

/* 内容区域样式 */
section {
    padding: 2rem 0;
}

.section-title {
    margin-bottom: 2rem;
    text-align: center;
    font-weight: bold;
    color: #495057;
}

/* 卡片样式 */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 0.5rem;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-img-top {
    border-bottom: 1px solid #e9ecef;
}

/* 产品卡片样式 */
.product-card .card-body {
    display: flex;
    flex-direction: column;
}

.product-card .card-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    flex-grow: 1;
}

.product-card .card-text {
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* 拼团卡片样式 */
.group-card .card-header {
    border-radius: 0.5rem 0.5rem 0 0;
}

.group-card .card-body {
    display: flex;
    flex-direction: column;
}

/* 进度条样式 */
.progress {
    height: 8px;
    border-radius: 4px;
}

/* 拼团成员卡片样式 */
.border-dashed {
    border-style: dashed !important;
}

/* 按钮样式 */
.btn {
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.btn-success {
    background-color: #198754;
    border-color: #198754;
}

.btn-success:hover {
    background-color: #157347;
    border-color: #146c43;
}

/* 页脚样式 */
footer {
    background-color: #212529;
    color: white;
    padding: 2rem 0 1rem;
    margin-top: 3rem;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #343a40;
    padding-top: 1rem;
    margin-top: 1rem;
    text-align: center;
    color: #adb5bd;
}

/* 加载指示器样式 */
#loader {
    background-color: rgba(255, 255, 255, 0.8);
}

/* 表单样式 */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    border-radius: 0.375rem;
}

/* 响应式设计调整 */
@media (max-width: 768px) {
    .carousel-inner,
    .carousel-item img {
        max-height: 300px;
        height: 300px;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .card-text {
        font-size: 0.85rem;
    }
    
    /* 移动端侧边栏导航样式 */
    #sidebar.collapse.show {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1050;
        width: 280px;
        height: 100vh;
        overflow-y: auto;
        background-color: #212529;
        transition: all 0.3s ease;
    }
    
    /* 确保移动端导航项可点击 */
    #sidebar .nav-item .nav-link {
        padding: 0.75rem 1rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        cursor: pointer;
    }
    
    /* 调整移动端导航下拉菜单 */
    #sidebar .nav-item .collapse {
        margin-left: 1rem;
    }
    
    /* 确保图标正确显示 */
    #sidebar .nav-link i {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .carousel-inner,
    .carousel-item img {
        max-height: 200px;
        height: 200px;
    }
    
    section {
        padding: 1rem 0;
    }
}

/* 辅助类 */
.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mt-6 {
    margin-top: 4rem;
}

.mb-6 {
    margin-bottom: 4rem;
}

/* 购物车样式 */
.cart-item {
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.25rem;
}

/* 用户中心样式 */
.user-profile-card {
    background-color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
}

/* 地址卡片样式 */
.address-card {
    position: relative;
    transition: all 0.3s ease;
}

.address-card .card-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #0d6efd;
    color: white;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 0 0.5rem 0 0.5rem;
}

.address-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.address-card.border-primary {
    border: 2px solid #0d6efd;
}

/* 拼团成员金字塔布局样式 */
.border-dashed {
    border-style: dashed !important;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

@media (max-width: 576px) {
    .col-3 {
        width: 20%;
        margin-right: 1rem;
    }
}

.group-member-card:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

/* 金字塔布局调整 */
.pyramid-row {
    margin-bottom: 1rem;
}

.pyramid-member {
    text-align: center;
}

.pyramid-member .card {
    transition: all 0.3s ease;
}

.pyramid-member .card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#availablePoints {
    font-weight: bold;
    color: #28a745;
}