/*
 * 易尼 - 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);
}

/* ==================== 语言切换器（滚动后实色背景） ====================
 * 语言切换器样式定义在 header.html 的 <style> 内（?lang= 切换，数据库驱动）。
 * 此处补充 .header.scrolled 状态下的实色背景：默认状态按钮为半透明白字，
 * 滚动白底后若仍半透明会导致白字看不清，改为品牌色实底白字。
 */
.header.scrolled .lang-current { background: #A67B5B; border-color: #A67B5B; color: #fff; }
.header.scrolled .lang-current:hover { background: #8B6448; border-color: #8B6448; }

/* ==================== 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);
    opacity: 0;
    background: rgba(74,53,40,.96);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    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;
    min-width: 220px;
    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: block;
    animation: dropInTerra .32s cubic-bezier(.2,.9,.3,1.2) forwards;
}
@keyframes dropInTerra {
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .nav-menu li.has-dropdown:hover .dropdown { animation: none; opacity: 1; transform: translateX(-50%) translateY(0); }
}
.nav-menu .dropdown li { margin: 0; }
.nav-menu .dropdown li + li { margin-top: 2px; }
.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);
    backdrop-filter: blur(20px) saturate(160%);
    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 ==================== */
.header-actions { display: flex; align-items: center; gap: 12px; }

/* 火爆合作咨询按钮 */
.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; }
}
