/* ==========================================
   ===== 导航栏基础样式 (高级柔光奶油燕麦) =====
   ========================================== */
.sa-nav-wrap {
  position: relative;
  z-index: 9999;
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.sa-nav-wrap .nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9998;
  /* 顶部默认：如奶霜般温柔的半透明柔光 */
  background: rgba(252, 250, 247, 0.65); 
  backdrop-filter: blur(18px) saturate(110%);
  -webkit-backdrop-filter: blur(18px) saturate(110%);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border-bottom: 1px solid rgba(230, 222, 211, 0.4); /* 温和的浅麦色边框 */
}

/* 滚动状态 */
.sa-nav-wrap .nav-bar.nav-scrolled {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 24px -4px rgba(68, 62, 52, 0.05); /* 带暖调的软阴影 */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(230, 222, 211, 0.3);
}

/* 菜单打开时隐藏logo和按钮区 */
.sa-nav-wrap.menu-open .nav-logo-area,
.sa-nav-wrap.menu-open .nav-btn-area {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

/* 遮罩 */
.sa-nav-wrap .menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 40, 35, 0.25); /* 带有咖啡馆滤镜感的温和暗色 */
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9997;
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s ease;
}

.sa-nav-wrap.menu-open .menu-overlay {
  opacity: 1;
  visibility: visible;
}

/* 移动端侧边栏菜单 */
.sa-nav-wrap .sa-mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  max-width: 85%;
  height: 100vh;
  background: #fdfcfb; /* 优雅的暖白大理石底色 */
  box-shadow: -8px 0 32px rgba(68, 62, 52, 0.04);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 28px 24px;
}

.sa-nav-wrap.menu-open .sa-mobile-menu {
  transform: translateX(0);
}

/* PC端恢复 */
@media (min-width: 1024px) {
  .sa-nav-wrap .sa-mobile-menu {
    position: relative;
    width: auto;
    height: auto;
    background: transparent;
    box-shadow: none;
    transform: none !important;
    overflow: visible;
    padding: 0;
  }
  .sa-nav-wrap .menu-overlay {
    display: none;
  }
}

/* ===== Footer ===== */
.sa-app .sa-footer { 
  position: relative; 
  overflow: hidden; 
  background: linear-gradient(180deg, #f7f4f0 0%, #ede9e2 100%); /* 温暖的燕麦渐变 */
}
.sa-app .sa-footer .sa-footer-deco { 
  position: absolute; 
  inset: 0; 
  pointer-events: none; 
  z-index: 0; 
  background: 
    radial-gradient(circle at 90% 90%, rgba(217, 119, 6, 0.03) 0%, transparent 50%), 
    radial-gradient(circle at 10% 10%, rgba(79, 70, 229, 0.03) 0%, transparent 40%); /* 极其微弱的金黄与暮蓝光晕 */
}

/* ===== 全局遮罩层 ===== */
.sa-app .sa-overlay { 
  position: fixed; 
  inset: 0; 
  background: rgba(44, 40, 35, 0.25); 
  backdrop-filter: blur(4px); 
  -webkit-backdrop-filter: blur(4px); 
  z-index: 49; 
  opacity: 0; 
  visibility: hidden; 
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1); 
}
.sa-app .sa-overlay.sa-show { 
  opacity: 1; 
  visibility: visible; 
}

/* ===== 面板通用 ===== */
.sa-app .sa-panel { 
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease; 
  background: #ffffff;
  color: #44403c; /* 柔和的深褐灰，比纯黑更高级 */
}
.sa-app .sa-panel.sa-hidden { 
  transform: translateY(100%); 
  opacity: 0; 
  pointer-events: none; 
}
.sa-app .sa-panel.sa-visible { 
  transform: translateY(0); 
  opacity: 1; 
  pointer-events: auto; 
}

@media (min-width: 1024px) {
  .sa-app .sa-panel { 
    border-radius: 20px; /* 略微加大圆角，更显圆润舒适 */
    border: 1px solid rgba(230, 222, 211, 0.6);
    box-shadow: 0 24px 48px -12px rgba(68, 62, 52, 0.08), 0 0 1px rgba(68, 62, 52, 0.05); 
  }
  .sa-app .sa-panel.sa-hidden { 
    transform: translateY(20px) scale(0.97); 
  }
}

@media (max-width: 1023px) {
  .sa-app .sa-panel { 
    bottom: calc(3.5rem + env(safe-area-inset-bottom)) !important; 
    right: 0 !important; 
    left: 0 !important; 
    width: 100% !important; 
    max-width: 100% !important; 
    border-radius: 24px 24px 0 0 !important; 
    border: none; 
    box-shadow: 0 -8px 32px rgba(68, 62, 52, 0.04); 
  }
}

/* ===== 输入框 (温润奶茶色) ===== */
.sa-app .sa-input { 
  width: 100%; 
  border: 1px solid #e6dfd5; 
  border-radius: 12px; 
  padding: 12px 14px; 
  font-size: 14px; 
  outline: none; 
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1); 
  background: #f5f2eb; /* 默认淡淡的燕麦底色 */
  color: #44403c; 
}
.sa-app .sa-input:focus { 
  background: #ffffff;
  border-color: #6366f1; /* 聚焦时变为优雅的暮蓝色 */
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.08); 
}
.sa-app .sa-input::placeholder { 
  color: #a8a29e; 
}
.sa-app .sa-input.sa-err { 
  background: #fff5f5;
  border-color: #fca5a5; 
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.06); 
}

/* ===== 运单查询结果 (莫兰迪治愈色系) ===== */
.sa-app .sa-track-result { 
  background: #f2f9f4; /* 极其温柔的淡抹茶绿 */
  border: 1px solid #e1f0e5; 
  border-radius: 12px; 
  padding: 14px 16px; 
  margin-top: 16px; 
  display: none; 
}
.sa-app .sa-track-result.sa-show { 
  display: block; 
  animation: saFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both; 
}
.sa-app .sa-track-result .sa-tr-status { 
  font-weight: 700; 
  color: #16a34a; 
  font-size: 15px; 
  margin-bottom: 6px; 
}
.sa-app .sa-track-result .sa-tr-info { 
  color: #166534; 
  font-size: 13.5px; 
  line-height: 1.6; 
  word-break: break-all; 
  white-space: pre-line; 
}
.sa-app .sa-track-result.sa-err { 
  background: #fdf4f4; /* 极其温柔的淡粉落樱红 */
  border-color: #fbe8e8; 
}
.sa-app .sa-track-result.sa-err .sa-tr-status { 
  color: #dc2626; 
}
.sa-app .sa-track-result.sa-err .sa-tr-info { 
  color: #991b1b; 
}

/* ===== 侧边服务栏 (修复图标白底隐形问题) ===== */
.sa-app .sa-side-item { 
  width: 3.25rem; 
  height: 3.25rem; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  background: #ffffff;
  color: #57534e;              /* 图标/文字基础颜色：高级暖深灰 */
  border: 1px solid #ede9e2;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(68, 62, 52, 0.03);
  /* 优雅的贝塞尔曲线，向左滑入时更丝滑 */
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1); 
}

/* 强制让内部 SVG 图标随父级着色 */
.sa-app .sa-side-item svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  stroke: currentColor;
}

/* 强制让内部字体图标 (如 FontAwesome) 随父级着色 */
.sa-app .sa-side-item i {
  font-size: 18px;
  color: currentColor;
}

/* 鼠标悬浮交互 */
.sa-app .sa-side-item:hover { 
  transform: translateX(-6px); 
  color: #6366f1;              /* 悬浮时，内部图标变暮蓝色 */
  box-shadow: -6px 8px 20px rgba(68, 62, 52, 0.06); 
}

/* ===== 返回顶部 (同步修复) ===== */
.sa-app .sa-back-top { 
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1); 
  opacity: 0; 
  visibility: hidden; 
  transform: translateY(16px) scale(0.9); 
  background: #ffffff;
  color: #57534e;              /* 箭头的默认暖深灰色 */
  border: 1px solid #ede9e2;
  border-radius: 12px;
}
.sa-app .sa-back-top svg {
  fill: currentColor;
  stroke: currentColor;
}
.sa-app .sa-back-top:hover {
  color: #6366f1;              /* 悬浮时箭头变暮蓝色 */
}
.sa-app .sa-back-top.sa-show { 
  opacity: 1; 
  visibility: visible; 
  transform: translateY(0) scale(1); 
}

/* ===== 聊天滚动条 ===== */
.sa-app .sa-chat-scroll::-webkit-scrollbar { 
  width: 4px; 
}
.sa-app .sa-chat-scroll::-webkit-scrollbar-track { 
  background: transparent; 
}
.sa-app .sa-chat-scroll::-webkit-scrollbar-thumb { 
  background: #d6d3d1; 
  border-radius: 10px; 
}
.sa-app .sa-chat-scroll::-webkit-scrollbar-thumb:hover { 
  background: #a8a29e; 
}

/* ===== 移动底部导航 safe-area ===== */
@media(max-width:1023px) { 
  .sa-app .sa-mobile-nav { 
    padding-bottom: env(safe-area-inset-bottom); 
  } 
}

/* ===== body 滚动锁定 ===== */
html.sa-no-scroll, body.sa-no-scroll { 
  overflow: hidden !important; 
}

/* 进场动画：减少突兀感，加入微弱缩放 */
@keyframes saFadeIn { 
  from { 
    opacity: 0; 
    transform: translateY(8px) scale(0.99); 
  } 
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  } 
}