/* Base Template Styles */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #2c3e50;
    --light-gray: #ecf0f1;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.navbar-brand {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333 !important;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.navbar-brand-logo {
    max-height: 40px;
    width: auto;
    object-fit: contain;
}

.navbar-nav {
    margin-left: auto;
}

.nav-link {
    color: #333 !important;
    font-weight: 500;
    margin: 0 0.5rem;
    padding: 0.5rem 1rem !important;
    border-radius: 0;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.nav-link:hover {
    color: #333 !important;
    text-decoration: underline;
}

.nav-link.active {
    color: #333 !important;
    text-decoration: underline;
}

/* 下拉箭头样式 */
.dropdown-toggle::after {
    content: '▼';
    font-size: 10px;
    margin-left: 5px;
}

/* 下拉菜单定位 */
.dropdown-menu {
    max-width: 200px;
    left: 0 !important;
    right: auto;
    width: 100%;
    overflow-x: hidden;
}

/* Mega Menu 特殊定位 */
.mega-menu {
    left: 0 !important;
    right: auto;
    max-width: 900px;
    width: 100%;
    overflow-x: hidden;
}

/* 用户菜单样式 */
.user-menu .nav-link {
    text-transform: none;
    font-size: 13px;
}

/* 用户下拉菜单特殊样式 */
.user-menu .dropdown-menu {
    min-width: 180px;
    max-width: 200px;
    width: auto;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.user-menu .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease;
}

.user-menu .dropdown-item:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

/* 社交媒体链接样式 */
.social-links a {
    color: #666;
    font-size: 18px;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--secondary-color);
}

/* 主要内容区域 */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
    margin-top: 80px; /* 为固定导航栏留出空间 */
}

/* 页脚样式 */
.footer {
    background: #f5f5f5;
    color: #333;
    padding: 3rem 0 1rem;
    margin-top: auto;
}

.footer h5 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.footer a {
    color: #555;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #3498db;
}

.footer-bottom {
    border-top: 1px solid #ddd;
    padding-top: 1rem;
    margin-top: 2rem;
    text-align: center;
}

/* 按钮样式 */
.btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: none;
    border-radius: 25px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* 消息样式 */
.alert {
    border-radius: 10px;
    border: none;
}

/* Mega Menu 样式 */
.dropdown-menu {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 0;
    min-width: 900px;
    margin-top: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.dropdown-menu.show {
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Mega Menu 网格布局 */
.mega-menu {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 10px;
    min-height: 120px;
    width: 100%;
    max-width: 900px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

.mega-menu-column {
    border-right: 1px solid #e9ecef;
    padding-right: 10px;
    padding-left: 5px;
    min-width: 0;
    overflow: hidden;
}

.mega-menu-column:last-child {
    border-right: none;
}

.mega-menu-column h6 {
    color: #333;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #007bff;
    padding-bottom: 5px;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.3;
}

.mega-menu-column .dropdown-item {
    color: #555;
    padding: 6px 0;
    border-radius: 0;
    transition: all 0.3s ease;
    font-weight: 400;
    font-size: 12px;
    text-transform: none;
    border-bottom: 1px solid #f0f0f0;
    display: block;
    text-decoration: none;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.3;
}

.mega-menu-column .dropdown-item:hover {
    background-color: transparent;
    color: #007bff;
    transform: translateX(5px);
    border-bottom-color: #007bff;
}

.mega-menu-column .dropdown-item:last-child {
    border-bottom: none;
}

/* 轮播图样式 */
.carousel-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin: 2rem 0;
}

.carousel-content {
    padding: 2rem;
    min-height: 400px;
}

.product-showcase {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.main-product {
    margin-bottom: 1rem;
}

.product-image {
    width: 100%;
    max-width: 300px;
    height: 250px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.product-image:hover {
    transform: scale(1.05);
}

.product-insets {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.inset {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    border: 3px solid white;
}

.inset-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-text {
    color: white;
    padding: 1rem;
}

.product-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.features {
    margin-bottom: 2rem;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.feature-item i {
    margin-right: 0.8rem;
    font-size: 1.2rem;
    color: #ffd700;
}

.lifestyle-image {
    margin-top: 1rem;
}

.lifestyle-img {
    width: 100%;
    max-width: 300px;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* 轮播控制按钮样式 */
.carousel-control-prev,
.carousel-control-next {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    margin: 0 1rem;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    filter: invert(1);
}

/* 轮播指示器样式 */
.carousel-indicators {
    bottom: 20px;
}

.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.5);
    border: 2px solid white;
    margin: 0 5px;
}

.carousel-indicators button.active {
    background-color: white;
}

/* Back to Top Button Styles */
#backToTop {
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: none;
    color: white;
    font-size: 18px;
}

#backToTop:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    background: linear-gradient(135deg, #2980b9 0%, #1f5f8b 100%);
}

#backToTop:active {
    transform: translateY(-1px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        margin-top: 70px; /* 移动端导航栏高度较小 */
    }
    
    .carousel-content {
        padding: 1rem;
        min-height: 300px;
    }
    
    .product-title {
        font-size: 1.4rem;
    }
    
    .feature-item {
        font-size: 1rem;
    }
    
    .product-image {
        max-width: 250px;
        height: 200px;
    }
    
    .lifestyle-img {
        max-width: 250px;
        height: 150px;
    }
    
    .inset {
        width: 60px;
        height: 60px;
    }
    
    .navbar-brand {
        font-size: 1.5rem;
    }
    
    .nav-link {
        margin: 0.25rem 0;
        font-size: 12px;
    }
    
    .dropdown-menu {
        width: 100%;
        max-width: 100vw;
        position: static !important;
        left: 0 !important;
        right: auto !important;
        transform: none !important;
        top: auto;
        float: none;
        margin: 0;
        border: none;
        box-shadow: none;
        background: #f8f9fa;
    }
    
    .mega-menu {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
        min-height: auto;
        max-width: 100%;
        max-height: 250px;
    }
    
    .mega-menu-column {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        padding-right: 0;
        padding-bottom: 15px;
    }
    
    .mega-menu-column:last-child {
        border-bottom: none;
    }
    
    /* 移动端回到顶部按钮 */
    #backToTop {
        bottom: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
}
