/* ============================================================
   导航栏彻底修复（v11）：容器加宽 + 分级压缩 + 防横向溢出
   ============================================================ */
html, body { overflow-x: clip; }

/* 导航专属更宽的容器（全站内容容器仍 1160） */
.header .container { max-width: 1380px; }

/* 基础压缩 */
.header-inner { gap: 14px; }
.nav { gap: 2px; }
.nav a { padding: 8px 13px; font-size: 15px; }
.logo { gap: 10px; }
.logo-text strong { font-size: 16px; }
.logo-seal { width: 20px; height: 24px; font-size: 10px; }
.header-cta .btn { padding: 10px 20px; font-size: 14.5px; }
.header-tel { font-size: 14.5px; }

/* 分级隐藏（在 v9 基础上提前触发） */
@media (max-width: 1520px) {
  .header-tel { display: none; }
}
@media (max-width: 1310px) {
  .header-cta { display: none; }
}
@media (max-width: 1120px) {
  .nav a { padding: 8px 9px; font-size: 13.5px; }
  .logo-text span { display: none; }
  .logo-mark { width: 36px; height: 36px; }
}
@media (max-width: 980px) {
  .nav a { padding: 8px 7px; font-size: 13px; }
  .logo-seal { display: none; }
  .logo-text strong { font-size: 15px; }
}
/* 900px 以下汉堡菜单（与 style.css 一致） */
@media (max-width: 900px) {
  .lang-switch { display: none; }
}

/* ============================================================
   语言切换器优化（v12）：无缝悬停 + 点击开关 + 移动端入口
   ============================================================ */
.lang-switch { position: relative; margin-right: 10px; flex-shrink: 0; }
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink-soft);
  font-family: inherit;
  transition: all .25s;
  line-height: 1.4;
}
.lang-btn:hover, .lang-btn.on { border-color: var(--accent); color: var(--primary); }
/* 下拉菜单：贴住按钮消除 hover 间隙，加透明桥接 */
.lang-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  min-width: 132px;
  display: none;
  z-index: 80;
  overflow: hidden;
  padding-top: 6px;
  margin-top: -6px; /* 桥接缝隙 */
  background-clip: padding-box;
}
.lang-switch:hover .lang-menu,
.lang-switch:focus-within .lang-menu,
.lang-switch.open .lang-menu { display: block; }
.lang-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.lang-menu a:hover { background: var(--primary-light); color: var(--primary); }
.lang-menu a.active { color: var(--primary); font-weight: 600; background: var(--bg-soft); }
.lang-menu a.active::after { content: "✓"; margin-left: auto; font-size: 12px; }

/* 移动端：汉堡菜单内语言行 */
.nav-langs {
  display: none;
  border-top: 1px dashed var(--line);
  margin: 10px 0 4px;
  padding-top: 12px;
}
.nav-langs span {
  display: block;
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: .2em;
  margin-bottom: 8px;
}
.nav-langs a {
  display: inline-block;
  padding: 7px 16px;
  margin: 0 6px 6px 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.nav-langs a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
@media (max-width: 900px) {
  .nav-langs { display: block; }
}
@media (max-width: 1120px) {
  .lang-btn { padding: 6px 10px; }
}

/* ============================================================
   AI 在线客服挂件
   ============================================================ */
.chat-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 999px;
  background: var(--gradient);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(11, 59, 46, .35);
  transition: transform .25s;
}
.chat-btn:hover { transform: translateY(-3px); }
.chat-btn.hidden { display: none; }

.chat-panel {
  position: fixed;
  right: 20px;
  bottom: 84px;
  z-index: 96;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 110px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all .3s var(--ease-out);
}
.chat-panel.open { transform: none; opacity: 1; pointer-events: auto; }

.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--gradient);
  color: #fff;
}
.chat-head strong { font-size: 15.5px; font-family: var(--font-serif); letter-spacing: .04em; }
.chat-head small { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: .9; margin-top: 2px; }
.chat-dot { width: 7px; height: 7px; border-radius: 50%; background: #7ef0d2; animation: pulse 2s infinite; }
.chat-head button {
  border: none;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  background: #f6f8f6;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-msg { display: flex; }
.chat-msg span {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}
.chat-msg.bot { justify-content: flex-start; }
.chat-msg.bot span { background: #fff; border: 1px solid var(--line); border-top-left-radius: 4px; color: var(--ink); }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.user span { background: var(--gradient); color: #fff; border-top-right-radius: 4px; }

.chat-quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px 4px; background: #fff; }
.chat-quick button {
  border: 1px solid var(--line);
  background: #fafdfb;
  color: var(--primary);
  font-size: 12.5px;
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  font-family: inherit;
}
.chat-quick button:hover { border-color: var(--accent); }

.chat-typing {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 16px;
  font-size: 12.5px;
  color: var(--ink-faint);
  background: #fff;
}
.chat-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: chatBounce 1s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: .15s; }
.chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes chatBounce { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

.chat-input {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.chat-input input {
  flex: 1;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 14px;
  font-family: inherit;
}
.chat-input input:focus { outline: none; border-color: var(--accent); }
.chat-input button {
  border: none;
  background: var(--gradient);
  color: #fff;
  width: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.chat-foot { padding: 8px 14px 12px; text-align: center; background: #fff; }
.chat-foot button {
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--ink-soft);
  font-size: 12.5px;
  border-radius: 999px;
  padding: 5px 16px;
  cursor: pointer;
  font-family: inherit;
}
.chat-foot button:hover { color: var(--primary); border-color: var(--accent); }

@media (max-width: 560px) {
  .chat-panel { right: 8px; bottom: 76px; width: calc(100vw - 16px); }
  .chat-btn { right: 12px; bottom: 12px; padding: 11px 16px; }
}
