/* ==========================================
   通用样式 - 头部和底部
   ========================================== */

/* 头部样式 */
.site-header {
    background: white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.header-container {
    max-width: 1350px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 头部 Logo 样式 - V 和 C 突出显示 + 白光闪过效果 */
.site-logo a {
    text-decoration: none;
}

.site-logo .logo-text {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    position: relative;
    display: inline-block;
    background: linear-gradient(to right, 
        #FF6B35 0%, #FF6B35 1ch,
        #333 1ch, #333 7ch,
        #FF6B35 7ch, #FF6B35 8ch,
        #333 8ch, #333 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 白光闪过效果 */
.site-logo .logo-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.8) 50%, 
        transparent 100%
    );
    animation: shine 3s ease-in-out infinite;
    animation-delay: 1s;
}

@keyframes shine {
    0% {
        left: -100%;
    }
    20% {
        left: 100%;
    }
    100% {
        left: 100%;
    }
}

/* Hover 时加速闪光 */
.site-logo a:hover .logo-text::before {
    animation: shine 0.6s ease-in-out;
}

/* 暗黑模式 */
body.dark-mode .site-logo .logo-text {
    background: linear-gradient(to right, 
        #FF6B35 0%, #FF6B35 1ch,
        #e0e0e0 1ch, #e0e0e0 7ch,
        #FF6B35 7ch, #FF6B35 8ch,
        #e0e0e0 8ch, #e0e0e0 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-nav .nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.header-nav .nav-menu a {
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
}

.header-nav .nav-menu a:hover {
    color: var(--primary-color);
}

/* ==========================================
   头部 Mega Menu（Products 悬停面板）
   面板绝对定位相对 .site-header（sticky），实现通栏
   ========================================== */

/* 触发项：链接后加小箭头 */
.vc-mega-trigger > a {
    display: inline-flex;
    align-items: center;
}

.vc-mega-trigger > a::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    margin-left: 6px;
    transition: transform 0.25s ease;
}

.vc-mega-trigger:hover > a::after {
    transform: rotate(180deg);
}

/* 通栏面板 */
.vc-mega-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 2px solid var(--primary-color);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.14);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 1001;
}

/* 隐形桥：鼠标从导航移向面板时穿过头部下边距不丢失 hover */
.vc-mega-panel::before {
    content: '';
    position: absolute;
    top: -25px;
    left: 0;
    right: 0;
    height: 25px;
}

.vc-mega-trigger:hover .vc-mega-panel,
.vc-mega-trigger:focus-within .vc-mega-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 点击关闭按钮后强制收起（置于 hover 规则之后以覆盖） */
.vc-mega-trigger.vc-mega-dismissed .vc-mega-panel {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
}

/* 面板关闭按钮 */
.vc-mega-close {
    position: absolute;
    top: 14px;
    right: 20px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f5f5f5;
    color: #999;
    font-size: 26px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.25s ease;
    z-index: 2;
}

.vc-mega-close:hover {
    background: var(--primary-color);
    color: #fff;
    transform: rotate(90deg);
}

.vc-mega-inner {
    max-width: 1350px;
    margin: 0 auto;
    padding: 34px 20px 26px;
}

.vc-mega-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 36px;
}

.vc-mega-col-title {
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #999;
}

.vc-mega-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 加 .header-nav .nav-menu 前缀：面板在导航菜单内部，需压过 .header-nav .nav-menu a 的通用文字颜色 */
.header-nav .nav-menu .vc-mega-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 -10px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.header-nav .nav-menu .vc-mega-list a:hover {
    background: #FFF4EE;
    color: var(--primary-color);
}

.vc-mega-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: #FFF4EE;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.header-nav .nav-menu .vc-mega-list a:hover .vc-mega-icon {
    background: var(--primary-color);
}

.header-nav .nav-menu .vc-mega-viewall {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 26px;
    padding: 10px 24px;
    background: var(--primary-color);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 25px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.header-nav .nav-menu .vc-mega-viewall:hover {
    background: #E55A2B;
    color: #fff;
    transform: translateY(-2px);
}

.vc-mega-viewall-arrow {
    transition: transform 0.2s ease;
}

.vc-mega-viewall:hover .vc-mega-viewall-arrow {
    transform: translateX(4px);
}

/* 暗黑模式 */
body.dark-mode .vc-mega-panel {
    background: #1E1E1E;
}

body.dark-mode .vc-mega-col-title {
    color: #888;
    border-bottom-color: #333;
}

body.dark-mode .vc-mega-list a {
    color: #E0E0E0;
}

body.dark-mode .vc-mega-list a:hover {
    background: rgba(255, 107, 53, 0.14);
}

body.dark-mode .vc-mega-icon {
    background: rgba(255, 107, 53, 0.16);
}

body.dark-mode .vc-mega-close {
    background: #333;
    color: #aaa;
}

/* 移动端：面板改为静态列表（汉堡菜单内直接展开） */
@media (max-width: 768px) {
    .vc-mega-trigger > a::after {
        display: none;
    }

    .vc-mega-panel {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        border-top: none;
        box-shadow: none;
    }

    .vc-mega-panel::before {
        display: none;
    }

    .vc-mega-close {
        display: none;
    }

    .vc-mega-inner {
        padding: 2px 0 14px;
    }

    .vc-mega-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .vc-mega-viewall {
        margin-top: 16px;
    }

    /* 覆盖移动端菜单的通用链接样式（特异性需高于 .header-nav.active .nav-menu a） */
    .header-nav.active .nav-menu .vc-mega-list a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 11px 10px;
        font-size: 15px;
        color: #333;
    }

    .header-nav.active .nav-menu .vc-mega-list a:hover {
        padding-left: 10px;
    }
}

/* 用户菜单样式 */
.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    border-radius: 25px;
    text-decoration: none;
    color: var(--text-dark);
    transition: var(--transition);
    background: var(--bg-light);
}

.user-menu:hover {
    background: #e8e8e8;
    color: var(--primary-color);
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
}

.user-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-menu .user-name {
    font-size: 14px;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 桌面端显示类 */
.desktop-only {
    display: flex;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: var(--transition);
}

/* 底部样式 */
.site-footer {
    background: var(--secondary-color);
    color: white;
    padding: 60px 0 30px;
}

.footer-container {
    max-width: 1350px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: white;
}

.footer-column p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 15px;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 12px;
}

.footer-column ul li a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    transition: var(--transition);
}

.footer-column ul li a:hover {
    color: white;
    padding-left: 5px;
}

.footer-social {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.footer-social a {
    font-size: 24px;
    transition: var(--transition);
}

.footer-social a:hover {
    transform: translateY(-3px);
}

.footer-contact li {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

/* 响应式 - 头部和底部 */
@media (max-width: 768px) {
    .header-nav {
        display: none;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .footer-content {
        grid-template-columns: 1fr;
    }
}
