/*
 * 百昔 - PC端公共Header样式
 * 2026-05-31 从index.css独立
 * 
 * 全部页面：header默认透明，滚动后变白底
 */

/* ==================== Header基础 ==================== */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: transparent;
    box-shadow: none;
    transition: background .3s, box-shadow .3s;
}

/* 滚动后变白底 */
.header.scrolled {
    background: rgba(255,255,255,0.95);
    box-shadow: 0 2px 16px rgba(0,0,0,0.1);
}

/* ==================== 语言小标志（滚动后状态） ====================
 * ★ 2026-10-21 语言切换重设计为 ZH/EN 分段小标志（移至 400 电话后），
 * 全部样式（含滚动后状态）统一定义在 header.html 的 <style> 内，此处不再重复。
 */

/* ==================== Logo ==================== */
.logo-img {
    height: 20px;
    width: auto;
    object-fit: contain;
    transition: filter .3s;
    filter: brightness(0) invert(1);
}
.header.scrolled .logo-img {
    filter: none;
}

/* ==================== 导航链接 ==================== */
.nav-menu ul { display: flex; gap: 4px; }
.nav-menu li a {
    display: block;
    padding: 8px 16px;
    font-size: 15px;
    color: #fff;
    font-weight: 500;
    border-radius: 8px;
    text-decoration: none;
    transition: all .25s;
}
.nav-menu li a:hover,
.nav-menu li.active a { color: #fff; background: rgba(255,255,255,0.15); }
.header.scrolled .nav-menu li a { color: #5A4A3A; }
.header.scrolled .nav-menu li a:hover,
.header.scrolled .nav-menu li.active a { color: #A67B5B; background: #F5E8D8; }

/* ==================== Header Content ==================== */
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}
.logo a { display: flex; align-items: center; text-decoration: none; }

/* ==================== 二级导航 ==================== */
.nav-menu li.has-dropdown { position: relative; }
.nav-menu li.has-dropdown > a::after {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    margin-left: 4px;
    vertical-align: middle;
    transition: transform .2s;
    margin-bottom: 2px;
}
.nav-menu li.has-dropdown:hover > a::after { transform: rotate(-135deg); }
.nav-menu .dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: rgba(74,53,40,.96);
    /* 2026-10-25 移除 backdrop-filter：0.96 实底下模糊不可感知，且与入场动画
       叠加时会触发合成时序怪癖（悬停瞬间面板背景丢失呈透明，~1s 后才恢复） */
    border-radius: 18px;
    box-shadow: 0 24px 64px -12px rgba(0,0,0,.32), 0 0 0 1px rgba(255,255,255,.08), inset 0 1px 0 rgba(255,255,255,.06);
    padding: 10px;
    /* 2026-10-25 二级类目面板重设计：宽度自适应 + 长列表自动分列
       width:max-content 紧贴最长条目（短类目不再空旷），min-width 托底防过窄；
       grid 纵向流固定 6 行——≤6 项单列手风琴，7-12 项自动双列（高度减半）。
       列宽用 auto（按各自内容）：1fr 在 max-content 容器下会触发合成时序
       怪癖（悬停瞬间双列面板背景丢失），且菜单条目长度接近观感无异 */
    min-width: 150px;
    width: max-content;
    max-width: min(480px, 80vw);
    grid-auto-flow: column;
    grid-template-rows: repeat(6, auto);
    grid-auto-columns: auto;
    gap: 2px 6px;
    z-index: 100;
    isolation: isolate;
}
.nav-menu .dropdown::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: rgba(74,53,40,.96);
    border-top: 1px solid rgba(255,255,255,.08);
    border-left: 1px solid rgba(255,255,255,.08);
    z-index: -1;
}
.nav-menu .dropdown::before {
    content: '';
    position: absolute;
    top: -14px;
    left: 0;
    right: 0;
    height: 14px;
    background: transparent;
}
.nav-menu li.has-dropdown:hover .dropdown {
    display: grid;
    animation: dropInTerra .32s cubic-bezier(.2,.9,.3,1.2) forwards;
}
@keyframes dropInTerra {
    /* 2026-10-25 改 transform-only 入场（去掉 opacity 淡入）。
       注：headless 截图环境（--disable-gpu 软件光栅化）下 display:none→grid
       切换后首帧背景绘制会丢失（~1s 后自愈），与动画/backdrop-filter 无关，
       属截图伪影非真机行为，勿据此再改动 */
    to { transform: translateX(-50%) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .nav-menu li.has-dropdown:hover .dropdown { animation: none; transform: translateX(-50%) translateY(0); }
}
/* 2026-10-25 分列改用 grid gap 控距，移除 li+li 纵向外距（避免分列后各列首项错位） */
.nav-menu .dropdown li { margin: 0; min-width: 0; }
.nav-menu .dropdown li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    color: rgba(255,255,255,.88);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 12px;
    transition: all .22s cubic-bezier(.2,.8,.2,1);
    position: relative;
    overflow: hidden;
}
.nav-menu .dropdown li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg,#C4956A 0%,#A67B5B 100%);
    border-radius: 0 3px 3px 0;
    opacity: 0;
    transform: scaleY(.4);
    transition: all .22s cubic-bezier(.2,.8,.2,1);
}
.nav-menu .dropdown li a .dd-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: rgba(196,149,106,.7);
    transition: all .22s cubic-bezier(.2,.8,.2,1);
}
.nav-menu .dropdown li a:hover {
    color: #fff;
    background: linear-gradient(135deg, rgba(196,149,106,.18) 0%, rgba(166,123,91,.08) 100%);
    padding-left: 22px;
}
.nav-menu .dropdown li a:hover::before { opacity: 1; transform: scaleY(1); }
.nav-menu .dropdown li a:hover .dd-icon { color: #C4956A; transform: scale(1.15) rotate(-4deg); }
.nav-menu .dropdown li a:active { transform: scale(.985); }

/* 滚动后二级导航变白 */
.header.scrolled .nav-menu .dropdown {
    background: rgba(255,255,255,.97);
    box-shadow: 0 24px 64px -12px rgba(74,53,40,.18), 0 0 0 1px rgba(74,53,40,.06);
}
.header.scrolled .nav-menu .dropdown::after {
    background: rgba(255,255,255,.97);
    border-color: rgba(74,53,40,.06);
}
.header.scrolled .nav-menu .dropdown li a { color: #4A3528; }
.header.scrolled .nav-menu .dropdown li a:hover {
    color: #A67B5B;
    background: linear-gradient(135deg, rgba(196,149,106,.14) 0%, rgba(196,149,106,.04) 100%);
}
.header.scrolled .nav-menu .dropdown li a .dd-icon { color: rgba(166,123,91,.6); }
.header.scrolled .nav-menu .dropdown li a:hover .dd-icon { color: #A67B5B; }

/* ==================== Header Actions ==================== */
/* ★ 2026-10-21 flex-shrink:0：英文站导航文案长，默认收缩会把动作区压窄导致文字逐字竖排 */
.header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; white-space: nowrap; }

/* 火爆合作咨询按钮 */
.btn-fire {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #B88B6B, #A67B5B);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    cursor: pointer;
    text-decoration: none;
    overflow: hidden;
    transition: all .3s;
    box-shadow: 0 4px 15px rgba(166,123,91,.45), 0 0 20px rgba(166,123,91,.2);
    animation: firePulse 2s ease-in-out infinite;
}
.btn-fire:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 25px rgba(166,123,91,.55), 0 0 35px rgba(166,123,91,.3);
}
.btn-fire::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50px;
    background: linear-gradient(135deg, #B88B6B, #A67B5B, #B88B6B);
    z-index: -1;
    animation: fireGlow 3s linear infinite;
    background-size: 200% 200%;
}
@keyframes firePulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(166,123,91,.45), 0 0 20px rgba(166,123,91,.2); }
    50% { box-shadow: 0 4px 20px rgba(166,123,91,.6), 0 0 30px rgba(166,123,91,.35); }
}
@keyframes fireGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.btn-fire .fire-icon { font-size: 16px; animation: fireShake 1.5s ease-in-out infinite; }
@keyframes fireShake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-8deg); }
    75% { transform: rotate(8deg); }
}

/* 电话 */
.header-phone {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}
.header.scrolled .header-phone { color: #A67B5B; }
.header-phone i { font-size: 13px; }

/* ==================== 响应式 ==================== */
@media (max-width: 992px) {
    .header-content { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 10px; }
    .nav-menu ul { flex-wrap: wrap; gap: 2px; }
    .nav-menu li a { padding: 6px 12px; font-size: 14px; }
    .header-actions { width: 100%; justify-content: center; }
    .btn-fire { font-size: 13px; padding: 8px 18px; }
}
@media (max-width: 768px) {
    .header-content { height: auto; padding: 10px 0; }
    .header-phone { display: none; }
    .btn-fire { font-size: 12px; padding: 6px 14px; }
    .nav-menu li a { padding: 5px 8px; font-size: 13px; }
}

/* ==================== 头部组件（2026-10-25 自 header.html 内联迁入） ==================== */

/* ---- 头部自适应换行：放得下单行；放不下动作区换行右对齐，导航文字永不折行 ---- */
.header-content { flex-wrap: wrap; height: auto; padding: 14px 0; gap: 6px; }
.header-actions { flex-shrink: 0; margin-left: auto; gap: 12px; }
.nav-menu { flex: 1 1 auto; min-width: 0; }
.nav-menu li a { white-space: nowrap; }
@media (max-width: 992px) {
    .header-content { padding: 12px 0; }
    .header-actions { width: 100%; justify-content: flex-end; }
}
/* EN 站差异：导航文案远长于中文，收窄内边距/字号/间距 */
html[lang^="en"] .header-actions { gap: 10px; }
html[lang^="en"] .nav-menu li a { padding: 8px 8px; font-size: 13px; }
html[lang^="en"] .city-switch { margin-left: 10px; }
html[lang^="en"] .lang-switch { margin-left: 10px; }

/* ---- 语言切换：地球 SVG 图标 + 悬停下拉（默认态玻璃描边圆钮，滚动后转品牌棕描边） ---- */
.lang-switch { position: relative; margin-left: 14px; }
.lang-current { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.45); background: rgba(255,255,255,.08); color: #fff; cursor: pointer; transition: all .25s; padding: 0; }
.lang-current:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.6); }
.lang-current .globe-icon { width: 18px; height: 18px; }
.header.scrolled .lang-current { border-color: #A67B5B; background: transparent; color: #A67B5B; }
.header.scrolled .lang-current:hover { background: rgba(166,123,91,.1); }
.lang-dropdown { position: absolute; top: calc(100% + 10px); right: 0; min-width: 150px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 12px 32px rgba(15,23,42,.14); padding: 6px; opacity: 0; visibility: hidden; transform: translateY(-8px); transition: all .2s; z-index: 60; }
.lang-switch:hover .lang-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-dropdown a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 8px; color: #475569; font-size: 13px; text-decoration: none; transition: all .15s; }
.lang-dropdown a:hover { background: #FAF3EC; color: #A67B5B; }
.lang-dropdown a.active { background: #FAF3EC; color: #A67B5B; font-weight: 600; }
.lang-dropdown a.active::after { content: '✓'; font-size: 12px; }

/* ---- 城市分站悬浮提示：header 下方右侧悬浮，4 秒自动消失（top 由 JS 按头高动态覆盖） ---- */
.city-float-tip { position: fixed; top: 84px; right: 24px; z-index: 1100; display: flex; align-items: center; gap: 10px; background: linear-gradient(90deg,rgba(166,123,91,.78),rgba(139,100,72,.78)); color: #fff; font-size: 13px; padding: 8px 14px; border-radius: 999px; box-shadow: 0 8px 24px rgba(139,100,72,.35); max-width: calc(100vw - 48px); opacity: 0; transform: translateY(-8px); transition: opacity .35s ease, transform .35s ease; pointer-events: none; }
.city-float-tip.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.city-float-tip.hide { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.city-float-tip i.fa-map-marker-alt { font-size: 12px; opacity: .9; }
.city-float-tip strong { font-weight: 700; }
.city-float-tip a { color: #fff; text-decoration: underline; opacity: .92; font-size: 12px; white-space: nowrap; }
.city-float-tip a:hover { opacity: 1; }
.city-float-tip .cft-sep { opacity: .45; }
.city-float-tip .cft-close { border: none; background: rgba(255,255,255,.18); color: #fff; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; padding: 0; margin-left: 2px; flex-shrink: 0; transition: background .2s; }
.city-float-tip .cft-close:hover { background: rgba(255,255,255,.34); }
@media (max-width: 768px) {
    .city-float-tip { top: auto; right: 12px; left: 12px; justify-content: center; border-radius: 12px; font-size: 12px; }
}

/* ---- 城市分站切换器 + 热门城市下拉 ---- */
.city-switch { position: relative; margin-left: 14px; }
.city-switch .city-current { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); color: #fff; font-size: 14px; line-height: 1; padding: 8px 12px; border-radius: 8px; cursor: pointer; transition: all .2s; text-decoration: none; }
.city-switch .city-current:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.35); }
.city-switch .city-current i { font-size: 12px; opacity: .8; }
.header.scrolled .city-current { background: #A67B5B; border-color: #A67B5B; color: #fff; }
.header.scrolled .city-current:hover { background: #8B6448; border-color: #8B6448; }
.city-dropdown { position: absolute; top: calc(100% + 10px); right: 0; min-width: 320px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 12px 32px rgba(15,23,42,.14); padding: 16px; opacity: 0; visibility: hidden; transform: translateY(-8px); transition: all .2s; z-index: 60; }
.city-switch:hover .city-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.city-dropdown .cd-label { font-size: 12px; color: #94a3b8; margin-bottom: 8px; display: flex; align-items: center; gap: 5px; }
.city-dropdown .cd-label i { color: #A67B5B; }
.city-dropdown .cd-hot { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.city-dropdown .cd-hot a { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 6px; color: #475569; font-size: 13px; text-decoration: none; transition: all .15s; }
.city-dropdown .cd-hot a:hover { background: #FAF3EC; color: #A67B5B; }
.city-dropdown .cd-hot a i { font-size: 10px; color: #cbd5e1; }
.city-dropdown .cd-hot a:hover i { color: #A67B5B; }
.city-dropdown .cd-more { display: block; text-align: center; padding: 8px; border-top: 1px solid #f1f5f9; color: #A67B5B; font-size: 13px; text-decoration: none; border-radius: 0 0 8px 8px; transition: background .15s; }
.city-dropdown .cd-more:hover { background: #FAF3EC; }

/* ---- WAP 式多语言/城市切换与抽屉底部组件（en/pc/wap-header 页面引用） ---- */
.wap-lang-switch { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.wap-lang-switch a { display: inline-block; padding: 7px 14px; border: 1px solid var(--border-color, #e2e8f0); border-radius: 20px; font-size: 13px; color: #1e293b; text-decoration: none; transition: all .15s; }
.wap-lang-switch a.active { background: #A67B5B; border-color: #A67B5B; color: #fff; }
.wap-lang-switch a:hover { color: #A67B5B; }
.wap-lang-switch a.active:hover { color: #fff; }
.wap-city-switch { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 7px 14px; border: 1px solid var(--border-color, #e2e8f0); border-radius: 20px; font-size: 13px; color: #1e293b; text-decoration: none; transition: all .15s; }
.wap-city-switch:hover { color: #A67B5B; border-color: #A67B5B; }
.wap-city-switch i { font-size: 12px; }
