/* ============================================
   Home Header Styles
   ============================================ */

/* Home Header - Transparent by default */
.home-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: transparent;

  transition: background 0.2s ease, box-shadow 0.3s ease;
}

/* Home Header - Scrolled state (white background) */
.home-header.scrolled {
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* Header Inner Container */
.home-header .header-inner {
  display: flex;
  align-items: center;
  width: 94.8%;
  height: var(--header-height);
  margin: 0 auto;
  justify-content: space-between;
}

/* Logo */
.home-header .header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  height: 40px;
}

.home-header .header-logo img {
  height: 100%;
  width: auto;
}

/* Nav */
.home-header .nav {
  display: flex;
  align-items: center;
  gap: 80px;
  font-size: 16px;
  font-weight: 500;
}

/* Nav Item */
.home-header .nav-item {
  position: relative;
  padding: 8px 0;
  color: #fff;
  transition: color 0.3s ease;
  cursor: pointer;
  text-decoration: none;
}

.home-header .nav-item:hover,
.home-header .nav-item.active {
  color: #c9151e;
}

.home-header .nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #c9151e;
}

/* Dropdown */
.home-header .nav-dropdown {
  position: absolute;
  top: 100%;
  left: -18px;
  /* left: 50%; */
  /* transform: translateX(-50%); */
  padding-top: 16px;
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

.home-header .nav-item:hover .nav-dropdown {
  visibility: visible;
  opacity: 1;
}

.home-header .nav-dropdown-menu {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  border: 1px solid #f0f0f0;
  padding: 8px 0;
  min-width: 180px;
}

.home-header .nav-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  color: #333 !important;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
}

.home-header .nav-dropdown-item:hover {
  background: var(--primary-alpha-10);
  color: #c9151e !important;
}

.home-header .nav-dropdown-item.active {
  background: var(--primary-alpha-10);
  color: #c9151e !important;
  font-weight: 500;
}

/* Dropdown Sub */
.home-header .nav-submenu {
  position: absolute;
  top: 0;
  left: 100%;
  padding-left: 8px;
  display: none;
  padding-top: 16px;
}

.home-header .nav-dropdown-sub:hover .nav-submenu {
  display: block;
}

.home-header .nav-submenu-menu {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  border: 1px solid #f0f0f0;
  padding: 8px 0;
  min-width: 140px;
}

/* ============================================
   Right Section (Search, Language, Accessibility)
   ============================================ */
.home-header__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Search Button */
.home-header__search-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.home-header__search-btn:hover {
  opacity: 0.7;
}

.home-header__search-btn img {
  height: 26px;
}

/* Language Toggle */
.home-header__lang-toggle {
  display: flex;
  align-items: center;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.home-header__lang-option {
  padding: 4px 12px;
  font-size: 12px;
  color: rgba(196, 5, 10, 1);
  cursor: pointer;
  border-radius: 16px;
  transition: all 0.3s ease;
}

.home-header__lang-option.active {
  background: rgba(196, 5, 10, 1);
  color: #fff;
}

.home-header__lang-option:hover:not(.active) {
  color: #c9151e;
}

/* Accessibility Button */
.home-header__accessibility-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid transparent;
  border-radius: 20px;
  color: rgba(196, 5, 10, 1);
  font-weight: bold;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.home-header__accessibility-btn:hover {
  background: rgba(196, 5, 10, 0.1);
  border-color: rgba(196, 5, 10, 1);
}

.home-header__accessibility-btn img {
  width: 16px;
  height: 16px;
}

@media(max-width: 1200px) {
  .home-header .nav {
    gap: 40px;
  }
}

@media (max-width: 991px) {
  body {
    overflow-x: hidden;
    padding-top: 60px;
  }

  /* Hide PC header on mobile */
  .home-header {
    display: none;
  }

  /* Show new mobile header on mobile */
  .mobile-header {
    display: block;
  }
}

@media (min-width: 992px) {

  /* Hide new mobile header on desktop */
  .mobile-header {
    display: none;
  }

  .mobile-nav {
    display: none !important;
  }

  .mobile-nav-overlay {
    display: none !important;
  }
}

/* ============================================
   Scrolled State (dark background)
   ============================================ */
.home-header.scrolled .nav-item {
  color: #333;
}

.home-header.scrolled .home-header__search-btn {
  opacity: 0.8;
}

.home-header.scrolled .home-header__search-btn:hover {
  opacity: 1;
}

.home-header.scrolled .home-header__lang-toggle {
  color: rgba(196, 5, 10, 0.9);
  background: #f9e6e6;
}

.home-header.scrolled .home-header__lang-option {
  color: rgba(196, 5, 10, 1);
}

.home-header.scrolled .home-header__lang-option.active {
  background: rgba(196, 5, 10, 1);
  color: #fff;
}

.home-header.scrolled .home-header__lang-option:hover:not(.active) {
  color: rgba(196, 5, 10, 1);
}

.home-header.scrolled .home-header__accessibility-btn {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-color: rgba(196, 5, 10, 0.3);
  box-shadow: none;
  color: rgba(196, 5, 10, 1);
}

.home-header.scrolled .home-header__accessibility-btn:hover {
  background: rgba(196, 5, 10, 0.1);
  border-color: rgba(196, 5, 10, 1);
}

/* ============================================
   Header Styles (merged from header.css)
   ============================================ */

/* 顶部栏 */
.topbar {
  background: var(--bg-gray);
  font-size: 14px;
  color: var(--text-muted);
  height: var(--topbar-height);
}

.topbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.topbar-link {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.topbar-link:hover {
  color: var(--primary);
}

.topbar-phone {
  color: var(--primary);
  font-weight: bold;
}

/* 主头部 */
.header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  height: 40px;
}

.header-logo img {
  height: 100%;
  width: auto;
}

/* 导航 */
.nav {
  display: none;
  align-items: center;
  gap: 40px;
  font-size: 15px;
  font-weight: 500;
}

.nav-item {
  position: relative;
  padding: var(--space-sm) 0;
  color: var(--text-main);
  transition: color var(--transition-fast);
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  color: var(--primary);
}

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

.nav-item:hover .nav-dropdown {
  visibility: visible;
  opacity: 1;
}

.nav-dropdown-menu {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  padding: var(--space-sm) 0;
  min-width: 180px;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space);
  color: var(--text-main) !important;
  transition: all var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
}

.nav-dropdown-item:hover {
  background: var(--primary-alpha-10);
  color: var(--primary) !important;
}

.nav-dropdown-item.active {
  background: var(--primary-alpha-10);
  color: var(--primary) !important;
  font-weight: 500;
}

/* 子菜单 */
.nav-submenu {
  position: absolute;
  top: 0;
  left: 100%;
  padding-left: var(--space-sm);
  display: none;
  padding-top: 16px;
}

.nav-dropdown-sub:hover .nav-submenu {
  display: block;
}

.nav-submenu-menu {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  padding: var(--space-sm) 0;
  min-width: 140px;
}

/* 搜索框 */
.search-box {
  position: relative;
  display: none;
}

@media (min-width: 992px) {
  .search-box {
    display: flex;
  }
}

/* 桌面端显示，移动端隐藏 */
.desktop-only {
  display: none;
}

@media (min-width: 992px) {
  .desktop-only {
    display: flex;
    align-items: center;
  }
}

.search-input {
  width: 200px;
  height: 32px;
  padding: 0 32px 0 var(--space);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  font-size: 14px;
  outline: none;
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: var(--primary);
}

.search-icon {
  position: absolute;
  right: 10px;
  color: var(--text-light);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.search-icon:hover {
  color: var(--primary);
}

.search-dropdown {
  position: absolute;
  top: 120%;
  left: 0;
  width: 100%;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  z-index: 100;
}

.search-dropdown.show {
  display: flex;
}

/* 移动端搜索栏 */
#mobile-search-bar {
  display: none;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
}

.mobile-search-close {
  padding: var(--space-xs);
  color: var(--text-muted);
  cursor: pointer;
}

.mobile-search-container {
  position: relative;
  flex: 1;
}

.mobile-search-input {
  width: 100%;
  height: 32px;
  padding: 0 36px 0 var(--space);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  font-size: 14px;
  outline: none;
}

.mobile-search-submit {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  cursor: pointer;
}

.mobile-search-dropdown {
  position: absolute;
  top: 120%;
  left: 0;
  width: 100%;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 240px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  z-index: 100;
}

.mobile-search-dropdown.show {
  display: flex;
}

/* 悬浮导航 */
.floating-nav {
  position: fixed;
  right: 24px;
  bottom: 128px;
  z-index: 50;
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 72px;
}

.floating-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* gap: 6px; */
  width: 100%;
  padding: var(--space-sm);
  border-radius: var(--radius-xl);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.floating-nav>.floating-nav-btn:nth-of-type(1) {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  padding-top: 20px;
}

.floating-nav>.floating-nav-sub .floating-nav-btn {
  border-radius: 0;
}

.floating-nav a.floating-nav-btn {
  padding-top: 0 !important;
  padding-bottom: 20px;
  border-bottom-left-radius: var(--radius-xl) !important;
  border-bottom-right-radius: var(--radius-xl) !important;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.floating-nav-btn:hover {
  /* background: var(--border-dark); */
  background: var(--bg-gray);
}

.floating-nav-btn img {
  height: 30px;
  transition: transform var(--transition-fast);
}

.floating-nav-btn svg {
  color: var(--primary);
  font-size: 24px;
}

.floating-nav-btn:hover img {
  transform: scale(1.1);
}

.floating-nav-btn:hover svg {
  transform: scale(1.1);
}

.floating-nav-btn span {
  text-align: center;
  white-space: nowrap;
}

.floating-nav-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fbeeee;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.floating-nav-icon img {
  height: 24px;
  width: 24px;
  object-fit: contain;
}

.floating-nav-label {
  font-size: 13px;
  font-weight: 600;
}

.floating-nav-desc {
  font-size: 11px;
  color: var(--text-light);
}

.floating-nav-divider {
  width: 44px;
  height: 5px;
  background: url('../images/r_line.png') no-repeat center;
  background-size: contain;
  margin: var(--space-xs) 0;
}

/* 悬浮导航子菜单 */
.floating-nav-sub {
  position: relative;
  width: 100%;
}

.floating-nav-submenu {
  position: absolute;
  right: 100%;
  top: 0;
  padding-right: var(--space-sm);
  display: none;
  white-space: nowrap;
}

.floating-nav-sub:hover .floating-nav-submenu {
  display: block;
}

.floating-nav-submenu-inner {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  padding: var(--space-sm) 0;
}

.floating-nav-submenu-item {
  display: flex;
  align-items: center;
  font-size: 14px;
  gap: var(--space-sm);
  padding: 10px var(--space);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.floating-nav-submenu-item:hover {
  background: var(--primary-alpha-10);
  color: var(--primary);
}

.floating-nav-submenu-item i {
  color: var(--text-light);
  transition: color var(--transition-fast);
}

.floating-nav-submenu-item:hover i {
  color: var(--primary);
}

/* 智能客服弹窗 */
.smart-service-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9999;
  display: none;
}

.smart-service-modal.show {
  display: block;
}

.smart-service-backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.smart-service-content {
  position: absolute;
  inset: 16px;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.smart-service-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-default);
  background: var(--bg-gray-light);
}

.smart-service-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.smart-service-icon {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-white);
}

.smart-service-info h3 {
  font-size: 18px;
  font-weight: bold;
  color: var(--text-main);
}

.smart-service-info p {
  font-size: 12px;
  color: var(--text-muted);
}

.smart-service-close {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.smart-service-close:hover {
  background: var(--border-default);
}

.smart-service-iframe {
  flex: 1;
  width: 100%;
  border: 0;
}

/* 适老化按钮 */
.accessibility-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: var(--primary);
  color: var(--text-white);
  border-radius: var(--radius-full);
  font-size: 12px;
  transition: background var(--transition-fast);
  cursor: pointer;
}

.accessibility-btn:hover {
  background: var(--primary-hover);
}

/* 响应式 */
@media (max-width: 991px) {
  .topbar {
    display: none;
  }

  .header-inner {
    height: 60px;
  }

  .floating-nav {
    right: 16px;
    /* display: none; */
  }
}

/* 桌面端隐藏展开按钮 */
@media (min-width: 992px) {
  .floating-nav-mobile-toggle {
    display: none;
  }
}

/* ==================== 移动端浮动导航 ==================== */
@media (max-width: 991px) {

  /* 隐藏桌面端浮动导航 */
  .floating-nav.desktop-only {
    display: none;
  }

  /* 移动端展开按钮 - 半椭圆灰色背景 */
  .floating-nav-mobile-toggle {
    display: flex;
    position: fixed;
    right: 0;
    bottom: 220px;
    z-index: 1001;
    width: 28px;
    height: 64px;
    border-radius: 14px 0 0 14px;
    background: rgba(102, 102, 102, 0.85);
    color: #fff;
    border: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
  }

  .floating-nav-mobile-toggle:active {
    background: rgba(85, 85, 85, 0.9);
  }

  /* 展开状态隐藏按钮 - 位移动画 */
  .floating-nav.mobile-active+.floating-nav-mobile-toggle {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
  }

  .floating-nav-mobile-toggle {
    transform: translateX(0);
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  /* 移动端浮动导航 - 默认收起 */
  .floating-nav {
    position: fixed;
    right: 0;
    bottom: 128px;
    z-index: 1000;
    width: 72px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    flex-direction: column;
    align-items: center;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
  }


  .floating-nav.mobile-active {
    transform: translateX(0);
  }

  /* 遮罩层 */
  .floating-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }

  .floating-nav-overlay.active {
    display: block;
  }
}

@media (min-width: 992px) {
  .nav {
    display: flex;
  }
}