/**
 * 寰宇智创 - 全局样式表
 * Global Stylesheet
 * * 修改说明：
 * 1. 修复了全局平滑滚动导致的 Tab 切换位移冲突。
 * 2. 预留了跨平台兼容层（Compatibility Layer），方便后续适配 Mac 版本。
 */

/* ============================================
   CSS 变量定义 (Cross-platform Compatibility Layer)
   ============================================ */
:root {
  --logo-gold: #D4A574;
  --logo-gold-light: #E8C9A0;
  --logo-gold-dark: #B8935F;
  --black-primary: #0a0a0a;
  --black-secondary: #141414;
  --black-tertiary: #1a1a1a;
  
  /* 预留：针对 Mac/Win 系统可差异化定义的滚动条宽度 */
  --scrollbar-width: 8px;
}

/* ============================================
   基础重置与字体
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  /* 默认保持平滑滚动 */
  scroll-behavior: smooth;
}

/**
 * 【核心修复】临时禁用平滑滚动的辅助类
 * 当 JS 切换 Tab 时，会给 html 加上这个类，彻底解决内容“从下往上飞”的问题
 */
html.no-smooth {
  scroll-behavior: auto !important;
}

body {
  font-family: 'Noto Sans SC', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--black-primary);
  color: #ffffff;
  overflow-x: hidden;
  line-height: 1.6;
}

/* 英文状态下的字体 */
body.lang-en {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* 繁体中文状态下的字体 */
body.lang-zh-Hant {
  font-family: 'Noto Sans TC', 'Noto Sans SC', sans-serif;
}

/* ============================================
   工具类 - 颜色
   ============================================ */
.text-gold { color: var(--logo-gold); }
.bg-gold { background-color: var(--logo-gold); }
.border-gold { border-color: var(--logo-gold); }

/* 金色渐变 */
.gradient-gold {
  background: linear-gradient(135deg, var(--logo-gold) 0%, var(--logo-gold-light) 50%, var(--logo-gold-dark) 100%);
}

.gradient-text {
  background: linear-gradient(135deg, var(--logo-gold) 0%, var(--logo-gold-light) 50%, var(--logo-gold-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   工具类 - 毛玻璃效果 (Glassmorphism)
   ============================================ */
.glass-card {
  background: rgba(20, 20, 20, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(212, 165, 116, 0.2);
}

.glass-dark {
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.glass-light {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* 高倍数磨砂玻璃 - 用于巨型菜单 */
.backdrop-blur-xl {
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

/* ============================================
   导航栏样式
   ============================================ */
.nav-blur {
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* 导航链接样式 */
.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.3s ease;
}

/* 中文：不换行 */
body.lang-zh-CN .nav-link,
body.lang-zh-Hant .nav-link {
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.4;
}

/* 英文：允许换行，小字号 */
body.lang-en .nav-link {
  white-space: normal;
  font-size: 13px;
  line-height: 1.5;
  max-width: 90px;
  min-height: 40px;
}

/* ============================================
   巨型菜单 (Mega Menu)
   ============================================ */
.mega-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(20, 20, 20, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(212, 165, 116, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  max-height: 80vh;
  overflow-y: auto;
  z-index: 100;
}

.mega-menu.active {
  display: block;
}

.mega-menu-column-title {
  color: var(--logo-gold);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(212, 165, 116, 0.25);
}

.mega-menu-subcategory {
  display: inline-block;
  background: rgba(212, 165, 116, 0.15);
  color: var(--logo-gold-light);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 6px;
  white-space: nowrap;
  border: 1px solid rgba(212, 165, 116, 0.25);
  line-height: 1.4;
}

.mega-menu-item {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  line-height: 1.25;
  padding-top: 0.5px;
  padding-bottom: 0.5px;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mega-menu-item:hover {
  color: var(--logo-gold);
  transform: translateX(4px);
}

body.lang-en .mega-menu-item { font-size: 12px; }

/* ============================================
   信任背书卡片 (Trust Cards)
   ============================================ */
.trust-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  height: 180px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.trust-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.trust-card:hover .trust-card-bg {
  transform: scale(1.1);
}

.trust-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  filter: brightness(0.7);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.trust-card:hover .trust-card-overlay {
  background: rgba(0, 0, 0, 0);
  filter: brightness(1);
}

.trust-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  z-index: 10;
}

.trust-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 10;
}

body.lang-zh-CN .trust-card-title,
body.lang-zh-Hant .trust-card-title {
  font-size: 18px;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  margin-bottom: 4px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

body.lang-zh-CN .trust-card-desc,
body.lang-zh-Hant .trust-card-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
}

body.lang-en .trust-card-title {
  font-size: 15px;
  font-weight: 700;
  color: white;
  line-height: 1.3;
  margin-bottom: 4px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

body.lang-en .trust-card-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.4;
}

/* ============================================
   按钮样式
   ============================================ */
.btn-primary {
  background: linear-gradient(135deg, var(--logo-gold) 0%, var(--logo-gold-dark) 100%);
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(212, 165, 116, 0.4);
}

.btn-outline {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  transition: all 0.3s ease;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--logo-gold);
}

/* ============================================
   悬浮按钮组
   ============================================ */
.floating-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.floating-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  position: relative;
}

.floating-btn:hover {
  transform: scale(1.1);
}

.floating-btn-tooltip {
  position: absolute;
  right: 70px;
  background: white;
  color: black;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.floating-btn:hover .floating-btn-tooltip {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   滚动条样式 (跨平台兼容层)
   ============================================ */
::-webkit-scrollbar {
  width: var(--scrollbar-width);
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--black-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--logo-gold-dark);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--logo-gold);
}

/* ============================================
   动画效果
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================
   响应式工具类
   ============================================ */
@media (max-width: 1024px) {
  .mega-menu { max-height: 70vh; }
}

@media (max-width: 768px) {
  .trust-card { height: 150px; }
  .floating-widget { bottom: 20px; right: 20px; }
  .floating-btn { width: 48px; height: 48px; }
}

/* ============================================
   辅助工具类
   ============================================ */
.section-fade {
  opacity: 0;
  transform: translateY(30px);
}

.hover-lift {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(212, 165, 116, 0.2);
  border-color: var(--logo-gold);
}

.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================
   巨型菜单紧凑模式 (Mega Menu Compact)
   ============================================ */
.mega-menu-compact {
  max-height: 70vh;
  overflow-y: auto;
}

.mega-menu-compact::-webkit-scrollbar {
  width: 4px;
  height: 0;
}

.mega-menu-compact::-webkit-scrollbar-thumb {
  background: rgba(212, 165, 116, 0.3);
  border-radius: 2px;
}

.mega-menu-compact {
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 165, 116, 0.3) transparent;
}

.mega-menu-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px;
}

.mega-menu-outer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.mega-menu-compact .mega-menu-column-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--logo-gold);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(212, 165, 116, 0.25);
}

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

.mega-menu-left-col,
.mega-menu-right-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mega-menu-subcategory-box { margin-bottom: 0; }

.mega-menu-subcategory-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 6px;
  background: rgba(212, 165, 116, 0.15);
  color: rgba(232, 201, 160, 0.95);
  border: 1px solid rgba(212, 165, 116, 0.25);
  white-space: nowrap;
  line-height: 1.4;
}

.mega-menu-items-list {
  display: flex;
  flex-direction: column;
}

.mega-menu-compact .mega-menu-item {
  font-size: 13px;
  line-height: 1.25;
  padding-top: 0.5px;
  padding-bottom: 0.5px;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mega-menu-compact .mega-menu-item:hover {
  color: var(--logo-gold);
  transform: translateX(4px);
}

body.lang-en .mega-menu-compact .mega-menu-item { font-size: 12px; }

.mega-menu-compact .mega-menu-column { padding: 0 8px; }

@media (max-width: 1024px) {
  .mega-menu-container { padding: 12px 16px; }
  .mega-menu-outer-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

@media (max-width: 640px) {
  .mega-menu-outer-grid { grid-template-columns: 1fr; }
}

/* ============================================
   跨境服务页面专用样式
   ============================================ */

/* 区域卡片 */
.region-card {
  background: rgba(20, 20, 20, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(212, 165, 116, 0.2);
}

/* 对比表格 */
.compare-table {
  border-collapse: collapse;
  width: 100%;
}

.compare-table th,
.compare-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(212, 165, 116, 0.1);
}

.compare-table th {
  color: var(--logo-gold);
  font-weight: 600;
  background: rgba(212, 165, 116, 0.1);
}

.compare-table td {
  color: rgba(255, 255, 255, 0.8);
}

.compare-table tr:hover td {
  background: rgba(212, 165, 116, 0.05);
}

/* 金色渐变文字 */
.gold-gradient-text {
  background: linear-gradient(135deg, var(--logo-gold) 0%, var(--logo-gold-light) 50%, var(--logo-gold-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 区域图片 */
.section-image {
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  transition: all 0.4s ease;
}

.section-image:hover {
  transform: scale(1.02);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

/* 背景渐变装饰 */
.bg-gold\/5 { background-color: rgba(212, 165, 116, 0.05); }
.bg-gold\/10 { background-color: rgba(212, 165, 116, 0.1); }
.bg-gold\/20 { background-color: rgba(212, 165, 116, 0.2); }

.border-gold\/10 { border-color: rgba(212, 165, 116, 0.1); }
.border-gold\/20 { border-color: rgba(212, 165, 116, 0.2); }
.border-gold\/30 { border-color: rgba(212, 165, 116, 0.3); }

/* 响应式表格 */
@media (max-width: 768px) {
  .compare-table {
    font-size: 12px;
  }
  .compare-table th,
  .compare-table td {
    padding: 8px 10px;
  }
}