/* ============================================
   红山伴行 Brand CSS — 自然暖意·手绘风格
   Forest Green Primary + Warm Neutral + State
   ============================================ */

:root {
  /* === Brand Primary: Forest Green === */
  --hs-primary: #3A6B47;
  --hs-primary-50: #EEF6F0;
  --hs-primary-100: #D7E8DB;
  --hs-primary-200: #A8C9B1;
  --hs-primary-300: #7BAF8A;
  --hs-primary-400: #5B8B68;
  --hs-primary-500: #3A6B47;
  --hs-primary-600: #336040;
  --hs-primary-700: #2A4F33;
  --hs-primary-800: #1E3A26;
  --hs-primary-foreground: #FFFFFF;

  /* === Warm Accent (sparingly, for hand-drawn warmth) === */
  --hs-accent-warm: #E8943C;
  --hs-accent-warm-100: #FBE6CE;

  /* === Warm Neutral === */
  --hs-neutral-50: #FAF7F2;
  --hs-neutral-100: #F4EEE3;
  --hs-neutral-200: #EDE5D6;
  --hs-neutral-300: #E2D8C7;
  --hs-neutral-400: #CBBEA8;
  --hs-neutral-500: #9A9084;
  --hs-neutral-600: #6B6358;
  --hs-neutral-700: #4A443D;
  --hs-neutral-800: #3D3833;
  --hs-neutral-900: #2A2622;

  /* === State Colors === */
  --state-success: #4A8C5E;
  --state-warning: #D9943A;
  --state-error: #C25450;
  --state-info: #4A7BA8;

  /* === Semantic Aliases (Light Mode) === */
  --hs-background: #FAF7F2;
  --hs-foreground: #3D3833;
  --hs-card: #FFFFFF;
  --hs-card-foreground: #3D3833;
  --hs-popover: #FFFFFF;
  --hs-popover-foreground: #3D3833;
  --hs-muted: #F4EEE3;
  --hs-muted-foreground: #6B6358;
  --hs-border: #E2D8C7;
  --hs-input: #E2D8C7;
  --hs-ring: #3A6B47;

  /* === Radius === */
  --hs-radius-small: 8px;
  --hs-radius-medium: 12px;
  --hs-radius-large: 16px;
  --hs-radius-full: 9999px;

  /* === Typography === */
  --hs-font-sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  --hs-font-mono: "SF Mono", "Fira Code", "Consolas", monospace;

  --hs-font-size-display: 28px;
  --hs-font-size-h1: 22px;
  --hs-font-size-h2: 18px;
  --hs-font-size-h3: 16px;
  --hs-font-size-body: 14px;
  --hs-font-size-body-lg: 16px;
  --hs-font-size-caption: 12px;

  --hs-font-weight-regular: 400;
  --hs-font-weight-medium: 500;
  --hs-font-weight-semibold: 600;
  --hs-font-weight-bold: 700;

  --hs-line-height-tight: 1.3;
  --hs-line-height-normal: 1.6;
  --hs-line-height-relaxed: 1.8;

  /* === Shadows === */
  --hs-shadow-static: 0 1px 2px rgba(61, 56, 51, 0.04);
  --hs-shadow-float: 0 8px 24px rgba(61, 56, 51, 0.10);
  --hs-shadow-modal: 0 16px 40px rgba(61, 56, 51, 0.14);

  /* === Spacing === */
  --hs-space-1: 4px;
  --hs-space-2: 8px;
  --hs-space-3: 12px;
  --hs-space-4: 16px;
  --hs-space-5: 20px;
  --hs-space-6: 24px;
  --hs-space-8: 32px;
  --hs-space-10: 40px;
  --hs-space-12: 48px;
  --hs-space-16: 64px;
}

/* === Dark Mode === */
.dark {
  --hs-background: #2A2622;
  --hs-foreground: #F4EEE3;
  --hs-card: #3D3833;
  --hs-card-foreground: #F4EEE3;
  --hs-popover: #3D3833;
  --hs-popover-foreground: #F4EEE3;
  --hs-primary: #5B8B68;
  --hs-primary-foreground: #FFFFFF;
  --hs-muted: #4A443D;
  --hs-muted-foreground: #9A9084;
  --hs-border: #4A443D;
  --hs-input: #4A443D;
  --hs-ring: #5B8B68;
}

/* === Base Styles === */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--hs-font-sans);
  font-size: var(--hs-font-size-body);
  line-height: var(--hs-line-height-normal);
  color: var(--hs-foreground);
  background-color: var(--hs-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Utility Component Classes === */
.hs-card {
  background: var(--hs-card);
  border: 1px solid var(--hs-border);
  border-radius: var(--hs-radius-large);
  box-shadow: var(--hs-shadow-static);
}

.hs-button-primary {
  background: var(--hs-primary);
  color: var(--hs-primary-foreground);
  border-radius: var(--hs-radius-medium);
  font-weight: var(--hs-font-weight-semibold);
  border: none;
  cursor: pointer;
  transition: background-color .18s ease, transform .18s ease;
}
.hs-button-primary:hover { background: var(--hs-primary-600); }
.hs-button-primary:active { transform: scale(.98); }

.hs-button-secondary {
  background: var(--hs-muted);
  color: var(--hs-foreground);
  border-radius: var(--hs-radius-medium);
  border: 1px solid var(--hs-border);
  cursor: pointer;
  transition: background-color .18s ease, transform .18s ease;
}
.hs-button-secondary:hover { background: var(--hs-neutral-200); }
.hs-button-secondary:active { transform: scale(.98); }

.hs-button-ghost {
  background: transparent;
  color: var(--hs-primary);
  border: 1px solid var(--hs-primary);
  border-radius: var(--hs-radius-medium);
  cursor: pointer;
  transition: background-color .18s ease, transform .18s ease;
}
.hs-button-ghost:hover { background: var(--hs-primary-50); }

.hs-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: var(--hs-radius-full);
  border: 1px solid var(--hs-border);
  background: var(--hs-card);
  color: var(--hs-foreground);
  font-size: var(--hs-font-size-body);
  cursor: pointer;
  user-select: none;
  transition: all .18s ease;
}
.hs-chip:hover { border-color: var(--hs-primary-300); }
.hs-chip-active {
  border-color: var(--hs-primary);
  background: var(--hs-primary-50);
  color: var(--hs-primary-700);
  font-weight: var(--hs-font-weight-medium);
}

/* === Helpers === */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.h-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 16px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.h-scroll::-webkit-scrollbar { display: none; }

/* === Mobile shell === */
.mobile-shell {
  max-width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  padding-bottom: 76px;
}

:root {
  --hs-bottom-nav-height: 56px;
}

/* === Bottom Navigation === */
.bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  width: 100vw !important;
  height: var(--hs-bottom-nav-height) !important;
  z-index: 50 !important;
  background-color: var(--hs-card) !important;
  border-top: 1px solid var(--hs-border) !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}
.bottom-nav-inner {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  margin: 0 auto !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  justify-content: space-around !important;
  box-sizing: border-box !important;
  list-style: none !important;
}

/* 桌面端预览：底部导航栏与内容区同宽并居中 */
@media (min-width: 768px) {
  .bottom-nav-inner {
    max-width: 540px !important;
  }
}
.bottom-nav-inner > a {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  text-decoration: none !important;
  color: var(--hs-muted-foreground) !important;
  transition: color .15s ease !important;
  white-space: nowrap !important;
}
.bottom-nav-inner > a.active {
  color: var(--hs-primary) !important;
  font-weight: var(--hs-font-weight-semibold) !important;
}
.bottom-nav-inner > a > span {
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

/* === Chat Bubbles === */
.chat-bubble {
  padding: 10px 14px;
  border-radius: var(--hs-radius-large);
  font-size: var(--hs-font-size-body);
  line-height: var(--hs-line-height-normal);
  max-width: 80%;
  word-break: break-word;
  animation: hs-fade-up .35s ease both;
}
.chat-bubble-ai {
  background: var(--hs-card);
  border: 1px solid var(--hs-border);
  color: var(--hs-foreground);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.chat-bubble-user {
  background: var(--hs-primary);
  color: var(--hs-primary-foreground);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
  margin-left: auto;
}
@keyframes hs-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === Map Marker === */
.venue-marker { position: absolute; z-index: 10; transform: translate(-50%, -50%); }
.current-location { position: absolute; z-index: 11; transform: translate(-50%, -50%); }
.pulse-ring {
  position: absolute; top: 50%; left: 50%;
  width: 48px; height: 48px; border-radius: 9999px;
  background: var(--hs-primary); opacity: 0.35;
  transform: translate(-50%, -50%);
  animation: hs-pulse-ring 2s ease-out infinite;
  pointer-events: none;
}
@keyframes hs-pulse-ring {
  0%   { transform: translate(-50%, -50%) scale(0.5); opacity: 0.55; }
  100% { transform: translate(-50%, -50%) scale(2.4); opacity: 0; }
}
.live-dot { animation: hs-blink 1.4s ease-in-out infinite; }
@keyframes hs-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* === Voice Wave Animation === */
.voice-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 56px;
}
.voice-wave span {
  display: inline-block;
  width: 4px;
  height: 12px;
  background: var(--hs-primary);
  border-radius: 2px;
  animation: hs-wave 1.1s ease-in-out infinite;
}
.voice-wave span:nth-child(1) { animation-delay: 0s; }
.voice-wave span:nth-child(2) { animation-delay: .1s; }
.voice-wave span:nth-child(3) { animation-delay: .2s; }
.voice-wave span:nth-child(4) { animation-delay: .3s; }
.voice-wave span:nth-child(5) { animation-delay: .4s; }
.voice-wave span:nth-child(6) { animation-delay: .5s; }
.voice-wave span:nth-child(7) { animation-delay: .4s; }
.voice-wave span:nth-child(8) { animation-delay: .3s; }
.voice-wave span:nth-child(9) { animation-delay: .2s; }
.voice-wave span:nth-child(10){ animation-delay: .1s; }
@keyframes hs-wave {
  0%, 100% { height: 8px; }
  50% { height: 40px; }
}

/* === Bottom Sheet === */
.bottom-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 56px;
  z-index: 30;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top-left-radius: var(--hs-radius-large);
  border-top-right-radius: var(--hs-radius-large);
  box-shadow: var(--hs-shadow-float);
  transform: translateY(0);
  transition: transform .35s cubic-bezier(.22,.61,.36,1);
  max-height: 60vh;
  overflow-y: auto;
}
.bottom-sheet.collapsed { transform: translateY(calc(100% - 56px)); }

/* === Modal === */
.hs-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(42, 38, 34, 0.5);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: hs-fade-in .2s ease both;
}
.hs-modal {
  background: var(--hs-card);
  border-radius: var(--hs-radius-large);
  box-shadow: var(--hs-shadow-modal);
  max-width: 420px;
  width: 100%;
  padding: 24px;
  animation: hs-pop-in .25s ease both;
}
@keyframes hs-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes hs-pop-in {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1); }
}

/* === Skeleton fade-in for page transitions === */
.page-enter { animation: hs-page-enter .3s ease both; }
@keyframes hs-page-enter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === Desktop responsive: keep mobile shell centered on large screens === */
@media (min-width: 768px) {
  body { background: var(--hs-neutral-100); }
  .mobile-shell {
    max-width: 540px;
    margin: 0 auto;
    box-shadow: var(--hs-shadow-float);
    background: var(--hs-background);
  }
}
