/* ==========================================================================
   全站统一头部组件（Site Header）—— 唯一事实源
   包含：顶部信息栏 + Logo 标题区 + 故宫风主导航（含下拉 / 搜索 / 移动端汉堡）
   所有前台页面共用本文件 + /js/site-header.js，任何页面都不要再单独写导航。
   命名空间 tj- ：与各页面既有样式完全隔离，避免冲突。
   ========================================================================== */

.tj-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---------- 顶部信息栏 ---------- */
.tj-topbar { background: #2A2A2A; height: 32px; line-height: 32px; font-size: 12px; color: #B9B9B9; }
.tj-topbar .tj-wrap { display: flex; align-items: center; justify-content: space-between; }
.tj-topbar a { color: #B9B9B9; }
.tj-topbar a:hover { color: #D8C196; }
.tj-topbar-l { letter-spacing: 1px; }
.tj-topbar-r a { margin-left: 18px; }

/* ---------- Logo 标题区 ---------- */
.tj-logo-zone { background: #F8F5F0; padding: 26px 0 22px; }
.tj-logo-zone .tj-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.tj-logo { height: 72px; width: auto; max-width: 100%; object-fit: contain; }
.tj-site-name { margin: 12px 0 0; font-family: "STSongti-SC", "华文宋体", "SimSun", "宋体", serif; font-weight: 700; font-size: 40px; line-height: 1.25; letter-spacing: 10px; color: #1A1A1A; }
.tj-slogan-en { display: flex; align-items: center; gap: 16px; margin-top: 10px; font-family: "Times New Roman", Times, serif; text-transform: uppercase; font-size: 13px; letter-spacing: 6px; color: #B89A67; }
.tj-slogan-en::before, .tj-slogan-en::after { content: ""; width: 90px; height: 1px; background: #B89A67; opacity: .7; }

/* ---------- 主导航 ---------- */
.tj-nav { position: relative; z-index: 60; background: #F8F5F0; border-top: 1px solid #B89A67; border-bottom: 1px solid #B89A67; }
.tj-nav > .tj-wrap { position: relative; display: flex; align-items: center; justify-content: center; }
.tj-nav-list { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tj-nav-item { position: relative; }
.tj-nav-item > a { position: relative; display: block; padding: 0 22px; line-height: 52px; font-size: 16px; letter-spacing: 2px; color: #1A1A1A; text-decoration: none; transition: color .2s; }
.tj-nav-item > a::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 0; height: 3px; background: #9B2D26; transform: translateX(-50%); transition: width .25s; }
.tj-nav-item > a:hover, .tj-nav-item.active > a { color: #9B2D26; }
.tj-nav-item > a:hover::after, .tj-nav-item.active > a::after { width: 34px; }

/* 下拉子菜单 */
.tj-sub { position: absolute; top: 100%; left: 50%; min-width: 160px; padding: 6px 0; background: #F8F5F0; border: 1px solid #B89A67; box-shadow: 0 8px 20px rgba(0, 0, 0, .08); opacity: 0; visibility: hidden; transform: translateX(-50%) translateY(6px); transition: opacity .2s, transform .2s, visibility .2s; }
.tj-nav-item.has-sub:hover > .tj-sub { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.tj-sub a { display: block; padding: 9px 20px; font-size: 14px; letter-spacing: 1px; color: #1A1A1A; white-space: nowrap; text-decoration: none; transition: background .2s, color .2s; }
.tj-sub a:hover { background: #F3EFE7; color: #9B2D26; }

/* 搜索图标 & 汉堡按钮 */
.tj-search, .tj-toggle { position: absolute; top: 50%; transform: translateY(-50%); line-height: 1; cursor: pointer; }
.tj-search { right: 24px; display: flex; align-items: center; color: #4A4A4A; transition: color .2s; }
.tj-search:hover { color: #9B2D26; }
.tj-toggle { left: 16px; display: none; font-size: 24px; color: #9B2D26; }

/* 搜索弹层 */
.tj-search-box { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 999; display: none; align-items: flex-start; justify-content: center; padding-top: 18vh; background: rgba(26, 26, 26, .45); }
.tj-search-box.open { display: flex; }
.tj-search-panel { width: 90%; max-width: 560px; padding: 26px; background: #FFFDF9; border: 1px solid #B89A67; box-shadow: 0 20px 50px rgba(0, 0, 0, .2); }
.tj-search-panel h3 { margin: 0 0 16px; font-family: "STSongti-SC", "SimSun", serif; font-weight: 700; font-size: 20px; letter-spacing: 3px; color: #1A1A1A; }
.tj-search-panel form { display: flex; }
.tj-search-panel input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; font-size: 15px; color: #1A1A1A; background: #fff; border: 1px solid #D8D2C6; outline: none; }
.tj-search-panel input:focus { border-color: #B89A67; }
.tj-search-panel button { height: 44px; padding: 0 24px; font-size: 15px; letter-spacing: 2px; color: #fff; background: #9B2D26; border: 0; cursor: pointer; }
.tj-search-close { float: right; margin-top: -6px; font-size: 22px; line-height: 1; color: #9B9B9B; cursor: pointer; }
.tj-search-close:hover { color: #9B2D26; }

/* ---------- 响应式 ---------- */
@media (max-width: 1000px) {
  .tj-nav > .tj-wrap { justify-content: flex-start; }
  .tj-toggle { display: block; }
  .tj-nav-list { position: absolute; top: 100%; left: 0; right: 0; display: none; flex-direction: column; align-items: stretch; gap: 0; padding: 6px 0; background: #F8F5F0; border-bottom: 1px solid #B89A67; box-shadow: 0 10px 20px rgba(0, 0, 0, .08); }
  .tj-nav-list.open { display: flex; }
  .tj-nav-item > a { padding: 0 20px; line-height: 48px; }
  .tj-nav-item > a::after { display: none; }
  .tj-nav-item.active > a { background: #F3EFE7; }
  .tj-sub { position: static; display: none; padding: 0; border: 0; border-top: 1px dashed #DDD8CE; box-shadow: none; opacity: 1; visibility: visible; transform: none; }
  .tj-nav-item.open > .tj-sub { display: block; }
  .tj-sub a { padding: 12px 40px; }
  .tj-logo { height: 58px; }
  .tj-site-name { font-size: 26px; letter-spacing: 4px; }
  .tj-slogan-en { font-size: 11px; letter-spacing: 3px; }
  .tj-slogan-en::before, .tj-slogan-en::after { width: 40px; }
  .tj-search { right: 16px; }
}

@media (max-width: 480px) {
  .tj-topbar { display: none; }
  .tj-logo-zone { padding: 18px 0 14px; }
  .tj-logo { height: 50px; }
  .tj-site-name { font-size: 21px; letter-spacing: 2px; }
  .tj-slogan-en { letter-spacing: 2px; }
  .tj-slogan-en::before, .tj-slogan-en::after { width: 22px; }
  .tj-toggle { left: 6px; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; }
  .tj-nav-item > a { padding: 0 16px; font-size: 15px; line-height: 44px; }
  .tj-search { right: 10px; width: 44px; height: 44px; justify-content: center; }
}
