/* ============================================================
   有口吗 AI 钓鱼助手 · H5 前端样式
   视觉沿用原型 v1（A 河岸叙事配色 × B 浮标信号动画）
   品牌色来自有口吗 uni.scss
   ============================================================ */
:root {
  --brand-orange: #FD6D2D;
  --brand-orange-light: #FD9839;
  --brand-gold: #F5C563;
  --brand-water: #1890C8;
  --brand-water-light: #4DB0CC;
  --brand-water-deep: #33859D;
  --brand-bg: #FAF8F5;
  --brand-card: #FFFFFF;
  --ink-strong: #2B2118;
  --ink-body: #5C534A;
  --ink-faint: #A89E93;
  --line: #EDE7DF;
  --radius: 18px;
  --water-bg: rgba(24,144,200,0.08);
  --orange-bg: rgba(253,109,45,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif;
  background: #E8E4DD;
  -webkit-font-smoothing: antialiased;
  height: 100%;
}

.phone {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  background: var(--brand-bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ============ 顶栏 ============ */
.header {
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
  background: var(--brand-bg);
  z-index: 10;
}
.logo {
  width: 36px; height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-orange), var(--brand-orange-light));
  position: relative;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo::after {
  content: ""; position: absolute;
  top: -6px; left: 50%; transform: translateX(-50%);
  width: 2px; height: 10px;
  background: var(--brand-gold);
  border-radius: 2px;
}
.logo-mark {
  width: 14px; height: 14px;
  border: 2.5px solid #fff;
  border-radius: 50%;
  position: relative;
}
.logo-mark::after {
  content: ""; position: absolute;
  width: 3px; height: 3px;
  background: var(--brand-bg);
  border-radius: 50%;
  left: 50%; top: 50%; transform: translate(-50%,-50%);
}
.header-title { font-size: 16px; font-weight: 700; color: var(--ink-strong); }
.header-sub {
  font-size: 11px; color: var(--ink-faint);
  margin-top: 2px; display: flex; align-items: center; gap: 5px;
}
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #A89E93;
  transition: background 0.3s;
}
.dot.online { background: var(--brand-water); animation: dotPulse 2.4s ease-in-out infinite; }
.dot.offline { background: #D9D2C8; }
@keyframes dotPulse {
  0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(24,144,200,0.35); }
  50% { opacity: 0.7; box-shadow: 0 0 0 4px rgba(24,144,200,0); }
}

/* ============ 聊天流 ============ */
.chat {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
}

/* 欢迎卡 */
.welcome {
  background: var(--brand-card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 14px 16px;
}
.welcome-title { font-size: 14px; font-weight: 700; color: var(--ink-strong); margin-bottom: 6px; }
.welcome-title .hi { color: var(--brand-orange); }
.welcome-text { font-size: 12.5px; color: var(--ink-body); line-height: 1.7; }
.welcome-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag {
  font-size: 11px; color: var(--brand-water-deep);
  background: var(--water-bg);
  padding: 3px 10px; border-radius: 20px;
  border: none; cursor: pointer;
  transition: background 0.2s;
}
.tag:active { background: rgba(24,144,200,0.18); }

/* 消息气泡 */
.msg { display: flex; flex-direction: column; max-width: 100%; }
.msg-user { align-items: flex-end; }
.msg-agent { align-items: flex-start; }
.bubble {
  max-width: 86%;
  font-size: 14px; line-height: 1.65;
  padding: 10px 14px;
  border-radius: 16px;
  word-break: break-word;
  white-space: pre-wrap;
}
.msg-user .bubble {
  background: linear-gradient(135deg, var(--brand-orange), var(--brand-orange-light));
  color: #fff;
  border-bottom-right-radius: 5px;
}
.msg-agent .bubble {
  background: var(--brand-card);
  color: var(--ink-strong);
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
}
.bubble b { color: var(--brand-orange); }

/* ============ 浮标思考过程 ============ */
.thinking {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--water-bg);
  border: 1px solid rgba(24,144,200,0.14);
  border-radius: var(--radius);
  padding: 12px 14px;
  max-width: 92%;
}
.buoy {
  width: 26px; height: 34px;
  flex-shrink: 0; position: relative; margin-top: 2px;
}
.buoy-top {
  width: 6px; height: 6px;
  background: var(--brand-orange);
  border-radius: 50%;
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
}
.buoy-stem {
  width: 2px; height: 12px;
  background: var(--brand-gold);
  position: absolute; top: 5px; left: 50%; transform: translateX(-50%);
  border-radius: 1px;
}
.buoy-body {
  width: 20px; height: 12px;
  background: var(--brand-water);
  border-radius: 8px 8px 5px 5px;
  position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
}
.buoy-body::after {
  content: ""; position: absolute;
  bottom: -2px; left: 50%; transform: translateX(-50%);
  width: 14px; height: 4px;
  background: var(--brand-orange);
  border-radius: 0 0 3px 3px;
}
.buoy-ripple {
  position: absolute; bottom: -6px; left: 50%;
  width: 30px; height: 8px;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 1.5px solid rgba(24,144,200,0.5);
  animation: ripple 1.6s ease-out infinite;
}
@keyframes ripple {
  0%   { opacity: 0.9; transform: translateX(-50%) scale(0.6); }
  100% { opacity: 0;   transform: translateX(-50%) scale(1.5); }
}
.thinking-idle .buoy { animation: bob 2s ease-in-out infinite; }
@keyframes bob {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-3px); }
}
.thinking-working .buoy { animation: sink 1.2s ease-in-out infinite; }
@keyframes sink {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(6px); }
}
.thinking-working .buoy-body { background: var(--brand-orange); }
.thinking-working .buoy-top { background: var(--brand-water); }
.thinking-working .buoy-stem { background: var(--brand-water-light); }
.thinking-text { flex: 1; min-width: 0; }
.thinking-step {
  font-size: 12.5px; color: var(--ink-body);
  display: flex; align-items: center; gap: 6px;
  line-height: 1.5;
}
.thinking-step + .thinking-step { margin-top: 4px; }
.tool-badge {
  font-size: 10.5px;
  background: var(--brand-card);
  color: var(--brand-water-deep);
  border: 1px solid rgba(24,144,200,0.25);
  padding: 1px 7px;
  border-radius: 10px;
  white-space: nowrap;
  font-family: "SF Mono", Menlo, monospace;
}
.thinking-status { font-size: 11px; color: var(--ink-faint); margin-top: 4px; }

/* ============ 卡片体系 ============ */
.card {
  background: var(--brand-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 8px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.card-title { font-size: 13px; font-weight: 700; color: var(--ink-strong); }
.card-more { font-size: 11px; color: var(--brand-water); font-weight: 600; }

/* 钓点卡 */
.spot-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.spot-item:first-of-type { border-top: none; padding-top: 0; }
.spot-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--water-bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.spot-icon svg { width: 18px; height: 18px; }
.spot-info { flex: 1; min-width: 0; }
.spot-name { font-size: 13px; font-weight: 600; color: var(--ink-strong); }
.spot-meta { font-size: 11px; color: var(--ink-faint); margin-top: 2px; }
.spot-dist {
  font-size: 11px; font-weight: 700;
  color: var(--brand-orange);
  background: var(--orange-bg);
  padding: 3px 9px; border-radius: 12px;
  flex-shrink: 0;
}

/* 鱼情卡 */
.score-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 0;
  border-top: 1px solid var(--line);
}
.score-row:first-of-type { border-top: none; padding-top: 0; }
.score-fish { display: flex; align-items: center; gap: 8px; }
.score-dot { width: 8px; height: 8px; border-radius: 50%; }
.score-fish-name { font-size: 13px; color: var(--ink-strong); font-weight: 500; }
.score-num { font-size: 13px; font-weight: 700; }
.score-num.good { color: var(--brand-orange); }
.score-num.mid { color: var(--brand-water); }
.score-tag {
  font-size: 10.5px; color: var(--brand-water-deep);
  background: var(--water-bg);
  padding: 2px 8px; border-radius: 10px;
}

/* ============ 输入区 ============ */
.input-bar {
  flex-shrink: 0;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
  background: var(--brand-bg);
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.input-field {
  flex: 1;
  background: var(--brand-card);
  border: 1.5px solid var(--line);
  border-radius: 22px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--ink-strong);
  outline: none;
  transition: border-color 0.2s;
}
.input-field::placeholder { color: var(--ink-faint); }
.input-field:focus { border-color: var(--brand-orange); }
/* 发图按钮 */
.img-btn {
  width: 38px; height: 38px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--brand-card);
  color: var(--brand-water);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s;
}
.img-btn:active { transform: scale(0.92); }
.img-btn svg { width: 20px; height: 20px; }

/* 用户消息里的图片预览 */
.msg-images {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 6px;
}
.msg-images img {
  width: 120px; height: 120px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
}

/* 输入区上方待发送图片条 */
.pending-images {
  display: none;              /* 有图时才显示 */
  gap: 8px;
  padding: 8px 14px 0;
  background: var(--brand-bg);
}
.pending-images.has-img { display: flex; }
.pending-thumb {
  position: relative;
  width: 64px; height: 64px;
}
.pending-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.pending-thumb .remove {
  position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(43,33,24,0.7);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
}

.send-btn {
  width: 40px; height: 40px;
  border: none; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-orange), var(--brand-orange-light));
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(253,109,45,0.3);
  transition: transform 0.15s, opacity 0.2s;
}
.send-btn:active { transform: scale(0.92); }
.send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.send-btn svg { width: 18px; height: 18px; }

/* 打字机光标 */
.cursor {
  display: inline-block;
  width: 2px; height: 14px;
  background: var(--brand-orange);
  vertical-align: -2px;
  margin-left: 2px;
  animation: blink 0.9s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ===== 公众号手机号绑定浮层（2026-08-25）===== */
.phone-bind-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.phone-bind-card {
  width: 82%;
  max-width: 320px;
  background: #fff;
  border-radius: 14px;
  padding: 22px 20px;
  text-align: center;
}
.phone-bind-title { font-size: 17px; font-weight: 700; color: #1f2328; margin-bottom: 8px; }
.phone-bind-sub { font-size: 13px; color: #6b7280; margin-bottom: 16px; line-height: 1.5; }
.phone-bind-card input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 12px;
}
.phone-bind-btn {
  width: 100%;
  padding: 12px;
  background: #FD6D2D;   /* 品牌暖橙 */
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}
.phone-bind-btn:disabled { opacity: 0.6; }
.phone-bind-skip {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 13px;
}
