/* ============================================================
   项策头部导航 —— 子页专用
   与首页（xc-assets/style.css）头部区域保持完全一致
   ============================================================ */

:root {
  --orange: #ff6a00;
  --orange-dark: #e55a00;
  --orange-darker: #c44d00;
  --orange-light: #fff3ea;
  --orange-soft: #ffe9d6;

  --ink: #1d1d1f;
  --ink-2: #42464d;
  --gray: #6e7378;
  --gray-2: #9aa0a6;
  --line: #ededf0;
  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --bg-dark: #14161a;

  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;

  --container: 1200px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 2px 10px rgba(20, 22, 26, 0.06);
  --shadow: 0 12px 32px rgba(20, 22, 26, 0.10);
  --shadow-orange: 0 14px 34px rgba(255, 106, 0, 0.28);
  --header-h: 80px;
}

.header-space {
  height: var(--header-h);
  display: block;
}

.header,
.header *,
.header *::before,
.header *::after {
  box-sizing: border-box;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 1000;
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid transparent;
  transition: all 0.3s ease;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.header.scrolled {
  background: #ffffff;
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

/* 容器：覆盖主题默认 .container */
.header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* Logo 区域 */
.header .site-branding {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  float: none;
  text-align: left;
}
.header .site-branding .custom-logo-link,
.header .site-branding .logo-img {
  display: flex;
  align-items: center;
}
.header .site-branding .custom-logo-link img,
.header .site-branding .logo-img img {
  display: block;
  max-height: 50px;
  max-width: 168px;
  width: auto;
  object-fit: contain;
  margin: 0;
}

.header .site-tagline {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.35;
  color: var(--gray);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* 右侧：菜单 + 电话 */
.header .nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.header .nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.header .nav-item {
  position: relative;
}

.header .nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
  background: transparent;
}
.header .nav-links a:hover {
  color: var(--orange);
  background: var(--orange-light);
}

.header .nav-links > .nav-item.active > a {
  color: var(--orange);
  font-weight: 700;
}

/* 下拉箭头 */
.header .caret {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.6;
  transition: transform 0.2s ease, opacity 0.2s ease;
  pointer-events: none;
}
.header .nav-item.has-dropdown:hover > a .caret {
  opacity: 1;
  transform: rotate(180deg);
}

/* 下拉面板 */
.header .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 232px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 200;
}
.header .nav-item.has-dropdown:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.header .sub-menu .sub-item {
  position: relative;
}
.header .sub-menu .sub-item > a {
  display: block;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  transition: all 0.18s ease;
  text-decoration: none;
}
.header .sub-menu .sub-item > a:hover {
  background: var(--orange-light);
  color: var(--orange);
}

/* 二级嵌套：右侧展开 */
.header .sub-menu .has-dropdown {
  position: relative;
}
.header .sub-menu .has-dropdown::after {
  content: '';
  position: absolute;
  top: 0;
  right: -6px;
  width: 6px;
  height: 100%;
  background: transparent;
  z-index: 1;
}
.header .sub-menu .sub-menu {
  top: -8px;
  left: 100%;
  margin-left: 6px;
}
.header .sub-menu .has-dropdown:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.header .sub-menu .has-dropdown > a .caret {
  transform: rotate(-90deg);
}

/* 移动端汉堡按钮 */
.header .nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.header .nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: 0.3s;
}

/* 电话按钮 */
.header .nav-phone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border-radius: 8px;
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(255, 106, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
}
.header .nav-phone:hover {
  transform: translateY(-2px);
  background: var(--orange-dark);
  box-shadow: 0 12px 28px rgba(255, 106, 0, 0.38);
  color: #fff;
}

/* WP 登录管理条偏移 */
.logged-in .header {
  top: 32px;
}

/* 平板/手机端 */
@media (max-width: 960px) {
  .header .nav-links {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 16px 24px 24px;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: 0.25s;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
  .header .nav-links.open {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }
  .header .nav-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 13px 14px;
  }
  .header .caret {
    pointer-events: auto;
    margin-left: auto;
    padding: 9px 11px;
    background: var(--orange-light);
    border-radius: 8px;
    flex-shrink: 0;
  }
  .header .nav-toggle {
    display: flex;
    flex-shrink: 0;
  }
  .header .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--line);
    min-width: 0;
    margin: 2px 0 6px 8px;
    padding: 2px 0 2px 12px;
    display: none;
  }
  .header .nav-item.has-dropdown.open > .sub-menu,
  .header .sub-item.has-dropdown.open > .sub-menu {
    display: block;
  }
  .header .sub-menu .sub-menu {
    top: auto;
    left: auto;
    margin-left: 10px;
  }
  .header .nav-phone {
    padding: 9px 14px;
    font-size: 13.5px;
    border-radius: 7px;
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: 60px;
  }
  .header .site-tagline {
    display: none;
  }
  .header .site-branding .custom-logo-link img,
  .header .site-branding .logo-img img {
    max-height: 42px;
    max-width: 140px;
  }
}

@media (max-width: 480px) {
  .header .site-branding .custom-logo-link img,
  .header .site-branding .logo-img img {
    max-height: 31px;
    max-width: 105px;
  }
  .header .nav-phone {
    padding: 8px 10px;
    font-size: 12.5px;
  }
  .header .nav-links {
    padding: 14px 16px 20px;
  }
}

@media (max-width: 782px) {
  .logged-in .header {
    top: 46px;
  }
}
