/**
 * 网站前端全局样式
 * 主题色：LOGO 绿色 #398D40
 * 存放路径：public/static/web/css/style.css
 */

/* ========== 主题色变量（与 Tailwind 一致，供非 Tailwind 类使用） ========== */
:root {
    --theme-primary: #398D40;
    --theme-primary-hover: #2d6b33;
    --theme-primary-light: rgba(57, 141, 64, 0.1);
    /* 顶部区域总高度：上栏(12+100+14+1) + 下栏导航(18*2+约22) ≈ 185px，与下方内容无缝衔接 */
    --header-height: 185px;
    /* 全站内容区最大宽度，与头部一致，保证头与内容可视区域统一 */
    --content-max-width: 1400px;
    --content-padding-x: 24px;
}

/* 固定顶栏时为主内容留出高度，与 header 实际高度一致避免空白 */
body {
    padding-top: var(--header-height);
}

/* ========== 顶部公共区域（纯白不透明，滚动时也不透底） ========== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    isolation: isolate;
}

.site-header.nav-scrolled {
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

/* 上栏：LOGO/标题 + 服务电话/搜索 */
.header-top {
    border-bottom: 1px solid #eee;
}

.header-top-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 12px var(--content-padding-x) 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: #1a1a1a;
    flex-shrink: 0;
}

/* LOGO 固定尺寸 550×100，不缩放 */
.header-logo-img {
    width: 550px;
    height: 100px;
    object-fit: contain;
    object-position: left center;
    display: block;
    flex-shrink: 0;
}

.header-title-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.header-title-cn {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

.header-title-en {
    font-size: 12px;
    color: #666;
    line-height: 1.3;
}

/* 右侧：服务电话在上、搜索框在下，左对齐 */
.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.header-phone {
    font-size: 15px;
    color: #555;
}

.header-phone .header-phone-num {
    margin-left: 4px;
}

.header-phone-num {
    color: var(--theme-primary);
    font-weight: 600;
    text-decoration: none;
}

.header-phone-num:hover {
    color: var(--theme-primary-hover);
    text-decoration: underline;
}

.header-search {
    display: flex;
    align-items: stretch;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.header-search-input {
    width: 200px;
    padding: 8px 12px;
    font-size: 14px;
    border: none;
    outline: none;
    background: #fafafa;
}

.header-search-input::placeholder {
    color: #999;
}

.header-search-input:focus {
    background: #fff;
}

.header-search-btn {
    width: 40px;
    padding: 0;
    border: none;
    background: var(--theme-primary);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s;
}

.header-search-btn:hover {
    background: var(--theme-primary-hover);
}

/* 下栏：主导航（绿色底） */
.header-nav-wrap {
    background: var(--theme-primary);
}

.header-nav-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 var(--content-padding-x);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.header-nav-item {
    display: block;
    padding: 18px 28px;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #fff;
    text-decoration: none;
    transition: background 0.2s;
}

.header-nav-item:hover {
    background: var(--theme-primary-hover);
    color: #fff;
}

.header-nav-item.active {
    background: rgba(0, 0, 0, 0.15);
    color: #fff;
}

.header-mobile-toggle {
    display: none;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

/* 移动端菜单：默认隐藏，由 JS 切换 .is-open 控制展开 */
.header-mobile-menu {
    display: none;
    background: #fff;
    border-top: 1px solid #eee;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.header-mobile-menu.is-open {
    display: block;
}

.header-mobile-menu-inner {
    padding: 12px 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-mobile-menu-item {
    display: block;
    padding: 12px 0;
    font-size: 15px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
}

.header-mobile-menu-item:hover {
    color: var(--theme-primary);
}

.header-mobile-menu-item:last-child {
    border-bottom: none;
}

/* 全站内容区容器：与头部同宽，保证头与内容可视区域一致 */
body .container {
    max-width: var(--content-max-width);
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .header-top-inner {
        flex-direction: column;
        align-items: center;
        padding: 10px 16px 12px;
    }

    .header-brand {
        width: 100%;
        justify-content: center;
    }

    /* LOGO 最大化显示，不超过自身宽度(550px)、不撑爆屏幕 */
    .header-logo-img {
        width: auto;
        max-width: 100%;
        height: auto;
        max-height: 100px;
        object-fit: contain;
        object-position: center;
    }

    .header-title-cn {
        font-size: 16px;
    }

    .header-title-en {
        display: none;
    }

    /* 服务电话、搜索框居中 */
    .header-right {
        width: 100%;
        align-items: center;
        gap: 10px;
    }

    .header-search-input {
        width: 160px;
    }

    .header-nav {
        display: none;
    }

    .header-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 导航栏：汉堡菜单图标居中 */
    .header-nav-inner {
        padding: 0 16px;
        min-height: 48px;
        justify-content: center;
    }

    .header-mobile-menu.is-open {
        display: block !important;
    }
}

/* ========== 底部：快速链接收窄、政策法规加宽，标题单行截断 ========== */
@media (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 0.5fr 1.5fr 1fr;
    }
}

.footer-policy-list .footer-policy-link {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
