/* 全局样式 */
:root {
    /* 现代化配色方案 */
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --accent-color: #f72585;
    --success-color: #4cc9f0;
    --warning-color: #ff9e00;
    --danger-color: #e63946;
    --info-color: #4cc9f0;
    
    /* 中性色调 */
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    /* 背景色 */
    --bg-light: #ffffff;
    --bg-subtle: #f8f9fa;
    --bg-dark: #212529;
    
    /* 设计系统 */
    --border-radius-sm: 0.25rem;
    --border-radius: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    --border-radius-pill: 50rem;
    --border-radius-circle: 50%;
    
    --box-shadow-sm: 0 .125rem .25rem rgba(0,0,0,.075);
    --box-shadow: 0 .5rem 1rem rgba(0,0,0,.08);
    --box-shadow-lg: 0 1rem 2rem rgba(0,0,0,.1);
    
    --transition-fast: all 0.2s ease;
    --transition: all 0.3s ease;
    --transition-slow: all 0.5s ease;
    
    /* 间距 */
    --spacing-1: 0.25rem;
    --spacing-2: 0.5rem;
    --spacing-3: 1rem;
    --spacing-4: 1.5rem;
    --spacing-5: 3rem;
}

/* 自定义导航容器，覆盖Bootstrap默认值 */
.custom-navbar .container {
    max-width: 600px; /* 缩小为默认宽度的一半左右 */
    width: 95%;
    margin: 0 auto;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: var(--gray-800);
    line-height: 1.6;
    padding-bottom: 50px; /* 为移动端底部导航留出空间，减小高度 */
    background-color: var(--bg-subtle);
}

/* 顶部导航栏样式优化 */
.custom-navbar {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    transition: all 0.3s ease;
}

.brand-text {
    font-weight: 600;
    font-size: 1.2rem;
    color: #333;
}

.brand-icon-container {
    background-color: #FF6B6B;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.brand-icon-container i {
    font-size: 1rem;
}

.navbar-brand:hover .brand-icon-container {
    transform: scale(1.1);
    background-color: #FF8080;
}

.top-nav-btn {
    background-color: transparent;
    border: none;
    color: #666;
    padding: 0.25rem;
    transition: all 0.3s ease;
}

.top-icon-container {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.top-icon-container i {
    font-size: 1.2rem;
}

.top-nav-btn:hover .top-icon-container {
    background-color: #FF6B6B;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(255,107,107,0.25);
}

/* 优化语言切换按钮在移动设备上的表现 */
#languageDropdown .top-icon-container {
    background-color: var(--primary-color);
    color: white;
}

#languageDropdown .bi-globe2 {
    color: white;
}

.top-badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.4rem;
    background-color: #FF6B6B;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bg-accent {
    background-color: #FF6B6B;
}

.custom-toggler {
    border: none;
    color: #666;
    padding: 0.5rem;
}

.custom-toggler i {
    font-size: 1.5rem;
}

.custom-toggler:focus {
    box-shadow: none;
}

.nav-link {
    color: #555;
    font-weight: 500;
    padding: 0.7rem 1rem;
    position: relative;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #FF6B6B;
}

.nav-link.active {
    color: #FF6B6B;
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background-color: #FF6B6B;
    border-radius: 10px;
}

.custom-dropdown {
    border: none;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    overflow: hidden;
    min-width: 120px; /* 确保下拉菜单足够宽 */
}

.dropdown-item {
    padding: 0.6rem 1.2rem;
    color: #555;
    transition: all 0.2s ease;
    font-size: 0.95rem; /* 适当增大字体，提高可读性 */
    font-weight: 500; /* 加粗字体，提高对比度 */
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: #fff4f4;
    color: #FF6B6B;
}

.dropdown-item.active {
    background-color: #FF6B6B;
    color: white;
}

@media (max-width: 992px) {
    .nav-link.active::after {
        display: none;
    }
    
    .custom-navbar {
        padding: 0.3rem 0;
    }
    
    .navbar-collapse {
        background-color: white;
        border-radius: 10px;
        margin-top: 10px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        padding: 1rem;
    }
    
    /* 移动设备上的语言切换样式优化 */
    #languageDropdown {
        padding: 0.3rem;
    }
    
    #languageDropdown .top-icon-container {
        background-color: var(--primary-color);
        color: white;
        width: 35px;
        height: 35px;
    }
    
    .dropdown-menu.custom-dropdown {
        background-color: white;
        border: 1px solid rgba(0,0,0,0.08);
    }
    
    .dropdown-item {
        color: var(--gray-800);
        text-align: center;
        font-weight: 500;
    }
}

/* 移动端底部导航样式 - 保持不变 */
.mobile-footer-nav {
    display: none;
}

/* 移动端底部导航 - 高级设计 */
.mobile-footer-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-light);
    box-shadow: 0 -2px 20px rgba(0,0,0,0.06);
    z-index: 1000;
    justify-content: space-around;
    padding: 6px 0 3px; /* 减小上下内边距 */
    max-width: 600px; /* 与顶部导航栏同样宽度 */
    left: 50%;
    transform: translateX(-50%); /* 居中 */
}

.mobile-footer-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.65rem; /* 减小字体大小 */
    font-weight: 500;
    transition: var(--transition-fast);
    padding: 3px 0; /* 减小内边距 */
    width: 100%;
    position: relative;
}

.mobile-footer-nav a.active {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-icon-container {
    width: 38px; /* 减小容器尺寸 */
    height: 38px; /* 减小容器尺寸 */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 2px; /* 减小间距 */
    transition: var(--transition);
}

.mobile-footer-nav a.active .nav-icon-container {
    transform: translateY(-6px); /* 减小上移距离 */
    background-color: var(--primary-color);
    border-radius: var(--border-radius-circle);
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.mobile-footer-nav a.active .nav-icon-container i {
    color: white;
}

.mobile-footer-nav i {
    font-size: 1.2rem; /* 减小图标尺寸 */
    transition: var(--transition);
}

.mobile-footer-nav a:active {
    transform: scale(0.95);
}

/* 精美购物车徽章 */
.cart-badge {
    font-size: 0.6rem !important;
    padding: 0.25rem 0.4rem;
    border: 2px solid white;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(40%, -40%) !important;
    box-shadow: 0 2px 6px rgba(230, 57, 70, 0.4);
}

/* 圆形图标样式 - 现代设计 */
.icon-circle {
    width: 70px;
    height: 70px;
    border-radius: var(--border-radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}

.promo-item {
    transition: var(--transition);
    border: none;
    background-color: var(--bg-light);
    border-radius: var(--border-radius-lg);
}

.promo-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08) !important;
}

.promo-item:hover .icon-circle {
    transform: scale(1.1) rotate(5deg);
}

/* 现代化背景色 */
.bg-primary-subtle {
    background-color: rgba(67, 97, 238, 0.1);
}

.bg-success-subtle {
    background-color: rgba(76, 201, 240, 0.1);
}

.bg-warning-subtle {
    background-color: rgba(255, 158, 0, 0.1);
}

.bg-info-subtle {
    background-color: rgba(76, 201, 240, 0.1);
}

.bg-danger-subtle {
    background-color: rgba(230, 57, 70, 0.1);
}

.bg-accent-subtle {
    background-color: rgba(247, 37, 133, 0.1);
}

/* 增强的圆角 */
.rounded-4 {
    border-radius: var(--border-radius-lg) !important;
}

.rounded-5 {
    border-radius: var(--border-radius-xl) !important;
}

/* 精选商品卡片样式 - 时尚设计 */
.compact-card {
    transition: var(--transition);
    overflow: hidden;
    border: none;
    border-radius: var(--border-radius-lg);
    background-color: var(--bg-light);
    box-shadow: var(--box-shadow-sm);
    max-height: 180px; /* 限制卡片最大高度 */
}

.compact-card:hover {
    transform: translateY(-3px); /* 减小悬停效果 */
    box-shadow: var(--box-shadow);
}

.compact-card .product-img-container {
    overflow: hidden;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    max-height: 180px; /* 限制图片容器高度 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.compact-card .object-fit-cover {
    object-fit: cover;
    transition: var(--transition-slow);
    max-height: 180px; /* 限制图片高度 */
    width: 100%;
    height: auto; /* 自动调整高度，保持比例 */
}

.compact-card:hover .object-fit-cover {
    transform: scale(1.05); /* 减小图片放大效果 */
}

.compact-card .btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
}

.compact-card .btn-outline-primary {
    border-color: var(--gray-300);
    color: var(--gray-700);
}

.compact-card .btn-outline-primary:hover {
    background-color: var(--gray-200);
    color: var(--gray-900);
    border-color: var(--gray-300);
}

.compact-card .btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 3px 6px rgba(67, 97, 238, 0.2);
}

.compact-card .btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(67, 97, 238, 0.3);
}

.price {
    font-weight: 700;
    color: var(--accent-color);
    font-size: 1.1rem;
}

@media (max-width: 767.98px) {
    .compact-card {
        max-height: 150px; /* 在移动端进一步减小卡片高度 */
    }
    
    .compact-card .product-img-container {
        max-height: 150px; /* 在移动端减小图片容器高度 */
    }
    
    .compact-card .object-fit-cover {
        max-height: 150px; /* 在移动端减小图片高度 */
    }
    
    .compact-card .card-body {
        padding: 0.5rem; /* 减小内边距 */
    }
    
    .compact-card .card-title {
        font-size: 0.85rem !important;
    font-weight: 600;
        margin-bottom: 0.2rem !important;
    }
    
    .compact-card .card-text {
        font-size: 0.7rem !important;
        margin-bottom: 0.5rem !important;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2; /* 限制描述为两行 */
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .compact-card .btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.7rem;
    }
    
    .price {
        font-size: 0.85rem;
    }
    
    .icon-circle {
        width: 60px;
        height: 60px;
    }
}

/* 自定义导航栏样式 */
.navbar-dark .navbar-brand {
    font-weight: 600;
}

.nav-link {
    font-weight: 500;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
    border-radius: var(--border-radius);
}

.dropdown-item {
    padding: 0.5rem 1rem;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item.active {
    background-color: var(--primary-color);
}

/* 首页轮播优化 */
.carousel-item {
    height: auto;
    background-color: #f8f9fa;
}

.carousel-caption {
    background-color: rgba(0,0,0,0.4);
        border-radius: var(--border-radius);
    padding: 1rem;
}

/* 响应式调整 */
@media (min-width: 768px) {
    body {
        padding-bottom: 0; /* 桌面版不需要底部padding */
    }
    
    .product-card .card-title {
        font-size: 1rem;
    }
}

/* 购物车等图标样式 */
.badge.rounded-pill {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(50%, -50%);
}

.nav-item {
    position: relative;
}

/* 搜索框美化 */
.input-group .form-control {
    border-right: none;
}

.input-group .btn {
    border-left: none;
    background-color: white;
    color: var(--primary-color);
}

/* 登录页面和表单样式优化 */
.auth-container {
    max-width: 450px;
    margin: 0 auto;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
    background-color: white;
}

.auth-title {
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* 用户资料页面样式 */
.profile-header {
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: var(--box-shadow);
}

@media (max-width: 767.98px) {
    .profile-header {
        padding: 1rem;
    }
    
    .profile-avatar {
        width: 60px;
        height: 60px;
    }
}

/* 加载动画 */
.loader {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 产品名称样式 */
.product-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.3rem;
}

/* 懒加载图片过渡动画 */
.lazy-load {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
}

.lazy-load.loaded {
    opacity: 1;
}

.img-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
    background-size: 200% 100%;
    animation: shine 1.5s linear infinite;
    z-index: 1;
}

/* 图片渐入动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 页面切换动画 */
.page-transition {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes shine {
    to {
        background-position-x: -200%;
    }
}

/* 分类展示优化 */
.product-grid-container {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--dark-color);
}

@media (max-width: 767.98px) {
    .section-title {
        font-size: 1.1rem;
    }
    
    main {
        padding-bottom: 60px; /* 为底部导航留出空间 */
    }
    
    .carousel-caption {
        padding: 0.5rem;
    }
    
    .carousel-caption h5 {
        font-size: 1rem;
        margin-bottom: 0;
    }
    
    .carousel-caption p {
        display: none;
    }
    
    .welcome-banner {
        margin-bottom: 0.5rem !important;
        padding: 0.5rem !important;
    }
    
    .product-grid-layout {
        margin: 0 -0.25rem;
    }
    
    .product-grid-layout .col {
        padding: 0.25rem;
    }
    
    .card-body {
        padding: 0.5rem !important;
    }
    
    .card-title {
        font-size: 0.85rem !important;
        margin-bottom: 0.2rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .price {
        font-size: 0.9rem;
    }
}

/* 常规商品卡片样式优化 */
.product-card {
    transition: var(--transition);
    border: none;
    border-radius: var(--border-radius-lg);
    background-color: var(--bg-light);
    box-shadow: var(--box-shadow-sm);
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow);
}

.product-card .card-img-top {
    height: 220px; /* 限制图片高度 */
    object-fit: cover;
    transition: var(--transition-slow);
}

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

.product-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 针对小屏幕的调整 */
@media (max-width: 767.98px) {
    .product-card .card-img-top {
        height: 180px; /* 移动端更小的图片高度 */
    }
    
    .product-card .card-title {
        font-size: 0.9rem;
    }
    
    .product-card .card-body {
        padding: 0.75rem;
    }
}

/* 分类卡片样式优化 */
.category-card {
    transition: var(--transition);
    border: none;
    border-radius: var(--border-radius-lg);
    background-color: var(--bg-light);
    box-shadow: var(--box-shadow-sm);
    overflow: hidden;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow);
}

.category-card .position-relative {
    overflow: hidden;
}

.category-card .card-img-top {
    height: 180px; /* 限制分类图片高度 */
    object-fit: cover;
    transition: var(--transition-slow);
}

.category-card:hover .card-img-top {
    transform: scale(1.05);
}

.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
        width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.3);
    opacity: 0;
    transition: var(--transition);
}

.category-card:hover .category-overlay {
    opacity: 1;
}

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

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

.category-card .card-text {
    font-size: 0.85rem;
    color: var(--gray-600);
}

/* 针对小屏幕的调整 */
@media (max-width: 767.98px) {
    .category-card .card-img-top {
        height: 150px; /* 移动端更小的图片高度 */
    }
    
    .category-card .card-body {
        padding: 0.75rem;
    }
    
    .category-card .card-title {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }
    
    .category-card .card-text {
        font-size: 0.8rem;
    }
}

/* 新品资讯卡片样式优化 */
.news-section .card {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.news-section .card:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow);
}

.news-section .card .position-relative {
    overflow: hidden;
    max-height: 140px; /* 限制图片容器高度 */
}

.news-section .card img {
    transition: var(--transition-slow);
    object-fit: cover;
    max-height: 140px; /* 限制图片高度 */
}

.news-section .card:hover img {
    transform: scale(1.05);
}

.news-section .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.news-section .card-text {
    font-size: 0.85rem;
    color: var(--gray-600);
}

/* 针对小屏幕的调整 */
@media (max-width: 767.98px) {
    .news-section .card .position-relative {
        max-height: 120px; /* 移动端更小的图片容器高度 */
    }
    
    .news-section .card img {
        max-height: 120px; /* 移动端更小的图片高度 */
    }
    
    .news-section .card-body {
        padding: 0.75rem;
    }
    
    .news-section .card-title {
        font-size: 0.95rem;
        margin-top: 0.25rem;
    }
    
    .news-section .card-text {
        font-size: 0.8rem;
        display: -webkit-box;
        -webkit-line-clamp: 2; /* 限制描述为两行 */
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* 移动端底部导航按钮 */
.mobile-nav-buttons {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-light);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    justify-content: space-around;
    padding: 6px 0 3px; /* 缩小上下内边距 */
    max-width: 600px; /* 与顶部导航栏同样宽度 */
    left: 50%;
    transform: translateX(-50%); /* 居中 */
    height: auto; /* 自动调整高度 */
}

.mobile-nav-buttons a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--gray-600);
    font-size: 0.65rem; /* 减小字体大小 */
    padding: 3px 0; /* 减小内边距 */
    transition: var(--transition-fast);
    width: 25%;
}

.mobile-nav-buttons a i {
    font-size: 1.15rem; /* 减小图标尺寸 */
    margin-bottom: 2px; /* 减小间距 */
    position: relative;
}

.mobile-nav-buttons a.active {
    color: var(--primary-color);
    font-weight: 500;
}

.mobile-nav-buttons a span {
    font-size: 0.6rem; /* 减小字体大小 */
    margin-top: 1px; /* 减小间距 */
    line-height: 1; /* 减小行高 */
}

@media (min-width: 768px) {
    .mobile-nav-buttons {
        display: none; /* 在桌面端隐藏底部导航 */
    }
} 