/* ============================================================
   思明招商助手 · 公共样式（首页 / 对话页 共用）
   自适应分辨率：全部使用相对单位 vw/vh/%/rem/flex
   ============================================================ */

:root {
  --brand-primary: #0EA5E9;
  --brand-primary-deep: #075985;
  --brand-gold: #D9B25F;
  --ink-900: #0F2C44;
  --ink-700: #2B4A66;
  --ink-500: #5B7891;
  --ink-300: #B7C9D6;
  --paper: #FFFFFF;
  --paper-soft: rgba(255, 255, 255, 0.86);
  --paper-glass: rgba(255, 255, 255, 0.62);
  --line: rgba(255, 255, 255, 0.55);
  --shadow-card: 0 6px 24px rgba(7, 89, 133, 0.18);
  --shadow-soft: 0 2px 12px rgba(7, 89, 133, 0.10);
  --radius-sm: 0.4rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.1rem;
  --font-family: "Microsoft YaHei", "微软雅黑", -apple-system,
    BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: clamp(14px, 1.6vw, 18px); -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-family);
  color: var(--ink-900);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
  background-image: url("../img/bg.png");
  background-size: 100% auto;
  background-position: center top;
  background-repeat: no-repeat;
  background-color: #cfe7f5;
  background-attachment: scroll;
}
.page-bg-bottom {
  position: fixed;
  right: 0;
  bottom: 0;
  width: clamp(220px, 36vw, 480px);
  height: auto;
  aspect-ratio: 1 / 1;
  z-index: -1;
  background-image: url("../img/bgbottom.png");
  background-size: contain;
  background-position: right bottom;
  background-repeat: no-repeat;
  pointer-events: none;
  opacity: 0.95;
}

/* ---------- 顶部浮动栏（透明融入背景，高度 80px） ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 80px;
  background: transparent;
  border-bottom: 0;
  box-shadow: none;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}
/* 滚动后才出现背景色（磨砂玻璃感） */
.topbar.is-scrolled {
  background: rgba(207, 231, 245, 0.82);
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  border-bottom: 1px solid rgba(14, 165, 233, 0.2);
  box-shadow: 0 2px 12px rgba(7, 89, 133, 0.1);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem;
  padding: 0 clamp(0.8rem, 2vw, 1.6rem);
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
}

.slogan-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.slogan-img {
  height: clamp(2.4rem, 5vw, 3.6rem);
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(7, 89, 133, 0.35));
}

.top-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.2rem, 0.8vw, 0.6rem);
  flex-wrap: wrap;
}
.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: clamp(0.78rem, 1.1vw, 0.95rem);
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: all 0.18s ease;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(7, 89, 133, 0.4);
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.7);
  transform: translateY(-1px);
}
.nav-item svg { font-size: 1.05em; }

@media (max-width: 640px) {
  .top-nav .nav-item span { display: none; }
  .nav-item { padding: 0.45rem 0.55rem; }
}

/* ---------- 动画小人物（首页跟随按钮，对话页 fixed） ---------- */
.hero-char {
  position: fixed;
  /* 沿用 4vw 起步，再往里推 1rem，确保落在背景图"白色圆角框"内部、
     与框左缘有明显边距（不会贴在白框边、更不会超出），同时人像仍偏左不遮挡气泡。
     max() 兜底窄屏最小 1rem 边距。bottom 保持 6vh。 */
  left: max(1rem, calc(4vw + 1rem));
  bottom: 6vh;
  width: clamp(80px, 14vw, 140px);
  height: auto;
  aspect-ratio: 1 / 1;
  z-index: 50;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
  filter: drop-shadow(0 8px 18px rgba(7, 89, 133, 0.22));
  transition: transform 0.25s ease;
}
/* 首页：放在对话成功按钮左侧（放大一倍） */
.hero-char.is-inline {
  position: relative;
  left: auto;
  bottom: auto;
  z-index: 5;
  width: clamp(180px, 28vw, 280px);
}
.hero-char:active { cursor: grabbing; }
.hero-char img { width: 100%; height: 100%; display: block; pointer-events: none; }

/* 跳一跳动画 */
@keyframes heroJump {
  0%   { transform: translateY(0)   scale(1, 1); }
  20%  { transform: translateY(-30px) scale(0.95, 1.05); }
  40%  { transform: translateY(0)   scale(1.05, 0.92); }
  55%  { transform: translateY(-12px) scale(0.97, 1.03); }
  70%  { transform: translateY(0)   scale(1.03, 0.97); }
  85%  { transform: translateY(-4px)  scale(0.99, 1.01); }
  100% { transform: translateY(0)   scale(1, 1); }
}
.hero-char.is-jumping { animation: heroJump 0.9s cubic-bezier(0.4, 0, 0.2, 1); }

/* ---------- 背景音乐按钮（公共） ---------- */
.bgm-toggle {
  position: fixed;
  right: clamp(0.8rem, 2vw, 1.6rem);
  bottom: clamp(0.8rem, 2vw, 1.6rem);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(14, 165, 233, 0.28);
  color: var(--brand-primary-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
  transition: all 0.2s ease;
}
.bgm-toggle:hover { background: #fff; transform: translateY(-1px); }
.bgm-toggle.is-playing {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}
/* 顶部 banner 右上角变体（首页用） */
.bgm-toggle.is-top-right {
  top: 14px;
  right: 14px;
  bottom: auto;
  left: auto;
}

/* ---------- 工具类 ---------- */
.icon-btn {
  background: transparent;
  border: 0;
  cursor: pointer;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- 选择思明 选择成功 艺术字大标题（首页 + 对话页共用） ---------- */
.hero-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.25s ease;
  position: relative;
  z-index: 2;
}
.hero-banner:hover { transform: scale(1.02); }
.hero-banner:active { transform: scale(0.98); }
.hero-ink {
  height: auto;
  display: block;
  overflow: visible;
  /* 嵌入背景感：白色柔光 + 浅蓝外发光，让字像融进蓝色背景里 */
  filter: drop-shadow(0 6px 16px rgba(255, 255, 255, 0.35)) drop-shadow(0 0 28px rgba(125, 211, 252, 0.4));
  /* screen 混合模式让字与背景颜色融合，产生"嵌入"感 */
  mix-blend-mode: screen;
  opacity: 0.95;
}