* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: #ededed;
  color: #222222;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

/* 页面主容器 - 响应式设计：手机端全屏，PC端居中展示移动端模拟视窗 */
.page-container {
  width: 100%;
  max-width: 480px;
  background-color: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.08);
}

/* 顶部导航栏 (模拟微信公众号内嵌页头部) */
.top-nav {
  height: 52px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid #f0f0f0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #222;
}

.nav-icon {
  width: 20px;
  height: 20px;
  cursor: pointer;
  stroke: #181818;
}

.close-icon {
  width: 18px;
  height: 18px;
}

.nav-title {
  font-size: 17px;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: 0.5px;
}

.nav-right {
  font-size: 14px;
  color: #666;
  cursor: pointer;
}

/* 顶部三角洲横幅展示 */
.banner-wrapper {
  width: 100%;
  position: relative;
  overflow: hidden;
  background: #111;
  aspect-ratio: 16 / 9;
}

.banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.banner-overlay {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 100%);
  pointer-events: none;
}

/* 聊天对话主容器 */
.chat-container {
  flex: 1;
  padding: 18px 16px 140px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

/* 消息行基础结构 */
.chat-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  animation: messageFadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.chat-row.bot {
  justify-content: flex-start;
}

.chat-row.user {
  justify-content: flex-end;
}

/* 头像样式 */
.avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
  display: block;
  background: #1e242a;
}

/* 客服头像上的红标装饰 (与截图一致) */
.bot-badge {
  position: absolute;
  top: -6px;
  left: -4px;
  font-size: 11px;
  color: #ff2a2a;
  font-weight: 900;
  font-family: "LiSu", "Kaiti", sans-serif;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  letter-spacing: -0.5px;
  pointer-events: none;
}

/* 气泡样式 */
.bubble {
  max-width: 76%;
  padding: 13px 16px;
  font-size: 15px;
  line-height: 1.55;
  border-radius: 12px;
  position: relative;
  word-break: break-word;
  transition: all 0.2s ease;
}

/* 客服气泡 (白色微阴影，左侧圆角微调) */
.chat-row.bot .bubble {
  background-color: #ffffff;
  color: #1f2329;
  border: 1px solid #ebecee;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  border-top-left-radius: 4px;
}

/* 用户气泡 */
.chat-row.user .bubble {
  background-color: #ffffff;
  color: #1f2329;
  border: 1px solid #e5e6eb;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  border-top-right-radius: 4px;
}

/* 打字加载中动画指示器 */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #999;
  animation: dotPulse 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* 底部操作固定区域 */
.bottom-action-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 20px 24px;
  background: linear-gradient(to top, #ffffff 78%, rgba(255, 255, 255, 0.95) 90%, rgba(255, 255, 255, 0) 100%);
  z-index: 40;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 选项按钮双列排列 (如截图：我是未成年 / 我已满18岁) */
.options-group {
  display: flex;
  gap: 14px;
  width: 100%;
  max-width: 420px;
}

.btn-option {
  flex: 1;
  height: 48px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, filter 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}

.btn-option:active {
  transform: scale(0.97);
}

/* 棕褐色按钮 (截图左侧: 我是未成年 / 我不需要) */
.btn-brown {
  background: linear-gradient(135deg, #b8864a 0%, #a47236 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(184, 134, 74, 0.3);
}

/* 绿色按钮 (截图右侧: 我已满18岁 / 是的，我需要) */
.btn-green {
  background: linear-gradient(135deg, #27c36a 0%, #1eb05d 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(39, 195, 106, 0.35);
}

/* 最终下单/联系客服长条大按钮 (截图下方全宽大圆角按钮) */
.btn-submit-order {
  width: 100%;
  max-width: 420px;
  height: 54px;
  border-radius: 999px;
  background: linear-gradient(135deg, #20cf6a 0%, #15b85a 100%);
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(32, 207, 106, 0.4);
  animation: buttonPulse 2s infinite ease-in-out;
  text-decoration: none;
}

.btn-submit-order:active {
  transform: scale(0.98);
}

.btn-submit-order .order-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* 动画特效 */
@keyframes messageFadeUp {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dotPulse {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes buttonPulse {
  0% {
    box-shadow: 0 6px 18px rgba(32, 207, 106, 0.38);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 8px 26px rgba(32, 207, 106, 0.65);
    transform: scale(1.02);
  }
  100% {
    box-shadow: 0 6px 18px rgba(32, 207, 106, 0.38);
    transform: scale(1);
  }
}
