/* ============================================
   通用样式文件 - 包含全局样式、Header和Footer
   可在其他页面中复用
   ============================================ */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1C2B4C;
    --accent-color: #FFC107;
    --text-white: #FFFFFF;
    --text-dark: #333333;
    --bg-gray: #F5F5F5;
    --bg-dark: #1C2B4C;
    --header-height: 72px;
}

a {
    text-decoration: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    width: 100%;
}

/* 响应式容器宽度适配 */
@media (max-width: 1440px) {
    .container {
        max-width: 1200px;
        padding: 0 30px;
    }
}

@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 30px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
}

/* ============================================
   顶部导航栏 (Header)
   ============================================ */
.header {
    background-color: var(--primary-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 15px 0;
    transition: box-shadow 0.2s ease;
}

/* 下滑一定高度后由 JS 添加 .is-fixed，header 固定在顶部 */
.header.is-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
}

body.header-fixed {
    padding-top: var(--header-height, 72px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.logo-main {
    font-weight: 700;
    font-size: 24px;
    color: var(--text-white);
}

.logo-sub {
    font-weight: 400;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.nav-menu {
    display: flex;
    gap: 30px;
    flex: 1;
    justify-content: flex-start;
    align-items: center;
    margin-left: 30px;
}

.nav-menu-mobile {
    display: none;
}

.nav-ul {
    display: flex;
    gap: 50px;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

#lihome a {
    color: var(--text-white);
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s;
    text-decoration: none;
    position: relative;
    letter-spacing: 1px;
}

.nav-link {
    color: var(--text-white);
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s;
    text-decoration: none;
    position: relative;
    letter-spacing: 1px;
}

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

/* 当前页导航高亮：与 style.css 同时加载时提高优先级 */
.nav-link.active,
body .header .nav-link.active,
body .header .nav-menu-desktop .nav-link.active {
    color: var(--text-white) !important;
    font-weight: 600;
}

.nav-link.active::after,
body .header .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--accent-color);
}

/* 下拉菜单样式 */
.nav-item-dropdown {
    position: relative;
}

.nav-link-dropdown {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-link-dropdown i {
    font-size: 12px;
    transition: transform 0.3s;
}

.nav-item-dropdown:hover .nav-link-dropdown i {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--text-white);
    min-width: 230px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-radius: 5px;
    list-style: none;
    padding: 10px 0;
    margin-top: 10px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    transform: translateX(-50%) translateY(-10px);
    z-index: 1000;
}

.nav-item-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--text-white);
}

.dropdown-link {
    display: block;
    padding: 10px 20px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.3s, color 0.3s;
}

.dropdown-link:hover {
    background-color: var(--bg-gray);
    color: var(--accent-color);
}

/* 三级菜单样式 */
.dropdown-submenu {
    position: absolute;
    left: 100%;
    top: 0;
    background-color: var(--text-white);
    min-width: 200px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-radius: 5px;
    list-style: none;
    padding: 10px 0;
    margin-left: 5px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    transform: translateX(-10px);
    z-index: 1001;
}

.menu-item.LiLevel1 {
    position: relative;
}

.menu-item.LiLevel1:hover .dropdown-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.dropdown-submenu::before {
    content: '';
    position: absolute;
    top: 15px;
    left: -8px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid var(--text-white);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-quote {
    background-color: var(--accent-color);
    color: var(--primary-color);
    padding: 12px 16px;
    border: none;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    text-transform: uppercase;
}

.btn-quote:hover {
    background-color: #FFB300;
    transform: translateY(-2px);
}

.btn-search {
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.3s;
}

.btn-search:hover {
    color: var(--accent-color);
}

/* 搜索弹层 */
.search-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(28, 43, 76, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.search-popup-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.search-popup-overlay.is-open .search-popup-box {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.search-popup-box {
    position: relative;
    width: 100%;
    max-width: 560px;
    background: var(--text-white);
    border-radius: 16px;
    padding: 28px 60px 28px 28px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    transform: scale(0.94) translateY(-16px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

.search-popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--bg-gray);
    color: #666;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

.search-popup-close:hover {
    background: var(--primary-color);
    color: var(--text-white);
}

.search-popup-close:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.search-popup-box .header-search-form {
    display: flex;
    align-items: center;
    gap: 0;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-popup-box .header-search-form:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(28, 43, 76, 0.12);
}

.search-popup-input {
    flex: 1;
    height: 52px;
    padding: 0 20px;
    border: none;
    font-size: 16px;
    outline: none;
    background: transparent;
    color: var(--text-dark);
}

.search-popup-input::placeholder {
    color: #9ca3af;
}

.search-popup-submit {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    padding: 0;
    border: none;
    background: var(--primary-color);
    color: var(--text-white);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.search-popup-submit:hover {
    background: #152238;
    color: var(--text-white);
}

.search-popup-submit:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.nav-toggle {
    display: none;
}

/* 移动端导航遮罩层（桌面端不显示） */
.nav-overlay {
    display: none;
}

/* ============================================
   底部区域 (Footer)
   ============================================ */
.footer {
    background-color: var(--bg-dark);
    padding: 60px 0 40px;
    color: var(--text-white);
}

.footer-content {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 0.9fr 1.1fr;
    gap: 40px;
}


.footer-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--text-white);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quote-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    color: var(--text-white);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
}

.form-input {
    padding: 12px 15px;
    border: none;
    background: var(--text-white);
    color: var(--text-dark);
    font-size: 14px;
    border-radius: 0;
    transition: box-shadow 0.3s;
    width: 100%;
    font-family: inherit;
}

.form-input::placeholder {
    color: #999;
}

.form-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.3);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.btn-submit {
    background-color: var(--accent-color);
    color: var(--primary-color);
    padding: 12px 30px;
    border: none;
    border-radius: 0;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    text-transform: uppercase;
    align-self: flex-start;
    letter-spacing: 0.5px;
}

.btn-submit:hover {
    background-color: #E5A611;
    transform: translateY(-2px);
}

.footer-right-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.footer-right .social-icons {
    margin-bottom: 20px;
}

.social-icon {
    color: var(--text-white);
    font-size: 28px;
    transition: color 0.3s, transform 0.2s;
}

.social-icon:hover {
    color: var(--accent-color);
    transform: translateY(-3px);
}

.footer-contact {
    margin-bottom: 25px;
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 12px 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.5;
}

.footer-contact-item:last-child {
    margin-bottom: 0;
}

.footer-contact-item i {
    color: var(--accent-color);
    margin-top: 3px;
    flex-shrink: 0;
}

.footer-contact-item a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-contact-item a:hover {
    color: var(--accent-color);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--accent-color);
}

/* ============================================
   右下角浮动按钮：返回顶部 + WhatsApp
   ============================================ */
.float-buttons {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 12px;
}

.back-to-top {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--text-white);
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background-color 0.2s;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--accent-color);
    color: var(--text-dark);
}

.whatsapp-float {
    flex-shrink: 0;
}

.whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background-color: #25D366;
    border-radius: 50%;
    color: var(--text-white);
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
}

.whatsapp-btn:hover {
    color: var(--text-white);
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.5);
}

/* ============================================
   响应式设计 - Header和Footer相关
   ============================================ */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        gap: 15px;
    }

    /* 桌面导航与按钮在移动端隐藏 */
    .nav-menu-desktop,
    .header-actions-desktop {
        display: none;
    }

    /* 移动端导航遮罩层 */
    .nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1099;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    body.nav-open .nav-overlay {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* 移动端侧边菜单 - 左侧 */
    .nav-menu-mobile {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        background-color: var(--primary-color);
        padding: 70px 0 20px;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1100;
        overflow-y: auto;
    }

    body.nav-open .nav-menu-mobile {
        transform: translateX(0);
    }

    .logo {
        flex-shrink: 0;
    }

    .nav-toggle {
        display: block;
        background: none;
        border: none;
        color: var(--text-white);
        font-size: 22px;
        cursor: pointer;
        padding: 8px;
        margin-left: auto;
    }

    .nav-ul-mobile {
        flex-direction: column;
        width: 100%;
        gap: 0;
        list-style: none;
        margin: 0;
        padding: 0;
        align-items: flex-start;
    }

    .nav-ul-mobile>li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-ul-mobile>li:last-child {
        border-bottom: none;
    }

    .nav-item-dropdown,
    .nav-item-dropdown-mobile {
        width: 100%;
    }

    /* 移动端导航链接样式 - 左对齐 */
    .nav-ul-mobile .nav-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 15px 20px;
        color: var(--text-white);
        font-size: 16px;
        font-weight: 500;
        text-align: left;
        transition: background-color 0.3s, color 0.3s;
    }

    .nav-ul-mobile .nav-link:hover,
    .nav-ul-mobile .nav-link.active {
        background-color: rgba(255, 255, 255, 0.1);
        color: var(--accent-color);
    }

    /* 移动端下拉菜单链接样式 */
    .nav-link-dropdown-mobile {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .mobile-chevron {
        font-size: 12px;
        transition: transform 0.3s ease;
        margin-left: 10px;
        flex-shrink: 0;
    }

    .nav-item-dropdown-mobile.active .mobile-chevron,
    .has-submenu.active .mobile-chevron {
        transform: rotate(180deg);
    }

    /* 移动端二级菜单 - 默认隐藏 */
    .dropdown-menu-mobile {
        position: static;
        transform: none;
        width: 100%;
        margin-top: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        box-shadow: none;
        background-color: rgba(0, 0, 0, 0.2);
        list-style: none;
        padding: 0;
        transition: max-height 0.3s ease, opacity 0.3s ease, visibility 0.3s ease, padding 0.3s ease;
    }

    .nav-item-dropdown-mobile.active .dropdown-menu-mobile {
        max-height: 1000px;
        opacity: 1;
        visibility: visible;
        padding: 5px 0;
    }

    .dropdown-menu-mobile>li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .dropdown-menu-mobile>li:last-child {
        border-bottom: none;
    }

    .dropdown-menu-mobile::before {
        display: none;
    }

    /* 移动端三级菜单 - 默认隐藏 */
    .dropdown-submenu-mobile {
        position: static;
        transform: none;
        width: 100%;
        margin-left: 0;
        margin-top: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        box-shadow: none;
        background-color: rgba(0, 0, 0, 0.3);
        list-style: none;
        padding: 0;
        transition: max-height 0.3s ease, opacity 0.3s ease, visibility 0.3s ease, padding 0.3s ease;
    }

    .has-submenu.active .dropdown-submenu-mobile {
        max-height: 500px;
        opacity: 1;
        visibility: visible;
        padding: 5px 0;
    }

    .dropdown-submenu-mobile>li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .dropdown-submenu-mobile>li:last-child {
        border-bottom: none;
    }

    .dropdown-submenu-mobile::before {
        display: none;
    }

    /* 移动端下拉菜单链接样式 - 左对齐 */
    .dropdown-menu-mobile .dropdown-link,
    .dropdown-submenu-mobile .dropdown-link {
        padding: 12px 20px;
        color: rgba(255, 255, 255, 0.9);
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        font-size: 15px;
        transition: background-color 0.3s, color 0.3s;
    }

    .dropdown-menu-mobile .dropdown-link:hover,
    .dropdown-submenu-mobile .dropdown-link:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: var(--accent-color);
    }

    .dropdown-submenu-mobile .dropdown-link {
        padding-left: 40px;
        font-size: 14px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-categories,
    .footer-center,
    .footer-right {
        margin-top: 20px;
    }

    .footer-right-header {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 14px;
    }

    .nav-menu {
        flex-wrap: wrap;
        gap: 10px;
    }

    .nav-link {
        font-size: 12px;
    }

    .btn-quote {
        padding: 8px 15px;
        font-size: 12px;
    }

    .float-buttons {
        bottom: 16px;
        right: 16px;
        gap: 10px;
    }

    .back-to-top {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .whatsapp-btn {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }
}

/* ============================================
   与 style.css 同页时的覆盖（保证 header/footer 使用本文件样式）
   ============================================ */
body .header a.nav-link,
body .header .nav-menu-desktop a.nav-link {
    color: var(--text-white);
    text-decoration: none;
}

body .header a.nav-link:hover {
    color: var(--accent-color);
}

body .header .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    width: 100%;
}

body .footer .footer-links a,
body .footer .footer-contact a {
    color: rgba(255, 255, 255, 0.8);
}

body .footer .footer-links a:hover {
    color: var(--accent-color);
}