/* ========================================
   ViSiLight 官网 - 导航栏组件样式
   ======================================== */

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 0.8rem 0;
    z-index: 1000;
    transition: var(--transition-soft);
    background: rgba(0, 8, 20, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--bg-border);
    overflow: visible;
}

/* 白蓝色主题下的导航栏 */
html[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
}

.navbar.scrolled {
    padding: 0.6rem 0;
    background: rgba(0, 8, 20, 0.95);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* 白蓝色主题下滚动后的导航栏 */
html[data-theme="light"] .navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    width: 100%;
    max-width: 100%;
}

/* Logo 样式 */
.logo {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-white);
    text-decoration: none;
    transition: var(--transition-bounce);
    z-index: 2;
    flex-shrink: 0;
    position: relative;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    width: auto;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px var(--primary-glow));
    flex-shrink: 0;
    transition: opacity 0.3s ease;
}

/* 默认显示浅色 Logo (白蓝色主题) */
.logo-light {
    display: block;
}

.logo-dark {
    display: none;
}

/* 黑紫色主题下切换 Logo */
html[data-theme="dark"] .logo-light {
    display: none;
}

html[data-theme="dark"] .logo-dark {
    display: block;
}

.logo-text-wrapper {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-text-cn {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-white);
    letter-spacing: 8px;
    display: block;
    white-space: nowrap;
    line-height: 1.1;
}

.logo-text-en {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: 2px;
    display: block;
    white-space: nowrap;
    line-height: 1.1;
}

/* 英文模式下隐藏中文 */
html[lang="en"] .logo-text-cn {
    display: none;
}

/* 中文模式下都显示 */
html[lang="zh-CN"] .logo-text-cn {
    display: block;
}

html[lang="zh-CN"] .logo-text-en {
    display: block;
}

/* 英文模式下调整包装器和字体大小 */
html[lang="en"] .logo-text-wrapper {
    display: flex;
    align-items: center;
}

html[lang="en"] .logo-text-en {
    font-size: 1.6rem;
    font-weight: 800;
}

/* 导航链接 */
.nav-links {
    display: flex;
    gap: 1.8rem;
    align-items: center;
    margin-left: auto;
}

.nav-link {
    color: var(--text-gray);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-soft);
    position: relative;
    padding: 0.5rem 0;
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--text-white);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active {
    color: var(--primary);
    font-weight: 700;
}

.nav-link.active::after {
    width: 100%;
}

/* 导航栏右侧操作区 */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: 2rem;
}

/* 汉堡菜单按钮（默认隐藏，移动端显示） */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 8px;
    gap: 4px;
    z-index: 1001;
    flex-shrink: 0;
}

html[data-theme="light"] .hamburger-menu {
    border-color: rgba(59, 130, 246, 0.2);
}

.hamburger-menu:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-white);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

html[data-theme="light"] .hamburger-line {
    background: #1e293b;
}

/* 汉堡菜单激活状态 - 变成X */
.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* 移动端主题切换按钮（默认隐藏） */
.mobile-theme-btn {
    display: none;
}

/* 移动端导航面板（默认隐藏） */
.mobile-nav-panel {
    display: none;
}

/* 语言切换器 */
.lang-switcher {
    display: flex;
    gap: 8px;
    padding: 4px;
    background: var(--bg-card);
    border: 1px solid var(--bg-border);
    border-radius: 30px;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

/* 白蓝色主题下的语言切换器 */
html[data-theme="light"] .lang-switcher {
    background: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.2);
}

.lang-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-gray);
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 20px;
    transition: var(--transition-soft);
    cursor: pointer;
}

.lang-btn.active {
    background: var(--gradient-primary);
    color: var(--text-white);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* 主题切换按钮 */
.theme-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--bg-card);
    border: 1px solid var(--bg-border);
    border-radius: 50%;
    color: var(--text-white);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition-soft);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-shrink: 0;
}

/* 移动端主题按钮默认隐藏 */
.mobile-theme-btn {
    display: none;
}

/* 白蓝色主题下的按钮背景 */
html[data-theme="light"] .theme-switcher {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

.theme-switcher:hover {
    background: var(--gradient-primary);
    border-color: var(--primary);
    color: var(--text-white);
    box-shadow: 0 0 20px var(--primary-glow);
    transform: rotate(30deg);
}

.theme-switcher i {
    transition: var(--transition-soft);
}

/* ========================================
   页脚组件样式
   ======================================== */

.footer {
    background: #000814;
    padding: 6rem 0 2rem;
    border-top: 1px solid var(--bg-border);
    position: relative;
    z-index: 1;
}

/* 亮色主题下的页脚样式 */
html[data-theme="light"] .footer {
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(59, 130, 246, 0.2);
}

html[data-theme="light"] .footer-logo,
html[data-theme="light"] .footer-link-title {
    color: #1a1a1a;
}

html[data-theme="light"] .footer-slogan {
    color: #555555;
}

html[data-theme="light"] .footer-link {
    color: #555555;
}

html[data-theme="light"] .footer-link:hover {
    color: var(--primary);
}

html[data-theme="light"] .footer-qr-title {
    color: #555555;
}

html[data-theme="light"] .footer-qr-code {
    background: linear-gradient(135deg, #f0f4ff, #ffffff);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
}

html[data-theme="light"] .footer-qr-code-img {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
}

html[data-theme="light"] .footer-qr-code-img:hover {
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.3);
}

html[data-theme="light"] .footer-bottom {
    color: #444444;
    border-top: 1px solid rgba(59, 130, 246, 0.2);
}

html[data-theme="light"] .footer-bottom-link {
    color: #444444;
}

html[data-theme="light"] .footer-bottom-link:hover {
    color: var(--primary);
}

.footer-top {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: flex-start;
    margin-bottom: 4rem;
    gap: 3rem;
}

/* 页脚Logo区域 */
.footer-logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;  /* 桌面端居中对齐 */
    gap: 0.5rem;
    text-align: center;
}

.footer-logo {
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--text-white);
    letter-spacing: 2px;
}

.footer-slogan {
    font-size: 1.2rem;  /* 增大字号，从1rem改为1.2rem */
    font-weight: 500;
    color: var(--text-gray);
    letter-spacing: 1px;
    opacity: 0.8;
}

.footer-nav-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 1.5rem;
    justify-self: center;
    max-width: 900px;
    width: 100%;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 120px;
}

.footer-link-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 0.5rem;
    text-decoration: none;
}

.footer-link {
    font-size: 1rem;
    color: var(--text-gray);
    text-decoration: none;
    transition: var(--transition-soft);
    white-space: normal;
}

.footer-link:hover {
    color: var(--primary);
    transform: translateX(5px);
}

/* 页脚电话号码特殊样式 */
.footer-phone {
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
}

/* 页脚联系方式区域 */
.footer-contact-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-gray);
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer-contact-item i {
    color: var(--primary);
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.footer-contact-item span {
    white-space: nowrap;
    flex-shrink: 0;
}

.footer-contact-item a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.3s ease;
    word-break: break-all;
}

.footer-contact-item a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.footer-qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    min-width: 180px;
    flex-shrink: 0;
}

.footer-qr-title {
    font-size: 1.2rem;
    color: var(--text-gray);
    margin: 0;
}

.footer-qr-code {
    width: 160px;
    height: 160px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: bold;
    font-size: 0.9rem;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 0 30px var(--primary-glow);
}

.footer-qr-code-img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 30px var(--primary-glow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.footer-qr-code-img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px var(--primary-glow);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-gray);
    font-size: 0.95rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom .visilight-brand {
    color: var(--primary);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.footer-bottom-right {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.footer-phone-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.footer-phone-link i {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.footer-phone-link:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.footer-phone-link:hover i {
    transform: rotate(15deg);
}

/* 亮色模式下的电话号码样式 */
html[data-theme="light"] .footer-phone-link {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

html[data-theme="light"] .footer-phone-link:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* ========================================
   响应式优化
   ======================================== */

@media (max-width: 1400px) {
    .footer-nav-grid {
        max-width: 700px;
    }
}

@media (max-width: 1200px) {
    .nav-links {
        gap: 1rem;
    }
    .nav-link {
        font-size: 0.9rem;
        min-width: 70px;
    }
    
    /* 平板设备：页脚导航变为2列 */
    .footer-top {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-logo {
        justify-self: center;
    }
    
    .footer-nav-grid {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
        gap: 2rem;
        justify-self: center;
        max-width: 600px;
    }
    
    .footer-qr-section {
        justify-self: center;
    }
}

@media (max-width: 992px) {
    /* 移动端：隐藏桌面端导航链接和操作区 */
    .desktop-nav-links,
    .desktop-actions {
        display: none !important;
    }
    
    /* 移动端：保持原有的 space-between 布局，添加宽度控制 */
    .nav-content {
        justify-content: space-between;
        padding: 0 3%;
        width: 100%;
        max-width: 100vw;
        overflow: visible;
        box-sizing: border-box;
    }
    
    /* 移动端：确保导航容器不溢出 */
    #navbar-placeholder {
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }
    
    /* 移动端：Logo 往右微调，使用 flex-shrink 防止压缩 */
    .logo {
        flex-shrink: 1;
        margin-right: auto;
    }
    
    /* 移动端：主题切换按钮显示在Logo右边 */
    .mobile-theme-btn {
        display: flex !important;
        order: 2;
        margin-left: 0.5rem;
        margin-right: 0.5rem;
        flex-shrink: 0;
    }
    
    /* 移动端：汉堡菜单按钮显示在最右边 */
    .hamburger-menu {
        display: flex !important;
        order: 3;
        margin-left: 0;
        flex-shrink: 0;
    }
    
    /* 移动端导航面板 */
    .mobile-nav-panel { 
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 350px;
        height: 100vh;
        background: rgba(0, 8, 20, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
        z-index: 999;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-top: 80px;
        display: flex;
    }
    
    /* 亮色主题下的移动端菜单 */
    html[data-theme="light"] .mobile-nav-panel {
        background: rgba(255, 255, 255, 0.98);
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-nav-panel.active {
        right: 0;
    }
    
    /* 移动端语言切换器样式 */
    .mobile-lang-switcher {
        display: flex;
        justify-content: center;
        padding: 1.5rem 2rem;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid rgba(59, 130, 246, 0.2);
        flex-shrink: 0;
    }
    
    html[data-theme="light"] .mobile-lang-switcher {
        border-bottom: 1px solid rgba(59, 130, 246, 0.15);
    }
    
    .mobile-lang-switcher .lang-switcher {
        background: transparent;
        border: 2px solid rgba(59, 130, 246, 0.3);
        padding: 6px;
    }
    
    html[data-theme="light"] .mobile-lang-switcher .lang-switcher {
        border-color: rgba(59, 130, 246, 0.25);
    }
    
    .mobile-lang-switcher .lang-btn {
        padding: 8px 16px;
        font-size: 0.95rem;
    }
    
    /* 移动端导航链接容器 */
    .mobile-nav-links {
        display: flex;
        flex-direction: column;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .mobile-nav-link {
        display: block;
        width: 100%;
        padding: 1.2rem 2.5rem;
        font-size: 1.1rem;
        color: var(--text-gray);
        text-decoration: none;
        font-weight: 500;
        border-bottom: 1px solid rgba(59, 130, 246, 0.1);
        transition: all 0.3s ease;
    }
    
    html[data-theme="light"] .mobile-nav-link {
        color: var(--text-dark);
        border-bottom: 1px solid rgba(59, 130, 246, 0.15);
    }
    
    .mobile-nav-link:hover,
    .mobile-nav-link.active {
        color: var(--primary);
        background: rgba(59, 130, 246, 0.1);
        padding-left: 3rem;
    }
    
    html[data-theme="light"] .mobile-nav-link:hover,
    html[data-theme="light"] .mobile-nav-link.active {
        background: rgba(59, 130, 246, 0.08);
    }
    
    /* 遮罩层 */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        transition: opacity 0.4s ease;
    }
    
    .nav-overlay.active {
        display: block;
        opacity: 1;
    }
    
    /* 平板设备：页脚导航变为2列 */
    .footer-top {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-logo {
        justify-self: center;
    }
    
    .footer-nav-grid {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
        gap: 2rem;
        justify-self: center;
        max-width: 600px;
    }
    
    .footer-qr-section {
        justify-self: center;
    }
}

@media (max-width: 768px) {
    /* 移动端导航栏优化 */
    .navbar {
        padding: 0.7rem 0;
    }
    .nav-content {
        padding: 0 1.5rem;
        flex-wrap: wrap;
    }
    .logo {
        font-size: 1.5rem;
        gap: 3px;
    }
    .logo-icon {
        width: auto;
        height: 55px;
    }
    .logo-text-wrapper {
        line-height: 1.1;
    }
    .logo-text-cn {
        font-size: 1.1rem;
    }
    .logo-text-en {
        font-size: 1.1rem;
    }
    /* 英文模式下移动端字体更大 */
    html[lang="en"] .logo-text-en {
        font-size: 1.4rem;
    }
    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
        gap: 1rem;
        flex-wrap: wrap;
    }
    .nav-link {
        font-size: 0.9rem;
        padding: 0.3rem 0;
    }
    .lang-switcher {
        order: 2;
    }
    
    /* 移动端页脚优化 */
    .footer {
        padding: 4rem 0 1.5rem;
    }
    .footer-top { 
        grid-template-columns: 1fr; 
        gap: 3rem; 
        align-items: center; 
        text-align: center; 
    }
    .footer-logo-section {
        align-items: center;
    }
    .footer-nav-grid { 
        grid-template-columns: 1fr; 
        gap: 2rem; 
        justify-self: stretch;
    }
    .footer-bottom { 
        flex-direction: column; 
        gap: 1rem; 
        text-align: center; 
    }
    
    .footer-bottom-right {
        flex-direction: column;
        gap: 0.8rem;
        width: 100%;
    }
    
    .footer-phone-link {
        width: fit-content;
        margin: 0 auto;
    }
    
    .footer-logo {
        font-size: 2.2rem;
    }
    .footer-slogan {
        font-size: 0.9rem;
    }
    .footer-qr-code {
        width: 140px;
        height: 140px;
    }
    
    .footer-qr-code-img {
        width: 140px;
        height: 140px;
    }
}

@media (max-width: 576px) {
    .nav-link {
        font-size: 0.85rem;
    }
    .footer-bottom-right {
        gap: 0.8rem;
    }
    .footer-bottom-link {
        font-size: 0.85rem;
    }
}