/**
 * header.css - 公共头部组件样式
 */

/* --- 变量与基础重置 --- */
:root {
    --primary-red: #a71e1b;
    --bright-red: #e63e2e;
    --text-dark: #333333;
    --bg-blue: #0b1f3a;
    --bg-light: #f5f5f5;
    --accent-gold: #fdb933;
}

/* 防止下拉菜单导致页面出现滚动条 */
html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
}

.header-component-wrapper * { box-sizing: border-box; margin: 0; padding: 0; }
.header-component-wrapper ul { list-style: none; }
.header-component-wrapper a { text-decoration: none; color: inherit; transition: opacity 0.3s; }

/* 注意：这里保留基础 hover 效果，但会在下方通过更具体的权重覆盖它 */
.header-component-wrapper .main-nav > li > a:hover { opacity: 0.8; } 

.header-component-wrapper { line-height: 1.6; color: var(--text-dark); position: relative; }

/* ================= 搜索栏样式 ================= */
.header-search-bar {
    position: absolute;
    top: 60px; /* 统一调整为 60px，与 index 保持一致，同时也起到上移的效果 */
    left: 0;
    width: 100%;
    height: 213px;
    background-color: rgba(31, 31, 31, 0.9); /* 改为黑色背景 */
    z-index: 100; /* 低于 Header (100) 但高于其他内容 */
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* 移除之前的 media query，使用固定高度 */

.header-search-bar .search-container {
    width: 60%;
    max-width: 800px;
    position: relative;
    border-bottom: 2px solid #a71e1b; /* 改为红色下划线 (header red) */
}

.header-search-bar .search-input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 18px;
    font-style: italic;
    padding: 10px 40px 10px 0;
    outline: none;
    color: #fff; /* 改为白色文字 */
    font-family: inherit;
}

.header-search-bar .search-input::placeholder {
    color: #ccc; /* 浅灰色 placeholder */
    font-style: italic;
}

.header-search-bar .search-submit {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 20px;
    color: #ffffff; /* 改为红色图标 */
}

.header-search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.header-search-toggle .icon-close {
    font-size: 24px;
    color: #fff; /* 确保是白色 */
}


/* 通用容器 */
.header-component-wrapper .container {
    width: 72vw;
    margin: 0 auto;
    position: relative;
    height: 100%; 
}

/* --- 1. 顶部导航 Header --- */
.header {
    background-color: var(--primary-red);
    height: 9vw;
    min-height: 100px;
    color: #fff;
    display: flex;
    align-items: center;
    position: relative; 
    z-index: 100;
}

.header .container {
    display: flex;
    align-items: center;
    position: static; 
    height: 100%;
    padding: 0; /* 防止页面CSS中的.container padding影响header */
}

/* === Logo === */
.logo {
    display: flex;
    align-items: center; 
    height: 100%;
    flex-shrink: 0; 
    margin-right: 20px; 
}
.logo img { max-height: 80px; width: auto; }

/* === 主导航 === */
.main-nav { 
    flex: 8; 
    display: flex; 
    font-size: 18px; 
    height: 100%;
    align-items: center; 
    position: static; 
}

.main-nav > li {
    flex: 1;             
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    position: static; 
}

.main-nav > li > a { 
    color: #ffffff; 
    display: inline-block;
    line-height: 1.5;
    border-bottom: 3px solid transparent; 
    padding: 10px 0;
    
    /* 【修复关键点 1】 */
    /* 不要使用 'all'。只对颜色和边框进行过渡，禁止对 font-weight 进行过渡 */
    /* 这样字体加粗时是瞬间完成的，不会产生重影模糊 */
    transition: opacity 0.3s, border-bottom 0.3s;
}

/* 选中状态 */
.main-nav > li.active > a { border-bottom: 3px solid white; font-weight: bold; }

/* 【修复关键点 2】 */
/* 鼠标悬浮一级标题：加粗 + 下划线 + 强制不透明 */
/* 增加了 .header-component-wrapper 前缀以提高权重，并使用了 !important 确保覆盖顶部的 opacity: 0.8 */
.header-component-wrapper .main-nav > li:hover > a {
    font-weight: bold;
    border-bottom: 3px solid white;
    opacity: 1 !important; /* 强制完全不透明，解决发白/发粉/发虚的问题 */
}

/* === 二级菜单 (全屏宽度处理) === */
.dropdown-layer {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.75);
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 99;
}

.main-nav > li:hover .dropdown-layer {
    display: block;
    opacity: 1;
}

.dropdown-content {
    display: flex;
    justify-content: center; 
    align-items: center;
    color: #fff;
    font-size: 14px;
    height: 100%;
    width: 100%;
}

.submenu-item {
    cursor: pointer;
    padding: 0 40px;
    height: 100%;
    display: flex;
    align-items: center;
    transition: all 0.3s;
    color: #fff;
}

.submenu-item:hover {
    background-color: var(--accent-gold);
    color: #000;
    font-weight: bold;
}

.submenu-divider {
    width: 1px;
    height: 20px;
    background: #fff;
    opacity: 1;
    transition: opacity 0.3s;
}

.submenu-item:hover + .submenu-divider,
.submenu-divider:has(+ .submenu-item:hover) {
    opacity: 0;
}

/* === 右侧工具栏 === */
.header-tools { 
    flex: 2; 
    position: static; 
    display: flex; 
    align-items: flex-start; 
    padding-top: 25px; 
    justify-content: flex-start; 
    padding-left: 20px; 
    gap: 30px; 
    height: 100%;
    min-width: 80px; 
}

.search-icon { 
    cursor: pointer; 
    width: 20px; 
    height: auto;
    display: block;
    filter: brightness(0) invert(1);
    margin-top: 2px; 
}

.lang-btn { 
    border: 1px solid #fff; 
    padding: 4px 8px; 
    font-size: 13px; 
    border-radius: 2px; 
    line-height: 1; 
    white-space: nowrap;
    color: #fff;
}

/* --- 2. Banner --- */
.banner {
    height: 350px;
    background: url('../img/header_bg1.png') center center no-repeat;
    background-size: cover; 
    position: relative; 
    z-index: 1;
    display: flex;
    align-items: center;
}

/* Banner 文字区域容器 */
.banner-text-container {
    width: 72vw;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
}

/* 标题组 */
.banner-title-group {
    display: flex;
    align-items: center;
    height: 50px;
    transform: translateY(20px);
}

/* 红线 */
.banner-red-line {
    width: 6px; 
    height: 100%;
    background-color: #d93826; 
    margin-right: 25px; 
}

/* 文字 */
.banner-main-title {
    color: #fff;
    font-size: 45px;
    font-weight: normal;
    letter-spacing: 4px; 
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* --- 面包屑 --- */
.breadcrumb { padding: 20px 0; font-size: 13px; color: #000000; }
.breadcrumb a { color: #000000; }
.breadcrumb a:hover { text-decoration: underline; }

