/**
 * ============================================================
 *  header.css · 顶栏 / Mega Menu / 页脚 / 浮条
 * ============================================================
 */

/* ---------- 顶栏 ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--jpy-header-h);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: background 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.site-header.is-scrolled {
  background: #fff;
  box-shadow: 0 6px 24px rgba(9, 15, 38, 0.06);
  border-bottom-color: var(--jpy-line);
}

.site-header.is-transparent {
  background: transparent;
  border-bottom-color: transparent;
}

.site-header.is-transparent .nav-link,
.site-header.is-transparent .logo-text {
  color: #fff;
}

.site-header.is-transparent .header-tel {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

.site-header.is-transparent .menu-toggle span {
  background: #fff;
}

.site-header.is-transparent.is-scrolled {
  background: #fff;
}

.site-header.is-transparent.is-open {
  background: rgba(5, 9, 22, 0.98);
}

.site-header.is-transparent.is-scrolled .nav-link,
.site-header.is-transparent.is-scrolled .logo-text,
.site-header.is-transparent.is-scrolled .header-tel {
  color: var(--jpy-text);
}

.site-header.is-transparent.is-open .nav-link,
.site-header.is-transparent.is-open .logo-text,
.site-header.is-transparent.is-open .header-tel {
  color: #eef4ff;
}

.site-header.is-transparent.is-scrolled .header-tel {
  border-color: var(--jpy-line);
}

.site-header.is-transparent.is-open .header-tel {
  border-color: rgba(255, 255, 255, 0.28);
}

.site-header.is-transparent.is-scrolled .menu-toggle span {
  background: var(--jpy-text);
}

.site-header.is-transparent.is-open .menu-toggle span {
  background: #fff;
}

.header-inner {
  height: var(--jpy-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  line-height: 0;
}

/* 横版完整 Logo（含图标+文字），避免方框裁切 */
.logo-img {
  display: block;
  height: 42px;
  width: auto;
  max-width: 210px;
  object-fit: contain;
  object-position: left center;
}

/* 兼容旧结构 */
.logo-mark {
  display: none;
}

.logo-text {
  display: none;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 10px 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--jpy-text);
  white-space: nowrap;
}

.nav-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.55;
  transition: transform 0.25s;
}

.nav-item:hover .nav-caret {
  transform: rotate(180deg);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background-image: var(--jpy-grad-primary);
  transform: scaleX(0);
  transition: transform 0.3s;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--jpy-primary);
}

.nav-link:hover::after,
.nav-link.is-active::after {
  transform: scaleX(1);
}

/* ---------- Mega Menu ---------- */
.mega-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: 640px;
  padding: 20px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(9, 15, 38, 0.12);
  border: 1px solid var(--jpy-line);
  opacity: 0;
  visibility: hidden;
  transition: all 0.28s ease;
  z-index: 20;
}

.nav-item:hover .mega-panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.mega-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mega-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: #f8fafc;
  transition: all 0.25s;
}

.mega-card:hover {
  background: rgba(30, 82, 255, 0.06);
  transform: translateY(-2px);
}

.mega-card img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  background: #0a0f26;
  flex-shrink: 0;
}

.mega-card strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--jpy-dark);
  margin-bottom: 2px;
}

.mega-card span {
  font-size: 12px;
  color: var(--jpy-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

@media (max-width: 1280px) {
  .header-tel {
    display: none;
  }
  .nav-link {
    padding: 10px 8px;
    font-size: 13px;
  }
  .logo-img {
    height: 32px;
    max-width: 150px;
  }
}

.header-tel {
  font-size: 14px;
  font-weight: 600;
  color: var(--jpy-text);
  border: 1px solid var(--jpy-line);
  padding: 8px 16px;
  border-radius: 40px;
}

.header-tel:hover {
  color: var(--jpy-primary);
  border-color: var(--jpy-primary);
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 20px;
  border-radius: 40px;
  font-size: 14px;
  font-weight: 700;
  color: #fff !important;
  background-image: var(--jpy-grad-primary);
  box-shadow: 0 6px 16px rgba(30, 82, 255, 0.25);
  transition: all 0.3s;
}

.btn-cta:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 10px 22px rgba(30, 82, 255, 0.32);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 10px;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  z-index: 1002;
}

.menu-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--jpy-text);
  border-radius: 2px;
  transition: transform 0.35s cubic-bezier(.22, 1, .36, 1), opacity 0.25s ease;
}

.site-header.is-open .menu-toggle span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.site-header.is-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}
.site-header.is-open .menu-toggle span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

body.nav-open {
  overflow: hidden;
}

/* 打开时顶栏拉满视口：避免 backdrop-filter 把 fixed 菜单裁成一条 */
.site-header.is-open {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  backdrop-filter: none;
}

.nav-mobile {
  position: absolute;
  top: var(--jpy-header-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  padding: 8px 6% 28px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border-bottom: 0;
  box-shadow: none;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.32s cubic-bezier(.22, 1, .36, 1),
    visibility 0.32s;
}

.site-header.is-open .nav-mobile {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.nav-mobile a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px;
  border-bottom: 1px solid rgba(20, 33, 58, 0.08);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--jpy-text);
  opacity: 0;
  transform: translateY(12px);
  transition:
    color 0.25s ease,
    background 0.25s ease,
    opacity 0.36s cubic-bezier(.22, 1, .36, 1),
    transform 0.36s cubic-bezier(.22, 1, .36, 1);
}

.site-header.is-open .nav-mobile a {
  opacity: 1;
  transform: translateY(0);
}

.site-header.is-open .nav-mobile a:nth-child(1) { transition-delay: 0.04s; }
.site-header.is-open .nav-mobile a:nth-child(2) { transition-delay: 0.07s; }
.site-header.is-open .nav-mobile a:nth-child(3) { transition-delay: 0.1s; }
.site-header.is-open .nav-mobile a:nth-child(4) { transition-delay: 0.13s; }
.site-header.is-open .nav-mobile a:nth-child(5) { transition-delay: 0.16s; }
.site-header.is-open .nav-mobile a:nth-child(6) { transition-delay: 0.19s; }
.site-header.is-open .nav-mobile a:nth-child(7) { transition-delay: 0.22s; }
.site-header.is-open .nav-mobile a:nth-child(8) { transition-delay: 0.25s; }
.site-header.is-open .nav-mobile a:nth-child(9) { transition-delay: 0.28s; }
.site-header.is-open .nav-mobile a:nth-child(10) { transition-delay: 0.31s; }
.site-header.is-open .nav-mobile a:nth-child(11) { transition-delay: 0.34s; }
.site-header.is-open .nav-mobile a:nth-child(12) { transition-delay: 0.37s; }

.nav-mobile a:not(.mobile-cta)::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-top: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.28;
  transition: opacity 0.25s, transform 0.25s;
}

.nav-mobile a:not(.mobile-cta):hover::after,
.nav-mobile a.is-active:not(.mobile-cta)::after {
  opacity: 0.7;
  transform: rotate(45deg) translate(1px, -1px);
}

.nav-mobile a.is-active {
  color: var(--jpy-primary);
}

.nav-mobile .mobile-cta {
  margin-top: auto;
  margin-bottom: 8px;
  padding: 15px 18px;
  border: 0;
  border-radius: 10px;
  text-align: center;
  justify-content: center;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 12px 28px rgba(21, 94, 239, 0.28);
}

.nav-mobile .mobile-cta::after {
  content: none;
}

/* 列表里的「联系我们」与底部按钮重复时隐藏列表项 */
.nav-mobile > a:not(.mobile-cta)[href*="contact"] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .nav-mobile,
  .nav-mobile a,
  .menu-toggle span {
    transition: none !important;
  }
  .site-header.is-open .nav-mobile a {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 页脚 ---------- */
.site-footer {
  background: var(--jpy-dark);
  color: #fff;
}

.footer-nav-bar {
  background: #121833;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 16px 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

.footer-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-nav-links a {
  color: rgba(255, 255, 255, 0.7);
}

.footer-nav-links a:hover {
  color: var(--jpy-secondary);
}

.footer-main {
  padding-top: 56px;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand .footer-logo {
  display: inline-block;
  margin-bottom: 18px;
  line-height: 0;
}

.footer-brand .logo-img {
  height: 44px;
  max-width: 220px;
}

.footer-brand h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  line-height: 1.8;
}

.footer-phone {
  display: inline-block;
  margin-top: 18px;
  font-size: 28px;
  font-weight: 800;
  color: var(--jpy-secondary);
  letter-spacing: 0.5px;
}

.footer-col h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
}

.footer-col a,
.footer-col li {
  display: block;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  line-height: 2.2;
}

.footer-col a:hover {
  color: var(--jpy-secondary);
}

/* 桌面：业务入口 / 探索 仍占两列；移动端合并 */
.footer-nav-merge {
  display: contents;
}
.footer-col-biz .title-mobile {
  display: none;
}

/* 页脚微信二维码样式已停用（HTML 已移除，咨询改由右侧 fixed-side 浮标承担） */

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 24px 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.35);
}

.footer-bottom a:hover {
  color: #fff;
}

/* ---------- 左侧咨询浮条（旧版，可隐藏） ---------- */
.float-consult {
  position: fixed;
  left: 0;
  top: 42%;
  z-index: 950;
  width: 56px;
  padding: 12px 6px;
  background: linear-gradient(180deg, #1e52ff, #0937da);
  color: #fff;
  border-radius: 0 12px 12px 0;
  box-shadow: 6px 8px 24px rgba(30, 82, 255, 0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  writing-mode: horizontal-tb;
  transition: transform 0.25s, width 0.25s;
}

.float-consult img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}

.float-consult span {
  writing-mode: vertical-rl;
  letter-spacing: 2px;
}

.float-consult:hover {
  transform: translateX(2px);
}

/* ---------- 右侧固定浮条 ---------- */
.fixed-side {
  position: fixed;
  right: 20px;
  bottom: 36px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.fixed-side-panel {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 20px;
  box-shadow: none;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

/* Hover 时，面板变成一个完整的白底圆角框 */
.fixed-side:hover .fixed-side-panel,
.fixed-side:focus-within .fixed-side-panel {
  padding: 10px;
  background: #fff;
  border-color: rgba(21, 94, 239, 0.12);
  box-shadow: 0 16px 44px rgba(21, 94, 239, 0.18);
}

/* 左侧展开层：默认收起，hover 时向左滑出 */
.fixed-side-expand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateX(12px);
  transition: max-width 0.35s cubic-bezier(0.25, 1, 0.5, 1),
              opacity 0.28s ease,
              transform 0.35s cubic-bezier(0.25, 1, 0.5, 1),
              margin-right 0.35s ease;
  margin-right: 0;
  pointer-events: none;
}

.fixed-side:hover .fixed-side-expand,
.fixed-side:focus-within .fixed-side-expand {
  max-width: 148px;
  opacity: 1;
  transform: translateX(0);
  margin-right: 12px;
  pointer-events: auto;
}

.fixed-side-expand-inner {
  width: 128px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.fixed-expand-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  white-space: nowrap;
}

.fixed-qr-box {
  width: 112px;
  height: 112px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e8eef6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
  box-sizing: border-box;
}

.fixed-qr-box .footer-qr-placeholder {
  font-size: 12px;
  font-weight: 600;
  color: #98a2b3;
}

.fixed-phone-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  min-height: 40px;
  padding: 8px 10px;
  box-sizing: border-box;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e8eef6;
  font-size: 13px;
  font-weight: 750;
  color: #10203c;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.fixed-phone-box:hover {
  color: var(--jpy-primary);
  border-color: rgba(21, 94, 239, 0.28);
  background: #f0f5ff;
}

.fixed-side-icons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
  align-items: center;
}

/* 按钮默认样式：独立的悬浮圆圈 */
.fixed-side-btn {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50% !important;
  border: 1px solid rgba(21, 94, 239, 0.12) !important;
  background: #fff !important;
  color: var(--jpy-primary) !important;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  padding: 0 !important;
  box-shadow: 0 4px 14px rgba(21, 48, 87, 0.06);
  transition: background 0.25s ease,
              color 0.25s ease,
              transform 0.25s ease,
              box-shadow 0.25s ease,
              border-color 0.25s ease !important;
  text-decoration: none;
}

/* Hover 状态下，按钮融入白底圆角框 */
.fixed-side:hover .fixed-side-btn {
  box-shadow: none !important;
  border-color: transparent !important;
  background: #f8fafc !important;
  color: #60708b !important;
}

/* 按钮在面板展开后的单独 hover 状态 */
.fixed-side:hover .fixed-side-btn:hover,
.fixed-side-btn:hover {
  background: var(--jpy-primary) !important;
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(21, 94, 239, 0.28) !important;
}

.fixed-side-btn iconify-icon {
  font-size: 20px;
}

.fixed-side a,
.fixed-side button {
  overflow: visible;
}

.fixed-side > .back-top {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(21, 94, 239, 0.12);
  background: #fff;
  box-shadow: 0 10px 30px rgba(9, 15, 38, 0.08);
  color: var(--jpy-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
}

.fixed-side > .back-top:hover {
  color: #fff;
  background: var(--jpy-primary);
  transform: translateY(-2px);
}

.back-top.is-show {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 1100px) {
  .nav-desktop {
    display: none;
  }
  .header-actions .header-tel {
    display: none;
  }
  .menu-toggle {
    display: flex;
  }
  .float-consult {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-mobile,
  .nav-mobile a,
  .menu-toggle span {
    transition: none !important;
  }
  .site-header.is-open .nav-mobile a {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 992px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
  }
  .footer-nav-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .footer-top {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  /* 移动端：业务入口 + 探索金品云 合并为「网站导航」两列链接 */
  .footer-nav-merge {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 20px;
    row-gap: 0;
    padding: 4px 0 8px;
  }
  .footer-nav-merge .footer-col {
    display: contents;
  }
  .footer-nav-merge .footer-col-biz h4 {
    grid-column: 1 / -1;
    margin-bottom: 14px;
  }
  .footer-nav-merge .footer-col-biz .title-desktop {
    display: none;
  }
  .footer-nav-merge .footer-col-biz .title-mobile {
    display: inline;
  }
  .footer-nav-merge .footer-col-explore h4 {
    display: none;
  }
  .footer-nav-merge a {
    line-height: 2.1;
  }
}
