/*
 * 百昔心理 - 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);
}

/* ==================== 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: #444; }
.header.scrolled .nav-menu li a:hover,
.header.scrolled .nav-menu li.active a { color: #f96c9f; background: #fff0f5; }

/* ==================== 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% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    opacity: 0;
    background: rgba(20,10,30,.95);
    backdrop-filter: blur(24px);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,.25), 0 0 0 1px rgba(255,255,255,.06);
    padding: 8px;
    z-index: 100;
}
.nav-menu li.has-dropdown:hover .dropdown { display: block; animation: dropIn .25s ease forwards; }
@keyframes dropIn { to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.nav-menu .dropdown::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: rgba(20,10,30,.95);
}
.nav-menu .dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
}
.nav-menu .dropdown li { margin: 0; }
.nav-menu .dropdown li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: rgba(255,255,255,.85);
    font-size: 14px;
    white-space: nowrap;
    border-radius: 8px;
    transition: all .2s;
}
.nav-menu .dropdown li a::before {
    content: '·';
    font-weight: bold;
    font-size: 18px;
    line-height: 1;
    color: #f96c9f;
    opacity: .6;
    transition: opacity .2s, transform .2s;
}
.nav-menu .dropdown li a:hover { color: #f96c9f; background: rgba(249,108,159,.12); }
.nav-menu .dropdown li a:hover::before { opacity: 1; transform: scale(1.3); }

/* 滚动后二级导航变白 */
.header.scrolled .nav-menu .dropdown {
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(20px);
    box-shadow: 0 12px 40px rgba(0,0,0,.1), 0 0 0 1px rgba(0,0,0,.04);
}
.header.scrolled .nav-menu .dropdown::after {
    border-bottom-color: rgba(255,255,255,.97);
}
.header.scrolled .nav-menu .dropdown li a { color: #444; }
.header.scrolled .nav-menu .dropdown li a:hover { color: #f96c9f; background: linear-gradient(135deg, #fff0f5, #fce4ec); }

/* ==================== 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, #ff4d6d, #f96c9f);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    text-decoration: none;
    overflow: hidden;
    transition: all .3s;
    box-shadow: 0 4px 15px rgba(249,108,159,.45), 0 0 20px rgba(249,108,159,.2);
    animation: firePulse 2s ease-in-out infinite;
}
.btn-fire:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 25px rgba(249,108,159,.55), 0 0 35px rgba(249,108,159,.3);
}
.btn-fire::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50px;
    background: linear-gradient(135deg, #ff4d6d, #f96c9f, #ff4d6d);
    z-index: -1;
    animation: fireGlow 3s linear infinite;
    background-size: 200% 200%;
}
@keyframes firePulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(249,108,159,.45), 0 0 20px rgba(249,108,159,.2); }
    50% { box-shadow: 0 4px 20px rgba(249,108,159,.6), 0 0 30px rgba(249,108,159,.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: #f96c9f; }
.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; }
}
